/* Menu główne, mapa kampanii, pokoje i ekran wyniku. Korzysta z kolorów z style.css (:root). */

/* W menu chowamy elementy rozgrywki (pasek, panele, minimapa, kursor podpowiedzi) */
body.in-menu #topbar, body.in-menu #build, body.in-menu #sel, body.in-menu #minimap,
body.in-menu #msg, body.in-menu #debug, body.in-menu #tooltip, body.in-menu #flash, body.in-menu canvas#game { display: none; }

#menu {
  position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 35%, #2c3d24 0%, #15201a 55%, #070b08 100%);
  overflow: auto;
}
#menu.on { display: flex; }
#menuScreen { position: absolute; inset: 0; overflow: hidden; }
/* Warstwa ekranu (menu/transition.js): przy zmianie ekranu stara i nowa leżą na sobie na czas animacji. */
.menu-layer { position: absolute; inset: 0; padding: 16px; display: flex; justify-content: center; align-items: center; overflow: auto; background: radial-gradient(ellipse at 50% 35%, #2c3d24 0%, #15201a 55%, #070b08 100%); } /* pełne tło: odchodzący ekran nie prześwituje */
.menu-layer.leaving { pointer-events: none; }

.menu-box {
  width: 100%; max-width: 440px; padding: 26px 28px 22px; text-align: center;
  background: var(--panel); border: 3px solid #937044; border-radius: 14px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 220, 150, 0.08);
}
.menu-box.wide { max-width: 720px; text-align: left; }
.menu-title { margin: 0 0 26px; font: 800 58px/1 Georgia, serif; color: #f9e7bd; letter-spacing: 2px; text-shadow: 0 3px 0 #120a06, 0 0 24px rgba(242, 184, 75, 0.35); }
.menu-sub { margin: 10px 0 22px; color: var(--muted); font-size: 15px; }
.menu-h { margin: 0 0 14px; font: 700 26px Georgia, serif; color: #f9e7bd; }
.menu-col { display: flex; flex-direction: column; gap: 10px; }
.menu-col .btn { font-size: 18px; padding: 11px; }
.menu-ver { margin: 16px 0 0; min-height: 1.3em; color: var(--muted); font-size: 13px; } /* miejsce na wersję z serwera: bez przeskoku po jej dopisaniu */

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #3a2a1c; }
.set-label { font-weight: 700; }
.set-ctl { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.set-ctl .btn.on { border-color: #ffe5a3; color: #fff5d9; background: linear-gradient(#80603c, #4b301d); }

/* Mapa kampanii: mapa po lewej, panel misji po prawej */
.camp { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.camp-top { display: flex; align-items: center; gap: 14px; }
.camp-titles { flex: 1; min-width: 0; }
.camp-h { margin: 0; font: 800 26px Georgia, serif; color: #f9e7bd; text-shadow: 0 2px 0 #120a06; }
.camp-titles .camp-sub { margin: 0; font-size: 13px; }
.camp-total { padding: 6px 16px; font-weight: 800; color: #ffe36a; white-space: nowrap; background: linear-gradient(#3a2a18, #22180d); border: 2px solid #a88753; border-radius: 999px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5); }
.camp-body { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 4px; }
.camp-map {
  flex: 1; min-width: 0; height: 100%; border-radius: 14px;
  border: 4px solid #8a6537; background: #0a3550;
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.5), 0 0 0 2px #2a1b0c, inset 0 0 46px rgba(0, 0, 0, 0.45);
}
.camp-info { width: 300px; flex: none; padding: 14px; overflow: auto; }
.camp-name { margin: 0; font: 700 22px Georgia, serif; color: #f9e7bd; }
.camp-sub { margin: 4px 0 8px; color: var(--muted); font-size: 14px; }
.camp-boss { margin: 4px 0 10px; color: #ff9a7a; font: 700 15px Georgia, serif; cursor: help; }
.camp-lock { color: var(--danger); font-weight: 700; }
.camp-info .btn { width: 100%; margin-top: 12px; padding: 10px; font-size: 17px; }
.stars { font-size: 26px; letter-spacing: 3px; color: #ffe36a; text-shadow: 0 2px 0 #120a06; margin: 4px 0 8px; }
.stars.small { font-size: 18px; }
.objs { list-style: none; margin: 8px 0 0; padding: 0; }
.objs li { padding: 5px 0; border-bottom: 1px solid #3a2a1c; font-size: 15px; }
.objs li.ok { color: var(--good); }
.objs li.miss { color: #ff9a88; }
.objs li.todo::before { content: '◆ '; color: var(--accent); }

/* Pokoje multiplayer */
.room-row { display: flex; gap: 8px; margin: 10px 0; }
.room-input { flex: 1; min-width: 0; padding: 8px 10px; font: 600 15px "Segoe UI", sans-serif; background: #0d1117; color: var(--text); border: 2px solid var(--line); border-radius: 8px; }
.room-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #3a2a1c; }
.room-item b { flex: 1; }
.room-details { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.room-meta { white-space: nowrap; font-size: 13px; }
.campaign-room { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; } /* stała wysokość: mapa nie skacze po wejściu do pokoju */
.campaign-room .camp-sub { margin: 0; }
.campaign-room .room-player { padding: 5px 7px; border: 1px solid #765333; border-radius: 4px; font-size: 12px; }
.campaign-room .room-player.ready { color: #9fe8ad; }
.room-code { font-family: Consolas, monospace; letter-spacing: 3px; color: var(--accent); }
.room-code.big { font-size: 22px; margin: 0 0 12px; }
.room-slots { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.room-slot { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--panel2); border: 2px solid var(--line); border-radius: 8px; }
.room-slot.free { opacity: 0.55; }
.room-lobby .btn { margin: 4px 6px 4px 0; }
.room-err { color: var(--danger); font-weight: 700; min-height: 20px; margin: 10px 0 0; }
.ok { color: var(--good); font-weight: 700; }
.miss { color: #ff9a88; font-weight: 700; }

/* Ekran wyniku misji (nad planszą, w rozgrywce) */
#result {
  position: fixed; inset: 0; z-index: 25; margin: auto; width: 420px; height: fit-content; max-height: 90vh; display: none;
  flex-direction: column; align-items: center; gap: 6px; padding: 22px 26px; text-align: center; overflow: auto;
}
#result.on { display: flex; }
#result h2 { margin: 0; font: 800 30px Georgia, serif; color: #f9e7bd; }
#result .sub { margin: 0; color: var(--muted); font-size: 15px; }
#result .objs { width: 100%; text-align: left; }
#result .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
#result .actions .btn { padding: 9px 14px; font-size: 15px; }
