/* poziomo.css — telefon obrócony poziomo (29.09.2026).
   Układ jak w grach mobilnych: po lewej kolumna zakładek z dużym „Następnym cyklem" pod kciukiem,
   u góry jeden cienki pasek (dom · liczniki · cykl · menu), pod nim podpowiedź w jednej linii,
   reszta ekranu to mapa, a panel wysuwa się z prawej i ma własny przycisk zamknięcia.
   Plik ładuje się PO style.css i skorki.css, dlatego nadpisuje też ramki pasków ze skórek.
   Próg: niski ekran w poziomie (telefon), tablety i komputery tego nie dostają. */

@media (orientation: landscape) and (max-height: 500px) {
  #app {
    display: grid;
    grid-template-columns: calc(var(--sal) + 70px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  /* --- pasek górny: jeden rząd --- */
  #hud {
    grid-column: 2; grid-row: 1;
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 8px; align-items: center;
    padding: calc(var(--sat) + 5px) calc(var(--sar) + 8px) 5px 10px;
  }
  .hudRow { display: contents; }
  .hudHouse { grid-column: 1; grid-row: 1; }
  .hudHouse b { font-size: 13px; }
  .houseMark { width: 22px; height: 22px; }
  .shield { font-size: 10px; padding: 0 6px; }
  /* liczniki mają pierwszeństwo: to nazwa domu się skraca, nie kwoty */
  .hudStats { grid-column: 2; grid-row: 1; margin: 0; gap: 5px; grid-template-columns: repeat(4, auto); }
  .stat { padding: 4px 8px; gap: 6px; border-radius: 9px; }
  .stat .ic { display: block; width: 14px; height: 14px; flex: none; }
  .stat label { display: none; }
  .stat b { font-size: 12.5px; overflow: visible; }
  .hudTurn { grid-column: 3; grid-row: 1; margin: 0; gap: 6px; font-size: 12px; }
  .iconBtn { width: 34px; height: 34px; }
  .hudLogin { height: 34px; padding: 0 9px; }
  .hudLogin i { display: none; }
  .side .mpSuma { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goalWrap { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 799px) {
  .hudLogin span { display: none; }          /* sama ikona — liczniki potrzebują miejsca */
  #hShield { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {

  /* --- podpowiedź doradcy: jedna linia, stuknięcie w tekst rozwija całość --- */
  #status { grid-column: 1 / -1; grid-row: 2; }
  .statusCard { margin-top: 5px; padding: 3px 6px 3px 10px; gap: 8px; flex-wrap: nowrap; border-radius: 10px; }
  .statusIco { display: grid; }
  .statusIco .ic { width: 15px; height: 15px; }
  .statusTxt { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 auto; order: 0; cursor: pointer; }
  .statusTxt b { font-size: 12.5px; white-space: nowrap; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
  .statusTxt span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  #status.pelny .statusTxt { display: grid; gap: 1px; }
  #status.pelny .statusTxt b, #status.pelny .statusTxt span { white-space: normal; max-width: none; }
  .statusAct { order: 0; margin: 0 0 0 auto; height: 28px; padding: 0 12px; font-size: 12px; }
  .tutorOff { order: 0; margin: 0; align-self: center; }

  /* --- środek: mapa + panel z prawej --- */
  #stage { grid-column: 2; grid-row: 2; flex-direction: row; }
  .side {
    position: relative; inset: auto; width: clamp(300px, 44%, 400px); max-height: none; height: 100%;
    border-radius: 0; border-top: 0; border-left: 1px solid var(--line2);
    transform: none; box-shadow: -10px 0 30px rgba(0, 0, 0, .35); flex: 0 0 auto; overflow: hidden; transition: none;
  }
  .side.empty { display: none; }
  /* uchwyt zostaje jako sam krzyżyk w rogu — bez niego panelu nie dałoby się zamknąć */
  .sideGrip { display: flex; position: absolute; top: 4px; right: calc(var(--sar) + 4px); width: 38px; height: 34px; z-index: 3;
    border-radius: 10px; background: var(--glass); border: 1px solid var(--line2); }
  .sideGrip i { display: none; }
  .sideGrip .sideClose { position: static; width: auto; height: auto; }
  .sideBody { padding: 10px calc(var(--sar) + 12px) 16px 12px; }
  .side .panelHead { padding-right: 42px; margin-bottom: 8px; }
  .side .panelHead h2 { font-size: 16px; }

  .mapTop { top: 8px; }
  .mapTools { top: 8px; }
  #btnZoomIn, #btnZoomOut { display: none; }         /* przybliżanie dwoma palcami */
  .mapTools button { width: 34px; height: 34px; }
  .sectorTabs button { height: 30px; font-size: 12px; padding: 0 10px; }
  .fleetStrip { bottom: 6px; }
  .shipChip { padding: 4px 10px 4px 8px; font-size: 12px; }
  .mapLegenda { top: auto; bottom: 46px; right: 8px; font-size: 10.5px; gap: 7px; padding: 3px 8px; }
  #stage:has(.side:not(.empty)) .mapLegenda { display: none; }

  /* --- lewa kolumna zakładek --- */
  #bar, :root[data-skin] #bar {
    grid-column: 1; grid-row: 1 / -1;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px;
    padding: calc(var(--sat) + 6px) 6px calc(var(--sab) + 6px) calc(var(--sal) + 6px);
    border-top: 0; border-right: 1px solid var(--line2);
  }
  .tab { flex: 0 0 auto; width: 100%; height: 48px; border-radius: 12px; }
  .tab .ic { width: 20px; height: 20px; }
  .tab span, :root[data-skin] .tab span { display: block; font-size: 9px; letter-spacing: 0; text-transform: none; line-height: 1.1; text-align: center; white-space: normal; }
  .next, :root[data-skin] .next {
    margin: auto 0 0; width: 100%; height: auto; min-height: 66px; padding: 8px 2px;
    flex-direction: column; gap: 4px; border-radius: 14px; font-size: 10.5px;
  }
  .next span, :root[data-skin] .next span { white-space: normal; text-align: center; line-height: 1.1; font-size: 10.5px; letter-spacing: .02em; }
  .next .ic { order: -1; width: 20px; height: 20px; }
  :root[data-skin="retro"] .next { font-size: 10.5px; box-shadow: 2px 2px 0 #f2b134; }
  .toast { bottom: calc(14px + var(--sab)); left: calc(50% + 35px); }

  /* --- okna: niski ekran, więc przewijane, bez marginesów u góry --- */
  .modalWrap { align-items: center; }
  .modal { max-height: calc(100% - 16px); overflow-y: auto; }

  /* --- mapa planety: plansza z lewej, panel budowy z prawej --- */
  #planetaView { overflow: hidden; }
  .plHud { flex-wrap: nowrap; gap: 10px; padding: calc(var(--sat, 0px) + 5px) calc(var(--sar) + 10px) 5px calc(var(--sal) + 10px); }
  .plWroc { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .plTytul { flex: 0 1 auto; }
  .plTytul h1 { font-size: 16px; white-space: nowrap; }
  .plTytul small { display: none; }
  .plKula { width: 26px; height: 26px; }
  .plStaty { margin-left: auto; width: auto; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 5px; }
  .plStaty::-webkit-scrollbar { display: none; }
  .plSt { min-width: 0; padding: 3px 8px; flex: none; }
  .plSt small { font-size: 8.5px; }
  .plSt b { font-size: 12.5px; }
  .plGra { flex: 1; grid-template-columns: minmax(0, 1fr) clamp(280px, 40%, 370px); min-height: 0; }
  .plMapa { height: auto; padding: 0; }
  #plPlansza { position: absolute; inset: 0 0 30px; width: 100%; height: calc(100% - 30px); max-height: none; }
  .plLegenda { position: absolute; left: 6px; right: 6px; bottom: 4px; padding: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .plPanel { border-top: 0; border-left: 1px solid var(--line); overflow-y: auto; padding-right: calc(var(--sar) + 12px); }
}

/* Podpowiedź „obróć telefon" — tylko telefon w pionie, jednorazowa, zamykana. */
.obrocHint { display: none; }
@media (orientation: portrait) and (max-width: 699px) {
  .obrocHint {
    position: fixed; left: 12px; right: 12px; bottom: calc(76px + var(--sab)); z-index: 40;
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
    background: var(--sidebg); border: 1px solid var(--acc); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); color: var(--txt);
  }
  .obrocHint[hidden] { display: none; }
  .obrocHint .obrocIk { width: 34px; height: 34px; flex: none; color: var(--acc); animation: obroc 2.4s ease-in-out infinite; }
  .obrocHint p { margin: 0; flex: 1; font-size: 13px; line-height: 1.35; }
  .obrocHint p b { display: block; }
  .obrocHint button { flex: none; background: none; border: 0; color: var(--dim); padding: 6px; }
  .obrocHint button .ic { width: 16px; height: 16px; }
}
@keyframes obroc { 0%, 30% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
