/* Dead Eye — 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);
}
* { 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: 10px 12px 16px;
  -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: 960px; display: flex; flex-direction: column; gap: 8px; }

/* header */
.head { position: relative; padding-top: 2px; }
.kicker { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 28px; 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); }

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

/* the view */
.view-wrap { position: relative; width: 100%; height: 60vh; border-radius: 12px; overflow: hidden; background: #000;
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  touch-action: none; user-select: none; -webkit-user-select: none; }
#view { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; cursor: crosshair; }
.view-wrap.shake { animation: shake .25s; }
@keyframes shake { 25% { transform: translate(-4px, 2px); } 75% { transform: translate(4px, -2px); } }
.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; }

.toast { position: absolute; top: 10px; left: 0; right: 0; text-align: center; pointer-events: none;
  font-weight: 700; font-size: 15px; color: var(--bone); text-shadow: 0 2px 0 #000, 0 0 8px #000; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.pop { position: absolute; left: 0; right: 0; top: 26%; text-align: center; pointer-events: none;
  font-weight: 700; font-size: 30px; color: var(--amber); text-shadow: 0 2px 0 #000, 0 0 18px var(--glow); opacity: 0; text-transform: uppercase; letter-spacing: .04em; }
.pop small { display: block; font-size: 16px; color: var(--bone); text-transform: none; letter-spacing: 0; }
.pop.show { animation: pop 1.6s 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(-24px); }
}

/* touch controls (phones and tablets only): a pad under the view, or over it when the phone is on its side */
.touch { display: none; }
@media (pointer: coarse) {
  .touch { display: flex; align-items: center; justify-content: space-between; height: 132px; padding: 0 6px; touch-action: none; }
  .hint { display: none; }
}
@media (pointer: coarse) and (orientation: landscape) {
  .touch { position: fixed; left: 0; right: 0; bottom: 8px; padding: 0 16px; pointer-events: none; }
  .touch > * { pointer-events: auto; }
  .touch-hint { display: none; }
}
.touch-hint { flex: 1; text-align: center; font-size: 11px; color: var(--muted); padding: 0 8px; }
.stick { position: relative; flex: none; width: 116px; height: 116px; border-radius: 50%;
  background: rgba(46,45,43,.6); border: 2px solid rgba(243,237,224,.3); touch-action: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%;
  background: rgba(251,173,54,.8); box-shadow: 0 0 12px rgba(0,0,0,.5); pointer-events: none; }
.fire { flex: none; width: 104px; height: 104px; border-radius: 50%;
  background: rgba(200,55,45,.85); color: var(--bone); border: 2px solid rgba(243,237,224,.5);
  font-weight: 700; letter-spacing: .12em; font-size: 17px; touch-action: none; user-select: none; -webkit-user-select: none; }
.fire.held { background: rgba(251,173,54,.9); color: #1c1b1a; }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(21, 20, 19, .72); padding: 12px; }
.card { background: var(--panel); border: 1px solid var(--amber); border-radius: 16px; padding: 18px 16px;
  text-align: center; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px;
  box-shadow: 0 0 30px rgba(251,173,54,.15); animation: rise .3s ease-out; }
.card h2 { font-size: 22px; text-transform: uppercase; letter-spacing: .06em; }
.card .sub { font-size: 14px; line-height: 1.4; }
.card .sub b { color: var(--amber); }
.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; } }

.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; }


@media (max-height: 700px) { .kicker, .hint { display: none; } .stage { gap: 6px; } h1 { font-size: 22px; } }
/* phone on its side: squeeze the header so the view gets the room */
@media (orientation: landscape) and (max-height: 500px) {
  body { padding: 4px 8px; }
  .head, .foot { display: none; }
  .hud { padding: 3px; } .hud b { font-size: 16px; }
}
