:root{color-scheme:dark;--tb-bg:#061b15;--tb-gold:#f6d77f;--tb-cream:#fff5da;--tb-green:#126346}*{box-sizing:border-box}html{background:var(--tb-bg)}body{margin:0;min-height:100dvh;background:radial-gradient(ellipse at 50% -20%,#26734a77,transparent 66%),linear-gradient(165deg,#061b15,#030f0c);font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--tb-cream);overscroll-behavior-y:contain}button,a{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{cursor:default;opacity:.5}button:focus-visible,a:focus-visible{outline:3px solid var(--tb-gold);outline-offset:4px}.hidden{display:none!important}.tb-app{max-width:1270px;margin:0 auto;padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}.tb-header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;min-height:65px;padding:5px 0 14px;border-bottom:1px solid #e5c17933}.tb-back{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:max-content;min-height:44px;padding:8px 15px;border:1px solid #e5c17970;border-radius:12px;background:#103f2d;color:var(--tb-gold);text-decoration:none;font-size:.76rem;font-weight:900;letter-spacing:.5px}.tb-back>span:first-child{font-size:30px;line-height:19px}.tb-logo img{display:block;width:140px;max-height:65px;object-fit:contain}.tb-header-tag{justify-self:end;font-size:10px;font-weight:850;letter-spacing:1.3px;color:#d2bd8a}.tb-hero{max-width:750px;margin:36px auto 28px;text-align:center}.tb-eyebrow,.tb-game-copy small,.tb-play-header small{font-size:10px;letter-spacing:2px;color:#e0bc68;font-weight:950}.tb-hero h1{font:900 clamp(30px,4.2vw,56px)/1.1 Georgia,serif;letter-spacing:-1px;color:var(--tb-gold);margin:14px 0}.tb-hero p{font-size:14px;color:#d8e3d6;margin:0;line-height:1.6}.tb-games{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:1060px;margin:0 auto 20px}.tb-game{display:flex;position:relative;min-width:0;min-height:193px;text-align:left;overflow:hidden;align-items:center;gap:16px;padding:14px;border:1px solid #d5b15c88;border-radius:18px;background:linear-gradient(145deg,#0d382b,#061b15);box-shadow:0 12px 32px #0005;color:var(--tb-cream);transition:border-color .15s,transform .15s}.tb-game:active{transform:scale(.985)}.tb-game[aria-pressed=true]{border:2px solid var(--tb-gold);box-shadow:0 0 0 1px #f6d77f55,0 12px 32px #0007}.tb-art{flex:0 0 38%;max-width:195px;min-width:105px;min-height:155px;border-radius:13px;display:flex;align-items:center;justify-content:center;gap:0;box-shadow:inset 0 0 45px #0008,0 3px 12px #0006;overflow:hidden}.tb-chess-art{background:repeating-conic-gradient(#927351 0% 25%,#32291f 0% 50%) 0 0/44px 44px}.tb-chess-art span{font:64px Georgia,serif;color:#fff2cc;text-shadow:2px 6px 6px #000b}.tb-chess-art span:nth-child(2){font-size:48px;color:#29211e;text-shadow:1px 1px 0 #e9d6a9,2px 5px 5px #000}.tb-chess-art span:nth-child(3){font-size:48px}.tb-damas-art{background:repeating-conic-gradient(#643a27 0% 25%,#e2bf8a 0% 50%) 0 0/50px 50px;gap:0}.tb-damas-art i{width:48px;height:48px;border:5px double #fff0c2;border-radius:50%;background:radial-gradient(circle at 35% 22%,#f6d8a0,#98672d);box-shadow:0 6px 6px #0009;margin-left:-11px}.tb-damas-art i.king{display:grid;place-items:center;font:25px Georgia,serif;color:#e6b94a;background:radial-gradient(circle at 35% 22%,#687b6c,#142923);border-color:#d0b874}.tb-game-copy{display:grid;gap:8px;min-width:0}.tb-game-copy strong{font:900 clamp(22px,2.8vw,37px) Georgia,serif;color:var(--tb-gold)}.tb-game-copy em{font-size:12px;font-style:normal;color:#c5d8c7;line-height:1.4}.tb-game-arrow{margin-left:auto;color:var(--tb-gold);font-size:28px}.tb-play{border:1px solid #c7a75366;border-radius:20px;background:linear-gradient(145deg,#0b3125,#051711);padding:clamp(12px,2.5vw,25px);max-width:1080px;margin:20px auto 0}.tb-play-header{display:flex;justify-content:space-between;gap:10px;align-items:center;border-bottom:1px solid #d5b15c40;padding-bottom:14px;margin-bottom:16px}.tb-play-header h2{font:900 clamp(22px,3vw,34px) Georgia,serif;color:var(--tb-gold);margin:5px 0}.tb-play-header p{font-size:12px;color:#c9dbd0;margin:0}.tb-change{min-height:44px;padding:10px 13px;border:1px solid #e4ca77;border-radius:10px;color:var(--tb-gold);font-weight:800;background:#134630}.tb-play-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(240px,.75fr);gap:26px;align-items:start}.tb-board-wrap{width:100%;max-width:615px;margin:auto;min-width:0}.tb-board-frame{padding:clamp(5px,1.2vw,12px);border:4px solid #ad8344;border-radius:13px;box-shadow:0 7px 22px #000a,inset 0 2px 7px #0009;background:linear-gradient(145deg,#f0c982,#654429)}.tb-board{width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));overflow:hidden;border-radius:4px;user-select:none;-webkit-user-select:none}.tb-square{position:relative;min-width:0;min-height:0;padding:0;border:0;display:grid;place-items:center;outline-offset:-4px;-webkit-tap-highlight-color:transparent}.tb-light{background:#f0d9b5}.tb-dark{background:#9b704e}.tb-square.tb-selected{background:#c9c166!important}.tb-square.tb-last{box-shadow:inset 0 0 0 4px #eecf6599}.tb-square.tb-target:before{content:"";position:absolute;inset:36%;border-radius:100%;background:#164c348c;pointer-events:none}.tb-square.tb-target.tb-has-piece:before{inset:5%;background:transparent;border:5px solid #177d5ebd}.tb-piece{font:clamp(21px,5.6vw,61px)/1 Georgia,"Times New Roman",serif;position:relative;z-index:1;pointer-events:none}.tb-piece.tb-white{color:#fff5dd;text-shadow:-1px -1px 0 #654a33,2px 2px 1px #352319,0 4px 3px #0009}.tb-piece.tb-black{color:#1f2823;text-shadow:1px 1px 0 #e8cf9d88,0 3px 3px #000a}.tb-disc{width:73%;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;border:clamp(2px,.6vw,6px) double #f9e6b8;box-shadow:inset 0 4px 7px #fff5,0 6px 8px #0009;position:relative;z-index:1;pointer-events:none}.tb-disc.tb-white{background:radial-gradient(circle at 30% 20%,#fff6d7,#c4944b);border-color:#fff3bb}.tb-disc.tb-black{background:radial-gradient(circle at 30% 20%,#455b4b,#0d231c);border-color:#b9a066}.tb-disc .tb-crown{font-size:clamp(15px,3vw,34px);color:#f6d77f;text-shadow:0 2px 3px #000}.tb-opponent,.tb-player{display:flex;align-items:center;gap:8px;min-height:32px;font-size:11px;font-weight:900;letter-spacing:1px;color:#f0db9f}.tb-seat-dot{width:13px;height:13px;border-radius:50%;background:#222;border:2px solid #b99a5c}.tb-player .tb-seat-dot{background:#e5d1a7}.tb-sidebar{display:grid;gap:14px}.tb-turn-panel,.tb-history{padding:16px;border:1px solid #a98e566b;border-radius:15px;background:#051e16}.tb-turn-panel small,.tb-history>strong{font-size:10px;color:#d9be7d;letter-spacing:1.2px;font-weight:900}.tb-turn-panel>strong{display:block;margin:10px 0;color:#fff2ce;font:900 23px Georgia,serif}.tb-turn-panel p{font-size:12px;line-height:1.6;color:#c5d3c7;margin:0}.tb-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.tb-actions button{min-height:48px;padding:9px 7px;border:1px solid #dfbe72;border-radius:11px;background:linear-gradient(155deg,#19704e,#0c3b2c);font-size:11px;color:#fff0b9;font-weight:900}.tb-actions button:nth-child(2){background:#18392c}.tb-history{min-height:100px}.tb-history ol{padding-left:22px;margin:12px 0 0;max-height:150px;overflow-y:auto;color:#d5e0d4;font-size:12px;line-height:1.7}.tb-disclaimer{font-size:10px;line-height:1.6;text-align:center;color:#acbda9}.tb-footer{text-align:center;margin:25px auto 12px;color:#acb599;letter-spacing:1.2px;font-size:9px}@media(max-width:750px){.tb-app{padding-left:12px;padding-right:12px}.tb-header-tag{display:none}.tb-header{grid-template-columns:1fr auto}.tb-hero{margin:24px auto 20px}.tb-games{gap:10px}.tb-game{min-height:155px;display:grid;justify-items:center;text-align:center;padding:10px 7px;gap:8px}.tb-art{min-height:83px;width:100%;max-width:none}.tb-chess-art span{font-size:43px}.tb-chess-art span:nth-child(2),.tb-chess-art span:nth-child(3){font-size:33px}.tb-damas-art i{width:33px;height:33px}.tb-game-copy{gap:4px}.tb-game-copy strong{font-size:21px}.tb-game-copy small{font-size:8px;letter-spacing:.7px}.tb-game-copy em{font-size:10px}.tb-game-arrow{display:none}.tb-play-grid{grid-template-columns:1fr;gap:14px}.tb-play-header p{max-width:300px}.tb-board-wrap{max-width:550px}.tb-piece{font-size:clamp(23px,9vw,52px)}}@media(max-width:375px){.tb-game-copy strong{font-size:18px}.tb-art{min-width:0}.tb-chess-art span{font-size:32px}.tb-chess-art span:nth-child(2),.tb-chess-art span:nth-child(3){font-size:25px}.tb-play-header{align-items:flex-start}.tb-change{font-size:10px;padding:8px}}@media(prefers-reduced-motion:reduce){.tb-game{transition:none}}
/* Escolha opcional de cor contra bot nos dois Tabuleiros. */
.tb-color-choice{display:grid;grid-template-columns:minmax(0,1fr) minmax(165px,1fr);gap:7px 12px;align-items:center;padding:10px 12px;border:1px solid #b99c6166;border-radius:12px;background:linear-gradient(100deg,#092b21,#103d2f)}
.tb-color-choice label{font-size:11px;font-weight:900;color:#f5d68f;letter-spacing:.7px}
.tb-color-choice select{width:100%;min-height:40px;padding:8px 10px;background:#061e18;color:#ffedc2;border:1px solid #c9ab6d;border-radius:9px;font:800 12px system-ui,sans-serif;cursor:pointer}
.tb-color-choice select:focus-visible{outline:3px solid #f5d68f;outline-offset:2px}
.tb-color-choice select:disabled{opacity:.6;cursor:default}
.tb-color-choice small{grid-column:1/-1;color:#bfd1bf;font-size:10px;line-height:1.3}
@media(max-width:480px){.tb-color-choice{grid-template-columns:1fr;gap:5px}.tb-color-choice small{grid-column:auto}}


/* V2: artes próprias substituem símbolos Unicode nativos. */
.tb-art.tb-art-image{
  display:block;flex:0 0 38%;width:38%;height:160px;min-height:0;max-width:195px;min-width:0;
  object-fit:cover;object-position:center;
  border:1px solid #dcbe7b66;border-radius:13px;
}
.tb-piece{
  display:block;width:93%;height:93%;max-width:100%;max-height:100%;
  filter:drop-shadow(0 3px 2px #0008);
  pointer-events:none;
}
.tb-disc{
  display:block;width:91%;height:91%;
  aspect-ratio:1;
  border:0!important;border-radius:0!important;
  box-shadow:none!important;background:none!important;
  filter:drop-shadow(0 3px 3px #0008);
  pointer-events:none;
}
.tb-game[aria-pressed=true] {border-color:#f7dc91}
@media(max-width:750px){
  .tb-art.tb-art-image{width:100%;max-width:100%;height:100px;flex:none}
  .tb-piece{width:94%;height:94%}
  .tb-disc{width:95%;height:95%}
}

/* Tabuleiros V3: mesa com presença premium e HUD online isolados do lobby. */
.tb-play[data-mode="xadrez"] .tb-board-frame{
 border:9px ridge #d3a362!important;
 padding:clamp(7px,1.7vw,18px)!important;
 background:linear-gradient(142deg,#f8e4ac 0%,#8d572c 17%,#3f2516 42%,#bd8650 72%,#ffe8a5 100%)!important;
 box-shadow:0 5px 0 #432510,0 13px 0 #211308,0 19px 32px #000c,inset 0 0 0 3px #ffe0a3!important;
 border-radius:13px;
}
.tb-play[data-mode="xadrez"] .tb-board{
 border:3px solid #241910;
 box-shadow:inset 0 0 0 3px #dac38e,0 0 0 3px #1b1e18,0 7px 18px #000a!important;
 background:#aa8654;
}
.tb-play[data-mode="xadrez"] .tb-square.tb-dark{
 background:linear-gradient(135deg,#48664e 0%,#1a4132 52%,#143020 100%)!important;
}
.tb-play[data-mode="xadrez"] .tb-square.tb-light{
 background:linear-gradient(135deg,#f6e4bb 0%,#e7c58f 54%,#c9a773 100%)!important;
}
.tb-play[data-mode="xadrez"] .tb-square.tb-selected{background:#b7aa45!important}
.tb-play[data-mode="xadrez"] .tb-piece{width:100%!important;height:100%!important;filter:drop-shadow(2px 5px 3px #030f0fb9) saturate(1.11)!important}
.tb-play[data-mode="xadrez"] .tb-board-wrap{
 border-radius:17px;padding:clamp(4px,.9vw,10px);
 background:radial-gradient(ellipse at 50% 44%,#b48d5940,transparent 69%);
}
.tb-board.tb-flipped{transform:rotate(180deg)}
.tb-board.tb-flipped .tb-square{transform:rotate(180deg)}
.tb-online-controls{
 display:grid;gap:12px;margin:0 0 18px;padding:14px;
 border:1px solid #d8bc7b78;border-radius:16px;
 background:linear-gradient(135deg,#174933e3,#07261b);
}
.tb-online-settings{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(120px,.7fr);gap:12px;align-items:center}
.tb-online-settings label{display:grid;gap:7px;color:#f5d68f;font-size:11px;font-weight:900;letter-spacing:.8px}
.tb-online-settings select{
 width:100%;min-height:47px;min-width:0;padding:9px 8px;
 border:1px solid #ecc879;border-radius:11px;background:#061b13;color:#f4dfad;
 font-size:12px;font-weight:800;
}
.tb-pot-preview{display:grid;gap:2px}
.tb-pot-preview>span{font-size:10px;color:#dcc78f;letter-spacing:1px}
.tb-pot-preview>strong{font:900 29px Georgia,serif;color:#ffdf89}
.tb-pot-preview>small{font-size:9px;color:#bdcbbb}
.tb-online-buttons{display:flex;gap:9px;flex-wrap:wrap}
.tb-online-buttons button{
 flex:1 1 155px;min-height:48px;padding:10px 13px;border-radius:12px;
 border:2px solid #f0cd77;background:linear-gradient(145deg,#167950,#07452c);
 color:#fff5c7;font-weight:950;letter-spacing:.4px;
 box-shadow:0 4px 0 #795621;font-size:11px;
}
.tb-online-buttons #tb-start-local,.tb-online-buttons #tb-cancel-online,
.tb-online-buttons #tb-leave-online{background:#143b2e;border-color:#998650}
.tb-online-buttons .hidden{display:none!important}
#tb-online-status{margin:0;color:#d4e4d5;font-size:12px;line-height:1.5}
.tb-online-wait{display:flex;align-items:center;gap:12px;color:#ffdf8e;font-size:12px}
.tb-online-wait.hidden{display:none!important}
.tb-online-wait strong{font:900 25px Georgia,serif;font-variant-numeric:tabular-nums}
.tb-wait-pulse{height:12px;width:12px;border-radius:50%;background:#e8c76d;box-shadow:0 0 0 6px #e8c76d29}
@media(max-width:480px){.tb-online-settings{grid-template-columns:minmax(0,1fr) 120px}.tb-online-buttons{gap:7px}
 .tb-online-buttons button{flex-basis:138px;font-size:10px}
 .tb-pot-preview>strong{font-size:23px}
}

/* V3.1 - fluxos de partida primeiro, sem alterar a vitrine geral de Tabuleiros.
   A abertura direta do jogo expõe entrada, pote e busca online ANTES da mesa. */
.tb-app.tb-game-open .tb-hero,
.tb-app.tb-game-open .tb-games { display:none!important }
.tb-app.tb-game-open .tb-play {
  margin-top:clamp(12px,2vw,22px);
}
.tb-app.tb-game-open .tb-online-controls {
  border:2px solid #e7cb82;
  box-shadow:0 8px 24px #0008, inset 0 1px 0 #f6d88733;
}
.tb-app.tb-game-open .tb-play-header { margin-bottom:12px; }
@media (max-width:750px) {
  .tb-app.tb-game-open .tb-play{padding:10px}
  .tb-app.tb-game-open .tb-online-controls{padding:12px;gap:10px}
  .tb-app.tb-game-open .tb-play-header{align-items:center}
  .tb-app.tb-game-open .tb-play-header h2{font-size:25px}
  .tb-app.tb-game-open .tb-play-header p{font-size:11px}
}

/* V3.2 — entrada com a mesma interação de setas e moeda do lobby/Sinukin.
   Escopo estritamente limitado a Tabuleiros. */
.tb-online-settings .tb-bet-group{display:grid;gap:8px;min-width:0;align-content:center}
.tb-online-settings .tb-bet-label{font-size:11px;font-weight:900;color:#f5d68f;letter-spacing:.8px}
.tb-bet-stepper{
 display:grid;grid-template-columns:minmax(43px,58px) minmax(0,1fr) minmax(43px,58px);
 align-items:stretch;gap:5px;min-height:61px;width:100%;border:1px solid #caa755;
 border-radius:15px;padding:4px;background:linear-gradient(145deg,#0d3b29,#05271c);
 box-shadow:inset 0 2px 7px #0007,0 3px 10px #0005;
}
.tb-bet-stepper button{
 min-height:48px;display:grid;place-items:center;border:1px solid #d7ba7399;
 border-radius:11px;color:#f2cd68;background:linear-gradient(145deg,#194e32,#082c20);
 touch-action:manipulation;cursor:pointer;
}
.tb-bet-stepper button:disabled{opacity:.3;cursor:default}
.tb-bet-stepper button:focus-visible{outline:3px solid #fff2b0;outline-offset:2px}
.tb-bet-stepper button svg{width:23px;height:23px;display:block}
.tb-bet-stepper output{
 display:flex;align-items:center;justify-content:center;gap:9px;min-width:0;
 color:#ffe4a0;font:900 clamp(23px,3.7vw,37px)/1 Georgia,serif;
 font-variant-numeric:tabular-nums;
}
.tb-bet-stepper output img{width:clamp(24px,3.5vw,34px);height:auto;flex-shrink:0;filter:drop-shadow(0 2px 3px #0009)}
.tb-bet-native{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%)!important}
.tb-bet-hint{display:block;color:#c5d1bb;font-size:10px;line-height:1.3}
@media(max-width:480px){
 .tb-bet-stepper{grid-template-columns:44px minmax(0,1fr) 44px;gap:3px;min-height:56px}
 .tb-bet-stepper button{min-height:44px}
 .tb-bet-stepper output{gap:5px;font-size:26px}
 .tb-bet-stepper output img{width:25px}
 .tb-online-settings{grid-template-columns:minmax(0,1fr) minmax(105px,.55fr);gap:8px}
}

/* TABULEIROS PREMIUM V4: contraste por equipe, leitura da jogada e resultado.
   Arquivos e motores de outras modalidades permanecem inalterados. */
.tb-play .tb-square .tb-piece.tb-white,
.tb-play .tb-square .tb-disc.tb-white {
  filter:drop-shadow(0 0 2px #24190b) drop-shadow(0 4px 3px #1b130bc7)!important;
}
.tb-play .tb-square .tb-piece.tb-black,
.tb-play .tb-square .tb-disc.tb-black {
  filter:drop-shadow(0 0 2px #fff5dc) drop-shadow(0 3px 3px #000d)!important;
}
.tb-play .tb-square.tb-has-piece:has(.tb-white)::after,
.tb-play .tb-square.tb-has-piece:has(.tb-black)::after {
  content:"";position:absolute;right:6%;bottom:5%;z-index:2;
  width:clamp(6px,.85vw,10px);aspect-ratio:1;border-radius:100%;
  border:1.5px solid #171511;pointer-events:none;
}
.tb-play .tb-square.tb-has-piece:has(.tb-white)::after {
  background:#fffef0;box-shadow:0 0 0 1px #fff6d8,0 1px 3px #0009;
}
.tb-play .tb-square.tb-has-piece:has(.tb-black)::after {
  background:#10151c;border-color:#fff1d2;box-shadow:0 0 0 1px #0f1a26,0 1px 3px #0009;
}
.tb-play .tb-square.tb-last-from {
  box-shadow:inset 0 0 0 4px #f2d388!important;
  background-image:linear-gradient(155deg,#ffe9a82e,#ffd15b33)!important;
}
.tb-play .tb-square.tb-last-to {
  box-shadow:inset 0 0 0 4px #ffe59e!important;
  background-image:linear-gradient(155deg,#f6d57f69,#eabb4c56)!important;
}
.tb-play .tb-square.tb-opponent-last {
  box-shadow:inset 0 0 0 4px #45e5e1,inset 0 0 0 7px #04372f!important;
  background-image:linear-gradient(155deg,#29babf5e,#0f83714d)!important;
}
.tb-last-move-info{
  display:block;margin:9px 0 10px;padding:9px 12px;
  min-height:39px;line-height:1.3;
  background:#103629;border:1px solid #d5b97799;border-radius:10px;
  color:#f5dda4;font-size:clamp(10px,1.8vw,12px);
  font-weight:900;letter-spacing:.65px;text-align:center;
}
.tb-last-move-info.tb-opponent-move{
  border-color:#54dcd2;color:#e6fffb;
  background:linear-gradient(130deg,#06463f,#0b2b27);
}
.tb-timer-wrap{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0 10px}
.tb-timer-wrap span{font-size:10px;color:#dfca8d;font-weight:900;letter-spacing:.8px}
.tb-timer-wrap strong{
  min-width:54px;padding:6px 10px;border:1px solid #d9b778b5;
  border-radius:10px;background:#0f3a2b;
  color:#fdf0c2;font-size:19px;font-weight:900;font-variant-numeric:tabular-nums;
  text-align:center;
}
.tb-result.hidden{display:none!important}
.tb-result{
  position:fixed;inset:0;z-index:9999;display:grid;place-items:center;
  padding:calc(env(safe-area-inset-top,0px) + 20px) 18px calc(env(safe-area-inset-bottom,0px) + 20px);
  background:#00120fe8;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  overflow-y:auto;overscroll-behavior:contain;
}
.tb-result-card{
  display:flex;flex-direction:column;align-items:center;gap:14px;
  width:min(100%,465px);max-height:100%;
  overflow-y:auto;text-align:center;
  padding:clamp(22px,5vw,40px);
  border-radius:26px;
  background:radial-gradient(ellipse at top,#16573b,#061f17 73%);
  border:2px solid #ebc875;
  box-shadow:0 18px 55px #000b,0 0 34px #b9953644,inset 0 0 0 3px #0e3e2c;
}
.tb-result-mark{
  width:78px;height:78px;flex:0 0 auto;border:5px double #efca79;border-radius:50%;
  background:radial-gradient(circle at 32% 26%,#ffe5a2,#c38a2c 60%,#543818);
  position:relative;box-shadow:0 5px 25px #d5a74566;
}
.tb-result-mark::before{
  content:"";position:absolute;inset:22px 19px 23px;
  border:6px solid #123b2b;border-radius:50%;transform:rotate(-12deg);
}
.tb-result-kicker{font-size:11px;letter-spacing:2.2px;font-weight:900;color:#f4d38c}
.tb-result h2{
  font:900 clamp(53px,11vw,91px)/1 Georgia,serif;
  margin:0;color:#ffedbb;text-shadow:0 4px 0 #81501c,0 8px 20px #000a;
}
.tb-result[data-outcome="lost"] .tb-result-mark{filter:saturate(.45)}
.tb-result[data-outcome="lost"] h2{color:#d9e3df;text-shadow:0 4px 0 #24372c}
.tb-result[data-outcome="draw"] h2{font-size:clamp(42px,9vw,72px);color:#f8dfa4}
.tb-result[data-outcome="local"] h2{font-size:clamp(31px,6.8vw,51px)}
.tb-result-card>p{margin:0;line-height:1.4;font-size:clamp(12px,3.2vw,15px);color:#e5e9d9}
.tb-result-prize{font-weight:900;font-size:clamp(15px,3vw,20px);color:#ffe09a}
.tb-result-actions{width:100%;display:grid;gap:10px}
.tb-result-actions button{
  min-height:52px;padding:12px 18px;border-radius:13px;
  font-size:clamp(12px,2.5vw,15px);font-weight:950;
  border:2px solid #ffdf8e;cursor:pointer;touch-action:manipulation;
  background:linear-gradient(135deg,#15754e,#07442d);
  color:#fff1be;box-shadow:0 4px 0 #7b5828;
}
.tb-result-actions button:last-child{background:#12382c;border-color:#9e8c65}
.tb-result-actions button:focus-visible{outline:3px solid white;outline-offset:3px}
.tb-result-actions button:disabled{opacity:.5}
#tb-result-footnote{font-size:10px;opacity:.8}
@media(max-width:460px){
 .tb-result-card{gap:11px;padding:21px}
 .tb-result-mark{height:68px;width:68px}
 .tb-last-move-info{font-size:10px}
}

/* XADREZIN PREMIUM V5: 2.5D em alto contraste. Não atinge o Damaszin. */
.tb-play[data-mode="xadrez"] .tb-square .tb-piece-25d {
 width:94%!important;
 height:98%!important;
 overflow:visible;
 transform:translateY(-2%);
 filter:drop-shadow(0 2px 1px #0d1316c9) drop-shadow(0 5px 3px #0007)!important;
}
.tb-play[data-mode="xadrez"] .tb-square .tb-piece-25d.tb-white{
 filter:drop-shadow(0 1px 1px #4c3828c9) drop-shadow(0 4px 3px #0008)!important;
}
.tb-play[data-mode="xadrez"] .tb-square .tb-piece-25d.tb-black{
 filter:drop-shadow(0 0 1px #ebf7f2) drop-shadow(0 4px 3px #0009)!important;
}
/* Os círculos de cor V4 não são necessários quando cada escultura já é inequívoca. */
.tb-play[data-mode="xadrez"] .tb-square.tb-has-piece:has(.tb-piece-25d)::after {display:none!important}
.tb-play[data-mode="xadrez"] .tb-square.tb-selected {
 background:linear-gradient(145deg,#ffe7a1,#b4a159)!important;
 box-shadow:inset 0 0 0 4px #eed179!important;
}
.tb-play[data-mode="xadrez"] .tb-square.tb-last-from {box-shadow:inset 0 0 0 4px #f3d387!important}
.tb-play[data-mode="xadrez"] .tb-square.tb-last-to {box-shadow:inset 0 0 0 4px #ffe6a0!important}
.tb-play[data-mode="xadrez"] .tb-square.tb-opponent-from {
 box-shadow:inset 0 0 0 4px #4bdacb!important;
 background-image:linear-gradient(130deg,#36c6bb29,#35ac8e48)!important;
}
.tb-play[data-mode="xadrez"] .tb-square.tb-opponent-last {
 box-shadow:inset 0 0 0 4px #70f6d5,inset 0 0 0 7px #07372b!important;
 background-image:linear-gradient(135deg,#26b8ae5e,#0c77644a)!important;
}
.tb-play[data-mode="xadrez"] .tb-square.tb-target {box-shadow:inset 0 0 0 3px #12654eb3}
.tb-play[data-mode="xadrez"] .tb-square.tb-target::before {background:#0f6a4e86}
.tb-play[data-mode="xadrez"] .tb-square.tb-target.tb-has-piece::before{
 background:transparent;border:5px solid #118364dc;
}
.tb-timer-wrap[data-urgency="warning"] strong{background:#69531b;color:#fff2b3;border-color:#f0c56e}
.tb-timer-wrap[data-urgency="critical"] strong,
.tb-timer-wrap[data-urgency="expired"] strong{
 background:#762e1d;color:#fff0dc;border-color:#ffab8e;
 box-shadow:0 0 0 2px #fd986126;
}
.tb-timer-wrap[data-urgency="critical"] span{color:#ffb59a}
@media(max-width:480px){
 .tb-play[data-mode="xadrez"] .tb-square .tb-piece-25d{width:98%!important;height:100%!important}
 .tb-play[data-mode="xadrez"] .tb-board-frame{padding:5px!important;border-width:6px!important}
 .tb-timer-wrap strong{font-size:23px;min-width:66px}
}

/* Tabuleiros Premium V6 — apenas carregamento robusto de peças 2.5D.
   Imagens SVG autossuficientes: sem <use> externo, fontes ou emojis. */
html body .tb-play .tb-board .tb-square > img.tb-asset-v6 {
  display:block!important;
  position:relative;
  z-index:1;
  width:100%!important;
  height:100%!important;
  max-width:100%;
  max-height:100%;
  min-width:0;
  min-height:0;
  padding:0;
  margin:0;
  object-fit:contain;
  object-position:center center;
  aspect-ratio:auto;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  text-shadow:none!important;
  overflow:visible;
  pointer-events:none;
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
  transform:none!important;
}
html body .tb-play[data-mode="xadrez"] .tb-board .tb-square > img.tb-asset-v6{
  filter:drop-shadow(0 3px 3px #050b0aa6)!important;
}
html body .tb-play[data-mode="damas"] .tb-board .tb-square > img.tb-asset-v6{
  filter:drop-shadow(0 2px 3px #050b0a9c)!important;
}
/* Indicação de equipe está integrada às pedras e peças — elimina marcas que
   mascaravam detalhes de esculturas pequenas em iPhone. */
html body .tb-play .tb-square.tb-has-piece:has(img.tb-asset-v6)::after{
  display:none!important;
}
html body .tb-play .tb-square.tb-opponent-from {
  box-shadow:inset 0 0 0 4px #4bdacb!important;
  background-image:linear-gradient(135deg,#24c9bc42,#15a18b3f)!important;
}
@media(max-width:430px){
  html body .tb-play .tb-board .tb-square > img.tb-asset-v6{
    width:100%!important;height:100%!important;
  }
}

/* Tabuleiros V7 — resenhas curtas: mesma identidade dourada, sem emojis. */
.tb-play .tb-opponent,.tb-play .tb-player {gap:8px;flex-wrap:wrap}
.tb-banter-bubble{
 display:inline-flex;align-items:center;max-width:min(100%,270px);
 padding:7px 12px;margin-left:auto;min-height:30px;
 border:1px solid #f6db97b3;border-radius:14px 14px 14px 4px;
 color:#fff5ce;background:linear-gradient(135deg,#6a5125ed,#284d37f2);
 box-shadow:0 3px 12px #0007;letter-spacing:.2px;
 font-size:clamp(10px,2.4vw,13px);font-weight:800;line-height:1.3;
 white-space:normal;overflow-wrap:anywhere;
 animation:tb-bubble-in .18s ease-out both;
}
.tb-player .tb-banter-bubble{border-radius:14px 14px 4px 14px;background:linear-gradient(135deg,#35664ae9,#7c5929df)}
.tb-banter-bubble.hidden,.tb-resenhas.hidden,.tb-banter-options.hidden{display:none!important}
@keyframes tb-bubble-in {from{transform:translateY(5px);opacity:0}to{transform:translateY(0);opacity:1}}
.tb-resenhas{display:grid;gap:8px;margin:12px 0 10px}
.tb-resenhas #tb-banter-toggle{
 min-height:43px;padding:9px 14px;border:1.5px solid #e1bf70;
 border-radius:12px;cursor:pointer;touch-action:manipulation;
 color:#ffe7a8;background:linear-gradient(135deg,#18513b,#082e22);
 font-size:12px;font-weight:900;letter-spacing:1.4px;
 box-shadow:0 3px 0 #694b22;
}
.tb-banter-options{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
 gap:8px;padding:8px 0 6px;
}
.tb-banter-options button{
 min-width:0;min-height:43px;padding:8px 10px;
 color:#f8e6b8;font-size:clamp(10px,2.5vw,12px);font-weight:800;line-height:1.4;
 border:1px solid #b89b5d;border-radius:10px;
 background:#123d2f;cursor:pointer;touch-action:manipulation;
}
.tb-banter-options button:focus-visible,.tb-resenhas #tb-banter-toggle:focus-visible{
 outline:3px solid #fff5c8;outline-offset:2px
}
.tb-result[data-outcome="interrupted"] h2{
 font-size:clamp(30px,7.1vw,53px);line-height:1.08;color:#f3d8a6;
 text-shadow:0 3px 0 #674a28
}
@media(max-width:400px){
 .tb-banter-bubble{max-width:100%;margin-left:0}
 .tb-banter-options{gap:6px}
}
@media(prefers-reduced-motion:reduce){
 .tb-banter-bubble{animation:none}
}

/* V10 — restauração da fotografia aprovada na seleção independente.
   O resultado não altera mesas/engines: apenas as duas imagens de escolha. */
.tb-games>a.tb-game {cursor:pointer;text-decoration:none;touch-action:manipulation}
.tb-games>a.tb-game:focus-visible {outline:3px solid #ffe3a0;outline-offset:3px}
.tb-games .tb-art-image.tb-photo-xadrez {
 object-position:left center!important;object-fit:cover!important;
 filter:contrast(1.08) saturate(1.08);
}
.tb-games .tb-art-image.tb-photo-damas {
 object-position:center center!important;object-fit:cover!important;
 filter:contrast(1.08) saturate(1.08);
}

/* Fallback de inicialização V10: só aparece caso o módulo falhe ao importar. */
.tb-boot-warning {
  max-width:690px;margin:20px auto;padding:16px 20px;
  border:1px solid #e0bc74;border-radius:14px;
  background:#163c2e;color:#fff0cf;
  font:700 14px/1.5 system-ui,sans-serif;text-align:center;
}
.tb-boot-warning button {
  display:block;margin:12px auto 0;padding:12px 18px;min-height:44px;
  border:2px solid #e8cd8d;border-radius:11px;
  color:#f9e5a9;background:#07543c;font-weight:900;cursor:pointer;
}

/* Aviso temporário de cor contra bot — sem modal que bloqueie o relógio. */
#tb-color-announcement{
 position:fixed;top:max(12px,env(safe-area-inset-top));left:50%;
 transform:translate(-50%,-12px);z-index:9999;
 width:max-content;max-width:min(92vw,420px);pointer-events:none;
 opacity:0;visibility:hidden;text-align:center;
 background:linear-gradient(160deg,#10543d,#04271d);color:#ffe8a0;
 border:2px solid #dfbb65;border-radius:14px;padding:13px 20px;
 font-size:clamp(12px,2.8vw,18px);font-weight:900;letter-spacing:.07em;
 box-shadow:0 15px 35px #000a;
 transition:opacity .2s ease,transform .2s ease,visibility .2s;
}
#tb-color-announcement.visible{
 opacity:1;visibility:visible;transform:translate(-50%,0);
}
@media(prefers-reduced-motion:reduce){#tb-color-announcement{transition:none;}}

/* Revisão da posição final: somente leitura, sem alterar resultado ou carteira. */
.tb-final-position{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;
  margin:0 0 13px;padding:14px 16px;scroll-margin-top:14px;
  border:2px solid #e5bd68;border-radius:16px;
  background:linear-gradient(145deg,#15513b,#062b21);
  box-shadow:0 8px 24px #0006,inset 0 0 0 1px #fff5c01b;
}
.tb-final-position-copy{display:grid;gap:5px;flex:1 1 230px;min-width:0}
.tb-final-position-copy strong{color:#ffe3a2;font-size:clamp(11px,2.3vw,15px);font-weight:950;letter-spacing:1px}
.tb-final-position-copy span{color:#e0eadf;font-size:clamp(11px,2vw,13px);line-height:1.45}
#tb-review-back{
  min-height:46px;padding:10px 16px;border:2px solid #f5d787;border-radius:12px;
  background:linear-gradient(145deg,#f8dfa0,#d4a444);color:#092c21;
  font-size:12px;font-weight:950;box-shadow:0 3px 0 #71531c;
}
#tb-result-review{
  background:linear-gradient(145deg,#ffe5ab,#d4a446);
  border-color:#ffeec5;color:#062d22;box-shadow:0 4px 0 #755721;
}
.tb-play .tb-square.tb-mated-king{
  box-shadow:inset 0 0 0 5px #ff6262,inset 0 0 0 9px #72151b!important;
  background-image:linear-gradient(155deg,#ef3d4580,#6a192960)!important;
}
.tb-board.tb-final-review .tb-square{cursor:default}
@media(max-width:510px){
  .tb-final-position{flex-direction:column;align-items:stretch}
  #tb-review-back{width:100%}
}
