/* Roll Model — Loaded Dice look: charcoal, amber, bone, Josefin Sans. */
:root {
  --amber: #FBAD36;
  --amber-deep: #e0942b;
  --bg: #1c1b1a;
  --panel: #262524;
  --panel-2: #2e2d2b;
  --bone: #f3ede0;
  --muted: #8c8780;
  --line: #3a3937;
  --glow: rgba(251, 173, 54, .55);
  --f1: #c8372d; --f2: #e0942b; --f3: #3f8f4f; --f4: #2f6db5; --f5: #7b4bb3; --f6: #2a2724;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Josefin Sans', system-ui, sans-serif;
  background: radial-gradient(120% 90% at 50% -10%, #2a2826 0%, var(--bg) 55%);
  background-color: var(--bg);
  color: var(--bone);
  min-height: 100vh;
  display: flex; justify-content: center;
  padding: 12px 16px 24px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--amber); }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hidden { display: none !important; }
.stage { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px; }

/* header */
.head { position: relative; padding-top: 2px; }
.kicker { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
h1 span { color: var(--amber); }
.head-btns { position: absolute; top: 4px; right: 0; display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); color: var(--bone); font-size: 14px;
}
.icon-btn:hover { border-color: var(--amber); }
.lab { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* score bar */
.hud { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 6px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px; }
.hud b { display: block; font-size: 22px; color: var(--amber); line-height: 1.1; font-variant-numeric: tabular-nums; }
.hud span { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* the table */
.table-wrap { position: relative; align-self: center; touch-action: none; user-select: none; -webkit-user-select: none; }
#table { display: block; border-radius: 12px; background: #121110; border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0,0,0,.7), 0 10px 30px rgba(0,0,0,.4); }
.table-wrap.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translate(-5px, 2px); } 50% { transform: translate(4px, -3px); } 80% { transform: translate(-2px, 1px); } }

.pop { position: absolute; left: 0; right: 0; top: 28%; text-align: center; pointer-events: none;
  font-weight: 700; font-size: 26px; color: var(--amber); text-shadow: 0 2px 0 #000, 0 0 18px var(--glow); opacity: 0; }
.pop small { display: block; font-size: 16px; color: var(--bone); }
.pop.show { animation: pop 1.4s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.6); }
  12% { opacity: 1; transform: scale(1.1); }
  25% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-30px); }
}

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(18, 17, 16, .78); border-radius: 12px; padding: 12px; }
.card { background: var(--panel); border: 1px solid var(--amber); border-radius: 16px; padding: 18px 14px;
  text-align: center; display: flex; flex-direction: column; gap: 10px; width: 100%;
  box-shadow: 0 0 30px rgba(251,173,54,.15); animation: rise .3s ease-out; }
.card h2 { font-size: 24px; text-transform: uppercase; letter-spacing: .06em; }
.card .sub { font-size: 14px; line-height: 1.4; }
.card .big { font-size: 40px; font-weight: 700; color: var(--amber); text-shadow: 0 0 24px var(--glow); }
.muted { color: var(--muted); }
.copied { font-size: 13px; color: var(--amber); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }



/* buttons */
.btn { height: 48px; border-radius: 12px; font-weight: 700; font-size: 16px;
  letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); padding: 0 16px; }
.btn.gold { background: var(--amber); color: #1c1b1a; border-color: var(--amber); }
.btn.gold:hover { background: var(--amber-deep); }
.btn.ghost { background: transparent; color: var(--bone); }
.btn.ghost:hover { border-color: var(--muted); }

.foot { text-align: center; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

/* help */
dialog { margin: auto; max-width: 420px; width: calc(100% - 32px); background: var(--panel); color: var(--bone);
  border: 1px solid var(--amber); border-radius: 16px; padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog h2 { text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
dialog ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; }
dialog b { color: var(--amber); }
dialog form { display: flex; justify-content: center; }

@media (max-height: 700px) { .kicker { display: none; } .stage { gap: 8px; } }
@media (hover: none), (pointer: coarse) { .hint { display: none; } }
@media (max-width: 420px) { h1 { font-size: 24px; } }

/* Roll Model extras */
#table { width: 100%; touch-action: none; }
.hint { text-align: center; font-size: 11px; color: var(--muted); }
.small { font-size: 12px !important; }
.faces { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; align-items: center;
  gap: 12px; pointer-events: none; }
.faces .side { font-size: 14px; font-weight: 700; color: var(--bone); opacity: .75; background: rgba(18,17,16,.6);
  border-radius: 10px; padding: 6px 9px 4px; font-variant-numeric: tabular-nums; }
.faces .top { width: 46px; height: 46px; border-radius: 10px; background: var(--bone); color: var(--f1);
  display: grid; place-items: center; font-size: 26px; font-weight: 700; padding-top: 3px;
  box-shadow: 0 3px 0 #9d927d, 0 0 18px rgba(0,0,0,.6); transition: transform .12s; }
.faces .top.air { color: var(--muted); }
.faces .top.bump { transform: scale(1.2); }
.faces .f1 { color: var(--f1); } .faces .f2 { color: var(--f2); } .faces .f3 { color: var(--f3); }
.faces .f4 { color: var(--f4); } .faces .f5 { color: var(--f5); } .faces .f6 { color: var(--f6); }
.hud b.hot { color: #fff3d6; text-shadow: 0 0 12px var(--glow); }
.pop.miss { color: var(--bone); font-size: 18px; }
.table-wrap.shake { animation: shake .45s; }
.table-wrap { width: 100%; }
