/* StarExplorer Web (duży ekran) — układ 3×3 jak w starej wersji: kolumna statystyk | plansza | sensory + dziennik.
   Ładowany PO mobile.css: wygląd ekranów (Ładownia, Odkrycia, Stacja...) zostaje z wersji mobilnej, tutaj tylko układ.
   Projekt w jednostkach logicznych 1280×720; desktop.js ustawia zoom = min(szer/1280, wys/720) (1280×720 … 2560×1440). */
:root {
  --dx-t: 34px;   /* górny wiersz */
  --dx-b: 100px;   /* dolny wiersz: 2 rzędy menu */
  --dx-l: 280px;  /* lewa kolumna */
  --dx-r: 300px;  /* prawa kolumna */
  --dx-line: rgba(160, 60, 255, 0.55);
  --dx-glow: 0 0 6px rgba(150, 40, 255, 0.45), inset 0 0 6px rgba(150, 40, 255, 0.25);
}
html, body, #root { width: 100%; height: 100%; overflow: hidden; background: #000; }
html.dx-zoom { zoom: var(--dx-zoom, 1); }
html.dx-zoom body, html.dx-zoom #root { width: calc(100vw / var(--dx-zoom, 1)); height: calc(100vh / var(--dx-zoom, 1)); }
body { touch-action: auto !important; user-select: none; }

/* ---------- siatka ---------- */
html body .game-container {
  display: grid !important;
  grid-template-columns: var(--dx-l) minmax(0, 1fr) var(--dx-r) !important;
  grid-template-rows: var(--dx-t) minmax(0, 1fr) var(--dx-b) !important;
  grid-template-areas:
    "tl  tc tr"
    "l   c  r"
    "log b  br";
  width: 100% !important; height: 100% !important; padding: 0 !important; margin: 0 !important;
  flex-direction: initial !important; overflow: hidden !important; background: #000;
}
html body .game-container > .top-row,
html body .game-container > .middle-row,
html body .game-container > .bottom-row { display: contents !important; }

html body .game-container .column {
  display: flex !important; flex-direction: column !important;
  order: 0 !important; flex: none !important; max-height: none !important; min-height: 0 !important; min-width: 0 !important;
  height: auto !important; width: auto !important; max-width: none !important;
  margin: 0 !important; padding: 6px 10px !important; box-sizing: border-box;
  border: 1px solid var(--dx-line) !important; box-shadow: var(--dx-glow) !important;
  background: #000; overflow: hidden !important; position: relative;
}
html body .top-row > .column:nth-child(1) { grid-area: tl; display: flex !important; }
html body .top-row > .column:nth-child(2) { grid-area: tc; justify-content: center; align-items: flex-start !important; padding: 0 14px !important; }
html body .top-row > .column:nth-child(3) { grid-area: tr; display: flex !important; }
html body .middle-row > .column:nth-child(1) { grid-area: l; overflow-y: auto !important; padding: 10px 12px !important; }
html body .middle-row > .column.game-area { grid-area: c; padding: 6px !important; overflow: hidden !important; }
html body .middle-row > .column:nth-child(3) { grid-area: r; overflow-y: auto !important; padding: 10px 12px !important; font-size: 13px; }
html body .bottom-row > .column:nth-child(1) { grid-area: log; padding: 6px 10px !important; }
html body .bottom-row > .column.game-area { grid-area: b; padding: 6px 8px !important; justify-content: center; }
html body .bottom-row > .column:nth-child(3) { grid-area: br; display: flex !important; align-items: center; justify-content: center; }

/* ekran zamiast planszy: boczne kolumny zostają (inaczej niż w telefonie) */
html body .game-container:not(:has(.board)) .middle-row > .column:nth-child(1),
html body .game-container:not(:has(.board)) .middle-row > .column:nth-child(3),
html body .game-container:not(:has(.board)) .bottom-row > .column:nth-child(1) { display: flex !important; }
html body .game-container:not(:has(.board)) .top-row { display: contents !important; }
html body .game-container:not(:has(.board)) .middle-row > .column.game-area,
html body .game-container .middle-row > .column.game-area:has(.screen-container) {
  display: flex !important; flex-direction: column !important; height: auto !important; flex: none !important;
  overflow: hidden !important; padding: 0 !important;
}
html body .game-container .middle-row > .column.game-area > .board-container {
  position: relative !important; inset: auto !important; flex: 1 1 0 !important; min-height: 0 !important; height: 100% !important;
  width: 100% !important; display: block !important; overflow: hidden !important; contain: strict;
}
html body .game-container .middle-row > .column.game-area > .screen-container,
html body .game-container .middle-row > .column.game-area > div:not(.board-container):not(.se-mis-hud):not(.se-mis-pop) {
  flex: 1 1 0 !important; min-height: 0 !important; max-height: 100% !important; height: 100% !important; overflow-y: auto !important; overflow-x: hidden;
}
html body .screen-container.se-scr, html body .screen-container.se-disc { overflow: hidden !important; }
html body .screen-container .screen-content { padding: 10px 16px 16px !important; }

/* ---------- górny wiersz ---------- */
html body .system-info {
  display: flex; gap: 28px; align-items: center; justify-content: center; height: 100%;
  font-size: 14px !important; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap !important;
}
.dx-brand { display: flex; align-items: center; height: 100%; font-size: 15px; letter-spacing: 0.2em; color: #00ff00; text-shadow: 0 0 6px rgba(0,255,0,.6); }

/* ---------- lewa kolumna: statystyki pionowo, w kolejności ze starej wersji ---------- */
html body .left-column-content.hx { display: flex !important; flex-direction: column !important; gap: 9px !important; font-size: 14px; }
html body .hx .hx-row { display: contents !important; }
html body .hx .hx-g {
  display: flex !important; flex-direction: row; justify-content: space-between; align-items: center;
  width: 100%; min-height: 28px; padding: 4px 8px !important; gap: 8px !important; flex: none !important;
  border: 1px solid rgba(0,255,0,.3); background: rgba(0,30,0,.5); border-radius: 5px;
}
html body .hx .hx-full { display: inline !important; }
html body .hx .hx-short { display: none !important; }
html body .hx .hx-num-full { display: inline !important; }
html body .hx .hx-num-short { display: none !important; }
html body .hx .hx-l { font-size: 12px !important; color: #4fc04f; }
html body .hx .hx-v { font-size: 15px !important; }
html body .hx .hx-lvl { order: 1; }
html body .hx .hx-xp { order: 2; }
html body .hx .hx-cr { order: 3; }
html body .hx .hx-meter { order: 4; flex-direction: column; align-items: stretch; gap: 4px !important; }
html body .hx .hx-meter.hx-life { order: 5; }
html body .hx .hx-atk { order: 6; }
html body .hx .hx-dod { order: 7; }
html body .hx .hx-meter .hx-l { align-self: flex-start; }
html body .hx .hx-bar { height: 18px !important; width: 100%; flex: none !important; }
html body .hx .hx-bar-text { font-size: 12px !important; }
html body .hx .hx-xp .hx-bar { height: 20px !important; }
/* kosmos: Osłony nad Poszyciem (jak w starej wersji) */
html body .hx .hx-meter:not(.hx-life):not(.hx-personal-shield):first-child { order: 5; }
html body .hx .hx-personal-shield { order: 4; }

html body .cargo-miniature {
  display: block !important; width: auto !important; margin: auto 0 4px !important; padding: 10px 0 0 !important;
}
html body .cargo-miniature .info-panel-subtitle { margin: 0 0 6px !important; font-size: 13px !important; text-align: left; }
html body .cargo-miniature-grid { display: grid !important; grid-template-columns: repeat(6, 1fr) !important; gap: 3px !important; aspect-ratio: auto !important; width: 100%; }
html body .cargo-miniature-item { border: 1px solid rgba(0,255,0,.55) !important; border-radius: 2px; aspect-ratio: 1/1; }
html body .cargo-miniature-item-filled { background: #00a000 !important; box-shadow: 0 0 5px #00ff00; }

/* ---------- plansza ---------- */
html body .middle-row > .column.game-area .board {
  position: absolute !important; display: grid !important; transform: none !important;
  max-width: none !important; max-height: none !important; aspect-ratio: auto !important;
  gap: 2px !important; background: #050505; border-radius: 0 !important; touch-action: manipulation !important;
}
html body .board .cell { cursor: default; transition: box-shadow .12s, filter .12s; }
html body .board .cell.cell-clickable, html body .board .cell.cell-attackable, html body .board .cell.cell-interactable { cursor: pointer; }
html body .board .cell.cell-clickable:hover, html body .board .cell.cell-attackable:hover, html body .board .cell.cell-interactable:hover {
  box-shadow: 0 0 0 2px #00ff00, 0 0 12px rgba(0,255,0,.8) !important; filter: brightness(1.35); z-index: 2;
}
html body .board .cell.dx-key { box-shadow: 0 0 0 2px #b0ffb0, 0 0 14px rgba(0,255,0,.9) !important; }
html body .se-mis-hud { top: 6px !important; left: 6px !important; font-size: 12px !important; padding: 4px 8px !important; cursor: pointer; }
html body .se-mis-pop { top: 36px !important; left: 6px !important; width: min(380px, calc(100% - 12px)) !important; font-size: 13px; }

/* ---------- prawa kolumna: sensory / panel akcji ---------- */
html body .middle-row > .column:nth-child(3) .info-panel { font-size: 13px; }
html body .middle-row > .column:nth-child(3) button, html body .info-panel button {
  min-height: 36px !important; font-size: 14px !important; cursor: pointer;
}
html body .middle-row > .column:nth-child(3) .sensors-active { text-align: center; padding-top: 6px !important; }
html body .scan-card .info-image-container { flex-basis: 96px !important; width: 96px !important; }
html body .scan-card .info-image { width: 92px !important; height: 92px !important; max-height: 92px !important; }

/* ---------- dziennik zdarzeń (lewy dolny róg) ---------- */
html body .bottom-row > .column:nth-child(1)::before {
  content: attr(data-dx-title); display: block !important; background: none !important; border: 0 !important; box-shadow: none !important; height: auto !important; inset: auto !important; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #3fa83f; margin: 0 0 4px; text-shadow: none;
}
html body .combat-log {
  flex: 1 1 0 !important; height: auto !important; max-height: none !important; min-height: 0 !important;
  overflow-y: auto !important; border: 1px solid rgba(0,255,0,.3) !important; padding: 4px 6px !important; font-size: 13px !important;
}
html body .log-entry { font-size: 13px !important; line-height: 1.3 !important; margin-bottom: 2px !important; }

/* ---------- dolny wiersz: menu 5×2 ---------- */
html body .menu-buttons {
  display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; grid-auto-rows: 1fr;
  gap: 6px !important; height: 100% !important; width: 100%;
}
html body .menu-button {
  min-height: 0 !important; height: 100% !important; width: 100% !important; padding: 2px 6px !important; margin: 0 !important;
  font-size: 12px !important; letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; cursor: pointer;
  border-radius: 7px; transition: background .12s, box-shadow .12s; position: relative;
}
html body .menu-button:hover { background: #005500 !important; box-shadow: 0 0 12px rgba(0,255,0,.6) !important; }
html body .menu-button.dx-active { background: #00ff00 !important; color: #001400 !important; text-shadow: none !important; }
html body .menu-button .dx-k { position: absolute; left: 5px; top: 3px; font-size: 9px; opacity: .55; letter-spacing: 0; }
html body .version-info { text-align: center; }
html body .version-info p { margin: 0; font-size: 13px; letter-spacing: .1em; }
html body .version-info::after { content: "WEB"; display: block; font-size: 10px; letter-spacing: .3em; opacity: .55; margin-top: 3px; }

/* ---------- panele dodane przez desktop.js (lewy dolny, prawy górny) ---------- */
.dx-cell { position: fixed; box-sizing: border-box; z-index: 30; border: 1px solid var(--dx-line); box-shadow: var(--dx-glow); background: #000; color: #00ff00; font-family: "Share Tech Mono", "Noto Sans", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", sans-serif; }
#dx-tr { right: 0; top: 0; width: var(--dx-r); height: var(--dx-t); display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 8px; }
#dx-tr button { font-family: inherit; font-size: 11px; letter-spacing: .06em; color: #00ff00; background: #002200; border: 1px solid #00ff00; border-radius: 5px; height: 24px; padding: 0 9px; cursor: pointer; }
#dx-tr button:hover { background: #005500; box-shadow: 0 0 10px rgba(0,255,0,.6); }
#dx-tr button.on { background: #00ff00; color: #001400; }
html:not(.dx-ingame) .dx-cell { display: none; }

/* ---------- ekran tytułowy (Jakub t277u): szeroka grafika 16:9, nazwa raz, wszystko wyśrodkowane ---------- */
html body .title-screen {
  justify-content: center !important; align-items: center !important; padding: 0 0 4% !important; overflow: hidden;
  background:
    radial-gradient(ellipse 34% 46% at 50% 50%, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,0) 100%),
    url("images/title/title-bg-wide.jpg?v=1") center / cover no-repeat, #000 !important;
}
html body .title-screen h1 {
  position: static !important; transform: none !important; inset: auto !important; width: auto;
  margin: 0 0 34px !important; text-align: center; font-size: 62px !important; z-index: 1;
}
html body .title-block { position: relative; z-index: 1; width: 440px !important; margin: 0 !important; gap: 12px !important; }
html body .title-play { min-height: 54px; font-size: 19px; cursor: pointer; }
html body .title-play:hover { background: rgba(0, 60, 0, .9); box-shadow: 0 0 22px rgba(0,255,0,.5); }
html body .lang-grid { grid-auto-rows: 34px !important; max-height: none !important; }
html body .title-screen .lang-grid button { font-size: 11.5px !important; height: 34px !important; cursor: pointer; }
html body .title-screen .lang-grid button:hover { border-color: #00ff00; box-shadow: 0 0 8px rgba(0,255,0,.5); }
html body .title-android {
  align-self: center; display: inline-flex; align-items: center; gap: 9px; margin-top: 6px;
  padding: 8px 18px; border: 1px solid rgba(0,255,0,.55); border-radius: 9px; background: rgba(0,10,0,.8);
  color: #00ff00; font-size: 13px; letter-spacing: .06em; text-decoration: none; box-shadow: 0 0 10px rgba(0,255,0,.15);
}
html body .title-android:hover { background: rgba(0,60,0,.9); box-shadow: 0 0 16px rgba(0,255,0,.5); color: #b8ffb8; }
html body .title-android-ic { font-size: 11px; }
html body .title-version { z-index: 1; font-size: 11px !important; height: 36px !important; }

/* przyciski: wskaźnik myszy + podświetlenie */
html body button:not(:disabled), html body a { cursor: pointer; }
html body .se-scr .se-scr-btn:not(:disabled):hover, html body .close-button:hover, html body .station-button:hover { filter: brightness(1.3); box-shadow: 0 0 12px rgba(0,255,0,.55); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #0a5a0a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #00a000; }
* { scrollbar-color: #0a5a0a #000; scrollbar-width: thin; }

/* mocniejsze od reguł telefonu (.game-container:not(:has(.board)) … :has(.se-scr) { height: 0 }) */
html body .game-container.game-container.game-container .middle-row > .column.game-area.game-area.game-area {
  height: auto !important; max-height: none !important; min-height: 0 !important; flex: none !important;
}
html body .game-container.game-container.game-container .middle-row > .column.game-area.game-area > .screen-container.screen-container {
  flex: 1 1 0 !important; height: 100% !important; max-height: 100% !important; min-height: 0 !important;
}
html body .game-container .bottom-row > .column:nth-child(1).column { flex-direction: column !important; }
html body .game-container .bottom-row > .column:nth-child(1)::before { flex: none !important; width: 100%; position: static !important; }
html body .version-info { display: flex !important; flex-direction: column; align-items: center; }
html body .version-info::after { display: block !important; }

/* stacja na dużym ekranie: nagłówek w jednym wierszu, wszystkie akcje widoczne bez przewijania */
html body .se-station-proposal .se-proposal-head { flex-direction: row !important; justify-content: space-between; align-items: center; }
html body .se-station-proposal .se-proposal-heading h2 { font-size: 18px !important; }
html body .se-station-proposal .se-station-frame { width: 210px !important; height: 118px !important; max-height: 118px !important; flex: none; }
html body .se-proposal-actions { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px !important; }
html body .se-proposal-actions .se-action-missions { grid-column: 1 / -1; flex-direction: row !important; min-height: 70px !important; }
html body .se-station-proposal .se-proposal-action { min-height: 112px !important; cursor: pointer; }
html body .se-station-proposal .se-proposal-action:not(:disabled):hover { background: #003300 !important; box-shadow: 0 0 12px rgba(0,255,0,.5); }
html body .se-station-proposal .se-proposal-undock:hover { background: #005000 !important; box-shadow: 0 0 12px rgba(0,255,0,.5); }

/* ===== t277u: proporcje — mniejsze ramki, zwarte przyciski, spokojniejsze rozmiary ===== */
/* lewa kolumna: niższe kafelki */
html body .left-column-content.hx { gap: 6px !important; }
html body .hx .hx-g { min-height: 24px !important; padding: 3px 8px !important; }
html body .hx .hx-v { font-size: 14px !important; }
html body .hx .hx-bar { height: 15px !important; }
html body .hx .hx-xp .hx-bar { height: 17px !important; }
html body .cargo-miniature-grid { grid-template-columns: repeat(auto-fill, 22px) !important; gap: 4px !important; }
html body .cargo-miniature-item { width: 22px; height: 22px; }

/* przyciski Zamknij / Wróć / Wydokuj: zwarte, wyśrodkowane (nie na całą szerokość) */
html body .middle-row > .column.game-area .se-scr .close-button.se-scr-close,
html body .middle-row > .column.game-area .close-button,
html body .middle-row > .column.game-area .se-station-proposal .se-proposal-undock {
  width: auto !important; min-width: 190px !important; max-width: 300px !important; min-height: 38px !important;
  margin: 0 auto !important; padding: 7px 28px !important; font-size: 14px !important; display: block !important; align-self: center !important;
  position: static !important; left: auto !important; right: auto !important; transform: none !important;
}
html body .middle-row > .column.game-area .se-scr-foot,
html body .middle-row > .column.game-area .se-proposal-footer { align-items: center !important; text-align: center; padding: 8px 0 !important; }
html body .middle-row > .column.game-area .se-scr-foot > *:not(.se-scr-close) { align-self: stretch; }

/* nagłówki ekranów */
html body .middle-row > .column.game-area .screen-container h2 { font-size: 18px !important; padding: 8px 8px 6px !important; margin: 0 !important; }
html body .se-scr-title h2 { font-size: 18px !important; }

/* Statek / Postać: mała ramka z grafiką między slotami wyposażenia */
html body .se-card-body { grid-template-columns: 72px 200px 72px !important; justify-content: center !important; gap: 14px !important; margin: 2px 0 10px !important; }
html body .se-card-hero { width: 200px !important; height: 250px !important; aspect-ratio: auto !important; max-height: 250px !important; }
html body .se-card-hero img { width: 90% !important; height: 90% !important; max-height: none !important; object-fit: contain !important; }
html body .se-card-col .se-eq-slot { min-height: 0 !important; }
html body .se-card-content { max-width: 680px; margin: 0 auto !important; }

/* prawa kolumna: grafika obiektu (stacja, planeta, wróg) w rozsądnym rozmiarze */
html body .middle-row > .column:nth-child(3) .info-image-container { max-height: 150px !important; }
html body .middle-row > .column:nth-child(3) .info-image { max-height: 140px !important; width: auto !important; max-width: 100% !important; object-fit: contain; }
html body .middle-row > .column:nth-child(3) .info-panel button { min-height: 32px !important; font-size: 13px !important; }
html body .middle-row > .column:nth-child(3) .info-panel h3 { font-size: 15px !important; }
/* Ładownia: więcej mniejszych kart w rzędzie */
html body .se-cg-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)) !important; gap: 8px !important; }
html body .se-scr .se-cg-card { min-height: 92px !important; cursor: pointer; }
html body .se-scr .se-cg-card.free { cursor: default; }
html body .se-scr .se-cg-card:not(.free):hover { filter: brightness(1.25); }
/* Komputer: Wesprzyj (PayPal) zwarty, wyśrodkowany */
html body .se-scr a.se-scr-btn.se-cp-support { flex: none !important; width: auto !important; min-width: 190px; max-width: 300px; margin: 0 auto !important; align-self: center; padding: 6px 24px !important; }
/* Odkrycia: karty minimalnie mniejsze */
html body .se-disc-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important; }
/* prawa kolumna przy stacji: mniejsza ramka z grafiką stacji */
html body .middle-row > .column:nth-child(3) .info-panel > .info-image-container { width: 150px !important; height: 104px !important; max-height: 104px !important; margin: 4px auto 8px !important; padding: 4px !important; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
html body .middle-row > .column:nth-child(3) .info-panel > .info-image-container .info-image { max-height: 92px !important; max-width: 140px !important; height: auto !important; }
/* stacja: niższe kafelki akcji */
html body .se-station-proposal .se-proposal-action { min-height: 96px !important; padding: 8px 6px !important; font-size: 13px !important; }
html body .se-proposal-actions .se-action-missions { min-height: 58px !important; }
html body .se-station-proposal .se-station-frame { width: 180px !important; height: 100px !important; max-height: 100px !important; }
/* dziennik zdarzeń w lewym dolnym rogu */
html body .bottom-row > .column:nth-child(1) { padding: 8px 10px 6px !important; }
html body .combat-log, html body .log-entry { font-size: 12px !important; }
html body .log-entry { line-height: 1.25 !important; }

/* ===== t294u/t295u: Aktywne Misje — licznik n/max na przycisku (wariant C) ===== */
/* znaczek „Misje n/max” z ramki planszy usunięty w układzie C (lista otwiera się z przycisku w szynie) */
html body .se-mis-hud { display: none !important; }
/* t295u: przycisk wyglada IDENTYCZNIE jak pozostale — bez zmian koloru / poswiaty / tla /
   obramowania / podswietlenia / przygaszenia w zadnym stanie (0, czesciowy, wszystkie).
   Zmienia sie wylacznie sam tekst licznika pod etykieta (subtelnie). */
html body .menu-buttons .menu-button.se-railmis { position: relative; padding-top: 0 !important; padding-bottom: 8px !important; }
html body .menu-button.se-railmis .se-mb-lbl { display: block; max-width: 100%; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .se-mb-sub { position: absolute; left: 0; right: 0; bottom: 1px; display: block; text-align: center; font-size: 9px; line-height: 9px; letter-spacing: .04em; color: #00ff00; opacity: .85; text-shadow: none; text-transform: none; white-space: nowrap; pointer-events: none; }
/* dozwolona, subtelna zmiana samego TEKSTU licznika (nie przycisku) */
html body .se-railmis.se-railmis-empty .se-mb-sub { opacity: .5; }
html body .se-railmis.se-railmis-all .se-mb-sub { opacity: 1; }

/* copyright (0.19.02f) */
.se-op-copy { margin: 6px 0 0; text-align: center; font-size: 11px; letter-spacing: .04em; color: rgba(0,255,0,.42); }
