* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #06202e; color: #f6ead0; font-family: Georgia, 'Palatino Linotype', serif; touch-action: none; user-select: none; -webkit-user-select: none; }
body.bigtext { font-size: 118%; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

#hud { position: fixed; left: 0; right: 0; top: 0; padding: max(8px, env(safe-area-inset-top)) 58px 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#msg { background: rgba(20, 12, 4, .82); border: 2px solid #c79a3b; border-radius: 12px; padding: 7px 16px; font-weight: 700; letter-spacing: .02em; text-align: center; max-width: 92vw; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#bubble { display: flex; align-items: center; gap: 8px; padding-left: 4px !important; background: #fff7de; color: #2a1a08; border: 2px solid #3a2410; border-radius: 14px; padding: 6px 12px; font-style: italic; max-width: 86vw; text-align: center; font-size: .92em; box-shadow: 0 3px 10px rgba(0,0,0,.35); animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

#bar { position: fixed; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 10px; pointer-events: none; }
#bar button { pointer-events: auto; }
button.big { font: 700 1.25em Georgia, serif; letter-spacing: .06em; padding: 14px 26px; min-width: 120px; min-height: 52px; border-radius: 14px; border: 3px solid #5a3a08; color: #2a1704; background: linear-gradient(#ffe08a, #d9a441 55%, #b27c1c); box-shadow: 0 5px 0 #6b4410, 0 8px 16px rgba(0,0,0,.4); cursor: pointer; }
button.big:active { transform: translateY(3px); box-shadow: 0 2px 0 #6b4410; }
button.big.alt { background: linear-gradient(#e8e2cf, #bdb497 60%, #8f876c); border-color: #4a4430; }
button.big:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
#btnGear { position: fixed; right: 8px; top: max(8px, env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%; border: 2px solid #c79a3b; background: rgba(20, 12, 4, .8); color: #f3dc9a; font-size: 24px; z-index: 5; }

.panel { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px; background: radial-gradient(ellipse at center, rgba(6, 30, 46, .78), rgba(2, 10, 18, .95)); text-align: center; overflow: auto; touch-action: pan-y; }
.panel h1 { margin: 0; font-size: clamp(34px, 9vw, 64px); letter-spacing: .08em; color: #ffe08a; text-shadow: 0 3px 0 #6b3d0a, 0 0 28px rgba(255, 190, 60, .45); }
.panel h2 { margin: 0; font-size: clamp(28px, 7vw, 44px); color: #ffe08a; }
.sub { margin: 0 0 6px; opacity: .85; }
#admirals { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.adm { width: min(270px, 88vw); border: 3px solid #c79a3b; border-radius: 16px; padding: 12px 14px; background: linear-gradient(#3a2412, #22140a); color: #f6ead0; font: inherit; cursor: pointer; text-align: left; display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.adm:active { transform: scale(.98); }
.adm .ico { font-size: 40px; text-align: center; }
.adm b { font-size: 1.1em; color: #ffe08a; } .adm small { opacity: .8; display: block; }
.row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
#themes button, #themes2 button { font: inherit; padding: 8px 12px; border-radius: 10px; border: 2px solid #8a6a28; background: #22140a; color: #f6ead0; cursor: pointer; min-height: 40px; }
#themes button.on, #themes2 button.on { background: #d9a441; color: #2a1704; font-weight: 700; }
.panel label { display: flex; gap: 10px; align-items: center; font-size: 1.05em; }
.panel input[type=checkbox] { width: 24px; height: 24px; }

#banner { position: fixed; left: 0; right: 0; top: 30%; z-index: 6; display: flex; flex-direction: column; align-items: center; pointer-events: none; text-shadow: 0 4px 0 #000, 0 0 24px rgba(0,0,0,.7); }
#banner .skull { font-size: clamp(54px, 14vw, 100px); line-height: 1; filter: drop-shadow(0 4px 0 #000); }
#bannerText { font: 900 clamp(30px, 8vw, 60px)/1.1 Georgia, serif; letter-spacing: .06em; color: #ffe08a; text-align: center; padding: 0 10px; }
#banner.show { animation: slam 2.4s ease-out forwards; }
body.reduce #banner.show { animation: fade 2s linear forwards; }
@keyframes slam { 0% { transform: scale(2.6); opacity: 0; } 12% { transform: scale(.94); opacity: 1; } 20% { transform: scale(1.04); } 28% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@keyframes fade { 0% { opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
label.twist { display: flex; gap: 12px; align-items: center; text-align: left; border: 2px solid #5fe0c8; border-radius: 14px; padding: 10px 14px; background: rgba(40, 120, 110, .22); max-width: min(560px, 92vw); cursor: pointer; }
label.twist input { width: 26px; height: 26px; flex: none; accent-color: #5fe0c8; }
label.twist b { color: #aaffee; display: block; } label.twist small { opacity: .85; display: block; }
#portrait { height: 64px; width: auto; margin: -14px 0 -6px -2px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); flex: none; }
#overImg { height: min(34vh, 260px); width: auto; filter: drop-shadow(0 8px 10px rgba(0,0,0,.6)); }
.adm .ico img { height: 64px; width: auto; display: block; margin: 0 auto; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
label.twist.salvo { border-color: #ffb347; background: rgba(160, 90, 20, .22); }
label.twist.salvo input { accent-color: #ffb347; } label.twist.salvo b { color: #ffd9a0; }
#chain { position: fixed; left: 0; right: 0; top: 18%; z-index: 7; text-align: center; font: 900 clamp(34px, 9vw, 64px)/1 Georgia, serif; letter-spacing: .06em; color: #ffd35a; text-shadow: 0 4px 0 #7a3a00, 0 0 22px rgba(255, 150, 20, .8); pointer-events: none; }
#chain.foe { color: #ff7a6a; text-shadow: 0 4px 0 #4a0a00, 0 0 22px rgba(255, 60, 40, .7); }
#chain.show { animation: chainpop 1.3s ease-out forwards; }
@keyframes chainpop { 0% { transform: scale(.4); opacity: 0; } 15% { transform: scale(1.25); opacity: 1; } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }
#themes, #themes2 { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 92vw; }
#twistList { display: flex; flex-direction: column; gap: 8px; align-items: stretch; max-width: min(560px, 92vw); width: 100%; }
#twistList label.twist { padding: 8px 12px; } #twistList label.twist small { font-size: .86em; }
#presets button { font: inherit; padding: 8px 12px; border-radius: 10px; border: 2px solid #8a6a28; background: #22140a; color: #f6ead0; cursor: pointer; min-height: 40px; }
.cosm { gap: 18px; } .cosm label { display: flex; gap: 8px; align-items: center; }
.orderCard { display: block; width: min(420px, 90vw); text-align: left; border: 2px solid #c79a3b; border-radius: 12px; background: linear-gradient(#3a2412, #22140a); color: #f6ead0; padding: 10px 14px; margin: 6px 0; font: inherit; cursor: pointer; }
.orderCard b { color: #ffe08a; display: block; } .orderCard small { opacity: .85; } .orderCard.on { border-color: #5fe0c8; background: linear-gradient(#1c4a44, #12302c); }
#pickList, #ordersList { display: flex; flex-direction: column; align-items: center; }
#online input, .panel input[type=text] { font: inherit; font-size: 1.1em; padding: 10px 14px; border-radius: 10px; border: 2px solid #8a6a28; background: #22140a; color: #f6ead0; min-width: 180px; text-align: center; text-transform: uppercase; }
#nick { text-transform: none; }
#codeBig { font: 900 clamp(34px, 11vw, 56px)/1 Georgia, serif; letter-spacing: .18em; color: #ffe08a; text-shadow: 0 3px 0 #6b3d0a; margin: 4px 0 8px; }
#timer { position: fixed; right: 12px; top: 64px; z-index: 6; font: 800 22px Georgia, serif; color: #ffe08a; background: rgba(20, 12, 4, .8); border: 2px solid #c79a3b; border-radius: 12px; padding: 2px 10px; pointer-events: none; }
#timer.low { color: #ff7a6a; border-color: #ff7a6a; }
#inviteBar { position: fixed; left: 0; right: 0; bottom: max(70px, calc(env(safe-area-inset-bottom) + 70px)); display: flex; justify-content: center; z-index: 6; }
#emotes { position: fixed; left: 8px; bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px)); display: none; flex-direction: column; gap: 6px; z-index: 5; }
body.online #emotes { display: flex; }
#emotes button { width: 42px; height: 42px; border-radius: 50%; border: 2px solid #c79a3b; background: rgba(20, 12, 4, .8); font-size: 22px; cursor: pointer; }

/* ---------- party mode: the big screen (body.tv) and the phones (body.phone) ---------- */
#tv, #ph { position: fixed; inset: 0; z-index: 3; pointer-events: none; font-family: Georgia, 'Palatino Linotype', serif; color: #f6ead0; }
.tvCards { position: absolute; right: 2vw; top: 4vh; width: 33vw; display: flex; flex-direction: column; gap: 1.6vh; }
.pc { border: .4vh solid var(--c); border-radius: 16px; background: rgba(20, 12, 4, .84); padding: 1.2vh 1.2vw; transition: transform .3s, box-shadow .3s, opacity .4s; }
.pc.active { transform: scale(1.04); box-shadow: 0 0 3.4vh var(--c); }
.pc.out { opacity: .42; filter: grayscale(.85); }
.pcHead { display: flex; align-items: center; gap: 1vw; } .pcName { font-size: 3.4vh; color: #fff3d6; }
.pcAmmo { display: flex; gap: .5vw; margin: .9vh 0; align-items: center; min-height: 3vh; } .ball { width: 2.7vh; height: 2.7vh; border-radius: 50%; background: #1b1b22; border: .25vh solid #55555e; display: inline-block; } .ball.on { background: radial-gradient(circle at 35% 30%, #c9ccd8, #0d0e12 70%); border-color: #e8e8f0; }
.ammoNum { font-size: 3vh; color: #ffe08a; }
.pcShips img { height: 3.8vh; margin-right: .7vw; } .pcShips img.dead { filter: grayscale(1) brightness(.35); }
.pcTag { font-size: 2.2vh; color: var(--c); letter-spacing: .12em; font-weight: 800; min-height: 2.6vh; }
.tvCap { position: absolute; left: 2.5vw; bottom: 2vh; width: 60vw; text-align: center; font-size: 3vh; font-weight: 700; background: rgba(20, 12, 4, .84); border: .3vh solid #c79a3b; border-radius: 14px; padding: 1vh 1.5vw; }
.tvBanner { position: absolute; left: 0; width: 64vw; top: 36%; text-align: center; font: 900 9vh/1.05 Georgia, serif; letter-spacing: .05em; color: #ffe08a; text-shadow: 0 .6vh 0 #7a3a00, 0 0 4vh rgba(0,0,0,.8); opacity: 0; }
.tvBanner.show { animation: slam 2.2s ease-out forwards; }
.tvHint { position: absolute; right: 2vw; bottom: 2vh; font-size: 2.2vh; opacity: .8; }
.tvLobby { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; background: radial-gradient(ellipse at center, rgba(6,30,46,.72), rgba(2,10,18,.94)); text-align: center; }
.tvLobby[hidden] { display: none; }
.tvTitle { font: 900 9vh Georgia, serif; letter-spacing: .08em; color: #ffe08a; text-shadow: 0 .6vh 0 #6b3d0a, 0 0 4vh rgba(255,190,60,.45); }
.tvSub { font-size: 3vh; opacity: .9; } .tvTip { font-size: 2.4vh; opacity: .8; max-width: 70vw; }
.tvJoinRow { display: flex; gap: 4vw; align-items: center; } .tvQr { background: #fff; padding: 1.6vh; border-radius: 14px; } .tvQr svg { display: block; height: 28vh; width: 28vh; }
.tvLab { font-size: 2.4vh; letter-spacing: .2em; opacity: .8; } .tvCode { font: 900 18vh/1 Georgia, serif; letter-spacing: .12em; color: #ffe08a; text-shadow: 0 .8vh 0 #6b3d0a; } .tvUrl { font-size: 2.6vh; opacity: .85; }
.tvLobList { display: flex; gap: 2vw; flex-wrap: wrap; justify-content: center; min-height: 8vh; } .tvLobP { display: flex; align-items: center; gap: .8vw; background: rgba(20,12,4,.8); border: .3vh solid #c79a3b; border-radius: 14px; padding: 1vh 1.6vw; font-size: 3.4vh; animation: pop .3s ease-out; } .tvLobP.away { opacity: .45; } .tvWait { font-size: 3vh; opacity: .7; }
.tvPodium { position: absolute; left: 4vw; width: 56vw; top: 6vh; display: none; flex-direction: column; align-items: center; gap: 1.2vh; text-align: center; background: rgba(10, 6, 2, .9); border: .4vh solid #c79a3b; border-radius: 22px; padding: 2vh 2vw; box-shadow: 0 0 6vh rgba(0,0,0,.7); } .tvPodium.show { display: flex; }
.podTitle { font: 900 8vh Georgia, serif; color: #ffe08a; text-shadow: 0 .6vh 0 #7a3a00; } .podTrophy { font-size: 12vh; }
.podRow { display: flex; align-items: center; gap: 1.2vw; background: rgba(20,12,4,.84); border: .3vh solid #8a6a28; border-radius: 14px; padding: 1vh 1.6vw; font-size: 3vh; } .podRow.win { border-color: #ffd35a; box-shadow: 0 0 3vh rgba(255,211,90,.6); } .podTip { font-size: 2.6vh; opacity: .85; }
.tvEmote { position: absolute; bottom: 18vh; font-size: 9vh; text-shadow: 0 0 3vh var(--c); animation: floatup 2.4s ease-out forwards; }
@keyframes floatup { from { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: scale(1.1); } to { transform: translateY(-40vh); opacity: 0; } }
.pcShape { display: inline-flex; }

#ph > * { pointer-events: auto; }
.phTop { position: absolute; left: 0; right: 0; top: 0; padding: max(8px, env(safe-area-inset-top)) 10px 6px; display: flex; align-items: center; gap: 10px; background: rgba(20, 12, 4, .86); border-bottom: 3px solid #c79a3b; }
.phTop.mine { background: rgba(60, 40, 8, .92); border-bottom-color: #ffd35a; }
.phName { font-size: 1.1em; } .phPips { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; } .phPips .ball { width: 17px; height: 17px; }
.phStatus { position: absolute; left: 8px; right: 8px; top: 52px; text-align: center; font-weight: 700; background: rgba(20, 12, 4, .8); border: 2px solid #c79a3b; border-radius: 10px; padding: 4px 8px; font-size: .95em; }
.phTimer { position: absolute; right: 10px; top: 96px; font: 800 20px Georgia; background: rgba(20, 12, 4, .85); border: 2px solid #ffd35a; border-radius: 10px; padding: 0 8px; color: #ffe08a; } .phTimer.low { color: #ff7a6a; border-color: #ff7a6a; }
.phTimer[hidden] { display: none; }
.phFoot { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 0 10px; }
.phJoin, .phLobby, .phOver { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px 18px 120px; text-align: center; background: radial-gradient(ellipse at center, rgba(6,30,46,.82), rgba(2,10,18,.96)); }
.phJoin[hidden], .phLobby[hidden], .phOver[hidden] { display: none; }
.phJoin h2, .phLobby h2, .phOver h2 { margin: 0; font-size: clamp(28px, 9vw, 44px); color: #ffe08a; text-shadow: 0 3px 0 #6b3d0a; }
.phJoin input { font: inherit; font-size: 1.2em; padding: 12px 16px; border-radius: 10px; border: 2px solid #8a6a28; background: #22140a; color: #f6ead0; text-align: center; min-width: 220px; }
.phLobList { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 240px; } .phLobP { display: flex; align-items: center; gap: 10px; background: rgba(20,12,4,.85); border: 2px solid #8a6a28; border-radius: 12px; padding: 8px 12px; font-size: 1.1em; } .phLobP.you { border-color: #ffd35a; }
.phEmotes { position: absolute; right: 6px; bottom: 96px; display: flex; flex-direction: column; gap: 5px; } .phEmotes button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #c79a3b; background: rgba(20,12,4,.85); font-size: 20px; }
body.tv, body.phone { background: #04131c; }
.phBadge { display: inline-flex; }

select { font: inherit; padding: 6px 10px; border-radius: 8px; border: 2px solid #8a6a28; background: #22140a; color: #f6ead0; margin-left: 6px; }

/* ---------- unlock window (same module as the other games) ---------- */
:root { --bg2: #231b30; --panel: #2c2340; --line: #4a3d66; --ink: #f4efe2; --dim: #b9aed0; --gold: #ffd23f; --good: #4cd6a0; }
.hidden { display: none !important; }
#unlock { position: fixed; inset: 0; background: #000b; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 12px; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
#unlock .card { background: var(--bg2); border: 2px solid var(--line); border-radius: 20px; padding: 16px; max-width: 460px; width: 100%; max-height: 92dvh; overflow: auto; color: var(--ink); }
#unlock h2 { margin: 0 0 6px; } #unlock .note { color: var(--dim); font-size: .9em; margin: 6px 0; } #unlock .note.good { color: var(--good); } #unlock .price { font-size: 1.7em; margin: 8px 0; } #unlock .price b { color: var(--gold); } #unlock .perks { padding-left: 1.1em; margin: 8px 0; }
#unlock input { width: 100%; font: inherit; padding: 12px; border-radius: 12px; margin: 6px 0; border: 2px solid var(--line); background: #fff; color: #000; text-transform: none; }
#unlock .btn { display: block; width: 100%; margin: 8px 0; padding: 12px; min-height: 48px; border-radius: 14px; border: 2px solid #b9a4ff; background: linear-gradient(#8d6bff, #6a47e0); color: #fff; font: inherit; font-weight: 800; cursor: pointer; } #unlock .btn.alt { background: var(--panel); border-color: var(--line); }
#unlock .chip { background: var(--panel); border: 2px solid var(--line); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer; }
.adm.locked, .big.locked, label.twist.locked { opacity: .62; } #settingsFb { width: min(420px, 90vw); }

#campList { display: flex; flex-direction: column; gap: 8px; width: min(560px, 94vw); max-height: 62vh; overflow: auto; }
.stage { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 2px solid #c79a3b; border-radius: 14px; padding: 8px 12px; background: linear-gradient(#3a2412, #22140a); color: #f6ead0; font: inherit; cursor: pointer; }
.stage img { height: 62px; width: auto; justify-self: center; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); } .stage b { color: #ffe08a; display: block; } .stage small { display: block; opacity: .85; font-size: .85em; } .stage .rules { color: #aaffee; }
.stage .stars { font-style: normal; font-size: 1.3em; color: #ffd35a; letter-spacing: .1em; } .stage.locked { opacity: .6; } .stage.boss { border-color: #ff7a6a; }
#ladderList { width: min(420px, 90vw); text-align: left; background: rgba(20,12,4,.8); border: 2px solid #8a6a28; border-radius: 12px; padding: 8px 12px; max-height: 30vh; overflow: auto; } .ladRow.me { color: #ffe08a; font-weight: 700; } .ladTitle { opacity: .8; font-size: .85em; margin-bottom: 4px; }

#menu { justify-content: flex-start; padding-top: max(24px, 6vh); } .sect { margin-top: 6px; opacity: .85; letter-spacing: .06em; font-size: .9em; text-transform: uppercase; }
button.big.wide { width: min(420px, 90vw); } #rules { width: min(560px, 92vw); text-align: center; } #rules summary { cursor: pointer; padding: 10px; font-size: 1.1em; color: #ffe08a; } #rules[open] summary { margin-bottom: 8px; }
#menu .adm { width: min(420px, 92vw); } #admirals { gap: 8px; } #admirals .adm { padding: 8px 12px; }

#gold { position: fixed; left: 50%; transform: translateX(-50%); bottom: 98px; z-index: 7; padding: 5px 12px; border-radius: 999px; background: #2a1a05cc; border: 2px solid #e0a82a; color: #ffe9a8; font: 600 14px/1.2 Georgia, serif; pointer-events: none; }
#gold b { color: #ffd35a; }
#weeklyBoard { width: min(420px, 90vw); margin: 8px auto; text-align: left; background: rgba(20,12,4,.8); border: 2px solid #8a6a28; border-radius: 12px; padding: 8px 12px; max-height: 26vh; overflow: auto; }

.tvStartRow { display: flex; gap: 2vw; justify-content: center; margin-top: 1.5vh; } .tvStart, .tvBot { font: 800 3vh Georgia, serif; padding: 1.4vh 3vw; border-radius: 2vh; border: .4vh solid #6a4a10; cursor: pointer; background: linear-gradient(#ffe08a, #d9a441); color: #3a2208; min-height: 8vh; } .tvStart:disabled { opacity: .45; cursor: default; } .tvBot { background: linear-gradient(#e8e4d8, #b9b3a2); }
.tvStartRow, .tvStartRow button { pointer-events: auto; position: relative; z-index: 4; }
.phFoot { z-index: 6; } .phEmotes { z-index: 6; }
