/* Gameplay feedback only: shared board selectors remain usable in rooms. */
.bubble-pane,.solo-pane{background:linear-gradient(160deg,#202932,#181d24);box-shadow:inset 0 1px 0 #ffffff08}
.bubble-pane .game-head,.solo-pane .game-head{margin-bottom:16px}
.bubble-pane .game-head h1,.solo-pane .game-head h1{font-size:25px;margin:0;letter-spacing:-.7px}
.bubble-pane .game-head .sub,.solo-pane .game-head .sub{font-size:13px;margin:7px 0 0}
.bubble-meta{gap:8px;color:#b9c8d6;font-size:12px;min-height:26px}
.bubble-meta .badge{white-space:nowrap}
.bubble-stage{position:relative;max-width:440px;margin:16px auto}
.bubble-stage .bubble-grid{position:relative;gap:7px;padding:12px;margin:0;background:#0b131dc2;border:1px solid #ffffff0d;border-radius:20px;box-shadow:inset 0 2px 10px #0005}
.bubble{position:relative;color:#21374c;font-size:14px;border:2px solid #ffffff45;box-shadow:inset 0 3px 3px #ffffff6b,inset 0 -4px 4px #0002,0 3px 0 #0005;transition:transform .12s,filter .12s,box-shadow .12s;will-change:transform}
.bubble:after{content:'';position:absolute;left:22%;top:13%;width:27%;height:12%;border-radius:50%;background:#ffffff7d;transform:rotate(-25deg);pointer-events:none}
.bubble:hover{transform:none}
.bubble.group-preview{filter:brightness(1.14);transform:scale(1.07);box-shadow:inset 0 3px 3px #ffffff6b,0 0 0 2px #fff,0 3px 12px #0007;z-index:1}
.bubble-grid[aria-busy=true] .bubble{pointer-events:none}
.bubble.popping{animation:bubble-pop .14s ease-in forwards;z-index:2}
.bubble.falling{animation:bubble-fall .18s cubic-bezier(.26,.75,.43,1.1) both}
.bubble.invalid{animation:piece-invalid .22s ease-out}
.score-bump{display:inline-block;animation:score-bump .24s ease-out}
.score-float{position:absolute;left:50%;top:42%;z-index:5;color:#fff4b3;font-size:28px;font-weight:950;text-shadow:0 2px 0 #312400,0 0 18px #ffbd4866;pointer-events:none;animation:score-float .38s ease-out both}
.bubble-pane .result{padding:16px;margin:16px 0 0}.bubble-pane .result h2{font-size:19px;margin:0}.bubble-pane .result p{font-size:13px;margin:7px 0 12px}
.solo-pane #turn:before{content:'';display:inline-block;vertical-align:middle;margin-right:9px;width:11px;height:11px;background:#69e9bb;border:1px solid #ceffe9;border-radius:50%;box-shadow:0 1px 3px #0005}
.solo-pane #turn[data-side="1"]:before{background:#fb9c80;border-color:#ffdbc6}
.solo-pane #turn[data-game="gomoku"][data-side="0"]:before{background:#151719;border-color:#75808b}
.solo-pane #turn[data-game="gomoku"][data-side="1"]:before{background:#f8f7ef;border-color:#fff}
.board-four{box-shadow:inset 0 1px 0 #ffffff2b,inset 0 -5px 0 #0003,0 8px 22px #0003;border:1px solid #6285a744;overflow:hidden}
.column:disabled,.intersection:disabled{opacity:1}
.column:not(:disabled):hover{background:#bcd9ff19;box-shadow:0 0 0 1px #bcd9ff22}
.column:not(:disabled):hover .disc[data-side="null"]{border-color:#c9e2ff2b}
.disc{position:relative;box-shadow:inset 0 3px 6px #0006}
.disc[data-side="0"],.disc[data-side="1"]{box-shadow:inset 0 3px 3px #ffffff4d,inset 0 -4px 3px #0002,0 2px 3px #0004}
.disc.last{outline:2px solid #fff;outline-offset:-7px}
.disc.last:after{content:'';position:absolute;inset:40%;border-radius:50%;background:#17323d88}
.disc.winning{outline:3px solid #fff5a2;outline-offset:-5px;box-shadow:0 0 14px #ffe477a1,inset 0 2px 4px #fff5;z-index:2}
.disc-drop{animation:disc-drop .24s cubic-bezier(.32,.76,.44,1) both}
.board-gomoku{background-color:#bd9c6e;border-color:#bd9c6e;box-shadow:inset 0 1px 0 #fff5,0 6px 18px #0003}
.intersection:focus-visible{outline:2px solid #f5fff2;outline-offset:-2px;z-index:3}
.stone-place{animation:stone-place .18s ease-out both}
.stone.last:after{inset:38%;background:#ef5d4e;box-shadow:0 0 0 1px #fff8}
.stone.winning{box-shadow:0 0 0 2px #fff7a8,0 0 12px #ffef9c,1px 3px 4px #0005;z-index:2}
.solo-result{display:flex;align-items:center;justify-content:center;gap:12px;padding:14px;margin:12px 0 0;flex-wrap:wrap}
.solo-result>strong{color:var(--mint);font-size:18px}.solo-result>span{font-size:12px;color:var(--muted)}
.bubble-pane .board-controls,.solo-pane .board-controls{margin-top:16px}
@keyframes bubble-pop{0%{transform:scale(1.08);opacity:1}50%{transform:scale(1.2)}100%{transform:scale(.25);opacity:0}}
@keyframes bubble-fall{from{transform:translate(var(--fall-x,0),var(--fall-y,0))}to{transform:translate(0,0)}}
@keyframes score-bump{0%,100%{transform:scale(1)}45%{transform:scale(1.16)}}
@keyframes score-float{from{opacity:1;transform:translate(-50%,8px) scale(.8)}to{opacity:0;transform:translate(-50%,-36px) scale(1.1)}}
@keyframes disc-drop{from{transform:translateY(calc(var(--drop-rows,1)*-108%))}80%{transform:translateY(3%)}to{transform:translateY(0)}}
@keyframes stone-place{from{transform:scale(1.3);opacity:.35}to{transform:scale(1);opacity:1}}
@keyframes piece-invalid{25%{transform:translateX(-2px)}75%{transform:translateX(2px)}to{transform:translateX(0)}}
@media(max-width:480px){.bubble-pane .game-head h1,.solo-pane .game-head h1{font-size:22px}.bubble-meta{font-size:10px}.bubble-stage .bubble-grid{gap:5px;padding:9px;border-radius:16px}.bubble{font-size:11px}.score-float{font-size:23px}.disc.last{outline-offset:-5px}.disc.winning{outline-width:2px;outline-offset:-4px}.stone.winning{box-shadow:0 0 0 1px #fff7a8,0 0 7px #ffef9c,1px 3px 4px #0005}}
@media(prefers-reduced-motion:reduce){.bubble,.bubble:after,.disc,.stone,.score-bump,.score-float{animation:none!important;transition:none!important}.score-float{display:none}.bubble.group-preview{transform:none}}

/* TTIA skin: presentation only. Piece side IDs and every rule stay unchanged. */
/* The site's auto-height iframe must not feed its shrinking viewport back into
   these games' vh-based sizing. Otherwise a460px game collapses to200px. */
.imported-game iframe[data-imported-game="star-defender"],.imported-game iframe[data-imported-game="fruit-slice"]{min-height:700px}
@media(max-width:480px){.imported-game iframe[data-imported-game="star-defender"],.imported-game iframe[data-imported-game="fruit-slice"]{min-height:660px}}
.ttia-piece-legend{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:12px 0 0;font-size:12px;color:#dbcfea}
.ttia-piece-legend>span{display:inline-flex;align-items:center;gap:6px;min-height:36px;border:1px solid #ffffff18;border-radius:12px;padding:3px 10px;background:#241d2f}
.ttia-piece-legend>span[data-turn=true]{border-color:#dfc3f6;box-shadow:0 0 0 2px #c9a6e916}
.ttia-piece-legend img{image-rendering:auto;object-fit:contain;flex-shrink:0}
.board-four{background:linear-gradient(150deg,#514263,#302840);border-color:#b59acc55}
.board-four .disc{background-color:#211b2c}
.board-four .disc[data-side="0"]{background-color:#864358;border-color:#f2a0ad;background-image:url('./theme/ttia-v1/angry.png')}
.board-four .disc[data-side="1"]{background-color:#d5e6e9;border-color:#effbff;background-image:url('./theme/ttia-v1/angel.png')}
.board-four .disc[data-side="0"],.board-four .disc[data-side="1"]{background-size:96% 96%;background-position:center;background-repeat:no-repeat;image-rendering:auto;box-shadow:inset 0 -3px 0 #0002,0 2px 4px #0004}
.board-four .disc.last{outline:2px solid #ffe392;outline-offset:1px}
.board-four .disc.last:after{inset:auto;right:2px;bottom:2px;width:6px;height:6px;background:#ffe392;box-shadow:0 0 0 1px #4c354d}
.board-gomoku{background-color:#68556b;border-color:#68556b}
.board-gomoku .intersection:before,.board-gomoku .intersection:after{background:#302139aa}
.board-gomoku .stone.black{background:#ad5a72 url('./theme/ttia-v1/angry.png') center/106% 106% no-repeat;border:1px solid #632e49}
.board-gomoku .stone.white{background:#e1eaf0 url('./theme/ttia-v1/angel.png') center/106% 106% no-repeat;border:1px solid #a0c1d0}
.board-gomoku .stone{image-rendering:auto;box-shadow:0 2px 2px #1b102e88}
.board-gomoku .stone.last:after{inset:auto;right:-2px;bottom:-2px;width:5px;height:5px;background:#ffe47b;border-radius:1px;box-shadow:0 0 0 1px #492143}
.board-four .disc.winning{outline:3px solid #ffe88a;outline-offset:-2px;box-shadow:0 0 12px #ffc681bb,inset 0 1px 2px #fff5}
.board-gomoku .stone.winning{box-shadow:0 0 0 2px #ffe88a,0 0 12px #ffc681bb,0 2px 2px #1b102e88;z-index:2}
.solo-pane #turn[data-side="0"]:before,.solo-pane #turn[data-game="gomoku"][data-side="0"]:before{width:20px;height:20px;border:0;box-shadow:none;background:transparent url('./theme/ttia-v1/angry.png') center/contain no-repeat;image-rendering:auto}
.solo-pane #turn[data-side="1"]:before,.solo-pane #turn[data-game="gomoku"][data-side="1"]:before{width:20px;height:20px;border:0;box-shadow:none;background:transparent url('./theme/ttia-v1/angel.png') center/contain no-repeat;image-rendering:auto}
@media(max-width:480px){.ttia-piece-legend{font-size:11px;gap:6px}.ttia-piece-legend>span{padding:2px 7px}.ttia-piece-legend img{width:24px;height:24px}.board-four .disc.last{outline-width:1px;outline-offset:0}.board-gomoku .stone.last:after{width:3px;height:3px}}
.game-score-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0;color:#a9bfd7;font-size:11px;line-height:1.6;padding:8px 0;order:3;flex-basis:100%}
.game-score-status .text-button{min-height:32px;font-size:11px;color:#85baff}
.imported-game iframe[data-imported-game="bubble-shooter"]{min-height:760px}
@media(max-width:480px){.imported-game iframe[data-imported-game="bubble-shooter"]{min-height:660px}}
.room-settings{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:14px 0;font-size:12px;color:#b8c4d1}
.room-settings label{display:flex;gap:8px;align-items:center}.room-settings select{max-width:240px;min-height:38px;border:1px solid #ffffff25;border-radius:9px;background:#20262d;color:#edf2f8;padding:6px 10px;font:inherit}
.room-spectators{margin:8px 0 14px;padding:10px 12px;background:#ffffff04;border:1px solid #ffffff10;border-radius:10px;color:#b9c6d7;font-size:12px}.room-spectators summary{cursor:pointer;width:fit-content}.room-spectator-list{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:10px}.room-spectator-list>div{display:flex;align-items:center;gap:8px;min-width:0}.room-spectator-list span{overflow-wrap:anywhere}.room-spectator-list .text-button,.seat .text-button{font-size:10px;min-height:30px}
.room-reactions{position:relative;display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;margin:10px 0;padding-top:8px;min-width:0;border-top:1px solid #ffffff0c}.room-reaction-actions{display:flex;gap:4px}.room-reaction-actions button{padding:3px;width:34px;min-height:36px;border-radius:8px;border:1px solid #ffffff12;background:#ffffff06;font-size:20px;line-height:1;box-shadow:none}.room-reaction-actions button:hover:not(:disabled){background:#ffffff12}.room-reaction-actions button:disabled{opacity:.35;cursor:default}.room-reaction-count{font-size:10px;color:#8b9aab;white-space:nowrap}.room-reaction-feed{position:absolute;bottom:100%;right:8px;display:flex;gap:10px;pointer-events:none;max-width:100%;overflow:hidden}.room-reaction-effect{display:grid;text-align:center;justify-items:center;gap:3px;max-width:80px;animation:room-reaction-float 2.2s ease-out both}.room-reaction-effect b{font-size:30px;line-height:1.3}.room-reaction-effect small{max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:#c8d4e2}
@keyframes room-reaction-float{0%{opacity:0;transform:translateY(8px) scale(.8)}15%{opacity:1;transform:translateY(0) scale(1)}75%{opacity:1}100%{opacity:0;transform:translateY(-22px)}}
@media(max-width:480px){.room-settings{gap:10px}.room-reactions{justify-content:center}.room-reaction-count{flex-basis:100%;text-align:center}.room-spectators{font-size:11px}}
@media(prefers-reduced-motion:reduce){.room-reaction-effect{animation:none}}

.gomoku-levels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 18px;max-width:560px}.gomoku-level{display:grid;gap:5px;justify-items:start;text-align:left;min-width:0;padding:13px 15px!important;border:1px solid #ffffff20!important;border-radius:12px!important;background:#ffffff05!important;color:#d8e1ed!important;box-shadow:none!important}.gomoku-level>strong{font-size:15px;font-weight:650}.gomoku-level>span{font-size:11px;color:#99a8ba}.gomoku-level>small{font-size:11px;color:#adc1da}.gomoku-level[aria-pressed=true]{background:#236bca1c!important;border-color:#5598ed!important;box-shadow:0 0 0 1px #5598ed!important}.gomoku-level[aria-pressed=true]>strong{color:#8fc1ff}.gomoku-level:focus-visible{outline:3px solid #a1c9ff;outline-offset:3px}
@media(max-width:480px){.gomoku-levels{gap:8px;margin:12px 0}.gomoku-level{padding:11px!important}.gomoku-level>span,.gomoku-level>small{font-size:10px}.gomoku-level>strong{font-size:14px}}
