:root { --ink: #e9e4d6; --muted: #a9a594; --bg: #0d141f; --accent: #d9a441; --danger: #c0392b; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: var(--bg); overflow: hidden; color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }

/* Iránytűsáv */
.compass { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(560px, 80vw); height: 30px;
  background: linear-gradient(90deg, transparent, rgba(10,16,24,.55) 15%, rgba(10,16,24,.55) 85%, transparent);
  overflow: hidden; font-size: 12px; letter-spacing: .5px; }
.compass .tick { position: absolute; top: 4px; width: 1px; height: 7px; background: rgba(233,228,214,.45); transform: translateX(-50%); }
.compass .tick.major { width: auto; height: auto; background: none; color: var(--ink); font-weight: 600; top: 8px; }
.compass-center { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid var(--accent); }
.compass .marker { position: absolute; top: 19px; width: 7px; height: 7px; border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.compass .marker[data-kind="raft"] { border-radius: 1px; width: 9px; height: 9px; top: 18px; }
.compass .marker.edge { opacity: .5; }

/* Célkereszt */
.crosshair { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%;
  background: rgba(255,255,255,.8); box-shadow: 0 0 2px rgba(0,0,0,.8); }

/* Teljes képernyős rétegek */
.overlay { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(8,12,18,.62); pointer-events: auto; text-align: center; cursor: pointer; }
.overlay.show { display: flex; }
.overlay h1 { font-size: 64px; font-weight: 700; letter-spacing: 6px; }
.overlay .sub { color: var(--muted); font-size: 16px; }

/* ===== HUD ===== */
.hud { position: absolute; inset: 0; pointer-events: none; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.hud-clock { position: absolute; top: 12px; left: 14px; }
.hud-clock .big { font-size: 16px; font-weight: 600; }
.hud-clock .small { color: var(--muted); margin-top: 2px; }
.hud-objective { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); max-width: min(560px, 80vw); text-align: center;
  color: #e9dcb8; font-size: 13px; opacity: 0; transition: opacity .4s; }
.hud-objective.show { opacity: .9; }

.hud-bars { position: absolute; left: 14px; bottom: 16px; width: 190px; display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-label { width: 40px; font-size: 12px; color: var(--muted); }
.bar-track { flex: 1; height: 8px; background: rgba(0,0,0,.45); border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.bar-fill { height: 100%; border-radius: 4px; transition: width .2s linear; }
.bar-fill.food { background: #c98b3a; } .bar-fill.water { background: #4f9ad1; } .bar-fill.warm { background: #d86a3c; } .bar-fill.hp { background: #c0392b; }
.bar-fill.low { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.8); } }
.hud-wet { display: none; font-size: 12px; color: #8fc3e6; margin-left: 48px; }
.hud-wet.show { display: block; }

.hud-hotbar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.hud-hotbar.hide { display: none; }
.slot { min-width: 92px; padding: 6px 10px; background: rgba(10,16,24,.55); border: 1px solid rgba(233,228,214,.15); border-radius: 6px; display: flex; gap: 8px; align-items: center; }
.slot .key { font-size: 11px; color: var(--muted); }
.slot.active { border-color: var(--accent); background: rgba(40,32,16,.65); }
.hud-build { position: absolute; bottom: 62px; left: 50%; transform: translateX(-50%); display: none; gap: 4px; }
.hud-build.show { display: flex; }
.bitem { padding: 3px 8px; font-size: 12px; border-radius: 4px; background: rgba(10,16,24,.45); color: var(--muted); }
.bitem.active { color: var(--ink); background: rgba(217,164,65,.35); }
.hud-buildcost { position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); display: none; font-size: 12px; white-space: nowrap; }
.hud-buildcost.show { display: block; }
.hud-buildcost.bad { color: #f0a59a; }

.hud-inv { position: absolute; right: 14px; bottom: 16px; min-width: 150px; padding: 8px 10px; background: rgba(10,16,24,.45); border-radius: 6px; }
.inv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 1.55; }
.inv-row.zero { opacity: .4; }
.inv-val { font-variant-numeric: tabular-nums; font-weight: 600; }

.hud-prompt { position: absolute; top: calc(50% + 22px); left: 50%; transform: translateX(-50%); display: none; padding: 4px 10px;
  background: rgba(10,16,24,.6); border-radius: 4px; font-size: 13px; white-space: nowrap; }
.hud-prompt.show { display: block; }
.hud-progress { position: absolute; top: calc(50% + 50px); left: 50%; transform: translateX(-50%); width: 120px; height: 4px; display: none;
  background: rgba(0,0,0,.5); border-radius: 2px; overflow: hidden; }
.hud-progress.show { display: block; }
.hud-progress .fill { height: 100%; background: var(--accent); }

.hud-helm { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 14px; background: rgba(10,16,24,.5); border-radius: 8px; }
.hud-helm.show { display: flex; }
.wind-arrow { font-size: 22px; line-height: 1; color: #bfe0f5; transition: transform .2s; }
.sail-track { width: 140px; height: 5px; background: rgba(0,0,0,.5); border-radius: 3px; overflow: hidden; }
.sail-track.hide { display: none; }
.sail-fill { height: 100%; background: #e8e1cf; }
.helm-help { font-size: 11px; color: var(--muted); }
.hud-fish { position: absolute; top: calc(50% - 60px); left: 50%; transform: translateX(-50%); display: none; font-size: 18px; font-weight: 700; color: #ffd27a; }
.hud-fish.show { display: block; animation: pulse .4s ease-in-out infinite; }

/* Értesítések */
.toasts { position: absolute; top: 48px; right: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; max-width: min(380px, 60vw); }
.toast { padding: 6px 10px; background: rgba(10,16,24,.7); border-radius: 5px; font-size: 13px; transition: opacity .8s; border-left: 3px solid rgba(233,228,214,.35); }
.toast.good { border-left-color: #6dbf6a; } .toast.bad { border-left-color: var(--danger); } .toast.note { border-left-color: #d9c38a; font-style: italic; }
.toast.fade { opacity: 0; }

/* Számbillentyűs menü */
.ctxmenu { position: absolute; left: 50%; top: 50%; transform: translate(24px, -50%); display: none; min-width: 220px; padding: 8px 0;
  background: rgba(12,18,26,.88); border: 1px solid rgba(233,228,214,.18); border-radius: 8px; }
.ctxmenu.show { display: block; }
.ctx-title { padding: 2px 14px 6px; font-weight: 700; }
.ctx-row { padding: 4px 14px; display: flex; gap: 10px; align-items: center; }
.ctx-row.off { opacity: .4; }
.ctx-row .key { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 3px; background: rgba(255,255,255,.12); font-size: 11px; }
.ctx-foot { padding: 6px 14px 2px; font-size: 11px; color: var(--muted); }

/* Hajnali sáv */
.hud-banner { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); padding: 10px 22px; font-size: 18px; letter-spacing: .5px;
  background: rgba(10,16,24,.55); border-radius: 6px; opacity: 0; transition: opacity 1s; white-space: nowrap; }
.hud-banner.show { opacity: 1; }

/* Rádiófelirat */
.radio { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); width: min(680px, 86vw); padding: 10px 14px;
  background: rgba(8,12,18,.72); border-radius: 6px; border-left: 3px solid #8a8576; opacity: 0; transition: opacity .3s; pointer-events: none; }
.radio.show { opacity: 1; }
.radio.official { border-left-color: #d9c38a; }
.radio-who { font-size: 12px; font-weight: 700; letter-spacing: .4px; margin-bottom: 3px; }
.radio-text { font-size: 14px; line-height: 1.45; }

/* Cetli */
.note-wrap { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(5,8,12,.45); }
.note-wrap.show { display: flex; }
.note-paper { width: min(460px, 86vw); padding: 26px 28px 18px; color: #2a2014; background: #efe3c4;
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(80,60,30,.12) 27px 28px);
  box-shadow: 0 10px 30px rgba(0,0,0,.5); transform: rotate(-1.2deg); font-family: Georgia, 'Times New Roman', serif; }
.note-title { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: #6b5636; margin-bottom: 10px; }
.note-body { font-size: 17px; line-height: 28px; white-space: pre-line; }
.note-foot { margin-top: 14px; font-size: 12px; color: #6b5636; text-align: right; font-family: system-ui, sans-serif; }

/* Napló */
.journal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(5,8,12,.55); pointer-events: auto; }
.journal.show { display: flex; }
.journal-panel { width: min(760px, 92vw); height: min(620px, 86vh); display: flex; flex-direction: column; background: rgba(16,22,30,.96);
  border: 1px solid rgba(233,228,214,.15); border-radius: 10px; overflow: hidden; }
.journal-tabs { display: flex; border-bottom: 1px solid rgba(233,228,214,.12); }
.jtab { flex: 1; padding: 12px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
.jtab.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.journal-body { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.journal-foot { padding: 8px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid rgba(233,228,214,.1); }
.jrow { padding-bottom: 10px; border-bottom: 1px solid rgba(233,228,214,.08); }
.jrow.paper .jtext { font-family: Georgia, serif; white-space: pre-line; }
.jhead { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.jtext { font-size: 14px; line-height: 1.5; }
.jcard { padding: 12px 14px; background: rgba(255,255,255,.04); border-radius: 8px; }
.jcard-name { font-size: 16px; font-weight: 700; border-left: 4px solid; padding-left: 8px; margin-bottom: 8px; }
.jfact { font-size: 13px; color: #cfc9b8; line-height: 1.6; }
.jstatus { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: rgba(255,255,255,.08); }
.jstatus.csalo { background: rgba(192,57,43,.35); color: #ffd6d0; }
.empty { color: var(--muted); }

/* Térkép */
.mapwrap { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(5,8,12,.6); pointer-events: auto; }
.mapwrap.show { display: flex; }
.map-frame { display: flex; gap: 16px; align-items: stretch; }
.map-canvas { box-shadow: 0 10px 40px rgba(0,0,0,.6); border: 6px solid #cbb88f; cursor: crosshair; }
.map-side { width: 220px; padding: 14px; background: rgba(16,22,30,.92); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.map-h { font-weight: 700; font-size: 15px; }
.map-p { font-size: 13px; color: #cfc9b8; line-height: 1.45; }
.map-p.small { font-size: 12px; color: var(--muted); }
.map-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.compass .marker[data-kind="cache"] { border-radius: 2px; transform: translateX(-50%) rotate(45deg); }
.compass .marker[data-kind="pin"] { width: 5px; height: 5px; top: 20px; }

/* Térkép és napló alatt a HUD elhalványul */
.ui-modal .hud, .ui-modal .toasts, .ui-modal .compass, .ui-modal .radio, .ui-modal .crosshair { opacity: 0; }

/* ===== Képernyők ===== */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px;
  pointer-events: auto; text-align: center; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 30%, rgba(40,60,80,.55), rgba(6,10,16,.92) 70%), linear-gradient(180deg, rgba(20,32,46,.6), rgba(5,8,12,.95)); }
.screen.show { display: flex; }
.screen h1 { font-size: 44px; letter-spacing: 2px; }
.screen h2 { font-size: 28px; }
.screen h3 { font-size: 16px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.screen .logo { font-size: 96px; font-weight: 800; letter-spacing: 10px; color: #e9e4d6; text-shadow: 0 4px 30px rgba(120,170,200,.35); }
.screen .tagline { max-width: 560px; color: #cfc9b8; line-height: 1.5; font-size: 16px; }
.screen .foot { color: var(--muted); font-size: 13px; margin-top: 10px; }
.screen .stats { color: #d9c38a; }
.screen .hint { max-width: 560px; padding: 10px 14px; background: rgba(217,164,65,.12); border-left: 3px solid var(--accent); border-radius: 4px; text-align: left; line-height: 1.5; }
.menu { display: flex; flex-direction: column; gap: 10px; width: min(320px, 86vw); }
.btn { padding: 11px 18px; font: inherit; font-size: 16px; color: var(--ink); background: rgba(255,255,255,.07); border: 1px solid rgba(233,228,214,.2);
  border-radius: 6px; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: rgba(255,255,255,.14); border-color: rgba(233,228,214,.4); }
.btn.primary { background: rgba(217,164,65,.28); border-color: rgba(217,164,65,.7); }
.btn.primary:hover { background: rgba(217,164,65,.42); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seed { padding: 9px 12px; font: inherit; font-size: 14px; color: var(--ink); background: rgba(0,0,0,.35); border: 1px solid rgba(233,228,214,.2); border-radius: 6px; text-align: center; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; text-align: left; max-width: 560px; }
.keys .k { font-weight: 700; color: #d9c38a; white-space: nowrap; }
.keys .v { color: #cfc9b8; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 18px; width: min(420px, 88vw); text-align: left; }
.setrow input[type=range] { width: 170px; accent-color: var(--accent); }
.setrow select { font: inherit; padding: 4px 8px; background: #1a222c; color: var(--ink); border: 1px solid rgba(233,228,214,.25); border-radius: 4px; }
.intro-card { max-width: 620px; padding: 18px 22px; background: rgba(8,12,18,.75); border-left: 3px solid #d9c38a; border-radius: 6px; text-align: left; line-height: 1.6; font-size: 16px; }
.endlist { display: flex; flex-direction: column; gap: 6px; width: min(560px, 90vw); }
.endrow { display: grid; grid-template-columns: 1fr auto 1.6fr; gap: 12px; align-items: center; padding: 6px 10px; background: rgba(255,255,255,.04); border-radius: 4px; text-align: left; font-size: 14px; }
.endname { font-weight: 700; }
.endrole { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.endrole.segito { background: rgba(109,191,106,.25); color: #cdeccc; }
.endrole.fosztogato { background: rgba(192,57,43,.3); color: #ffd6d0; }
.endev { color: var(--muted); font-size: 12px; }
.toast.tip { border-left-color: #8fc3e6; max-width: 380px; }
@media (max-width: 640px) { .screen .logo { font-size: 64px; } .endrow { grid-template-columns: 1fr auto; } .endev { grid-column: 1 / -1; } }
