.tt-shelf{margin:1.4rem 0 2rem}
.tt-shelf h3,#tt-quick{font:650 1.18rem/1.2 var(--title-font);color:var(--cream);margin:0 0 .8rem}
.tt-shelf>p{margin:0 0 .85rem}
.tt-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(9px,1.8vw,18px)}
#tt-library .tt-card{display:flex;flex-direction:column;min-width:0;overflow:hidden;padding:0;text-align:start;white-space:normal;border:1px solid var(--line-soft);border-radius:14px;background:var(--panel-card);box-shadow:0 4px 11px #06100c28;color:var(--cream);font-family:var(--title-font)}
#tt-library .tt-card:hover{border-color:var(--accent-text)}
#tt-library .tt-card:focus-visible{outline:2px solid var(--accent-text);outline-offset:3px}
.tt-thumb{display:block;width:100%;aspect-ratio:3/2;overflow:hidden;background:var(--felt-2);border-bottom:1px solid var(--line-soft)}
.tt-cover{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover}
.tt-thumb .tt-cover{height:100%}
.tt-card-text{display:flex;flex:1;flex-direction:column;justify-content:space-between;gap:.5rem;width:100%;padding:12px 14px}
.tt-card-text strong{font:650 clamp(1rem,2vw,1.2rem)/1.15 var(--title-font);overflow-wrap:anywhere}
.tt-card-meta{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:.2rem .55rem;font-size:.8rem;line-height:1.25;color:var(--muted)}
.tt-card-access,.tt-stat,.tt-risk{color:var(--accent-text);font-weight:600}
.tt-resume{margin:8px 0}
#tabletop{width:min(100%,1100px);margin:clamp(12px,3vw,30px) auto 0;color:var(--cream);font:1rem/1.45 var(--title-font)}
.tt-frame{border:1px solid var(--line-soft);border-radius:18px;overflow:clip;background:var(--panel);padding:clamp(8px,2vw,20px)}
.tt-head{display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:center;gap:10px 12px;padding-block-end:12px}
.tt-head h2{font:650 clamp(1.25rem,3vw,2rem)/1.12 var(--title-font);letter-spacing:-.025em;overflow-wrap:anywhere}
.tt-head-tools{display:grid;grid-auto-flow:column;grid-auto-columns:44px;align-items:center;justify-self:end;gap:6px}
.tt-frame button,.tt-guide button{min-height:44px;max-width:100%;padding:.48rem .78rem;border:1px solid var(--line-soft);border-radius:9px;background:var(--panel-card);color:var(--cream);font:inherit;cursor:pointer}
.tt-frame button:disabled{opacity:.5;cursor:default}
.tt-frame button:hover:enabled,.tt-frame button[aria-pressed=true]{border-color:var(--accent-text);color:var(--accent-text)}
.tt-frame .tt-tool{width:44px;height:44px;display:grid;place-items:center;padding:0;line-height:1}
.tt-frame button[hidden]{display:none}
.tt-tool svg,.tt-legend svg{display:block;width:24px;height:24px}
.tt-frame :is(button,a):focus-visible,.tt-guide button:focus-visible{outline:0;box-shadow:inset 0 -3px 0 var(--accent-text)}
.tt-map .tt-pick:focus-visible{outline:none;filter:drop-shadow(0 0 3px #ffe273)}
.tt-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(15rem,1fr);align-items:start;gap:clamp(12px,2.5vw,26px)}
@media(min-width:1024px){.tt-wide-board .tt-layout{grid-template-columns:minmax(0,2.65fr) minmax(14rem,1fr)}}
#tt-board-viewport{min-width:0;position:sticky;top:0}
#tt-map{min-width:0}
.tt-map{width:100%;height:auto;display:block;user-select:none}
.tt-board-number{text-anchor:middle;dominant-baseline:middle;font-family:var(--title-font)}
.tt-board-print{border-radius:9px;box-shadow:0 4px 11px #06100c42}
.tt-board-craft{filter:drop-shadow(0 5px 7px #06100c55)}
.tt-zoomed #tt-board-viewport{max-height:min(62dvh,620px);overflow:auto;overscroll-behavior:contain;border-radius:9px}
.tt-zoomed #tt-map{width:max(640px,145%)}
.tt-zoomed.tt-wide-board #tt-map{width:max(1000px,145%)}
.tt-move-trace{fill:none;stroke:#fff6cb;stroke-width:4;stroke-dasharray:3 8;stroke-linecap:round;opacity:.85;pointer-events:none}
.tt-moving-piece{pointer-events:none;filter:drop-shadow(0 2px 3px #221508b0)}
.tt-victory{position:fixed;inset:0;z-index:72;display:grid;place-items:center;pointer-events:none}
.tt-victory-display{
  display:grid;justify-items:center;gap:12px;max-width:94vw;text-align:center;
  animation:tt-victory-flight .44s cubic-bezier(.23,.8,.3,1) both,tt-victory-fade .3s ease-in 2.35s forwards;
}
.tt-victory-pieces{position:relative;isolation:isolate;display:flex;flex-wrap:wrap;justify-content:center;perspective:540px}
.tt-victory-pieces::before{
  content:"";position:absolute;z-index:-1;inset:-44%;border-radius:50%;
  background:radial-gradient(closest-side,#fff2b6bb,#ebae4540 48%,transparent);
  animation:tt-victory-glow 1.15s ease-in-out .35s 2 alternate both;
}
.tt-victory .tt-piece-preview{
  width:clamp(78px,21vmin,158px);height:clamp(78px,21vmin,158px);
  filter:drop-shadow(0 6px 10px #1b160da0);animation:tt-victory-spin 1.5s cubic-bezier(.3,.25,.25,1) .44s both;
}
.tt-victory-display strong{
  padding:.35em .75em;border:1px solid #f7d890;border-radius:12px;background:#15241f;color:#fff4d5;
  font:700 clamp(1.25rem,4vw,2rem)/1.2 var(--title-font);overflow-wrap:anywhere;
}
@keyframes tt-victory-flight{
  from{transform:translate(var(--victory-x,0px),var(--victory-y,0px)) scale(.22)}
  to{transform:translate(0,0) scale(1)}
}
@keyframes tt-victory-glow{from{opacity:.25;transform:scale(.76)}to{opacity:1;transform:scale(1.1)}}
@keyframes tt-victory-spin{from{transform:rotateY(0)}to{transform:rotateY(720deg)}}
@keyframes tt-victory-fade{to{opacity:0}}
.tt-active-token{display:none;filter:drop-shadow(0 0 1px #20180c)}
.tt-layout:has(.tt-turn-card) .tt-active-token{display:inline}
.tt-map .tt-pick{cursor:pointer;touch-action:manipulation}
.tt-map .tt-pick:focus-visible .tt-cell-hit{stroke:#09564b;stroke-width:4;stroke-dasharray:6 3}
#tabletop[data-save-paused] :is(#tt-book,#tt-zoom,#tt-full,#tt-guide,[data-board-info]){pointer-events:auto}
#tt-controls{min-width:0}
#tt-controls h3,.tt-guide h2{margin:0 0 .65rem;font:650 clamp(1.12rem,2vw,1.4rem)/1.2 var(--title-font)}
#tt-controls h4,.tt-guide h3{margin:.85rem 0 .4rem;font:650 1rem/1.3 var(--title-font)}
#tt-controls p{margin:.55rem 0;line-height:1.4}
.tt-frame button.tt-primary{display:block;background:var(--brass-soft);color:#261e0e;border-color:transparent;font-weight:700;margin-top:.8rem;min-width:8rem}
.tt-moves,.tt-tiles,.tt-dice,.tt-roster,.tt-count{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.tt-tiles button{min-width:44px}
.tt-moves{align-items:stretch;flex-direction:column}
.tt-moves button{text-align:start;line-height:1.25;overflow-wrap:anywhere}
.tt-roster{padding:0;list-style:none;margin:.55rem 0;color:var(--muted);font-size:.88rem}
.tt-turn-card{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--accent-text);border-radius:10px;background:color-mix(in srgb,var(--brass) 13%,var(--panel-solid))}
#tt-controls .tt-turn-card h3{margin:0;overflow-wrap:anywhere}
.tt-turn-card .tt-piece-preview{width:40px;height:40px}
.tt-roster li{display:inline-flex;align-items:center;gap:4px;padding:2px 7px 2px 4px;border:1px solid var(--line-soft);border-radius:8px;max-width:100%;overflow-wrap:anywhere}
.tt-roster .tt-piece-preview{width:23px;height:23px}
.tt-roster [aria-current="true"]{border-color:var(--accent-text);background:var(--panel-hover);color:var(--cream);font-weight:650}
.tt-dice{justify-content:center;align-content:center;gap:6px;min-height:clamp(136px,16vw,168px);padding:10px;border:1px solid var(--line-soft);border-radius:10px;background:radial-gradient(ellipse at 50% 35%,var(--felt-1),var(--felt-2))}
.tt-die-scene{width:min(clamp(74px,11vw,96px),calc((100% - 6px)/2));aspect-ratio:1;display:grid;min-width:0;place-items:center}
.tt-die-scene:only-child{width:min(100%,clamp(108px,15vw,136px))}
.tt-die-scene>.poly3d,.tt-die-fallback,.tt-stick{grid-area:1/1}
.tt-die-scene .poly3d-canvas{filter:drop-shadow(0 5px 4px #080e0b80)}
.tt-die-scene.has-canvas .tt-die-fallback{display:none}
.tt-die-fallback{display:grid;place-items:center;width:64%;aspect-ratio:1;border-radius:8px;background:#f2e9d2;color:#302926;box-shadow:inset 0 -3px #d2c3a1;font-size:1.5rem;font-weight:750}
.tt-die-scene:has(.tt-stick){width:clamp(38px,10vw,51px)}
.tt-stick{width:30px;height:37px;background:#eadbc0;clip-path:polygon(50% 0,100% 95%,50% 100%,0 95%)}
.tt-stick[data-value="1"]{background:linear-gradient(#9c4934 32%,#eadbc0 32%)}
.tt-dice.rolling :is(.tt-die-fallback,.tt-stick){animation:tt-dice-turn .38s linear infinite}
.tt-dice.rolling .tt-die-scene:nth-child(2n) :is(.tt-die-fallback,.tt-stick){animation-delay:-.16s}
@keyframes tt-dice-turn{
  from{transform:perspective(160px) rotateX(0) rotateY(0)}
  to{transform:perspective(160px) rotateX(360deg) rotateY(360deg)}
}
#tt-controls .tt-dice-result{margin:.3rem 0;color:var(--accent-text);font-weight:650;text-align:center}
.tt-dice[data-throwing]+.tt-dice-result{visibility:hidden}
#tt-roll[aria-disabled="true"]{cursor:wait;opacity:.6}
.tt-events{padding:.45rem .7rem;border-inline-start:3px solid var(--accent-text);color:var(--muted)}
.tt-person{display:grid;gap:8px;border:1px solid var(--line-soft);border-radius:10px;margin:.75rem 0 0;padding:8px 12px;min-width:0}
.tt-person legend{font-weight:650;padding-inline-end:8px}
.tt-count label{font-size:.85rem;color:var(--muted)}
.tt-player-name{
  width:100%;min-width:0;min-height:44px;padding:8px 10px;border:1px solid var(--line-soft);
  border-radius:8px;background:var(--panel);color:var(--cream);font:inherit;
}
.tt-player-name::placeholder{color:var(--muted);opacity:1}
.tt-appearance>summary{display:flex;align-items:center;gap:8px;min-height:44px;list-style:none;cursor:pointer}
.tt-appearance>summary::-webkit-details-marker{display:none}
.tt-piece-preview{display:block;width:28px;height:28px;flex:none}
.tt-appearance>summary .tt-piece-preview{width:32px;height:32px}
.tt-choice-group{margin:6px 0 10px}
.tt-choice-group>strong{font-size:.85rem;color:var(--muted);font-weight:550}
.tt-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(5.5rem,100%),1fr));gap:6px;margin-top:6px;padding:3px}
.tt-choices-compact{grid-template-columns:repeat(auto-fill,minmax(44px,1fr))}
.tt-choices-compact[aria-labelledby^="tt-color-"]{grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
.tt-choices-compact[aria-labelledby^="tt-color-"] .tt-choice{padding-inline:2px}
.tt-choices-compact:has([name^="tt-avatar-"]){max-height:156px;overflow:auto;overscroll-behavior:contain}
.tt-choice{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-height:44px;padding:5px;text-align:center;border:1px solid var(--line-soft);border-radius:8px;
  background:var(--panel-card);color:var(--cream);font-size:.8rem;line-height:1.18;cursor:pointer;overflow-wrap:anywhere;
}
.tt-choice:hover,.tt-choice:has(:checked){border-color:var(--accent-text)}
.tt-choice:has(:checked){background:var(--panel-hover);box-shadow:inset 0 -2px var(--accent-text)}
.tt-choice:has(:focus-visible),.tt-person :is(summary,input[type="text"]):focus-visible{outline:2px solid var(--accent-text);outline-offset:2px}
.tt-choice input{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
.tt-choice-art{display:grid;place-items:center;font-size:1.35rem}
.tt-choice-art>svg{width:24px;height:24px}
.tt-choice-art .tt-piece-preview{width:30px;height:30px}
.tt-swatch{display:block;width:23px;height:23px;border-radius:50%;background:var(--choice-color);border:1px solid var(--line-soft)}
@media(forced-colors:active){
  .tt-choice:has(:checked){border:2px solid Highlight}
  .tt-swatch{forced-color-adjust:none}
}
.tt-frame .select-menu{max-width:100%}
.tt-frame .select-trigger{min-height:44px;padding-inline-end:2rem}
#tt-notice:empty{display:none}
.tt-guide{position:fixed;inset:0;margin:auto;background:var(--panel-solid);color:var(--cream);border:1px solid var(--line-soft);border-radius:16px;padding:0;width:min(39rem,calc(100% - 24px));max-height:85dvh;font:1rem/1.5 var(--title-font)}
.tt-guide[open]{display:flex;flex-direction:column}
.tt-guide::backdrop{background:#07120fb8}
.tt-guide>header{flex:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line-soft)}
.tt-guide h2{margin:0}
#tt-guide-body{overflow:auto;overscroll-behavior:contain;padding:0 18px 18px}
#tt-guide-body p{margin:0 0 .65rem}
#tt-guide-body small,.tt-source{color:var(--muted)}
.tt-source a{color:inherit;text-underline-offset:.18em}
.tt-legend{list-style:none;margin:.4rem 0 .9rem;padding:0}
.tt-legend li{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line-soft);padding:6px 0}
.tt-legend svg{flex:none;color:var(--accent-text)}
.tt-legend .tt-legend-art{width:44px;height:44px;border-radius:6px}
.tt-legend small{display:block}
.tt-frame:is(:fullscreen,.tt-fullscreen){
  display:flex;flex-direction:column;width:100%;height:100dvh;max-height:100dvh;overflow:hidden;
  border:0;border-radius:0;background:var(--panel-solid);
  padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
}
.tt-frame.tt-fullscreen{position:fixed;inset:0;z-index:1500}
@media(max-width:820px){.tt-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.tt-layout{grid-template-columns:1fr}#tt-board-viewport{position:static}.tt-guide{max-height:90dvh}.tt-card-text{padding:9px}}
@media(max-width:480px){.tt-head{grid-template-columns:minmax(0,1fr)}}
@media(max-width:370px){.tt-frame{padding:6px}.tt-grid{gap:8px}}
.tt-offer{margin:clamp(20px,4vw,40px) 0}
.tt-offer h3{font:650 clamp(1.25rem,2.7vw,1.65rem)/1.2 var(--title-font);color:var(--cream);margin:0 0 14px}
#tt-offer-games{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(7px,2vw,16px)}
.tt-offer figure{margin:0;min-width:0}
.tt-offer .tt-cover{border:1px solid var(--line-soft);border-radius:10px;background:var(--panel-card)}
.tt-offer figcaption{margin-top:6px;color:var(--cream);font-size:clamp(.8rem,2vw,1rem);line-height:1.25}
#tt-explore{display:inline-flex;align-items:center;min-height:44px;margin-top:4px;color:var(--accent-text);text-underline-offset:.18em}
#tt-shelf-title{scroll-margin-top:9rem}
body.kids .tt-card,body.kids .tt-frame:not(:is(:fullscreen,.tt-fullscreen)){border-radius:20px}
body.kids .tt-die-fallback{font-family:"Dice Score",var(--title-font)}
.tt-frame:is(:fullscreen,.tt-fullscreen) .tt-head{flex:none}
.tt-frame:is(:fullscreen,.tt-fullscreen) .tt-layout{width:100%;min-height:0;overflow:auto;overscroll-behavior:contain}
@media(min-width:721px){
  .tt-frame:is(:fullscreen,.tt-fullscreen) .tt-layout{
    flex:1;grid-template-columns:minmax(0,1fr) clamp(16rem,23vw,24rem);grid-template-rows:minmax(0,1fr);
    align-items:stretch;overflow:hidden;
  }
  .tt-frame:is(:fullscreen,.tt-fullscreen) #tt-board-viewport{position:static;min-height:0;container-type:size}
  .tt-frame:is(:fullscreen,.tt-fullscreen):not(.tt-zoomed) #tt-board-viewport{display:grid;place-items:center}
  .tt-frame:is(:fullscreen,.tt-fullscreen):not(.tt-zoomed) #tt-map{width:min(100%,calc(100cqh * var(--tt-board-ratio,1)))}
  .tt-frame:is(:fullscreen,.tt-fullscreen).tt-zoomed #tt-board-viewport{max-height:none}
  .tt-frame:is(:fullscreen,.tt-fullscreen) #tt-controls{overflow:auto;overscroll-behavior:contain;padding:2px 3px 8px}
}
