/* Tally — the counting-house table. Stones on dark felt, brass operations. */

.tally-frame {
  width: min(560px, 96vw);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.2vw, 16px);
  padding: clamp(14px, 2.6vw, 22px);
  align-items: center;
}
.case-eyebrow {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 11px;
  color: var(--ink-light);
  margin: 0;
}

.target-plaque {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 26px;
  border-radius: 10px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(217, 148, 65, 0.12), rgba(217, 148, 65, 0) 60%),
    linear-gradient(180deg, #241a12, #171009);
  box-shadow: inset 0 0 0 1px rgba(200, 156, 58, .45);
}
.target-word {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: 13px;
  color: rgba(241, 230, 200, .6);
}
.target-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 8vw, 54px);
  color: var(--gold-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.target-plaque.struck .target-num { color: #7fd6a8; }
.target-plaque.struck .target-word { color: #7fd6a8; }

/* ---- stones ---- */
.stones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 2.4vw, 16px);
  width: 100%;
  padding: clamp(10px, 2vw, 16px);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(31, 51, 38, .9), rgba(21, 36, 27, .95));
  box-shadow: inset 0 0 0 1px rgba(200, 156, 58, .3), inset 0 8px 22px rgba(0, 0, 0, .4);
}
.stone {
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 6vw, 34px);
  color: var(--ink);
  background: radial-gradient(circle at 36% 30%, var(--cream), var(--parchment-deep) 62%, var(--parchment-shadow));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -4px 8px rgba(58, 46, 34, .35), 0 5px 12px rgba(0, 0, 0, .45);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), opacity .2s var(--ease);
  font-variant-numeric: tabular-nums;
}
.stone:hover { transform: translateY(-2px); }
.stone.sel {
  box-shadow: 0 0 0 3.5px var(--gold-bright), inset 0 2px 0 rgba(255, 255, 255, .5), 0 5px 14px rgba(0, 0, 0, .5);
  transform: translateY(-2px) scale(1.04);
}
.stone.derived { background: radial-gradient(circle at 36% 30%, #f4e3b8, var(--gold-bright) 70%, var(--gold-deep)); }
.stone.nudge-glow { animation: tly-nudge 1.2s infinite alternate var(--ease); }
@keyframes tly-nudge {
  from { box-shadow: 0 0 0 2px rgba(227, 183, 84, .4), 0 5px 12px rgba(0, 0, 0, .45); }
  to { box-shadow: 0 0 0 5px rgba(227, 183, 84, .85), 0 5px 16px rgba(0, 0, 0, .5); }
}
.stone.spent { visibility: hidden; }
.stone.pop { animation: tly-pop .3s var(--ease); }
@keyframes tly-pop {
  from { transform: scale(.7); }
  60% { transform: scale(1.1); }
  to { transform: none; }
}
.stone.shake { animation: tly-shake .3s var(--ease); }
@keyframes tly-shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---- operations ---- */
.ops { display: flex; gap: clamp(10px, 3vw, 18px); }
.op {
  width: clamp(52px, 12vw, 62px);
  height: clamp(44px, 10vw, 52px);
  border-radius: 10px;
  border: 1px solid rgba(122, 104, 80, .5);
  background: linear-gradient(180deg, var(--cream), rgba(235, 220, 180, .9));
  font-family: var(--display);
  font-size: clamp(24px, 5vw, 30px);
  color: var(--oxblood);
  cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .12s var(--ease);
}
.op:hover { transform: translateY(-1px); }
.op.sel {
  background: var(--oxblood);
  color: var(--parchment);
  box-shadow: 0 0 0 3px rgba(227, 183, 84, .7);
}
.op:disabled { opacity: .45; cursor: default; transform: none; }

.legend { margin: 0; text-align: center; font-size: 13px; color: var(--ink-light); }
.frame-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.help-body { text-align: left; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.help-body p { margin: 0 0 12px; }
.help-body b { color: var(--oxblood); }
.overlay-next {
  margin: 14px 0 0;
  font-family: var(--hand);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-light);
}
.overlay-stats .line-echo {
  display: block;
  font-family: var(--caps);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--ink-light);
}

.game-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(26, 20, 16, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 40;
}
.game-toast.on { opacity: 1; transform: translateX(-50%); }
