/* =====================================================================
   KARA ALTIN - Oyun Ekranı (Faz 10)
   Saha tam ekran; HUD sahanın üzerinde pah kırılmış mat çelik levhalar.
   Altta kontrol konsolu: solda inşaat, sağda Borsa / Sevkiyat.
   Kurallar: parlama, bulanıklık, gölge, neon yok. Derinlik = ton farkı + çizgi + pah.
   ===================================================================== */

:root {
    --deck-h: clamp(250px, 36vh, 360px);
    --hud-pad: 12px;
    --chamfer: 9px;
    --hud-bg: color-mix(in srgb, var(--c-surface) 93%, transparent);
    --hud-line: color-mix(in srgb, var(--c-line-strong) 90%, transparent);
}

body { overflow: hidden; }

.game {
    height: 100dvh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) var(--deck-h);
    transition: grid-template-rows .32s var(--ease-out);
}
.game[data-deck="hidden"] { grid-template-rows: minmax(0, 1fr) 0; }
.game[data-deck="hidden"] .deck { visibility: hidden; }

/* ---------------------------------------------------------------- saha */
.stage { position: relative; min-height: 0; overflow: hidden; background: var(--c-crude); }
.stage__canvas {
    position: absolute; inset: 0; display: block; width: 100%; height: 100%;
    cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.stage__canvas:focus-visible { outline-offset: -3px; }
/* Kenar karartma: göz sahnenin ortasına gider (ışık değil, mat gölgelik) */
.stage__shade {
    position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(to bottom, rgb(6 7 8 / .55), transparent 92px),
        linear-gradient(to top, rgb(6 7 8 / .45), transparent 110px);
}
:root[data-theme="light"] .stage__shade {
    background:
        linear-gradient(to bottom, rgb(40 44 48 / .28), transparent 92px),
        linear-gradient(to top, rgb(40 44 48 / .22), transparent 110px);
}

/* Pah kırılmış levha (sol üst ve sağ alt köşe) */
.plate-hud {
    position: relative;
    background: var(--hud-bg);
    border: 1px solid var(--hud-line);
    clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.plate-hud::before {
    /* pahın üzerindeki bakır çentik */
    content: ""; position: absolute; left: 0; top: 0; width: calc(var(--chamfer) + 10px); height: 2px; background: var(--c-copper);
}

/* ---------------------------------------------------------------- üst HUD */
.hud-top {
    position: absolute; z-index: 4; top: var(--hud-pad); left: var(--hud-pad); right: var(--hud-pad);
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px;
    pointer-events: none;
}
.hud-top > * { pointer-events: auto; }

.company { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; padding: 8px 14px 8px 12px; }
.company__mark { grid-row: span 2; width: 30px; height: 30px; color: var(--c-copper); align-self: center; }
.company__id { display: grid; min-width: 0; }
.company__name { font: 700 17px/1 var(--f-display); letter-spacing: .24em; white-space: nowrap; }
.company__op { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 10px var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--c-text-dim); }
.company__worth { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.company__worth span { font: 600 9px var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--c-text-faint); }
.company__worth b { font: 600 12px var(--f-mono); color: var(--c-copper); font-variant-numeric: tabular-nums; }

.res { display: flex; justify-content: center; gap: 6px; min-width: 0; overflow: hidden; }
.res__item {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 9px;
    flex: 0 0 auto; min-width: 128px; max-width: 220px; padding: 7px 12px 7px 10px;
}
.res__ico, .res__item > .tank, .res__item > .dial { grid-row: span 3; align-self: center; }
.res__ico { width: 22px; height: 22px; color: var(--c-steel); }
.res__label { font: 600 9px/1.2 var(--f-display); letter-spacing: .18em; text-transform: uppercase; color: var(--c-text-dim); white-space: nowrap; }
.res__label small { font-size: 8px; letter-spacing: .08em; text-transform: none; color: var(--c-text-faint); }
.res__value {
    font: 700 17px/1.15 var(--f-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.res__value small { font-size: 11px; font-weight: 500; color: var(--c-text-dim); }
.res__sub { font: 500 10px/1.2 var(--f-mono); color: var(--c-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res__sub[data-tone="up"] { color: var(--c-ok); }
.res__sub[data-tone="down"] { color: var(--c-alert); }
.res__sub[data-tone="warn"] { color: var(--c-warn); }

.res__item--cash { min-width: 200px; border-color: color-mix(in srgb, var(--c-copper) 55%, var(--hud-line)); }
.res__item--cash .res__ico { color: var(--c-copper); width: 26px; height: 26px; }
.res__item--cash .res__value { font-size: 22px; color: var(--c-text); }
.res__item--cash .res__sub { color: var(--c-ok); }
.res__item--cash[data-pulse] .res__value { animation: cash-kick .45s var(--ease-spring); }
@keyframes cash-kick { 35% { transform: translateY(-2px) scale(1.04); color: var(--c-ok); } }
.res__value { transform-origin: left center; }

/* Saha deposu: dikey tank göstergesi */
.tank { position: relative; width: 12px; height: 38px; border: 1px solid var(--c-line-strong); background: var(--c-bg); overflow: hidden; }
.tank::after {
    /* seviye çizgileri */
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(to top, transparent 0 8.5px, rgb(255 255 255 / .08) 8.5px 9.5px);
}
.tank__fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--c-steel); transition: height .3s linear, background-color .3s; }
.tank__fill[data-level="high"] { background: var(--c-warn); }
.tank__fill[data-level="full"] { background: var(--c-alert); animation: tank-full 1s steps(2, jump-none) infinite; }
@keyframes tank-full { 50% { opacity: .55; } }

/* Sevkiyat: hat doluluğu kadranı */
.dial { width: 40px; height: 24px; overflow: visible; }
.dial__track { fill: none; stroke: var(--c-line-strong); stroke-width: 3; }
.dial__red { fill: none; stroke: var(--c-alert); stroke-width: 3; }
.dial__needle { transform-origin: 20px 21px; transform: rotate(-90deg); transition: transform .6s var(--ease-spring); }
.dial__needle path { stroke: var(--c-copper); stroke-width: 2; stroke-linecap: square; }
.dial circle { fill: var(--c-steel); }

.res__item--brent .res__ico { color: var(--c-text-faint); }

/* Komuta menüsü */
.rail { display: flex; gap: 4px; }
.rail__btn {
    position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px;
    background: var(--hud-bg); border: 1px solid var(--hud-line); color: var(--c-text-dim);
    font: 600 11px var(--f-display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
    transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.rail__btn .ico { width: 17px; height: 17px; }
.rail__btn:hover { color: var(--c-text); border-color: var(--c-steel); }
.rail__btn:active { transform: translateY(1px); }
.rail__btn--icon { width: 40px; padding: 0; justify-content: center; }
.rail__btn--sell { color: var(--c-ok); border-color: color-mix(in srgb, var(--c-ok) 40%, var(--hud-line)); }
.rail__btn--sell[data-ready] { animation: ability-ready 2.4s ease-in-out infinite; }
.rail__btn--goals[data-pulse] { animation: ability-ready 1.2s ease-in-out 3; }
.rail .cloud { border-radius: 0; }

/* ---------------------------------------------------------------- sol HUD: uyarılar, pencere, sözleşme, etkiler */
.stage__hud {
    position: absolute; z-index: 3; top: calc(var(--hud-pad) + 74px); left: var(--hud-pad);
    display: grid; gap: 6px; width: min(290px, calc(100% - 24px)); pointer-events: none;
}
.stage__hud > * { pointer-events: auto; }
/* Sağ sütun: inşaat sırası (rayın altında, haritanın üstünde) */
.stage__hud--right { left: auto; right: var(--hud-pad); width: min(260px, calc(100% - 24px)); }
.stage__warn {
    margin: 0; display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 18px;
    background-color: var(--hud-bg); border: 1px solid var(--c-warn); color: var(--c-warn); font: 600 12px var(--f-display); letter-spacing: .08em; text-transform: uppercase;
    background-image: repeating-linear-gradient(-45deg, var(--c-warn) 0 5px, transparent 5px 10px);
    background-size: 8px 100%; background-repeat: no-repeat;
    animation: warn-pulse 1.6s steps(2, jump-none) infinite;
}
@keyframes warn-pulse { 50% { border-color: var(--c-line-strong); } }
.contract-hud { position: static; width: auto; }
.effects li { background: var(--hud-bg); }

.supply {
    display: grid; gap: 4px; padding: 8px 10px 8px 12px; text-align: left; color: var(--c-text);
    background: var(--hud-bg); border: 1px solid color-mix(in srgb, var(--c-ok) 45%, var(--hud-line)); border-left: 3px solid var(--c-ok);
    animation: supply-in .5s var(--ease-spring);
}
.supply__head { display: flex; align-items: center; gap: 8px; font: 700 12px var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--c-ok); }
.supply__head .ico { width: 16px; height: 16px; }
.supply__head span { margin-left: auto; font: 600 11px var(--f-mono); color: var(--c-text-dim); letter-spacing: 0; white-space: nowrap; }
.supply__body { font-size: 12px; color: var(--c-text-dim); }
.supply[data-state="soon"] { border-left-color: var(--c-warn); border-color: color-mix(in srgb, var(--c-warn) 40%, var(--hud-line)); }
.supply[data-state="soon"] .supply__head { color: var(--c-warn); }
.supply:hover { border-color: var(--c-steel); }
@keyframes supply-in { from { transform: translateX(-16px); opacity: 0; } }

/* ---------------------------------------------------------------- yetenekler */
.abilities {
    position: absolute; z-index: 3; left: var(--hud-pad); bottom: var(--hud-pad);
    display: grid; gap: 5px; padding: 6px 7px 7px; background: var(--hud-bg); border: 1px solid var(--hud-line); border-top: 2px solid var(--c-copper);
    clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.abilities__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; }
.abilities__head span { font: 700 10px var(--f-display); letter-spacing: .18em; text-transform: uppercase; color: var(--c-copper); }
.abilities__head small { font: 500 9px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--c-text-faint); }
.abilities__row { display: flex; gap: 5px; }

.ability {
    position: relative; width: 72px; height: 78px; padding: 0; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; align-items: center;
    background: var(--c-surface-2); border: 1px solid var(--c-line-strong); border-bottom: 3px solid var(--c-line-strong); overflow: hidden;
    color: var(--c-copper); transition: transform var(--dur-fast), border-color var(--dur-fast);
    clip-path: none;
}
.ability .ico { width: 28px; height: 28px; position: relative; z-index: 1; margin-top: 8px; }
.ability__key {
    position: absolute; top: 4px; left: 4px; z-index: 2; min-width: 16px; padding: 1px 4px; text-align: center;
    font: 700 11px var(--f-mono); line-height: 14px; color: var(--c-text); background: var(--c-bg); border: 1px solid var(--c-line-strong); border-bottom-width: 2px;
}
.ability__name { position: relative; z-index: 1; font: 700 10px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--c-text); white-space: nowrap; }
.ability__state {
    position: relative; z-index: 1; width: 100%; margin-top: 3px; padding: 2px 0; text-align: center;
    font: 700 10px var(--f-mono); color: var(--c-text-dim); background: color-mix(in srgb, var(--c-bg) 70%, transparent); border-top: 1px solid var(--c-line);
    white-space: nowrap; overflow: hidden;
}
.ability__active { position: absolute; left: 0; bottom: 0; z-index: 2; height: 3px; width: calc(var(--act, 0) * 100%); background: var(--c-ok); }
.ability__cd { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: conic-gradient(rgb(0 0 0 / .5) calc(var(--cd, 0) * 1turn), transparent 0); }
/* Hazır: çerçeve boyunca dönen bakır çentik (ışıma yok) */
.ability__ring { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; }
.ability[data-state="ready"] .ability__ring {
    opacity: 1; padding: 2px; background: conic-gradient(from var(--spin, 0deg), var(--c-copper) 0 14%, transparent 14% 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    animation: ring-spin 2.6s linear infinite;
}
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ring-spin { to { --spin: 360deg; } }
.ability[data-state="ready"] { border-color: var(--c-copper-dim); border-bottom-color: var(--c-copper); animation: none; }
.ability[data-state="ready"] .ability__state { color: var(--c-accent-ink); background: var(--c-accent-bg); border-top-color: var(--c-copper); letter-spacing: .1em; text-transform: uppercase; }
.ability[data-state="active"] { border-color: var(--c-ok); border-bottom-color: var(--c-ok); color: var(--c-ok); }
.ability[data-state="active"] .ability__state { color: var(--c-ok); }
.ability[data-state="cooldown"] { color: var(--c-text-faint); }
.ability[data-state="cooldown"] .ability__name { color: var(--c-text-dim); }
.ability[data-state="locked"] { opacity: .7; }
.ability[data-state="locked"] .ico { opacity: .35; }
.ability[data-state="locked"] .ability__name { color: var(--c-text-faint); }
.ability[data-state="locked"] .ability__state { font-size: 9px; letter-spacing: -.02em; }
.ability:hover:not(:disabled) { border-color: var(--c-copper); transform: translateY(-2px); }
.ability:active:not(:disabled) { transform: translateY(1px); border-bottom-width: 1px; }
.ability-tip { bottom: calc(var(--hud-pad) + 118px); left: var(--hud-pad); }

/* ---------------------------------------------------------------- sağ alt: mini harita + görünüm */
.navi { position: absolute; z-index: 3; right: var(--hud-pad); bottom: var(--hud-pad); display: grid; gap: 4px; justify-items: end; }
.navi__map { position: relative; width: 300px; padding: 5px; background: var(--hud-bg); border: 1px solid var(--hud-line); }
.navi__canvas { display: block; width: 100%; height: 54px; cursor: pointer; }
.zones { display: flex; justify-content: space-between; margin-top: 3px; }
.zones button {
    padding: 2px 3px; background: none; border: 0; border-top: 2px solid transparent;
    font: 600 9px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--c-text-faint); white-space: nowrap;
}
.zones button:hover { color: var(--c-text); }
.zones button[aria-current="true"] { color: var(--c-text); border-top-color: var(--c-copper); }
.viewctl { display: flex; align-items: stretch; background: var(--hud-bg); border: 1px solid var(--hud-line); }
.viewctl button { width: 32px; min-height: 28px; background: none; border: 0; border-left: 1px solid var(--c-line); font: 700 16px var(--f-mono); color: var(--c-text-dim); }
.viewctl button:hover { color: var(--c-text); }
.atmo { display: flex; align-items: center; padding: 0 10px; font: 600 11px var(--f-mono); color: var(--c-text-dim); white-space: nowrap; }

.fcard { top: calc(var(--hud-pad) + 74px); bottom: calc(var(--hud-pad) + 104px); }
.fcard__view { max-height: 34%; aspect-ratio: auto; object-fit: cover; }
.fcard__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- alt konsol */
.deck {
    min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
    background: var(--c-bg); border-top: 2px solid var(--c-line-strong);
}
.deck .panel { min-height: 0; display: flex; flex-direction: column; padding: 0; border: 0; background: var(--c-surface); }
.deck .panel + .panel { border-left: 1px solid var(--c-line-strong); }
.panel__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--c-line); background: var(--c-surface-2); }
.panel__bar .tabs { border-bottom: 0; margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.panel__bar .buyamount { margin: 0; flex: none; }
.panel--build .list {
    flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-content: start; gap: 8px;
}

/* Tesis kartı (inşaat listesi) */
.row {
    grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto auto; gap: 6px 12px; padding: 8px; align-items: stretch;
    background: var(--c-surface-2); border: 1px solid var(--c-line);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.row:hover { border-color: var(--c-line-strong); }
.row__icon {
    grid-row: span 2; width: 84px; height: auto; min-height: 68px; position: relative; overflow: hidden;
    background: var(--c-crude); border: 1px solid var(--c-line);
}
.row__thumb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.row__icon .ico { width: 30px; height: 30px; }
.row__lv {
    position: absolute; left: 0; bottom: 0; padding: 1px 6px; font: 700 11px var(--f-mono); color: var(--c-accent-ink); background: var(--c-accent-bg);
}
.row__lv:empty { display: none; }
.row__title { flex-wrap: nowrap; }
.row__name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__level { display: none; }
.row__desc { display: none; }
.row__stats { font-size: 10.5px; }
.row__buy { grid-column: 2; min-width: 0; width: 100%; min-height: 38px; grid-template-columns: auto 1fr; justify-items: start; align-items: center; padding: 6px 10px; }
.row__buy small { justify-self: end; }
.row__owned { grid-column: 2; }
.row[data-locked] { opacity: 1; }
.row[data-locked] .row__icon { filter: grayscale(1) brightness(.55); }
.row[data-locked] .row__icon::after {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(-45deg, rgb(196 155 75 / .22) 0 6px, transparent 6px 12px);
}
.row[data-locked] .row__name { color: var(--c-text-dim); }
.row__milestone { margin-top: 4px; }

/* Kilit nedeni: kilitli kartın üzerine gelince kartın sağ sütununu kaplayan mat levha */
.row { position: relative; }
.row__locktip {
    position: absolute; z-index: 2; top: 0; right: 0; bottom: 0; left: 104px;
    display: flex; align-items: center; padding: 8px 12px 8px 14px;
    background: var(--c-surface); border-left: 3px solid var(--c-warn);
    font: 500 12px/1.4 var(--f-ui); color: var(--c-text);
    opacity: 0; transform: translateX(6px); pointer-events: none;
    transition: opacity .14s var(--ease-out), transform .14s var(--ease-out);
}
.row__locktip[hidden] { display: none; }
.row:hover .row__locktip, .row:focus-visible .row__locktip, .row:focus-within .row__locktip { opacity: 1; transform: none; }
.row[data-locked] { cursor: help; }

/* ---------------------------------------------------------------- inşaat sırası levhası */
.buildq { display: grid; gap: 5px; padding: 8px 10px 9px 12px; }
.buildq__head { display: flex; align-items: center; gap: 7px; font: 700 11px var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--c-copper); }
.buildq__head .ico { width: 14px; height: 14px; }
.buildq__head small { margin-left: auto; font: 600 11px var(--f-mono); letter-spacing: 0; color: var(--c-text-dim); text-transform: none; }
.buildq__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.buildq__list:empty { display: none; }
.buildq__job { display: grid; gap: 3px; }
.buildq__row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.buildq__row b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buildq__time { font: 600 11px var(--f-mono); color: var(--c-text-dim); white-space: nowrap; }
.buildq__job[data-active] .buildq__time { color: var(--c-text); }
.buildq__bar { height: 5px; background: var(--c-bg); border: 1px solid var(--c-line); }
.buildq__bar span { display: block; height: 100%; width: 0; background: var(--c-warn); transition: width .25s linear; }
.buildq__job:not([data-active]) { opacity: .7; }
.buildq__note { margin: 0; font-size: 11px; color: var(--c-text-faint); }
.buildq[data-state="full"] { border-left: 3px solid var(--c-warn); }
.buildq[data-state="idle"] .buildq__note { color: var(--c-text-dim); }
.fcard__eta { grid-column: 1 / -1; font: 11px var(--f-mono); color: var(--c-text-dim); }

/* Sağ panel: Borsa / Sevkiyat */
.sidetabs { display: flex; border-bottom: 1px solid var(--c-line); background: var(--c-surface-2); }
.sidetabs button {
    position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
    font: 600 13px var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--c-text-dim);
}
.sidetabs button .ico { width: 16px; height: 16px; }
.sidetabs button[aria-selected="true"] { color: var(--c-text); border-bottom-color: var(--c-copper); }
.sidetabs .chip { margin-left: 4px; padding: 1px 6px; font-size: 9px; }
.side-badge { padding: 0 5px; font: 700 10px var(--f-mono); background: var(--c-ok); color: var(--c-bg); }
.panel--side > section { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; }
.panel--side .panel--market { display: flex; flex-direction: column; }
.panel--side .panel--market[hidden], .panel--side .panel--logistics[hidden] { display: none; }
.panel--market .chart { flex: 1; min-height: 110px; height: auto; }
.market__head { margin-bottom: 6px; }
.market__head .commodities { margin: 0; }
.quote__price { font-size: 22px; }

/* ---------------------------------------------------------------- sevkiyat ağı */
.netmap { display: block; width: 100%; height: auto; max-height: 120px; margin-bottom: 6px; background: var(--c-crude); border: 1px solid var(--c-line); }
.netmap .nm-line { fill: none; stroke: var(--c-line-strong); stroke-width: 2; }
.netmap .nm-flow { fill: none; stroke: var(--c-copper); stroke-dasharray: 4 7; animation: nm-flow 1.2s linear infinite; }
.netmap .nm-flow[data-off] { stroke: var(--c-line-strong); animation: none; opacity: .5; }
.netmap .nm-flow[data-window] { stroke: var(--c-ok); }
.netmap .nm-node { fill: var(--c-surface-2); stroke: var(--c-line-strong); }
.netmap .nm-node--field { fill: var(--c-accent-bg); stroke: var(--c-copper); }
.netmap text { font: 600 8px var(--f-display); letter-spacing: .08em; text-transform: uppercase; fill: var(--c-text-dim); }
.netmap .nm-prem { font: 700 8px var(--f-mono); letter-spacing: 0; fill: var(--c-ok); }
.netmap .nm-prem[data-neg] { fill: var(--c-alert); }
@keyframes nm-flow { to { stroke-dashoffset: -22; } }

.lg-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; font: 11px var(--f-mono); color: var(--c-text-dim); }
.lg-sum b { color: var(--c-text); font-weight: 600; }
.lg-sum [data-tone="ok"] { color: var(--c-ok); }

.routes { display: grid; gap: 6px; }
.route {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 10px;
    background: var(--c-surface-2); border: 1px solid var(--c-line); border-left: 3px solid var(--c-steel);
}
.route[data-state="idle"] { border-left-color: var(--c-line-strong); }
.route[data-state="switching"] { border-left-color: var(--c-warn); }
.route[data-state="window"] { border-left-color: var(--c-ok); }
.route__icon { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-copper); }
.route__icon .ico { width: 20px; height: 20px; }
.route[data-state="idle"] .route__icon { color: var(--c-text-faint); }
.route__name { font: 600 14px/1.2 var(--f-display); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route__name small { margin-left: 6px; font: 500 10px var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--c-text-faint); }
.route__prem { font: 700 15px var(--f-mono); color: var(--c-ok); text-align: right; white-space: nowrap; }
.route__prem[data-neg] { color: var(--c-alert); }
.route__prem[data-zero] { color: var(--c-text-dim); }
.route__bar { position: relative; height: 8px; background: var(--c-bg); border: 1px solid var(--c-line); overflow: hidden; }
.route__bar span {
    position: absolute; inset: 0 auto 0 0; width: 0; transition: width .4s linear;
    background: repeating-linear-gradient(-45deg, var(--c-copper) 0 6px, var(--c-copper-dim) 6px 12px);
    background-size: 17px 100%; animation: route-flow .8s linear infinite;
}
.route[data-state="switching"] .route__bar span { background: var(--c-warn); animation: none; }
@keyframes route-flow { to { background-position: 17px 0; } }
.route__meta { grid-column: 2 / -1; display: flex; justify-content: space-between; gap: 8px; font: 10.5px var(--f-mono); color: var(--c-text-dim); }
.route__dests { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.dest {
    display: inline-grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; padding: 4px 8px;
    background: var(--c-surface); border: 1px solid var(--c-line-strong); text-align: left;
    font: 600 11px var(--f-display); letter-spacing: .06em; color: var(--c-text-dim);
}
.dest b { font: 700 11px var(--f-mono); letter-spacing: 0; color: var(--c-ok); }
.dest b[data-neg] { color: var(--c-alert); }
.dest i { grid-column: 1 / -1; font: normal 9px var(--f-mono); letter-spacing: 0; color: var(--c-text-faint); }
.dest[aria-pressed="true"] { color: var(--c-text); border-color: var(--c-copper); background: var(--c-surface-3); box-shadow: inset 0 -2px 0 var(--c-copper); }
.dest[data-window] { border-color: var(--c-ok); }
.dest[data-window] i { color: var(--c-ok); }
.dest:hover:not(:disabled) { border-color: var(--c-steel); }
.dest:disabled { opacity: .5; }
.route__note { grid-column: 1 / -1; margin: 0; font-size: 11px; color: var(--c-text-faint); }

/* ---------------------------------------------------------------- uyarlamalar */
@media (max-width: 1360px) {
    .res__item--brent { display: none; }
}
@media (max-width: 1720px) {
    .rail__btn span:not(.sell-badge):not(.goal-badge) { display: none; }
    .rail__btn { width: 40px; padding: 0; justify-content: center; }
    .rail__btn b { position: absolute; top: -4px; right: -4px; margin: 0; }
}
@media (max-width: 1100px) {
    .company__worth { display: none; }
    .res__item:nth-child(3) { display: none; }
    .deck { grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr); }
    .panel--build .list { grid-template-columns: 1fr; }
    .navi__map { width: 230px; }
}
@media (max-width: 1000px) {
    .res__item { flex: 1 1 0; min-width: 0; }
    .res__item--cash { flex: 1.4 1 0; min-width: 150px; }
    .res__value small, .res__label small { display: none; }
    .res__item--cash .res__value { font-size: 19px; }
    .res__value { font-size: 15px; }
}
@media (max-width: 860px) {
    .company { display: none; }
    .hud-top { grid-template-columns: minmax(0, 1fr) auto; }
    .res { justify-content: flex-start; }
}

/* Telefon: saha üstte, konsol altta, sayfa kaydırılır; alt gezinme çubuğu */
@media (max-width: 720px) {
    body { overflow: auto; padding-bottom: 64px; }
    .game { height: auto; display: block; }
    .stage { height: 62dvh; min-height: 380px; }
    .hud-top { top: 8px; left: 8px; right: 8px; grid-template-columns: 1fr; gap: 6px; }
    .company { display: none; }
    .res { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
    .res__item { padding: 5px 8px; column-gap: 6px; }
    .res__item:nth-child(3), .res__item--brent { display: none; }
    .res__item--cash { min-width: 0; grid-column: 1 / -1; }
    .res__item--cash .res__value { font-size: 18px; }
    .res__value { font-size: 14px; }
    .tank { height: 30px; }
    .rail { position: absolute; top: 0; right: 0; }
    .rail__btn { width: 36px; min-height: 36px; }
    .rail [data-action="leaderboard"], .rail [data-action="theme"] { display: none; }
    .stage__hud { top: 132px; left: 8px; width: calc(52% - 12px); }
    .stage__hud--right { left: auto; right: 8px; width: calc(48% - 8px); }
    .guide__text { font-size: 11.5px; }
    /* Telefon: rehber katlanır (başlığa dokununca açılır), inşaat sırası notsuz, pencere uyarısı Sevkiyat rozetinde */
    .guide { padding: 6px 8px 7px 10px; gap: 4px; }
    .guide__title { font-size: 13px; cursor: pointer; }
    .guide__text, .guide__show { display: none; }
    .guide[data-open] .guide__text { display: block; }
    .guide[data-open] .guide__show:not([hidden]) { display: inline-flex; }
    .buildq__note, .stage__hud .supply { display: none; }
    .buildq { padding: 6px 8px 7px 10px; }
    .effects { display: none; }
    .abilities { left: 8px; bottom: 8px; padding: 4px 5px 5px; }
    .abilities__head small { display: none; }
    .ability { width: 58px; height: 66px; }
    .ability .ico { width: 22px; height: 22px; }
    .ability__name { font-size: 9px; }
    .navi { left: auto; right: 8px; bottom: 118px; }
    .navi__map { width: min(220px, calc(100vw - 16px)); padding: 3px; }
    .navi__canvas { height: 34px; }
    .zones button { font-size: 8px; padding: 1px 2px; }
    .viewctl { display: none; }
    .fcard { left: 8px; right: 8px; width: auto; top: 132px; bottom: 70px; }
    .deck { display: block; border-top: 0; }
    .deck .panel + .panel { border-left: 0; border-top: 1px solid var(--c-line-strong); }
    .panel__bar { flex-wrap: wrap; padding: 6px 8px; }
    .panel--build .list { max-height: none; overflow: visible; grid-template-columns: 1fr; padding: 8px; }
    .panel--side > section { overflow: visible; }
    .panel--market .chart { min-height: 180px; }
    .tab { padding: 9px 8px; }
    .tab span { display: none; }
    .tab[aria-selected="true"] span { display: inline; }
    .compare { grid-template-columns: 1fr; }
    .keys { grid-template-columns: 1fr; }
    .medals { grid-template-columns: repeat(2, 1fr); }
    .prestige__gain, .ladder { grid-template-columns: 1fr; }
    .dock {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(4, 1fr);
        background: var(--c-surface); border-top: 1px solid var(--c-line-strong); padding-bottom: env(safe-area-inset-bottom);
    }
    .dock a, .dock button {
        display: grid; justify-items: center; gap: 2px; padding: 8px 4px; background: none; border: 0; color: var(--c-text-dim);
        font: 600 10px var(--f-display); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
    }
    .dock .ico { width: 20px; height: 20px; }
    .toasts { bottom: 76px; }
}
@media (max-height: 640px) and (min-width: 721px) {
    :root { --deck-h: 220px; }
    .navi__map { display: none; }
}

/* Kayıtlar (ayarlar penceresi) */
.records { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 10px; background: var(--c-line); border: 1px solid var(--c-line); }
.records div { padding: 7px 9px; background: var(--c-surface-2); }
.records dt { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--c-text-dim); }
.records dd { margin: 2px 0 0; font: 600 13px var(--f-mono); }

/* Kasa gelir yazısı: levhanın altından aşağı süzülür */
.tick {
    position: fixed; z-index: 5; pointer-events: none; font: 700 12px var(--f-mono); color: var(--c-ok);
    animation: tick-down 1.6s var(--ease-out) forwards;
}
@keyframes tick-down { 0% { opacity: 0; transform: translateY(-6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(18px); } }

/* Oyun içi duyuru (yönetici panelinden) */
.announce {
    display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 6px 7px 10px;
    background: var(--hud-bg); border: 1px solid var(--hud-line); border-left: 3px solid var(--c-steel); font-size: 12.5px; line-height: 1.4;
    animation: supply-in .5s var(--ease-spring);
}
.announce .ico { flex: none; width: 16px; height: 16px; color: var(--c-steel); }
.announce span { flex: 1; }
.announce button { flex: none; width: 24px; height: 24px; padding: 0; background: none; border: 0; font-size: 18px; line-height: 1; color: var(--c-text-dim); }
.announce[data-level="event"] { border-left-color: var(--c-copper); }
.announce[data-level="event"] .ico { color: var(--c-copper); }
.announce[data-level="warn"] { border-left-color: var(--c-warn); }
.announce[data-level="warn"] .ico { color: var(--c-warn); }

/* ---------------------------------------------------------------- Saha Rehberi (görev levhası) */
.guide { display: grid; gap: 5px; padding: 9px 10px 10px 12px; border-left: 3px solid var(--c-copper); }
.guide[data-in] { animation: supply-in .45s var(--ease-spring); }
.guide__head { display: flex; align-items: center; gap: 8px; font: 700 11px var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--c-copper); }
.guide__head small { margin-left: auto; font: 600 11px var(--f-mono); letter-spacing: 0; text-transform: none; color: var(--c-text-dim); }
.guide__head button { width: 22px; height: 22px; padding: 0; background: none; border: 1px solid transparent; color: var(--c-text-faint); font-size: 16px; line-height: 1; cursor: pointer; }
.guide__head button:hover { color: var(--c-text); border-color: var(--c-line-strong); }
.guide__track { height: 3px; background: var(--c-bg); }
.guide__track span { display: block; height: 100%; width: 0; background: var(--c-copper); transition: width .4s var(--ease-out); }
.guide__title { font: 700 15px var(--f-display); letter-spacing: .04em; text-transform: uppercase; color: var(--c-text); }
.guide__text { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--c-text-dim); }
.guide__show { justify-self: start; }
.guide__show[hidden] { display: none; }
/* Rehber vurgusu: sahneyi karartmaz, tıklamayı engellemez; yalnızca hedefin çevresinde bakır çerçeve */
.coach__box--guide { box-shadow: none; z-index: 30; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .coach__box--guide { animation: none; } }
