/* Pip Drop — 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 { text-align: center; position: relative; padding-top: 2px; }
.kicker { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); text-align: left; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; text-align: left; }
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.4fr 1fr 1.2fr .8fr; gap: 6px; text-align: center; align-items: 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); }
.hud .next { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud .next canvas { width: 20px; height: 40px; }

/* the well */
.well-wrap { position: relative; align-self: center; touch-action: none; user-select: none; -webkit-user-select: none; }
#well { display: block; border-radius: 12px; background: #151413; border: 1px solid var(--line);
  box-shadow: inset 0 0 30px rgba(0,0,0,.6), 0 10px 30px rgba(0,0,0,.4); }
.well-wrap.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.pop { position: absolute; left: 0; right: 0; top: 30%; 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.1s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.6); }
  15% { opacity: 1; transform: scale(1.1); }
  30% { 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(21, 20, 19, .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; } }

/* legend */
.needs { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.need { display: inline-flex; align-items: center; gap: 3px; }
.mini { font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px;
  background: var(--bone); font-size: 11px; font-weight: 700; }
.mini.f1 { color: var(--f1); } .mini.f2 { color: var(--f2); } .mini.f3 { color: var(--f3); }
.mini.f4 { color: var(--f4); } .mini.f5 { color: var(--f5); } .mini.f6 { color: var(--f6); }

/* touch pad */
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.key { height: 56px; border-radius: 14px; font-size: 26px; background: var(--panel-2); color: var(--amber);
  border: 1px solid var(--line); user-select: none; -webkit-user-select: none; touch-action: none; }
.key:active, .key.held { background: #393735; border-color: var(--amber); }
.hint { text-align: center; font-size: 11px; color: var(--muted); }

/* 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 .scoring { margin: 14px 0; font-size: 13px; color: var(--muted); }
dialog form { display: flex; justify-content: center; }

/* small phones: no hint line, tighter */
@media (max-height: 700px) { .hint, .kicker { display: none; } .stage { gap: 8px; } }
@media (hover: hover) and (pointer: fine) { .pad { display: none; } }
