/* Statistics: a game record, not an analytics dashboard. Dark room, paper sheets, brass and felt red. */
.stats { padding-bottom: 24px; }
.st-tabs { display: flex; justify-content: center; gap: 4px; margin: 4px auto 18px; padding: 4px; width: fit-content; max-width: 100%; border-radius: 999px; background: rgba(243,234,216,.06); border: 1px solid var(--line); }
.st-tab { position: relative; min-height: 42px; padding: 0 clamp(14px, 3vw, 26px); border: 0; border-radius: 999px; background: none; color: rgba(243,234,216,.75); font: 700 13px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: background .2s, color .2s; }
.st-tab:hover { color: var(--paper); }
.st-tab.on { background: var(--brass); color: var(--brass-ink); box-shadow: 0 3px 0 var(--brass-2); }
.st-dot { position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--felt-hi); box-shadow: 0 0 0 2px var(--ink-1); animation: stPulse 1.4s ease-in-out infinite; }

.st-filters { display: grid; gap: 10px; margin-bottom: 18px; padding: 12px 0; }
@media (min-width: 900px) { .st-filters { position: sticky; top: 0; z-index: 6; background: linear-gradient(180deg, rgba(12,9,11,.94) 70%, rgba(12,9,11,0)); backdrop-filter: blur(6px); } }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); background: rgba(243,234,216,.05); color: var(--paper); font: 600 13.5px var(--f-ui); cursor: pointer; transition: transform .15s var(--ease-out), background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--brass); transform: translateY(-1px); }
.chip:focus-visible, .st-tab:focus-visible, .th-col:focus-visible { outline: 2px solid var(--brass-3); outline-offset: 2px; }
.chip.on { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); box-shadow: 0 3px 0 var(--brass-2); font-weight: 800; }
.chip.alt.on { background: var(--paper); border-color: var(--paper); color: var(--felt); box-shadow: 0 3px 0 var(--paper-3); }
.st-now { text-align: center; font: 700 12px var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--brass-3); }
.st-now span { margin-left: 12px; color: rgba(243,234,216,.6); }

.st-page { display: grid; gap: 18px; }
.st-page.enter > * { animation: stIn .5s var(--ease-out) both; }
.st-page.enter > *:nth-child(2) { animation-delay: .06s; } .st-page.enter > *:nth-child(3) { animation-delay: .12s; }
@keyframes stIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* summary */
.st-hero { display: grid; grid-template-columns: auto 1fr; gap: clamp(18px, 4vw, 44px); align-items: center; padding: clamp(18px, 3vw, 30px); border-radius: 16px;
  background: radial-gradient(90% 120% at 12% 0%, #5a0b15 0%, #2a0a10 55%, #150a0c 100%); border: 1px solid rgba(227,183,90,.5); box-shadow: inset 0 0 0 4px #150a0c, inset 0 0 0 5px rgba(227,183,90,.3), 0 20px 40px -20px rgba(0,0,0,.8); }
.hero-ring { position: relative; width: 148px; height: 148px; display: grid; place-items: center; }
.ring-bg { fill: none; stroke: rgba(243,234,216,.12); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--brass); stroke-width: 10; stroke-linecap: round; animation: ringIn 1.1s var(--ease-out) both; }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } }
.st-ring.rm .ring-fg { animation: none; }
.hr-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.hr-c b { font: 400 34px/1 var(--f-display); color: var(--brass-3); }
.hr-c span { font: 700 9.5px var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: rgba(243,234,216,.65); margin-top: 4px; max-width: 90px; }
.hero-nums { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }
.hero-nums div { border-left: 2px solid rgba(227,183,90,.4); padding-left: 12px; }
.hero-nums dt { font: 700 11px var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: rgba(243,234,216,.62); }
.hero-nums dd { margin: 4px 0 0; font: 400 clamp(28px, 3.4vw, 40px)/1 var(--f-display); color: var(--paper); }
.hero-nums dd small { font: 700 11px var(--f-ui); color: rgba(243,234,216,.6); letter-spacing: .06em; }
.hero-nums .poop { border-left-color: #a9773a; } .hero-nums .poop dd { color: #e2b57a; } .hero-nums .poop dt::after { content: ' \1F4A9'; letter-spacing: 0; }
.hero-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; line-height: 1.5; color: rgba(243,234,216,.55); }

/* sheets and charts */
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.st-sheet { padding: clamp(16px, 2.4vw, 26px); min-width: 0; }
.st-sh { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 0 4px; }
.st-h { margin: 0; font: 400 clamp(20px, 2.2vw, 26px)/1.1 var(--f-display); color: var(--paper-ink); }
.st-sub { margin: 5px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--paper-dim); }
.st-need { display: flex; align-items: center; gap: 12px; padding: 22px 16px; border: 1.5px dashed rgba(28,20,16,.3); border-radius: 12px; color: #4b3d31; font-size: 14px; line-height: 1.45; background: rgba(28,20,16,.04); }
.st-none { padding: 30px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.ch { position: relative; width: 100%; user-select: none; -webkit-user-select: none; }
.ch svg { position: absolute; left: 0; top: 0; display: block; overflow: visible; }   /* out of flow: the chart's own width can never stop its column from shrinking */
.ch { overflow: hidden; }
.gl { stroke: rgba(28,20,16,.14); stroke-width: 1; } .ax { font: 600 10.5px var(--f-ui); fill: var(--paper-dim); }
.line { stroke: var(--felt); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: lineIn 1.1s var(--ease-out) .1s forwards; }
.area { animation: stFade 1.2s ease both; }
.dot { fill: #fff; stroke: var(--felt); stroke-width: 2.2; transition: r .15s; } .dot.on { fill: var(--felt); }
.cursor { stroke: rgba(28,20,16,.4); stroke-dasharray: 3 3; }
.bar { transform-box: fill-box; transform-origin: 50% 100%; animation: barIn .6s var(--ease-out) both; transition: filter .15s; } .bar.on { filter: brightness(1.2) drop-shadow(0 0 4px rgba(0,0,0,.3)); }
@keyframes lineIn { to { stroke-dashoffset: 0; } } @keyframes stFade { from { opacity: 0; } } @keyframes barIn { from { transform: scaleY(0); } }
.ch.rm .line { animation: none; stroke-dashoffset: 0; } .ch.rm .area, .ch.rm .bar { animation: none; }
.ch-tip { position: absolute; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; gap: 2px; padding: 8px 11px; border-radius: 9px; background: var(--ink-1); color: var(--paper); font: 500 12px/1.3 var(--f-ui); white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.45), 0 0 0 1px rgba(227,183,90,.5); }
.ch-tip .h { color: var(--brass-3); font-weight: 800; letter-spacing: .04em; }

.hb { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hb li { position: relative; display: grid; grid-template-columns: minmax(96px, 34%) 1fr auto; align-items: center; gap: 10px; min-height: 30px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.hb li.on { background: rgba(28,20,16,.06); } .hb li.dim { opacity: .5; }
.hb-l { font: 700 12.5px var(--f-ui); color: var(--paper-ink); } .hb-v { font: 400 20px/1 var(--f-display); color: var(--paper-ink); min-width: 2.2ch; text-align: right; }
.hb-t { height: 12px; border-radius: 99px; background: rgba(28,20,16,.1); overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 99px; transform-origin: 0 50%; animation: hbIn .8s var(--ease-out) both; }
@keyframes hbIn { from { transform: scaleX(0); } }
.hb.rm .hb-t i { animation: none; }
.hb-tip { position: absolute; right: 4px; top: -26px; z-index: 3; padding: 4px 9px; border-radius: 7px; background: var(--ink-1); color: var(--paper); font: 600 11.5px var(--f-ui); white-space: nowrap; box-shadow: 0 0 0 1px rgba(227,183,90,.5); }
.hb-empty { color: var(--paper-dim); }

.places { display: grid; gap: 14px; }
.pl-bar { display: flex; gap: 3px; height: 50px; border-radius: 12px; overflow: hidden; }
.pl-bar span { display: grid; place-items: center; min-width: 6px; font: 800 13px var(--f-ui); color: var(--paper-ink); transform-origin: 0 50%; animation: hbIn .8s var(--ease-out) both; outline-offset: -3px; }
.places.rm .pl-bar span { animation: none; }
.pl-bar .p1, .pl-legend .p1 i { background: linear-gradient(180deg, #f6dc9a, #e3b75a); } .pl-bar .p2, .pl-legend .p2 i { background: #cfc8b8; } .pl-bar .p3, .pl-legend .p3 i { background: #c98a55; }
.pl-bar .p4, .pl-legend .p4 i { background: #6b4520; color: #ffe9c4; }
.pl-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pl-legend li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(28,20,16,.05); }
.pl-legend i { grid-row: span 3; width: 12px; height: 38px; border-radius: 4px; } .pl-legend span { font: 700 11.5px var(--f-ui); color: var(--paper-dim); }
.pl-legend b { font: 400 24px/1 var(--f-display); color: var(--paper-ink); } .pl-legend em { font: 600 12px var(--f-ui); font-style: normal; color: var(--paper-dim); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { display: grid; gap: 3px; align-content: start; padding: 13px 14px 12px; border-radius: 12px; background: rgba(255,255,255,.55); border: 1.5px solid rgba(28,20,16,.18); box-shadow: 0 2px 0 var(--paper-3); min-height: 104px; }
.tile .tl { font: 700 10.5px var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--paper-dim); }
.tile .tv { font: 400 clamp(26px, 2.6vw, 32px)/1.05 var(--f-display); color: var(--felt); }
.tile .th { font-size: 12px; line-height: 1.35; color: #4b3d31; } .tile.need .tv { color: rgba(28,20,16,.3); } .tile.need .th { color: var(--paper-dim); font-style: italic; }
.st-hero.t { background: radial-gradient(90% 120% at 12% 0%, #4a3608 0%, #241806 55%, #150f06 100%); }
.tiles.two .tile.wide { background: linear-gradient(180deg, #f9edc9, #f0d9a0); border-color: var(--brass-2); }

.t-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t-table th, .t-table td { padding: 10px 8px; text-align: right; border-bottom: 1px dotted rgba(28,20,16,.3); color: var(--paper-ink); }
.t-table th:first-child { text-align: left; } .t-table thead th { font: 700 10.5px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--paper-dim); }
.t-table tr.dim td, .t-table tr.dim th { color: rgba(28,20,16,.4); } .t-table td { font: 400 18px var(--f-display); }
.th-scroll { display: flex; gap: 8px; align-items: flex-end; height: 170px; overflow-x: auto; padding: 8px 4px 2px; scrollbar-width: thin; }
.th-col { flex: 0 0 auto; width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; }
.th-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; border-radius: 6px 6px 0 0; background: rgba(28,20,16,.07); overflow: hidden; }
.th-bar i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: #b9a58a; transform-origin: 50% 100%; animation: barIn .6s var(--ease-out) both; }
.th-col.won .th-bar i { background: linear-gradient(180deg, #f6dc9a, #e3b75a); box-shadow: 0 0 10px rgba(227,183,90,.7); }
.th-col.on .th-bar { outline: 2px solid var(--felt); } .th-x { font: 700 11px var(--f-ui); color: var(--paper-dim); }
.th-tip { min-height: 40px; margin-top: 10px; padding: 9px 12px; border-radius: 9px; background: rgba(28,20,16,.06); font-size: 13px; color: #4b3d31; } .th-tip b { color: var(--paper-ink); margin-right: 8px; }
.th.rm .th-bar i { animation: none; }

.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ms { display: grid; grid-template-columns: 58px 1fr; gap: 14px; padding: 14px; border-radius: 12px; background: rgba(28,20,16,.05); border: 1.5px solid rgba(28,20,16,.15); opacity: .8; }
.ms.got { opacity: 1; background: linear-gradient(135deg, rgba(246,220,154,.55), rgba(255,255,255,.5)); border-color: var(--brass-2); }
.ms-badge { position: relative; width: 52px; height: 72px; border-radius: 7px; display: grid; place-items: center; background: #f7efdd; color: rgba(28,20,16,.35); font: 400 26px var(--f-display); border: 2px solid rgba(28,20,16,.25); transform: rotate(-5deg); box-shadow: 0 3px 0 var(--paper-3); }
.ms.got .ms-badge { color: var(--felt); border-color: var(--brass-2); box-shadow: 0 3px 0 var(--brass-2), 0 0 16px rgba(227,183,90,.7); }
.ms.new .ms-badge { animation: msNew 1.2s var(--ease-out) both, msGlow 1.6s ease-in-out 1.2s 3; }
.ms.rm .ms-badge { animation: none; }
@keyframes msNew { 0% { transform: scale(.3) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.25) rotate(6deg); opacity: 1; } 100% { transform: rotate(-5deg); } }
@keyframes msGlow { 50% { box-shadow: 0 3px 0 var(--brass-2), 0 0 30px rgba(255,214,110,1); } }
.ms-spark { position: absolute; inset: -8px; border-radius: 12px; background: radial-gradient(circle, rgba(255,240,180,.9), transparent 70%); animation: stFade 1.5s ease both; pointer-events: none; }
.ms h3 { margin: 0; font: 700 13px var(--f-ui); color: var(--paper-ink); } .ms-val { margin: 3px 0 6px; color: var(--paper-dim); font-size: 13px; } .ms-val b { font: 400 24px var(--f-display); color: var(--felt); }
.ms-bar { height: 8px; border-radius: 9px; background: rgba(28,20,16,.12); overflow: hidden; } .ms-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--felt), var(--brass)); border-radius: 9px; transition: width .6s var(--ease-out); }
.ms-steps { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; } .ms-steps span { min-width: 26px; text-align: center; padding: 2px 6px; border-radius: 99px; font: 700 10.5px var(--f-ui); background: rgba(28,20,16,.08); color: var(--paper-dim); }
.ms-steps span.on { background: var(--brass); color: var(--brass-ink); }
.ms-toast { padding: 12px 16px; border-radius: 12px; background: linear-gradient(135deg, #e3b75a, #f6dc9a); color: var(--brass-ink); font: 800 14px var(--f-ui); text-align: center; box-shadow: 0 8px 24px rgba(227,183,90,.4); animation: stIn .5s var(--ease-out) both; }

.st-empty { max-width: 640px; margin: 4vh auto 0; padding: clamp(26px, 5vw, 48px); text-align: center; display: grid; gap: 16px; justify-items: center; }
.se-cards { display: flex; } .se-cards i { width: 62px; height: 88px; margin: 0 -8px; display: grid; place-items: center; font: 400 30px var(--f-display); font-style: normal; color: var(--felt); background: #f7efdd; border: 2px solid rgba(28,20,16,.3); border-radius: 8px; box-shadow: 0 6px 0 var(--paper-3); }
.se-cards i:nth-child(1) { transform: rotate(-12deg); } .se-cards i:nth-child(3) { transform: rotate(12deg); color: var(--jester); } .se-cards i:nth-child(2) { transform: translateY(-8px); z-index: 1; }
.se-h { margin: 0; font: 400 clamp(26px, 4vw, 36px)/1.1 var(--f-display); color: var(--paper-ink); } .se-p { margin: 0; color: #4b3d31; line-height: 1.6; max-width: 480px; }
.se-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; } .se-chips span { padding: 5px 11px; border-radius: 99px; border: 1.5px dashed rgba(28,20,16,.35); font: 700 11px var(--f-ui); color: var(--paper-dim); }

/* responsive: reorganise, do not just shrink */
@media (max-width: 860px) {
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .st-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; text-align: left; }
  .pl-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb li { grid-template-columns: minmax(84px, 38%) 1fr auto; }
}
@media (max-width: 520px) {
  .chip { padding: 0 12px; font-size: 13px; } .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile { min-height: 96px; padding: 11px; }
  .st-tab { padding: 0 12px; letter-spacing: .06em; } .tiles.two { grid-template-columns: minmax(0, 1fr); }
  .st-now span { display: block; margin: 2px 0 0; } .hero-ring { width: 128px; height: 128px; } .hero-ring .st-ring { width: 128px; height: 128px; }
}
@media (prefers-reduced-motion: reduce) {
  .stats *, .stats *::before { animation: none !important; } .line { stroke-dashoffset: 0; }
}
