.game-page{max-width:1180px;margin:12px auto 50px;color:#f8f6fa}
.game-page > .ghost{border-color:rgba(190,255,105,.5)}
.game-page > .ghost:hover{border-color:rgba(190,255,105,.8)}
.game-page h1{font-size:clamp(26px,3vw,40px);margin:16px 0 22px}
.game-lobby-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.game-lobby-card,.game-character{border:1px solid #ffffff22;background:#1d1724;color:inherit;text-align:left;border-radius:20px;overflow:hidden;cursor:pointer;padding:0;transition:transform .15s,border-color .15s}
.game-lobby-card:hover,.game-character:hover{transform:translateY(-3px);border-color:#b58aff}
.game-lobby-visual{height:320px;position:relative;background:radial-gradient(circle at 60% 30%,#653c91,#1d1724 65%);display:grid;place-items:center;overflow:hidden}
.game-lobby-visual img{position:absolute;width:100%;height:100%;object-fit:cover}
.game-lobby-visual>span{font-size:clamp(55px,8vw,110px)}
.game-lobby-shade{position:absolute;inset:40% 0 0;background:linear-gradient(transparent,#100b16)}
.game-lobby-visual strong{position:absolute;bottom:20px;left:22px;font-size:28px}
.game-lobby-info{padding:15px 22px;display:flex;justify-content:space-between;color:#c8bacf;font-size:13px}
.game-lobby-info b{color:#c8fa7e;font-size:21px}
.game-character-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.game-character-image{aspect-ratio:4/5;background:radial-gradient(circle at 60% 20%,#654381,#241b2d);display:grid;place-items:center;overflow:hidden}
.game-character-image img{width:100%;height:100%;object-fit:cover}
.game-character-image span{font-size:70px;color:#ba8cff}
.game-character strong,.game-character small{display:block;padding:0 14px}
.game-character strong{padding-top:12px;font-size:16px}.game-character small{padding-bottom:15px;color:#aa9eaf}
.game-arena{max-width:1120px}
.game-stage{position:relative;width:min(100%,360px);aspect-ratio:9/16;margin:0 auto;border:1px solid #7e55a9;border-radius:20px;background:radial-gradient(circle,#49305e,#100c16);box-shadow:0 20px 50px #0008}
.game-stage-video,.game-stage-image,.game-stage-placeholder{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.game-stage-video,.game-stage-image,.game-stage-placeholder{border-radius:19px}
.game-stage-placeholder{display:grid;place-items:center;font-size:90px;color:#be9de0}
.game-stage:after{content:'';position:absolute;inset:0;border-radius:19px;background:linear-gradient(#090710bb,transparent 25%,transparent 50%,#090710a8);pointer-events:none}
.game-stage-top{position:absolute;z-index:2;top:18px;left:22px;right:22px;display:flex;justify-content:space-between;gap:10px;text-shadow:0 2px 8px #000;font-size:16px}
.game-stage-top span{font-size:13px;color:#e3c5ff}
.game-sound{position:absolute;z-index:3;right:18px;bottom:18px;border:1px solid #ffffff55;border-radius:50%;background:#16101abb;color:white;width:42px;height:42px;cursor:pointer}
.game-controls{position:absolute;z-index:3;left:50%;top:50%;transform:translate(-50%,-50%);width:min(1020px,calc(100vw - 260px));display:flex;justify-content:space-between;gap:20px;pointer-events:none}
.game-move{pointer-events:auto;display:grid;gap:3px;width:170px;min-width:0;padding:13px 18px;border:2px solid #c28cff;border-radius:16px;background:#1d1124ed;color:white;cursor:pointer;text-align:center;backdrop-filter:blur(8px)}
.game-move:last-child{border-color:#c6f47d}.game-move strong{font-size:25px}.game-move small{font-weight:800}.game-move span{font-size:12px;color:#d3c3df}
.game-move:disabled{opacity:.65;cursor:default}.game-move.stopped{border-color:#f3df99}
.game-wager{display:flex;align-items:center;justify-content:center;gap:16px;margin:20px auto;padding:16px;background:#211929;border:1px solid #ffffff20;border-radius:16px;flex-wrap:wrap}
.game-wager label{font-weight:800}.game-wager>div{display:flex;align-items:center;gap:8px}.game-wager input{width:135px;text-align:center;background:#100c16;color:white;border:1px solid #ffffff38;border-radius:9px;padding:10px;font-size:16px;font-weight:800}
.game-wager button{width:39px;height:39px;border:0;border-radius:9px;background:#583b72;color:white;font-size:20px;cursor:pointer}.game-wager small{color:#b3a7bf}
.game-result{position:absolute;z-index:3;left:50%;bottom:8%;transform:translateX(-50%);width:min(90%,400px);padding:17px;border:1px solid #ffffff49;border-radius:16px;text-align:center;background:#140e1ce8;backdrop-filter:blur(10px)}
.game-result h2{margin:0 0 7px;font-size:25px}.game-result p{margin:5px 0;font-size:13px}.game-result button{margin-top:10px}
.game-admin-title,.game-admin-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.game-admin-title h2{margin:0}
.game-admin-character-tabs{display:flex;gap:7px;overflow:auto;margin:18px 0}.game-admin-character-tabs button{border:1px solid #ffffff30;border-radius:9px;background:#201a2a;color:#ddd;padding:8px 12px;white-space:nowrap}.game-admin-character-tabs button.active{background:#a76cf0;color:#1a0d26}
.game-file-row{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:12px 0;border-bottom:1px solid #ffffff1c;font-size:13px}.game-file-row label{flex:1;min-width:0;font-weight:700}.game-file-row input{display:block;width:100%;margin-top:7px;font-size:11px}.game-file-row img,.game-file-row video{width:88px;height:108px;flex:none;object-fit:cover;border:1px solid #ffffff33;border-radius:9px;background:#0e0b14}.game-file-row span{color:#9b92a3;white-space:nowrap}
.game-admin-actions{margin:18px 0}
@media(max-width:800px){.game-character-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.game-lobby-visual{height:245px}}
@media(max-width:950px){.game-controls{left:5%;right:5%;top:80%;width:auto;transform:translateY(-50%);gap:9px}.game-move{flex:1;width:auto;padding:10px 6px}.game-move strong{font-size:19px}}
@media(max-width:650px){.game-lobby-grid{grid-template-columns:1fr}.game-lobby-visual{height:270px}.game-stage{width:100%}.game-stage-top{top:12px;left:12px;right:12px;font-size:12px}.game-result{bottom:10%;padding:12px}.game-wager{gap:8px}.game-wager small{width:100%;text-align:center}.game-file-row{flex-wrap:wrap}.game-file-row label{flex-basis:100%}}
.puzzle-draw-overlay{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:16px;background:#0c0817e8;backdrop-filter:blur(8px)}.puzzle-draw-overlay .puzzle-draw-panel{width:min(850px,100%);max-height:calc(100dvh - 32px);overflow:auto;margin:0;box-shadow:0 25px 80px #000b}.puzzle-draw-header{display:flex;justify-content:space-between;gap:16px}.puzzle-draw-header>button{align-self:start;border:1px solid #ffffff40;border-radius:50%;width:37px;height:37px;background:#32223b;color:white;font-size:24px;cursor:pointer;flex:none}
.puzzle-history{margin-top:24px;padding:24px;border:1px solid #ffffff24;border-radius:22px;background:#1c1523}.puzzle-history h2{margin:0 0 15px}.puzzle-history-list>div{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #ffffff19;font-size:13px}.puzzle-history-list time{color:#b9aabe}.puzzle-history-list span{color:#f0a0cb}.puzzle-history-pages{display:flex;justify-content:center;align-items:center;gap:15px;margin-top:16px}.puzzle-history-pages button{border:1px solid #ffffff30;background:#382742;color:white;border-radius:9px;padding:8px 12px}.puzzle-history-pages button:disabled{opacity:.45}
.puzzle-lobby-pieces{display:grid;grid-template-columns:repeat(3,1fr);width:210px;transform:rotate(-8deg);filter:drop-shadow(0 18px 20px #100714aa)}
.puzzle-lobby-pieces svg{width:70px;fill:#f49ec8;stroke:#fff7;stroke-width:2}.puzzle-lobby-pieces svg:nth-child(2n){fill:#a77bea}.puzzle-lobby-pieces text,.puzzle-piece text{font:bold 29px system-ui;fill:#281227;stroke:none}
.puzzle-lobby-visual{background:#573071 url('./puzzle-iphone18.webp') center 44%/cover no-repeat}
.puzzle-lobby-visual::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#1b0b38bd 0%,#23103948 48%,#1c0b37b8 100%);pointer-events:none}
.puzzle-lobby-art{position:absolute;z-index:1;inset:0;display:flex;align-items:center;justify-content:space-between;gap:22px;padding:38px 9% 55px}
.puzzle-lobby-board{position:relative;width:min(43%,218px);aspect-ratio:1;flex:none;border:2px solid #ffebf4d9;border-radius:5px;background:#573071 url('./puzzle-iphone18.webp') center/cover;box-shadow:0 16px 34px #0b0714a6,0 0 0 5px #f4c6e32e;transform:rotate(-6deg)}
.puzzle-lobby-board .puzzle-seams{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:#fff0f6;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 2px #1a0925)}
.puzzle-lobby-exchange{display:grid;place-items:center;flex:none;width:40px;height:40px;border:1px solid #ffe9f1ab;border-radius:50%;background:#2a124a99;color:#fff2fa;font-size:27px;line-height:1;box-shadow:0 8px 20px #16062180}
.puzzle-lobby-gifts{display:grid;place-items:center;position:relative;flex:none;width:24%;min-width:90px;aspect-ratio:1;border-radius:22px;background:radial-gradient(circle,#f9bfdf93 0%,#b855a154 48%,transparent 72%);filter:drop-shadow(0 14px 18px #120618bc)}
.puzzle-lobby-gifts::before,.puzzle-lobby-gifts::after{content:'✦';position:absolute;color:#fff0c8;font-size:24px;text-shadow:0 0 12px #fff}.puzzle-lobby-gifts::before{top:4%;left:5%}.puzzle-lobby-gifts::after{right:0;top:30%;font-size:15px}
.puzzle-lobby-gifts svg{width:90%;height:90%;max-width:116px;max-height:116px;overflow:visible;filter:drop-shadow(0 8px 12px #1a0a26a6)}
.puzzle-lobby-gifts svg rect,.puzzle-lobby-gifts svg path:first-of-type{fill:#ed9cc8;stroke:#ffdfef;stroke-width:3}
.puzzle-lobby-gifts svg path:last-of-type{fill:#9060cb;stroke:#f3dfff;stroke-width:3}
.game-lobby-visual>.puzzle-lobby-reward{position:absolute;top:17px;left:19px;z-index:3;max-width:calc(100% - 38px);padding:6px 11px;border:1px solid #f6d5e65e;border-radius:999px;background:#281b35d9;color:#fbd9e9;font-size:11px;line-height:1.3;font-weight:800;letter-spacing:.03em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.puzzle-lobby-visual .game-lobby-shade{z-index:1;inset:55% 0 0;background:linear-gradient(transparent,#120d1af2);pointer-events:none}
.puzzle-lobby-visual strong{z-index:2;font-size:26px;text-shadow:0 2px 10px #10051d}
@media(max-width:450px){.puzzle-lobby-art{gap:9px;padding-inline:8%}.puzzle-lobby-board{width:40%}.puzzle-lobby-exchange{width:30px;height:30px;font-size:21px}.puzzle-lobby-gifts{min-width:74px}.puzzle-lobby-gifts svg{width:82%}}
.puzzle-heading{text-align:center;margin:18px auto 28px}.puzzle-heading>span,.puzzle-draw-panel>div:first-child>span{font-size:11px;letter-spacing:.22em;color:#f5a0cf;font-weight:900}.puzzle-heading h1{margin:8px 0}.puzzle-heading p,.puzzle-side p,.puzzle-draw-panel p{color:#c9bacd;line-height:1.6}
.puzzle-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:24px}.puzzle-collection,.puzzle-side,.puzzle-draw-panel{border:1px solid #ffffff24;border-radius:24px;background:linear-gradient(145deg,#2c1a32,#17121e);padding:25px}.puzzle-nine{display:grid;grid-template-columns:repeat(3,1fr);width:min(100%,420px);margin:0 auto;gap:2px}.puzzle-piece{position:relative;min-width:0;aspect-ratio:1}.puzzle-piece svg{width:100%;height:100%;fill:#403248;stroke:#a780a2;stroke-width:2;filter:drop-shadow(0 4px 6px #0005)}.puzzle-piece.owned svg{fill:#e887b9;stroke:#ffd6ed}.puzzle-piece.centre.owned svg{fill:#f7cb81;stroke:#fff1d4}.puzzle-piece b{position:absolute;right:7%;bottom:5%;border-radius:20px;background:#160d1c;color:white;padding:3px 7px;font-size:12px}.puzzle-prize{margin-top:24px;background:#ffffff0b;border:1px solid #ffffff1b;border-radius:15px;padding:17px;display:grid;gap:8px}.puzzle-prize span{color:#f3a3d1;font-weight:900;font-size:12px;letter-spacing:.13em}.puzzle-prize strong{font-size:18px}
.puzzle-nine{position:relative;gap:0;padding:0}.puzzle-piece{z-index:auto}.puzzle-piece svg{overflow:visible;fill:none;stroke:none;filter:none}.puzzle-piece image{opacity:.22}.puzzle-piece.owned{z-index:auto}.puzzle-piece.owned svg,.puzzle-piece.centre.owned svg{fill:none;stroke:none}.puzzle-piece.owned image{opacity:1}.puzzle-piece b{right:5%;bottom:3%;z-index:5;background:#160d1cde}.puzzle-nine>.puzzle-seams{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:4;fill:none;stroke:#e7c5e3;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 2px #0009)}
.puzzle-nine::before{content:'';position:absolute;inset:0;background:url('./puzzle-iphone18.webp') center/100% 100% no-repeat;opacity:.22;pointer-events:none}.puzzle-piece:not(.owned) image{opacity:0}
.puzzle-draw-action{display:flex;justify-content:center;margin-top:25px}.puzzle-draw-action>.primary{min-width:min(100%,260px)}.puzzle-side>.puzzle-prize{margin:0 0 24px}.puzzle-side>.puzzle-prize strong{font-size:21px}
.puzzle-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.puzzle-stats>div{padding:14px 8px;background:#ffffff0b;border:1px solid #ffffff18;border-radius:12px;text-align:center}.puzzle-stats small{display:block;color:#c9b5cc;font-size:12px}.puzzle-stats strong{display:block;font-size:24px;margin-top:5px}.puzzle-side h2{font-size:20px;margin:22px 0 12px}.puzzle-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.puzzle-counts>div{display:flex;justify-content:space-between;padding:10px 12px;background:#ffffff0b;border-radius:9px}.puzzle-counts span{color:#c9b5cc}.puzzle-counts strong{color:#f6aad3}.puzzle-side>.primary{margin-top:14px}.puzzle-side>.primary:disabled{opacity:.62;cursor:default}.puzzle-result{margin-top:15px;padding:16px;border-radius:12px;background:#e887b922;color:#ffd5ec;font-weight:900}.puzzle-draw-panel{margin-top:24px}.puzzle-draw-panel h2{margin:6px 0}.puzzle-card-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:7px;margin-top:20px}.puzzle-card-grid button{aspect-ratio:3/4;border:1px solid #f4afd466;border-radius:9px;background:linear-gradient(135deg,#8d436f,#42234f);color:#fbd0e7;font-size:20px;cursor:pointer;transition:transform .15s,background .15s}.puzzle-card-grid button:hover{transform:translateY(-4px);background:linear-gradient(135deg,#bc5a91,#684084)}.puzzle-card-grid button:disabled{opacity:.55;cursor:default}
@media(max-width:800px){.puzzle-layout{grid-template-columns:1fr}.puzzle-card-grid{gap:5px}.puzzle-card-grid button{border-radius:5px;font-size:14px}}
@media(max-width:420px){.puzzle-collection,.puzzle-side,.puzzle-draw-panel{padding:15px}.puzzle-card-grid{gap:3px}.puzzle-card-grid button{font-size:11px}.puzzle-stats strong{font-size:19px}}
@media(max-width:550px){.puzzle-history-list>div{display:grid;grid-template-columns:1fr auto}.puzzle-history-list time{grid-column:1/-1}}

/* Keep all 100 draw cards visible in one 10 × 10 board at every viewport size. */
.puzzle-draw-overlay{padding:clamp(4px,1.4vmin,16px)}
.puzzle-draw-overlay .puzzle-draw-panel{width:min(1280px,100%);height:calc(100dvh - 2 * clamp(4px,1.4vmin,16px));max-height:960px;display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:clamp(8px,1.8vmin,22px)}
.puzzle-draw-header{flex:none;align-items:flex-start;min-width:0}
.puzzle-draw-header h2{font-size:clamp(16px,2.5vmin,26px);line-height:1.2;margin:4px 0}
.puzzle-draw-header p{font-size:clamp(11px,1.5vmin,14px);margin:4px 0 0}
.puzzle-draw-header>button{width:clamp(28px,4.5vmin,38px);height:clamp(28px,4.5vmin,38px);font-size:clamp(18px,3vmin,24px)}
.puzzle-card-grid{flex:1;min-width:0;min-height:0;grid-template-columns:repeat(10,minmax(0,1fr));grid-template-rows:repeat(10,minmax(0,1fr));gap:clamp(2px,.55vmin,7px);margin-top:clamp(6px,1.5vmin,16px)}
.puzzle-card-grid button{width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:auto;border-radius:clamp(3px,.7vmin,9px);font-size:clamp(10px,2vmin,20px)}
@media(max-height:500px){.puzzle-draw-header p,.puzzle-draw-header span{display:none}.puzzle-draw-header h2{margin:0;font-size:14px}.puzzle-card-grid{margin-top:5px}}

/* One shared image keeps the phone and puzzle seams on the same coordinates. */
.puzzle-nine{background:url('./puzzle-iphone18.webp') center/100% 100% no-repeat;isolation:isolate}
.puzzle-nine::before{display:none}
.puzzle-piece{background:#211429b8}
.puzzle-piece.owned{background:transparent}
.puzzle-piece b{z-index:5}
.puzzle-nine>.puzzle-seams{stroke-width:1.45;filter:drop-shadow(0 1px 2px #140a1b)}
.puzzle-card-grid button.puzzle-card-picked{z-index:2;animation:puzzle-pick-shake .42s ease-in-out;background:linear-gradient(145deg,#e3adcc,#7d4f9c);box-shadow:0 0 0 2px #fff4d5,0 0 25px #f5b4de9c}
@keyframes puzzle-pick-shake{0%,100%{transform:rotate(0) scale(1)}25%{transform:rotate(-5deg) scale(1.08)}50%{transform:rotate(5deg) scale(1.12)}75%{transform:rotate(-3deg) scale(1.08)}}
.puzzle-reveal-overlay{position:fixed;inset:0;z-index:110;display:grid;place-items:center;padding:16px;background:#090613d9;backdrop-filter:blur(12px)}
.puzzle-reveal-panel{position:relative;width:min(420px,100%);padding:28px 28px 26px;border:1px solid #edc0dd77;border-radius:26px;background:radial-gradient(circle at 50% 5%,#50324f,#22182b 56%,#15101e);box-shadow:0 28px 90px #000b,0 0 40px #b87bbb2e;text-align:center;animation:puzzle-reveal-enter .55s cubic-bezier(.18,.8,.28,1) both}
.puzzle-reveal-close{position:absolute;top:14px;right:15px;width:34px;height:34px;border:1px solid #ffffff38;border-radius:50%;background:#ffffff16;color:white;font-size:22px;cursor:pointer}
.puzzle-reveal-eyebrow{color:#f4b9d8;font-size:12px;font-weight:800;letter-spacing:.18em;text-transform:uppercase}
.puzzle-reveal-card{width:190px;margin:24px auto 18px;padding:9px;border:1px solid #f3d4e7b0;border-radius:16px;background:linear-gradient(145deg,#76516f,#32243f);box-shadow:0 15px 35px #0a0616a8;transform:rotate(-3deg);animation:puzzle-reveal-card .65s .15s both}
.puzzle-reveal-image{aspect-ratio:1;background-image:url('./puzzle-iphone18.webp');background-size:300% 300%;border-radius:10px}
.puzzle-reveal-card span{display:block;padding:10px 0 3px;font-size:14px;font-weight:800;color:#fff2fa}
.puzzle-reveal-panel h2{margin:12px 0 6px;font-size:25px}.puzzle-reveal-panel p{color:#cdbdd1;font-size:13px;line-height:1.55}.puzzle-reveal-panel>.primary{width:100%;margin-top:10px}
@keyframes puzzle-reveal-enter{from{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes puzzle-reveal-card{from{opacity:0;transform:rotate(-9deg) translateY(25px) scale(.8)}to{opacity:1;transform:rotate(-3deg) translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.puzzle-card-grid button.puzzle-card-picked,.puzzle-reveal-panel,.puzzle-reveal-card{animation:none}}
