/* Dice Daily — same look as the Chamber Roll (charcoal, amber, bone). */
:root {
  --amber: #FBAD36;
  --amber-deep: #e0942b;
  --bg: #1c1b1a;
  --panel: #262524;
  --panel-2: #2e2d2b;
  --bone: #f3ede0;
  --pip: #2a2724;
  --muted: #8c8780;
  --line: #3a3937;
  --glow: rgba(251, 173, 54, .55);
  --red: #e23b3b;
  --green: #4caf50;
}
* { 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: 24px 16px 32px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.stage { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 18px; }

/* header */
.head { text-align: center; position: relative; padding-top: 40px; }
.kicker { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 44px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; margin-top: 4px; }
h1 span { color: var(--amber); }
.meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.head-btns { position: absolute; top: 0; 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: 15px;
}
.icon-btn:hover { border-color: var(--amber); }

/* target */
.target-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  text-align: center; padding: 14px 12px 10px;
}
.lab { font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.target { font-size: 64px; font-weight: 700; color: var(--amber); line-height: 1.1; text-shadow: 0 0 24px var(--glow); }

/* dice */
.tray { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.die {
  aspect-ratio: 1; width: 100%;
  background: linear-gradient(145deg, #fffaf0, var(--bone) 60%, #ddd3bf);
  border: none; border-radius: 18%;
  box-shadow: 0 4px 0 #b9ae98, 0 8px 16px rgba(0,0,0,.45);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 16%;
  transition: transform .12s, opacity .2s, box-shadow .12s;
}
.die:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 7px 0 #b9ae98, 0 0 18px var(--glow); }
.die:not(:disabled):active { transform: translateY(2px); box-shadow: 0 2px 0 #b9ae98; }
.die:disabled { cursor: default; }
.die.used { opacity: .22; transform: scale(.9); }
.die.wait { opacity: .55; }
.die.rolling { animation: tumble .6s ease-out both; }
.pip { width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--pip); align-self: center; justify-self: center; transform: scale(.78); }
@keyframes tumble {
  0% { transform: translateY(-40px) rotate(-200deg) scale(.6); opacity: 0; }
  70% { transform: translateY(4px) rotate(12deg) scale(1.04); opacity: 1; }
  100% { transform: none; }
}

/* operators */
.ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.op {
  height: 56px; border-radius: 12px; font-size: 30px; font-weight: 600;
  background: var(--panel-2); color: var(--amber); border: 1px solid var(--line);
  transition: background .12s, opacity .2s;
}
.op:not(:disabled):hover { background: #393735; border-color: var(--amber); }
.op:disabled { opacity: .3; cursor: default; }

/* running sum */
.sum { text-align: center; min-height: 96px; }
.chain { font-size: 22px; font-weight: 600; min-height: 30px; word-spacing: 2px; }
.chain.empty { color: var(--muted); font-size: 16px; font-weight: 400; }
.running { margin-top: 6px; font-size: 28px; font-weight: 700; }
.running .lab { vertical-align: middle; margin-right: 6px; }
.running.hit #total { color: var(--green); text-shadow: 0 0 16px rgba(76,175,80,.5); }
.hint { color: var(--red); font-size: 14px; margin-top: 4px; min-height: 18px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* buttons */
.actions { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; }
.btn {
  height: 50px; 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); }
.btn:disabled { opacity: .35; cursor: default; }

/* result */
.result {
  background: var(--panel); border: 1px solid var(--amber); border-radius: 16px;
  padding: 20px 16px; text-align: center; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 0 30px rgba(251,173,54,.15);
  animation: rise .4s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stars { font-size: 34px; letter-spacing: 6px; }
.result h2 { font-size: 26px; color: var(--amber); }
.your, .best { font-size: 16px; }
.best { color: var(--muted); }
.copied { color: var(--green); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.next { color: var(--muted); font-size: 14px; }
.next span { color: var(--bone); font-weight: 600; }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }

/* help dialog */
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: 22px 20px;
}
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog h2 { color: var(--amber); margin-bottom: 12px; }
dialog ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.4; }
dialog .scoring { margin: 14px 0; color: var(--muted); font-size: 14px; text-align: center; }
dialog .btn { width: 100%; }

@media (max-width: 380px) {
  h1 { font-size: 36px; }
  .target { font-size: 54px; }
  .tray { gap: 7px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .gold { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
