.count-room{--count-ink:#15374c;--count-line:#a9bfca;--count-accent:#195982;width:min(100%,1180px);margin-inline:auto;color:var(--count-ink);text-align:left}
.count-room .session-banner{text-align:left;margin:0 0 20px}
.game-shell .count-room .count-rule{text-align:left;font-size:.94rem;line-height:1.7;margin:18px 0 24px;max-width:52rem;color:#4f6d63}
.count-conversation{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr);gap:30px;align-items:stretch;margin:24px 0}
.count-last,.count-next{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:12px;padding:22px 28px;min-width:0;border:1px solid var(--count-line);border-radius:6px;background:#fff}
.count-last>span,.count-next>span{font-size:.9rem;line-height:1.5;font-weight:650}
.count-last>strong{font-size:clamp(3.3rem,6vw,5rem);font-weight:750;line-height:1;font-variant-numeric:tabular-nums;color:#78928a}
.count-next{border:0;border-left:5px solid #749a83;background:#f1f7ef}
.count-next>strong{font-size:clamp(5rem,11vw,8rem);font-weight:850;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.04em}
[data-count-phase="active"] .count-next>strong{animation:count-number-change 180ms ease-out both}
@keyframes count-number-change{from{opacity:.55;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
.game-shell .count-room .count-last p{text-align:left;color:#506c60;font-size:.85rem;line-height:1.55;margin:0}
.count-primary-actions{display:flex;align-items:stretch;gap:14px;margin:22px 0 18px}
.count-primary-actions>[data-action^="heard:"]{flex:1;min-height:64px;font-size:1.2rem;background:var(--count-accent);box-shadow:none}
.count-primary-actions>[data-action="undo"]{min-height:64px;font-size:.88rem;max-width:250px;background:#fff;border:1px solid #a3bfb5;color:var(--count-ink);box-shadow:none}
.count-mistake-actions{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}
.count-mistake-actions .button{flex:1;min-height:48px;font-size:.86rem;background:#fff;border:1px solid #c5bcb2;color:#78665d;box-shadow:none}
.game-shell .count-room .count-pending-reason{text-align:left;font-size:1.15rem;line-height:1.65;font-weight:750;border-left:4px solid #af8c5d;background:#fff7ea;padding:16px 20px;margin:22px 0}
.game-shell .count-room .count-best{text-align:left;font-size:1rem;margin:20px 0;line-height:1.5}
.count-best strong{font-size:2.3rem;font-variant-numeric:tabular-nums;margin-left:10px}
.count-final-best strong{font-size:3.4rem}
.count-attempt-ledger{margin:30px 0 0;padding-top:20px;border-top:2px solid #83a394}
.count-attempt-ledger>h3{font-size:1.1rem;margin:0 0 20px}
.count-attempt{padding:18px 20px;border:1px solid var(--count-line);border-radius:6px;background:#fff;margin:16px 0}
.count-attempt[data-count-state="active"]{border-left:5px solid #66937b;padding-left:16px}
.count-attempt[data-count-state="pending"]{background:#f8faf8;color:#5d746b}
.count-attempt-header{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 20px;margin:0 0 16px;line-height:1.5}
.count-attempt-header h4{font-size:.95rem;margin:0}
.count-attempt-header>strong{font-size:.85rem;font-weight:650;color:#58706a}
.count-attempt-header>span{margin-left:auto;font-size:.9rem;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap}
.count-step-rail{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:7px;list-style:none;padding:0;margin:0}
.count-step-rail li{display:flex;align-items:center;justify-content:center;min-width:0;min-height:36px;border:1px solid #dce6df;border-radius:4px;background:#f5f8f5;color:#596e62;font-size:.87rem;font-weight:650;font-variant-numeric:tabular-nums}
.count-step-rail [data-count-step-state="clear"]{border-color:#9bb9a7;background:#deeee2;color:#376a4f}
.count-step-rail [data-count-step-state="next"]{border:2px solid #79996d;background:#fffaf0;color:#466843}
.game-shell .count-room .count-record-expected{text-align:left;font-size:.82rem;color:#506c60;margin:15px 0 0;line-height:1.6}
.count-room button:focus-visible{outline:3px solid #658e77;outline-offset:4px}
.game-shell .play .count-room .session-banner>.meta{margin-inline:0;text-align:left}
.count-attempt[data-count-state="pending"] .count-step-rail{display:none}
.count-attempt[data-count-state="pending"] .count-attempt-header{margin-bottom:0}
.count-conversation:not(:has(.count-next)){grid-template-columns:minmax(0,38rem)}

@media(min-width:1200px){
  .game-shell.wide .count-room[data-count-phase="active"]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(310px,.85fr);gap:0 34px}
  .game-shell.wide .count-room[data-count-phase="active"]>.session-banner{grid-column:1/-1;margin-bottom:11px}
  .game-shell.wide .count-room[data-count-phase="active"]>.count-rule{grid-column:1/-1;margin:0 0 16px}
  .game-shell.wide .count-room[data-count-phase="active"]>.count-conversation{grid-area:3/1/6/2;align-self:stretch;gap:16px;margin:0}
  .game-shell.wide .count-room[data-count-phase="active"] .count-next>strong{font-size:7rem}
  .game-shell.wide .count-room[data-count-phase="active"]>.count-primary-actions{grid-area:3/2/4/3;display:grid;margin:0 0 12px}
  .game-shell.wide .count-primary-actions:has([data-action="undo"]){grid-template-columns:minmax(0,1fr) minmax(9rem,.75fr)}
  .game-shell.wide .count-room[data-count-phase="active"]>.count-primary-actions>[data-action="undo"]{max-width:none;min-height:44px}
  .game-shell.wide .count-room[data-count-phase="active"]>.count-mistake-actions{grid-area:4/2/5/3;display:grid;gap:8px;margin:0}
  .game-shell.wide .count-room[data-count-phase="active"]>.actions{grid-area:5/2/6/3;margin:8px 0 0}
  .game-shell.wide .count-room[data-count-phase="active"]>.count-attempt-ledger{grid-column:1/-1}
  .game-shell.wide .count-attempt-ledger{margin:17px 0 0;padding-top:13px}
  .game-shell.wide .count-attempt-ledger>h3{margin:0 0 10px}
  .game-shell.wide .count-attempt{margin:0;padding:8px 0 10px;border:0;border-bottom:1px solid var(--count-line);border-radius:0;background:transparent}
  .game-shell.wide .count-attempt-header{margin-bottom:9px}
  .game-shell.wide .count-attempt[data-count-state="pending"] .count-attempt-header{margin-bottom:0}
  .game-shell.wide .count-step-rail li{min-height:31px}
  .game-shell.wide [data-count-target="20"] .count-step-rail{grid-template-columns:repeat(20,minmax(0,1fr))}
  .game-shell.wide [data-count-target="15"] .count-step-rail{grid-template-columns:repeat(15,minmax(0,1fr))}
}
@media(max-width:699px){.count-conversation{gap:12px;margin:20px 0}.count-last,.count-next{padding:18px 16px;gap:10px}.count-last>span,.count-next>span{font-size:.78rem}.count-last>strong{font-size:3rem}.count-next>strong{font-size:4.7rem}.count-next{border-left-width:3px}.game-shell .count-room .count-last p{font-size:.74rem}.count-primary-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}.count-primary-actions>[data-action^="heard:"]{min-height:60px;font-size:1.08rem}.count-primary-actions>[data-action="undo"]{min-height:45px;max-width:none;font-size:.82rem}.count-mistake-actions{gap:8px}.count-mistake-actions .button{flex:1 1 100%;font-size:.84rem;min-height:46px}.count-attempt{padding:14px}.count-attempt[data-count-state="active"]{padding-left:10px}.count-step-rail{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.count-step-rail li{min-height:34px;font-size:.8rem}.count-attempt-header{gap:6px 12px}.count-attempt-header>strong{font-size:.78rem}.count-attempt-header h4{font-size:.88rem}.count-attempt-header>span{font-size:.82rem}.game-shell .count-room .count-rule{font-size:.86rem;margin:15px 0 20px}}
@media(prefers-reduced-motion:reduce){.count-room *{animation:none!important;transition:none!important}}

.page-game .game-shell.theme-count:has(.count-room) {
  background: radial-gradient(ellipse at 20% 0,#fffcf6,#edf4f7 85%);
}
.page-game .game-shell.theme-count:has(.count-room) .game-toolbar {
  background: #dcebf2;
  color: #15374c;
  border-color: #afc7d4;
}
.theme-count:has(.count-room) .game-toolbar .button {
  color: #15476a;
  border-color: #8eaebe;
  background: #f9fcfd;
}
.game-shell.theme-count .count-room .session-banner :is(h2,.meta) {color:var(--count-ink)}
.game-shell.theme-count .count-room .count-rule {color:#415c6c}

.game-shell .count-room .count-conversation {
  align-self: start;
  gap: clamp(8px,1.4vw,18px);
  padding: clamp(9px,1.45vw,19px);
  border: 2px solid #bd9654;
  border-radius: 14px;
  background: repeating-linear-gradient(135deg,#ffffff06 0 1px,transparent 1px 4px),
    linear-gradient(135deg,#205066,#102d3c);
  box-shadow: inset 0 0 0 2px #ffffff17,0 4px 0 #665239,0 9px 16px #22343c27;
}
.game-shell .count-room .count-conversation > :is(.count-last,.count-next) {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  align-items: start;
  justify-content: stretch;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff6e5;
}
.count-last > span,.count-next > span {align-self:end;min-height:2.8em;display:flex;align-items:end}
.game-shell .count-room .count-conversation strong {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: clamp(74px,12vw,154px);
  padding: .13em .02em;
  border: 1px solid #98b6c3;
  border-radius: 9px;
  background: linear-gradient(#cee5ee,#b2d3e2);
  box-shadow: inset 0 2px 5px #21475d55,0 3px 0 #091f2a;
  color: #15364b;
}
.game-shell .count-room .count-conversation .count-next strong {
  border-color: #eac982;
  background: linear-gradient(#fff2cf,#f3d9a0);
}
.count-conversation strong::after {
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: #273c495c;
  content: "";
  pointer-events: none;
}
.game-shell .count-room .count-last p {color:#f1f7fa}
.game-shell .count-room .count-primary-actions {margin-bottom:10px}
.theme-count .count-room .button:not(.secondary) {background:var(--count-accent);border-color:var(--count-accent);color:white}
.theme-count .count-room .button:not(.secondary):hover {background:#124466}
.theme-count .count-room .button.secondary {color:#204c69}
.theme-count .count-room .count-primary-actions > [data-action="undo"] {border-color:#8ca5b5;background:#f7fbfc}
.count-mistake-actions {
  padding: 11px;
  border: 1px solid #c9bea9;
  border-radius: 10px;
  background: #fbf6eb;
  margin-block: 10px;
}
.count-mistake-actions h3 {font-size:.92rem;margin:0;flex:1 1 100%}
.theme-count .count-room .count-mistake-actions .button {color:#5b493a;border-color:#ad9b82;background:#fffdf7}
.theme-count .count-room .count-mistake-actions .button:hover {background:#f6e6d2}
.game-shell .count-room .count-pending-reason {border-color:#aa6329;color:#644119}
.count-attempt-ledger {border-color:#8caebf}
.count-attempt-header > strong {color:#445f6c}
.count-step-rail li {border-color:#c7d6dd;background:#f4f8fa;color:#405962}
.count-step-rail [data-count-step-state="clear"] {border-color:#8abdb5;background:#c9e7df;color:#235b51}
.count-step-rail [data-count-step-state="next"] {border-color:#b8651b;background:#fff2d6;color:#6d3a12}
.count-room button:focus-visible {outline-color:#a35923}
.theme-count .count-room .count-best {
  color:var(--count-ink);
  border-left:4px solid #adcbd9;
  padding:.25rem .9rem;
}
@media(min-width:1200px) {
  .game-shell.wide .count-room[data-count-phase="active"] .count-mistake-actions .button {min-height:44px}
  .game-shell.wide .count-room[data-count-phase="active"] .count-conversation {min-height:230px}
}
@media(min-width:1200px) and (max-height:800px) {
  .game-shell.wide .count-room[data-count-phase="active"] > .session-banner h2 {
    font-size:clamp(1.9rem,3vw,2.6rem);
    line-height:1.1;
  }
  .game-shell.wide .count-room[data-count-phase="active"] > .count-rule {
    max-width:none;
    line-height:1.4;
    margin-bottom:12px;
  }
  .game-shell.wide .count-room[data-count-phase="active"] .count-mistake-actions {padding:8px;gap:5px}
  .game-shell.wide .count-room[data-count-phase="active"] .count-attempt-ledger {margin-top:12px;padding-top:8px}
}
@media(max-width:699px) {
  .count-last > span,.count-next > span {min-height:3.1em}
  .game-shell .count-room .count-conversation strong {min-height:80px}
  .page-game .game-shell.theme-count.wide .play:has([data-count-phase="active"]) {justify-content:flex-start;padding-block-start:1rem}
}
