/* Kule Savaşı arayüzü. Giriş sayfası yedili oyun standardındadır: menü solda, oyunun canlı görüntüsü sağda (telefonda menü görüntünün üstünde). */
:root { --bg: #102048; --ink: #fff; --dim: #c3d2f0; --gold: #ffd23f; --org: #f59f0b; --red: #f43f5e; --blue: #3b82f6; --grn: #2dd4bf; --teal: #5eead4; --card: rgba(16, 26, 62, .96); --line: rgba(255, 255, 255, .16); --b1: #2f4ba3; --b2: #172a63; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 500 16px/1.35 'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- düğmeler ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 4px 16px 0; border: 0; border-radius: 16px; background: var(--b1); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .02em; cursor: pointer; box-shadow: 0 5px 0 var(--b2), 0 8px 18px rgba(0, 0, 0, .3); transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--b2); }
.btn.pri { background: linear-gradient(180deg, #ffe680, var(--gold) 45%, var(--org)); color: #3a2600; box-shadow: 0 5px 0 #a3650a, 0 8px 22px rgba(245, 159, 11, .4); }
.btn.pri:active { box-shadow: 0 1px 0 #a3650a; }
.btn.grn { background: linear-gradient(180deg, #99f6e4, var(--grn) 50%, #0d9488); color: #042f2e; box-shadow: 0 5px 0 #0f5e57, 0 8px 22px rgba(45, 212, 191, .3); }
.btn.grn:active { box-shadow: 0 1px 0 #0f5e57; }
.btn.red { background: linear-gradient(180deg, #f47c80, var(--red)); box-shadow: 0 5px 0 #8c1d22; }
.btn.xl { min-height: 66px; font-size: 26px; border-radius: 22px; }
.btn.sm { min-height: 44px; font-size: 14.5px; padding: 3px 10px 0; border-radius: 14px; }
.btn.xs { min-height: 34px; width: auto; font-size: 13px; padding: 2px 10px 0; border-radius: 11px; box-shadow: 0 3px 0 var(--b2); }
.btn.ghost { background: rgba(255, 255, 255, .1); box-shadow: none; font-weight: 700; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn:focus-visible, input:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- ana menü ---------- */
.menu { position: fixed; inset: 0 auto 0 0; width: min(430px, 100%); padding: max(14px, env(safe-area-inset-top)) 22px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: center; gap: 11px; overflow-y: auto; touch-action: pan-y; background: linear-gradient(90deg, rgba(20, 16, 56, .95) 62%, rgba(20, 16, 56, 0)); }
.back { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 22px; color: var(--dim); text-decoration: none; font-weight: 700; font-size: 14px; }
.logo { margin: 18px 0 0; font-size: clamp(50px, 14vw, 74px); line-height: .9; font-weight: 800; letter-spacing: .01em; color: #fff; transform: rotate(-3deg); text-shadow: 0 4px 0 #4c1d95, 0 8px 0 #0b0828, 0 12px 22px rgba(0, 0, 0, .45); }
.logo span { color: var(--teal); text-shadow: 0 4px 0 #0f766e, 0 8px 0 #0b0828, 0 0 28px rgba(94, 234, 212, .55); }
.tagline { margin: 4px 0; color: var(--dim); font-weight: 700; font-size: 17px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lbtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-right: 40px; } .lbtop .btn.xs { width: auto; padding: 0 12px; white-space: nowrap; }
.lbjoin { display: flex; gap: 6px; } .lbjoin input { width: 112px; min-height: 36px; padding: 4px 8px; font-size: 15px; letter-spacing: .12em; text-align: center; }
.joinrow { display: grid; grid-template-columns: 1fr 100px; gap: 9px; margin-top: 2px; }
input { min-height: 44px; padding: 3px 14px 0; border-radius: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 800; font-size: 17px; user-select: text; -webkit-user-select: text; min-width: 0; width: 100%; }
#code, .codein { text-align: center; letter-spacing: .3em; text-transform: uppercase; } #code::placeholder, .codein::placeholder { letter-spacing: .08em; font-size: 14px; color: #9d9bd6; }
#menuMsg { min-height: 20px; margin: 0; text-align: center; color: #ffb3a8; font-weight: 700; font-size: 14.5px; }
.fine { margin: 0; text-align: center; color: #9d9bd6; font-size: 13px; } .fine a { color: var(--gold); font-weight: 700; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

/* ---------- maç göstergeleri ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.hbtn { position: absolute; top: max(6px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); width: 44px; height: 40px; border: 0; border-radius: 12px; background: rgba(14, 11, 40, .82); font-size: 20px; font-weight: 800; pointer-events: auto; cursor: pointer; }
.hbtn.chat { right: calc(max(8px, env(safe-area-inset-right)) + 52px); }
.fsbtn[hidden] { display: none; } .fsbtn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; } .fsbtn .i2, .fsbtn.on .i1 { display: none; } .fsbtn.on .i2 { display: inline; }
.hbtn.hfs { right: auto; left: max(8px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: center; }
.mfs { position: absolute; top: max(6px, env(safe-area-inset-top)); right: 16px; display: flex; align-items: center; gap: 6px; height: 34px; padding: 2px 11px 0; border: 2px solid var(--line); border-radius: 11px; background: rgba(0, 0, 0, .25); color: var(--dim); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; } .mfs svg { width: 17px; height: 17px; stroke: var(--dim); }
#big { position: absolute; top: 26%; left: 0; right: 0; text-align: center; pointer-events: none; }
#big div { display: inline-block; padding: 6px 28px 2px; border-radius: 22px; font-weight: 800; font-size: clamp(40px, 11vw, 84px); line-height: 1; text-shadow: 0 5px 0 rgba(0, 0, 0, .35); animation: big 2.6s forwards; }
#big small { display: block; font-size: .3em; margin-top: 4px; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
@keyframes big { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 10% { transform: scale(1.15) rotate(2deg); opacity: 1; } 18% { transform: scale(1) rotate(0); } 82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
#toast { position: absolute; top: 64px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#toast div { padding: 3px 16px 0; border-radius: 13px; background: rgba(14, 11, 40, .85); font-weight: 800; font-size: 16px; animation: toast 2.4s forwards; }
@keyframes toast { 0% { transform: scale(.6); opacity: 0; } 10% { transform: scale(1.06); opacity: 1; } 16% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
#chatLog { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(54px, calc(env(safe-area-inset-bottom) + 48px)); width: min(420px, 70vw); display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; font-weight: 700; }
#chatLog div { align-self: flex-start; max-width: 100%; padding: 2px 10px 0; border-radius: 9px; background: rgba(14, 11, 40, .7); animation: fade 9s forwards; overflow-wrap: anywhere; }
#chatLog div b { margin-right: 4px; } #chatLog div.sys { color: var(--dim); font-weight: 600; font-style: italic; }
@keyframes fade { 85% { opacity: 1; } 100% { opacity: 0; } }
#chatForm { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 20px)); pointer-events: auto; }
#chatForm input { min-height: 40px; font-size: 15px; background: rgba(14, 11, 40, .9); }
#keysHint { position: absolute; bottom: max(8px, env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .7); text-shadow: 0 1px 2px #000; animation: fade 12s forwards; }
#keysHint b { color: #fff; }

#net { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); padding: 6px 16px 3px; border-radius: 12px; background: var(--red); font-weight: 800; z-index: 50; }

/* ---------- pencereler ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 12px; background: rgba(6, 5, 20, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); touch-action: pan-y; }
.box { position: relative; width: min(460px, 100%); max-height: 100%; overflow-y: auto; padding: 20px 18px 18px; border-radius: 26px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 24px 70px rgba(0, 0, 0, .55); text-align: center; display: flex; flex-direction: column; gap: 10px; animation: pop .3s cubic-bezier(.2, 1.5, .4, 1); }
.box.wide { width: min(760px, 100%); }
.box > * { flex-shrink: 0; }
.box h2 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1; color: var(--gold); text-shadow: 0 3px 0 #a3650a; } .box h2.lose { color: #f47c80; text-shadow: 0 3px 0 #8c1d22; }
.box h3 { margin: 4px 0 0; font-size: 14px; color: var(--dim); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
.box p { margin: 0; } .box .dim { color: var(--dim); font-size: 14.5px; } .box a { color: var(--gold); font-weight: 800; }
.x { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: none; color: var(--dim); font-size: 22px; cursor: pointer; z-index: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { flex: 1 0 auto; min-width: 58px; padding: 6px 8px 3px; border-radius: 13px; border: 2px solid transparent; background: rgba(255, 255, 255, .09); text-align: center; cursor: pointer; line-height: 1.15; font-weight: 800; font-size: 14.5px; }
.chip small { display: block; font-size: 11.5px; color: var(--dim); font-weight: 700; }
.chip.on { border-color: var(--gold); background: rgba(255, 210, 63, .18); }
.chip[disabled] { cursor: default; opacity: .75; } .chip[disabled]:not(.on) { opacity: .4; }
.tog { display: flex; align-items: center; justify-content: center; gap: 6px; }
.tog::before { content: ''; width: 16px; height: 16px; border-radius: 5px; border: 2px solid rgba(255, 255, 255, .5); } .tog.on::before { background: var(--gold); border-color: var(--gold); box-shadow: inset 0 0 0 2px #133; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .stats.four { grid-template-columns: repeat(4, 1fr); }
.stats div { padding: 8px 4px 5px; border-radius: 16px; background: rgba(255, 255, 255, .09); line-height: 1.15; } .stats small { display: block; color: var(--dim); font-size: 12.5px; font-weight: 700; } .stats b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bigscore { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 44px; font-weight: 800; line-height: 1; } .bigscore span { font-size: 15px; padding: 2px 10px 0; border-radius: 10px; } .bigscore .r { background: var(--red); } .bigscore .b { background: var(--blue); }
.say { font-size: 17px; font-weight: 700; line-height: 1.3; } .say b { color: var(--gold); }
.codebig { font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: .12em; color: var(--gold); text-shadow: 0 4px 0 #a3650a; user-select: all; -webkit-user-select: all; padding-left: .12em; }
.share3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.note { padding: 8px 12px 6px; border-radius: 14px; background: rgba(255, 255, 255, .07); font-size: 14px; color: var(--dim); }
.how { text-align: left; margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 15.5px; } .how b { color: var(--gold); }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13px; font-weight: 800; } .badges span { padding: 2px 10px 0; border-radius: 9px; background: rgba(255, 255, 255, .1); }
.field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; } .field2 label, .lbl { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 800; color: var(--dim); text-align: left; }
/* oda: takımlar */
.teams { display: grid; grid-template-columns: 1fr .8fr 1fr; gap: 8px; text-align: left; }
.col { display: flex; flex-direction: column; gap: 5px; padding: 8px; border-radius: 16px; background: rgba(255, 255, 255, .06); min-width: 0; }
.col.t1 { box-shadow: inset 0 3px 0 var(--red); } .col.t2 { box-shadow: inset 0 3px 0 var(--blue); } .col.t0 { box-shadow: inset 0 3px 0 #9aa4b2; }
.col > b { font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.pp { display: flex; align-items: center; gap: 4px; padding: 4px 6px 2px 9px; border-radius: 11px; background: rgba(255, 255, 255, .1); font-weight: 800; font-size: 14px; min-height: 34px; }
.pp span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pp.me { background: rgba(255, 210, 63, .2); } .pp.off { opacity: .5; }
.pp button { flex: 0 0 auto; width: 24px; height: 26px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .14); font-size: 12px; cursor: pointer; padding: 0; }
.pp button:hover { background: rgba(255, 255, 255, .28); }
.col .btn.xs { width: 100%; }
.lchat { display: flex; flex-direction: column; gap: 6px; }
.lchat .log { height: 110px; overflow-y: auto; text-align: left; font-size: 14px; padding: 6px 10px; border-radius: 14px; background: rgba(0, 0, 0, .25); user-select: text; -webkit-user-select: text; touch-action: pan-y; }
.lchat .log div { overflow-wrap: anywhere; } .lchat .log .sys { color: var(--dim); font-style: italic; }
.lchat form { display: grid; grid-template-columns: 1fr 80px; gap: 7px; } .lchat input { min-height: 40px; font-size: 15px; }
.rlist { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; touch-action: pan-y; }
.ritem { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px 12px 5px; border-radius: 14px; background: rgba(255, 255, 255, .08); text-align: left; cursor: pointer; border: 0; width: 100%; }
.ritem:hover { background: rgba(255, 255, 255, .15); } .ritem b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ritem small { color: var(--dim); font-weight: 700; font-size: 12.5px; } .ritem em { font-style: normal; font-weight: 800; font-size: 15px; white-space: nowrap; }
.sect { display: flex; flex-direction: column; gap: 6px; }
details.more { text-align: left; } details.more summary { cursor: pointer; font-weight: 800; color: var(--dim); font-size: 14px; padding: 4px 0; }

/* ---------- lobi: oyuncular ---------- */
.seats { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.seat { display: flex; align-items: center; gap: 7px; padding: 5px 8px 3px; border-radius: 13px; background: rgba(255, 255, 255, .08); font-weight: 800; font-size: 15px; min-height: 40px; }
.seat > i { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .55); box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .25); }
.seat > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .seat.me { background: rgba(255, 210, 63, .18); } .seat.off { opacity: .5; }
.seat em { font-style: normal; font-size: 12px; padding: 1px 7px 0; border-radius: 8px; background: rgba(255, 255, 255, .12); white-space: nowrap; } .seat em.rd { background: var(--teal); color: #042f2e; }
.seat button { flex: 0 0 auto; height: 28px; min-width: 28px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .14); font-size: 12.5px; cursor: pointer; padding: 0 6px; font-weight: 800; }
.tcols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tcols > div { display: flex; flex-direction: column; gap: 5px; padding: 7px; border-radius: 16px; background: rgba(255, 255, 255, .05); min-width: 0; }
.tcols h4 { margin: 0; font-size: 14px; text-align: left; }
.cols { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.cbtn { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .5); cursor: pointer; padding: 0; box-shadow: inset -4px -6px 0 rgba(0, 0, 0, .25); }
.cbtn.on { outline: 3px solid var(--gold); outline-offset: 2px; } .cbtn[disabled] { opacity: .2; cursor: default; }
.rank { width: 100%; border-collapse: collapse; font-size: 13.5px; } .rank th { color: var(--dim); font-size: 11.5px; font-weight: 800; padding: 2px 3px; }
.rank td { padding: 4px 3px 2px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; } .rank td:first-child, .rank th:first-child { text-align: left; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.rank td i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; } .rank tr.w td { color: var(--gold); }
.mwrap { overflow-x: auto; }
.winner { font-size: 34px; font-weight: 800; line-height: 1.05; text-shadow: 0 3px 0 rgba(0, 0, 0, .4), 0 0 24px var(--tc, transparent); overflow-wrap: anywhere; }


/* ---------- Kule Savaşı: renkler ve menü ---------- */
.menu { background: linear-gradient(90deg, rgba(16, 32, 72, .94) 62%, rgba(16, 32, 72, 0)); }
.logo { text-shadow: 0 4px 0 #1e3a8a, 0 8px 0 #0b1530, 0 12px 22px rgba(0, 0, 0, .45); }
.logo span { color: var(--gold); text-shadow: 0 4px 0 #a3650a, 0 8px 0 #0b1530, 0 0 28px rgba(255, 210, 63, .5); }
#bEndless small { font-size: 13px; font-weight: 700; color: var(--gold); }
#bEndless small:empty { display: none; }

/* ---------- üst: puan tablosu, süre, sıradaki parça ---------- */
.board { position: absolute; top: max(6px, env(safe-area-inset-top)); left: calc(max(8px, env(safe-area-inset-left)) + 52px); display: flex; flex-direction: column; gap: 3px; max-width: 230px; z-index: 3; }
.board .r { display: flex; align-items: center; gap: 5px; padding: 2px 9px 0 6px; border-radius: 11px; background: rgba(14, 18, 48, .82); font-weight: 800; font-size: 13.5px; white-space: nowrap; line-height: 1.5; }
.board .r em { font-style: normal; color: var(--dim); width: 12px; text-align: center; font-size: 12px; }
.board .r i { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 3px; border: 2px solid rgba(0, 0, 0, .45); }
.board .r span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.board .r b { font-variant-numeric: tabular-nums; color: var(--gold); } .board .r small { color: var(--dim); font-size: 11.5px; font-weight: 700; margin-left: 2px; }
.board .r.me { box-shadow: inset 0 0 0 2px var(--gold); } .board .r.out { opacity: .45; }
.board .r.me b { font-size: 16px; }
.clock { position: absolute; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; padding: 2px 16px 1px; border-radius: 15px; background: rgba(14, 18, 48, .86); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); line-height: 1.05; z-index: 3; }
.clock b { font-size: 24px; font-variant-numeric: tabular-nums; } .clock small { font-size: 11.5px; color: var(--dim); font-weight: 800; white-space: nowrap; }
.clock.low { background: linear-gradient(180deg, #f97316, #be123c); } .clock.low small { color: #fff; }
.nextbox { position: absolute; top: max(6px, env(safe-area-inset-top)); left: calc(50% + 74px); display: flex; flex-direction: column; align-items: center; padding: 2px 6px 4px; border-radius: 13px; background: rgba(14, 18, 48, .78); z-index: 3; }
.nextbox small { font-size: 10px; font-weight: 800; color: var(--dim); letter-spacing: .06em; } .nextbox canvas { width: 60px; height: 42px; }
#status { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 54px); left: 0; right: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; pointer-events: none; }
#status span { padding: 2px 12px 0; border-radius: 10px; font-weight: 800; font-size: 14px; background: rgba(14, 18, 48, .8); }
#status span.go { background: #16a34a; animation: hot2 1s infinite; } #status span.cool { background: rgba(37, 99, 235, .85); } #status span.hot { background: #be123c; }
@keyframes hot2 { 50% { background: #22c55e; } }
#banner { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 84px); left: 0; right: 0; text-align: center; pointer-events: none; }
#banner span { display: inline-block; padding: 4px 18px 1px; border-radius: 14px; font-weight: 800; font-size: 17px; background: rgba(14, 18, 48, .88); animation: toast 2.6s forwards; }
#banner span.hot { background: linear-gradient(180deg, #f43f5e, #be123c); box-shadow: 0 0 24px rgba(244, 63, 94, .6); animation: hot3 .5s 4 alternate; }
@keyframes hot3 { from { transform: scale(1); } to { transform: scale(1.06); } }
#big { top: 26%; }
#big div.go { color: #fff; background: linear-gradient(180deg, #34d399, #059669); padding: 10px 30px 4px; animation: big 1.8s forwards; }
#big div.ev { color: #fff; background: linear-gradient(180deg, #818cf8, #4338ca); padding: 10px 30px 4px; box-shadow: 0 0 50px rgba(99, 102, 241, .6); }
#big div.bad { color: #fff; background: linear-gradient(180deg, #fb7185, #be123c); padding: 10px 30px 4px; }
#big div.win { color: var(--gold); text-shadow: 0 5px 0 #a3650a, 0 0 30px rgba(255, 210, 63, .6); animation: winb 3.4s forwards; }
@keyframes winb { 0% { transform: scale(.3); opacity: 0; } 12% { transform: scale(1.18); opacity: 1; } 22% { transform: scale(1); } 90% { opacity: 1; } 100% { opacity: 0; } }
#hud #toast { top: calc(max(6px, env(safe-area-inset-top)) + 118px); }
#pops { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: 22px; color: var(--gold); text-shadow: 0 2px 0 #7a4b00, 0 0 10px rgba(0, 0, 0, .5); animation: popup 1.1s forwards; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -240%) scale(1); } }

/* ---------- sağ: rakiplerin kuleleri ---------- */
.foes { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 50px); right: max(8px, env(safe-area-inset-right)); bottom: 150px; width: 128px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; pointer-events: auto; touch-action: pan-y; scrollbar-width: none; }
.foes:empty { display: none; }
.foe { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; padding: 3px; border: 2px solid transparent; border-radius: 14px; background: rgba(14, 18, 48, .82); color: #fff; font: inherit; cursor: pointer; text-align: left; box-shadow: inset 0 -3px 0 var(--c); }
.foe canvas { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 10px; display: block; }
.foe span { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 3px 0; }
.foe b { font-size: 11.5px; color: var(--dim); padding: 0 3px 2px; font-weight: 700; }
.foe em { position: absolute; top: 6px; left: 6px; right: 6px; font-style: normal; font-size: 11px; font-weight: 800; text-align: center; border-radius: 7px; }
.foe em:empty { display: none; }
.foe.tg { border-color: #f43f5e; } .foe.tg em { background: #e11d48; } .foe.auto em { background: rgba(14, 18, 48, .75); color: var(--dim); }
.foe.sh canvas { box-shadow: 0 0 0 3px #66e3ff; } .foe.out { opacity: .45; }

/* ---------- alt: enerji ve eylemler ---------- */
#panel { position: absolute; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(640px, calc(100vw - 16px)); padding: 7px 9px 7px; border-radius: 20px; background: rgba(14, 18, 48, .88); border: 2px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, .4); pointer-events: auto; z-index: 4; }
.energy { position: relative; height: 20px; border-radius: 10px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-bottom: 6px; }
.energy i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #22d3ee, #facc15); border-radius: 10px; transition: width .25s; }
.energy span { position: absolute; left: 10px; top: 0; font-weight: 800; font-size: 14px; line-height: 21px; text-shadow: 0 1px 2px #000; } .energy em { position: absolute; right: 10px; top: 0; font-style: normal; font-weight: 800; font-size: 11.5px; line-height: 21px; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 2px #000; }
.acts { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.act { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; padding: 3px 2px 2px; border: 2px solid transparent; border-radius: 13px; background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-weight: 800; font-size: 11.5px; line-height: 1.05; cursor: pointer; }
.act b { font-size: 21px; line-height: 1.15; font-weight: 400; } .act small { font-size: 11px; color: var(--gold); } .act kbd { position: absolute; top: 2px; left: 5px; font: 700 10px system-ui; color: var(--dim); opacity: .7; }
.act.atk.ok { background: rgba(244, 63, 94, .28); border-color: rgba(244, 63, 94, .6); } .act.def.ok { background: rgba(56, 189, 248, .25); border-color: rgba(56, 189, 248, .6); }
.act.ok:hover { filter: brightness(1.2); } .act[disabled] { opacity: .38; cursor: default; }
.act span { white-space: nowrap; }

/* ---------- dokunmatik kontroller ---------- */
.touch .tl, .touch .tr { position: absolute; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 140px); display: flex; gap: 8px; pointer-events: auto; }
.touch .tl { left: max(10px, env(safe-area-inset-left)); } .touch .tr { right: max(10px, env(safe-area-inset-right)); }
.touch button { width: 62px; height: 62px; border: 0; border-radius: 50%; background: rgba(14, 18, 48, .72); color: #fff; font-size: 26px; font-weight: 800; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); touch-action: none; -webkit-user-select: none; user-select: none; }
.touch button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); background: rgba(40, 50, 110, .9); }
.touch button.drop { width: 76px; height: 76px; margin-top: -14px; background: linear-gradient(180deg, #ffe680, var(--gold) 45%, var(--org)); color: #3a2600; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-size: 24px; box-shadow: 0 5px 0 #a3650a; }
.touch button.drop small { font-size: 12px; }
#chatLog { bottom: auto; top: 150px; } #chatForm { bottom: auto; top: 60px; left: 50%; transform: translateX(-50%); }
#keysHint { bottom: auto; top: calc(max(6px, env(safe-area-inset-top)) + 54px); }

@media (max-width: 700px) {
  .board { left: calc(max(8px, env(safe-area-inset-left)) + 48px); max-width: 150px; } .board .r { font-size: 12px; } .board .r small { display: none; }
  .clock { top: max(6px, env(safe-area-inset-top)); left: auto; right: calc(max(8px, env(safe-area-inset-right)) + 52px); transform: none; padding: 2px 10px 1px; } .clock b { font-size: 20px; }
  .nextbox { left: auto; right: calc(max(8px, env(safe-area-inset-right)) + 52px); top: calc(max(6px, env(safe-area-inset-top)) + 46px); }
  .foes { width: 76px; top: calc(max(6px, env(safe-area-inset-top)) + 108px); bottom: 220px; } .foe span { font-size: 11px; } .foe b { font-size: 10px; } .foe em { font-size: 9px; top: 3px; left: 3px; right: 3px; }
  #status { top: calc(max(6px, env(safe-area-inset-top)) + 100px); } #banner { top: calc(max(6px, env(safe-area-inset-top)) + 130px); } #banner span { font-size: 14.5px; }
  .acts { gap: 3px; } .act { min-height: 50px; font-size: 9.5px; } .act b { font-size: 18px; } .act kbd { display: none; } .act span { display: none; }
  .touch .tl, .touch .tr { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 104px); }
}
body:not(.net) .netonly { display: none; }
@media (max-width: 700px) {
  .menu { inset: 0; width: 100%; background: linear-gradient(180deg, rgba(16, 32, 72, .9), rgba(16, 32, 72, .55)); padding-left: max(22px, calc(50% - 200px)); padding-right: max(22px, calc(50% - 200px)); }
  .back { left: max(22px, calc(50% - 200px)); }
  .teams { grid-template-columns: 1fr 1fr; } .col.t0 { grid-column: 1 / -1; order: 3; }
  #keysHint { display: none; }
}
@media (max-height: 640px) { .menu { justify-content: flex-start; gap: 8px; } .logo { font-size: 44px; margin-top: 22px; } .tagline, .fine { display: none; } .btn.xl { min-height: 54px; font-size: 22px; } .btn { min-height: 44px; } }
/* rakip sayısı arttıkça küçük kuleler sütuna sığacak kadar küçülür */
.foe { flex: 0 1 196px; min-height: 92px; } .foe canvas { flex: 1 1 auto; min-height: 40px; aspect-ratio: auto; height: 0; object-fit: cover; }
