/* Dengiz Jangi — 3D sahna ustidagi shisha panellar. Ikkala mavzu, telefon portret/landscape va kompyuter. */
html, body { height: 100%; overflow: hidden; background: #0b0d12; overscroll-behavior: none; }
body { position: fixed; inset: 0; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#vig { position: fixed; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(ellipse 85% 85% at 50% 50%, transparent 58%, rgba(4, 8, 14, .36) 100%); }
body.low #vig { display: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; color: var(--fg); }
#ui > * { position: absolute; }
.pe, #ui button, #ui a, #ui input, #ui .gu-seg { pointer-events: auto; }
:root { --glass: rgba(13, 16, 23, .66); --glass2: rgba(13, 16, 23, .82); --gline: rgba(255, 255, 255, .14); --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
:root[data-theme="light"] { --glass: rgba(248, 249, 252, .72); --glass2: rgba(248, 249, 252, .9); --gline: rgba(15, 20, 30, .14); }
.glass { background: var(--glass); border: 1px solid var(--gline); -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); }
body.low .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass2); }

/* yuklanish */
#splash { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: linear-gradient(180deg, #151c2c 0%, #2a2a33 46%, #6d4a35 62%, #0d1a24 63%, #081018 100%); transition: opacity .6s ease; }
#splash.off { opacity: 0; pointer-events: none; }
.sp-box { width: min(300px, 76vw); text-align: center; color: #eef0f5; }
.sp-box b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.sp-bar { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 4%; border-radius: 3px; background: #f2b84b; transition: width .2s ease; }
.sp-box small { display: block; margin-top: 10px; color: rgba(238, 240, 245, .72); font-size: 12.5px; min-height: 18px; font-variant-numeric: tabular-nums; }

/* menyu */
#scrMenu { inset: 0; display: flex; flex-direction: column; pointer-events: none; }
#scrMenu .gu-bar { position: relative; background: transparent; border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: auto; color: #fff; }
#scrMenu .gu-bar h1 { opacity: 0; }
#scrMenu .gu-bar .gu-home, #scrMenu .gu-bar .gu-tb { color: #fff; background: rgba(8, 12, 18, .34); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#scrMenu .gu-bar .gu-home:hover, #scrMenu .gu-bar .gu-tb:hover { background: rgba(8, 12, 18, .55); color: #fff; }
.menu-panel { margin: auto 0 0; width: 100%; max-height: calc(100% - 64px); overflow: auto; padding: 16px max(14px, var(--sar)) calc(14px + var(--sab)) max(14px, var(--sal)); border-radius: 20px 20px 0 0; border-width: 1px 0 0; pointer-events: auto; scrollbar-width: none; }
.menu-panel::-webkit-scrollbar { display: none; }
.menu-panel h2 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
.menu-panel .lead { margin: 3px 0 11px; color: var(--mut); font-size: 13.5px; line-height: 1.38; }
.rules-row { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.rules-row small { flex: 1 1 170px; color: var(--mut); font-size: 12px; line-height: 1.32; min-width: 150px; }
.menu-panel .gu-menu { gap: 8px; }
.menu-panel .gu-menu > button { min-height: 58px; background: color-mix(in srgb, var(--sur) 74%, transparent); }
.menu-panel .gu-menu > button.prim { border-color: color-mix(in srgb, var(--acc) 55%, transparent); }
.menu-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.menu-foot button { flex: 1 1 auto; min-height: 40px; padding: 0 10px; border-radius: 10px; font-size: 13px; }
.menu-foot .gu-btn svg { width: 16px; height: 16px; }
#menuSponsors:empty { display: none; }
@media (min-width: 760px) and (min-height: 500px) {
  .menu-panel { position: absolute; left: max(40px, 5vw); bottom: 40px; margin: 0; width: 400px; max-height: calc(100% - 96px); border-radius: 20px; border-width: 1px; padding: 22px; }
  .menu-panel h2 { font-size: 32px; }
}
@media (max-height: 500px) { /* telefon landscape: panel yon tomonda */
  .menu-panel { position: absolute; right: max(10px, var(--sar)); top: 8px; bottom: 8px; margin: 0; width: min(380px, 52vw); max-height: none; border-radius: 16px; border-width: 1px; padding: 12px 14px; }
  .menu-panel h2 { font-size: 21px; }
  .menu-panel .lead { display: none; }
  .menu-panel .gu-menu > button { min-height: 50px; padding: 6px 10px; }
  .rules-row small { display: none; }
  .rules-row { margin-top: 6px; }
  #scrMenu .gu-bar { width: calc(100% - min(380px, 52vw) - 20px); }
}

/* umumiy panel (kutish, do'st, yakun) */
.center-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 18px; border-radius: 18px; pointer-events: auto; }
.center-panel h3 { margin: 0 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.center-panel p { margin: 0 0 12px; color: var(--mut); font-size: 14px; line-height: 1.42; }
.center-panel .btns { display: grid; gap: 8px; margin-top: 12px; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--gline); border-top-color: var(--acc); animation: dz-spin 1s linear infinite; flex: none; }
@keyframes dz-spin { to { transform: rotate(360deg); } }
.wait-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.wait-row h3 { margin: 0; }
.code-big { font: 800 40px/1.1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .14em; text-align: center; padding: 12px 8px; border-radius: 12px; background: color-mix(in srgb, var(--sur2) 80%, transparent); margin: 6px 0 10px; }
.code-input { width: 100%; min-height: 48px; font: 700 22px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3em; text-align: center; text-transform: uppercase; border-radius: 11px; border: 1px solid var(--line2); background: var(--sur2); color: var(--fg); outline: none; user-select: text; -webkit-user-select: text; }
.code-input:focus { border-color: var(--acc); }

/* jang HUD */
#hud { inset: 0; pointer-events: none; }
.hud-top { position: absolute; left: max(8px, var(--sal)); right: max(8px, var(--sar)); top: calc(6px + var(--sat)); display: flex; align-items: center; gap: 6px; }
.hud-btn { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 13px; border: 1px solid var(--gline); background: var(--glass); color: var(--fg); cursor: pointer; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
body.low .hud-btn { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass2); }
.hud-btn svg { width: 20px; height: 20px; }
.vs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 3px 8px; border-radius: 14px; height: 44px; }
.pl { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; line-height: 1.14; }
.pl.foe { text-align: right; align-items: flex-end; }
.pl b { max-width: 100%; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl small { font-size: 11.5px; color: var(--mut); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl.on b { color: var(--acc-text); }
.ring { position: relative; flex: none; width: 36px; height: 36px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: var(--gline); }
.ring .fg { stroke: var(--acc); stroke-linecap: round; transition: stroke .3s; }
.ring.low .fg { stroke: var(--red); }
.ring span { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring.idle span svg { position: static; width: 15px; height: 15px; transform: none; }
.status-wrap { position: absolute; left: 0; right: 0; top: calc(56px + var(--sat)); display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; }
.status { padding: 5px 13px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; max-width: calc(100vw - 20px); overflow: hidden; text-overflow: ellipsis; }
.status.me { color: var(--acc-text); }
.foe-fleet { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 5px; padding: 4px 8px; border-radius: 10px; max-width: calc(100vw - 16px); }
.foe-fleet svg { display: block; height: 7.5px; width: auto; color: var(--fg); }
@media (min-width: 560px) { .foe-fleet svg { height: 9px; } }
.foe-fleet svg.gone { opacity: .22; }
.hud-bottom { position: absolute; left: max(8px, var(--sal)); right: max(8px, var(--sar)); bottom: calc(8px + var(--sab)); display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; pointer-events: none; }
.mini-wrap { flex: none; padding: 5px 5px 3px; border-radius: 12px; cursor: pointer; display: block; color: var(--fg); text-align: center; pointer-events: auto; }
.mini-wrap canvas { display: block; width: 104px; height: 104px; border-radius: 6px; }
.mini-wrap small { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; color: var(--mut); height: 17px; white-space: nowrap; }
.mini-wrap small svg { width: 11px; height: 11px; }
.aimbox { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 16px; pointer-events: auto; }
.aim-x { flex: none; width: 36px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--mut); cursor: pointer; }
.aim-x svg { width: 18px; height: 18px; }
.aimbox .lbl { min-width: 54px; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.btn-fire { min-height: 56px; min-width: 112px; padding: 0 20px; border: 0; border-radius: 12px; background: #d9432f; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .01em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, filter .15s, opacity .15s; }
.btn-fire svg { width: 20px; height: 20px; }
.btn-fire:active { transform: scale(.97); }
.btn-fire:disabled { opacity: .38; background: var(--sur3); color: var(--mut); cursor: default; }
.announce { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 0); padding: 8px 20px; border-radius: 12px; font-size: 21px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; animation: dz-ann 1.5s ease both; pointer-events: none; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
.announce.hit { color: #ffb199; }
.announce.sunk { color: #ff8f73; }
:root[data-theme="light"] .announce.hit, :root[data-theme="light"] .announce.sunk { color: #c8331f; }
@keyframes dz-ann { 0% { opacity: 0; transform: translate(-50%, 8px); } 10%, 72% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) { .announce { animation-duration: 1.5s !important; } }
.skip-hint { position: absolute; left: 50%; bottom: calc(14px + var(--sab)); transform: translateX(-50%); padding: 6px 13px; border-radius: 999px; font-size: 12.5px; color: var(--mut); pointer-events: none; white-space: nowrap; }
.hud-bottom, .status-wrap { transition: opacity .18s ease; }
#hud.cine .hud-bottom, #hud.cine .status-wrap { opacity: 0; pointer-events: none; }
#hud.cine .hud-bottom * { pointer-events: none; }
.conn-banner { position: absolute; left: 50%; top: calc(58px + var(--sat)); transform: translateX(-50%); z-index: 3; padding: 6px 14px; border-radius: 10px; font-size: 13px; font-weight: 650; background: var(--amber); color: #201600; white-space: nowrap; }

/* joylash */
#scrPlace { inset: 0; pointer-events: none; }
.pl-top { position: absolute; left: max(8px, var(--sal)); right: max(8px, var(--sar)); top: calc(6px + var(--sat)); display: flex; align-items: center; gap: 6px; }
.pl-title { flex: 1 1 auto; min-width: 0; height: 44px; padding: 3px 12px; border-radius: 14px; display: flex; align-items: center; gap: 10px; }
.pl-title div { min-width: 0; flex: 1; line-height: 1.18; }
.pl-title b { display: block; font-size: 14.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-title small { display: block; font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-panel { position: absolute; left: max(8px, var(--sal)); right: max(8px, var(--sar)); bottom: calc(8px + var(--sab)); padding: 9px; border-radius: 16px; pointer-events: auto; }
.tray { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; min-height: 44px; }
.tray button { touch-action: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 9px; border-radius: 10px; border: 1px solid var(--gline); background: color-mix(in srgb, var(--sur2) 80%, transparent); color: var(--fg); cursor: grab; flex: 1 1 auto; }
.tray button:disabled { opacity: .3; cursor: default; }
.tray button svg { height: 11px; width: auto; display: block; }
.tray button b { font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--mut); }
.pl-hint { font-size: 12px; color: var(--mut); margin: 0 2px 8px; line-height: 1.3; }
.pl-acts { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; }
.pl-acts .gu-btn { padding: 0 8px; }
.drag-ghost { position: fixed; z-index: 40; pointer-events: none; padding: 6px 9px; border-radius: 9px; transform: translate(-50%, -130%); color: var(--fg); }
.drag-ghost svg { height: 14px; width: auto; display: block; }
@media (max-height: 500px) { /* telefon landscape */
  .pl-panel { left: auto; right: max(8px, var(--sar)); top: calc(56px + var(--sat)); bottom: calc(8px + var(--sab)); width: 196px; overflow: auto; padding: 8px; }
  .tray { gap: 4px; margin-bottom: 6px; }
  .tray button { min-height: 38px; padding: 0 6px; flex: 1 1 42%; }
  .pl-hint { display: none; }
  .pl-acts { grid-template-columns: 1fr; gap: 5px; }
  .pl-acts .gu-btn { min-height: 40px; }
  .pl-top { right: auto; width: calc(100% - 16px); }
  .status-wrap { position: static; }
  .status { position: absolute; left: max(8px, var(--sal)); top: calc(56px + var(--sat)); width: 112px; white-space: normal; text-align: center; font-size: 12px; line-height: 1.25; padding: 6px 7px; border-radius: 10px; }
  .foe-fleet { position: absolute; right: max(8px, var(--sar)); top: calc(56px + var(--sat)); max-width: 128px; }
  .hud-bottom { align-items: flex-end; }
  .mini-wrap canvas { width: 86px; height: 86px; }
  .aimbox { flex-direction: column; }
  .btn-fire { min-height: 50px; min-width: 96px; font-size: 16px; }
  .announce { top: 16%; font-size: 18px; }
}
@media (min-width: 760px) and (min-height: 501px) { /* kompyuter: joylash paneli pastda, markazda */
  .pl-panel { left: 50%; right: auto; transform: translateX(-50%); width: min(720px, calc(100% - 24px)); bottom: 12px; }
  .tray button { flex: 0 1 auto; padding: 0 12px; }
  .tray { justify-content: center; }
  .pl-acts { grid-template-columns: 1fr 1fr 2fr; }
  .mini-wrap canvas { width: 150px; height: 150px; }
  .hud-top { left: 12px; right: 12px; top: 10px; }
  .vs { flex: 0 1 460px; margin: 0 auto; }
  .status-wrap { top: 62px; }
  .hud-bottom { left: 12px; right: 12px; bottom: 12px; }
}

/* modallar ichi */
.dz-levels { display: grid; gap: 8px; }
.dz-levels button { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left; min-height: 62px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--sur2); color: var(--fg); cursor: pointer; }
.dz-levels button:hover { border-color: var(--acc); }
.dz-levels b { font-size: 15.5px; }
.dz-levels small { grid-column: 1; color: var(--mut); font-size: 12.5px; line-height: 1.3; }
.dz-levels i { grid-row: 1 / 3; grid-column: 2; font-style: normal; font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.25; }
.dz-set { display: grid; gap: 12px; }
.dz-set .row { display: grid; gap: 5px; }
.dz-rules h4 { margin: 12px 0 4px; font-size: 14.5px; }
.dz-rules ul { margin: 0; padding-left: 18px; color: var(--mut); font-size: 13.5px; line-height: 1.45; }
.dz-rules p { font-size: 13.5px; }
.dz-credits { font-size: 13px; color: var(--mut); line-height: 1.45; }
.dz-credits li { margin: 3px 0; }
.dz-credits ul { margin: 6px 0 0; padding-left: 18px; }
.dz-credits a { color: var(--acc-text); }
.res-title { font-size: 28px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 2px; }
.res-title.win { color: var(--acc-text); }
.res-title.lose { color: var(--red); }
.over-panel { width: min(400px, calc(100% - 20px)); top: auto; bottom: calc(8px + var(--sab)); transform: translateX(-50%); padding: 14px 16px; }
.over-panel .btns { margin-top: 10px; }
.over-panel .gu-row { align-items: stretch; }
.over-panel .gu-stats.four { grid-template-columns: 1fr 1fr; }
.over-panel .gu-stats > div { display: flex; flex-direction: column; justify-content: space-between; gap: 2px; }
#hud.over .mini-wrap { display: none; }
@media (max-height: 500px) { /* landshaft: yuqori panel ochiq qoladi, sarlavha va sabab bir qatorda */
  .over-panel { left: auto; right: max(10px, var(--sar)); top: calc(60px + var(--sat)); bottom: auto; transform: none; padding: 9px 13px; max-height: calc(100% - 66px - var(--sat)); overflow-y: auto; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; }
  .over-panel > * { grid-column: 1 / -1; }
  .over-panel > .res-title { grid-column: 1; font-size: 21px; }
  .over-panel > .res-title + p { grid-column: 2; margin: 0 0 4px; font-size: 12px; }
  .over-panel .gu-stats { grid-template-columns: repeat(3, 1fr); }
  .over-panel .gu-stats.four { grid-template-columns: repeat(4, 1fr); }
  #hud.over .foe-fleet { display: none; }
  .over-panel .gu-stats > div { padding: 5px 9px; }
  .over-panel .gu-stats b { font-size: 16px; }
  .over-panel .btns { margin-top: 6px; gap: 6px; }
  .over-panel .gu-btn { min-height: 44px; padding-block: 5px; }
  #hud.over .mini-wrap { display: block; }
}
@media (min-width: 760px) and (min-height: 501px) { .over-panel { left: auto; right: 40px; top: 50%; bottom: auto; transform: translateY(-50%); padding: 18px; } #hud.over .mini-wrap { display: block; } }
.delta-up { color: var(--green); } .delta-down { color: var(--red); }
.nogl { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--bg); color: var(--fg); text-align: center; }
.nogl p { color: var(--mut); max-width: 420px; }
