.world-map {
  --world-map-image: url("../assets/A-hat-birodalom-terkepe.png");
  background-position: center;
  background-size: cover;
}

/* Teljes képernyős, görgetésmentes játékelrendezés */
html, body, #root { width: 100%; height: 100%; overflow: hidden; }
.setup-screen {
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  padding: clamp(7px, 1.1vh, 14px);
  overflow: hidden;
  align-items: center;
}
.setup-panel {
  box-sizing: border-box;
  width: min(1320px, 100%) !important;
  max-height: 100%;
  padding: clamp(12px, 1.6vh, 24px) clamp(15px, 2vw, 30px) !important;
  overflow: hidden;
}
.setup-panel h1 { margin: 4px 0; font-size: clamp(1.7rem, 3.4vh, 2.65rem); }
.setup-panel .lead { margin: 4px 0 10px; font-size: clamp(.82rem, 1.5vh, 1rem); }
.realm-picker { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 7px; }
.realm-card { min-height: 66px; padding: 7px !important; }
.realm-card .realm-icon { font-size: clamp(1.45rem, 2.7vh, 2rem); }
.realm-card strong { font-size: clamp(.73rem, 1.35vh, .94rem); }
.realm-card small { font-size: .66rem; }
.setup-options { margin: 8px 0 !important; gap: 8px; }
.setup-options label { padding: 6px 9px !important; }
.setup-options select { min-height: 34px; padding: 5px 7px; }
.chosen-summary { padding: 8px 11px; gap: 9px; }
.chosen-sigil { font-size: 1.55rem; }
.setup-info-grid { margin-top: 8px; gap: 9px; min-height: 0; }
.realm-guide, .rules-guide { padding: clamp(9px, 1.2vh, 15px); min-height: 0; }
.realm-guide h2, .rules-guide h2 { margin: 3px 0 5px; font-size: clamp(1.05rem, 2vh, 1.35rem); }
.realm-guide > p, .rules-guide > p { font-size: clamp(.7rem, 1.25vh, .86rem); line-height: 1.35; }
.power-guide { margin-top: 7px !important; padding: 7px !important; }
.power-guide p { margin: 3px 0 0 !important; font-size: .72rem; }
.hero-preview { margin-top: 7px !important; gap: 3px !important; }
.hero-preview > div { padding: 4px 6px !important; }
.hero-preview em { display: none; }
.hero-preview small { font-size: .67rem; }
.rule-steps { margin-top: 7px !important; gap: 4px !important; }
.rule-steps > div { padding: 5px 7px !important; }
.rule-steps small { font-size: .67rem; }
.full-rules { margin-top: 6px !important; padding: 6px 8px !important; font-size: .72rem; }
.full-rules[open] { position: absolute; z-index: 30; right: 3%; bottom: 3%; width: min(620px, 90%); max-height: 72vh; overflow-y: auto; background: #0b1221; box-shadow: 0 18px 55px #000; }
.online-menu-button { margin-top:7px; border-color:#72c8e9; color:#dff7ff; background:linear-gradient(180deg,#245f7a,#12374e); box-shadow:0 0 18px rgba(77,194,235,.2); }

.capture-transfer {
  width: min(470px, 100%);
  display: grid;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid rgba(255,226,154,.5);
  border-radius: 11px;
  background: rgba(228,195,111,.08);
}
.capture-transfer strong { color: #ffe29a; text-align: center; }
.capture-transfer label { display: grid; grid-template-columns: 1fr auto; gap: 8px; color: #dbe4f5; }
.capture-transfer input { grid-column: 1 / -1; width: 100%; accent-color: #e4c36f; }
.capture-split { display: flex; justify-content: space-between; gap: 15px; color: #aebbd2; font-size: .82rem; }

.marching-army {
  position: absolute;
  z-index: 11;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  pointer-events: none;
  border: 2px solid #fff1b0;
  border-radius: 50%;
  color: #fff6d5;
  background: radial-gradient(circle at 35% 30%, #d9553c, #541411 72%);
  box-shadow: 0 0 0 6px rgba(228,195,111,.17), 0 0 28px #ffce62, 0 8px 18px rgba(0,0,0,.7);
  font-size: 1.35rem;
  text-shadow: 0 2px 4px #000;
  will-change: transform, opacity;
}
.marching-army.move {
  background: radial-gradient(circle at 35% 30%, #5d9cd4, #142d55 72%);
  box-shadow: 0 0 0 6px rgba(99,194,255,.17), 0 0 28px #6ed8ff, 0 8px 18px rgba(0,0,0,.7);
}
.marching-army.ai { filter: saturate(.85); }
.march-trail {
  position: absolute;
  z-index: 10;
  height: 4px;
  pointer-events: none;
  transform-origin: left center;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ffe29a, transparent);
  box-shadow: 0 0 10px #ffd166;
  opacity: .8;
}

.initiative-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(2,5,12,.72);
  backdrop-filter: blur(5px);
}
.initiative-card {
  width: min(760px, 90vw);
  padding: 24px;
  border: 2px solid #e4c36f;
  border-radius: 18px;
  background: linear-gradient(145deg,#17233c,#080d19);
  box-shadow: 0 25px 80px #000, 0 0 38px rgba(228,195,111,.3);
  text-align: center;
  animation: battle-in .35s ease-out;
}
.initiative-card h2 { margin: 0 0 15px; color: #ffe29a; }
.initiative-order { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.initiative-order span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.05); }
.initiative-order span:first-child { border-color: #ffe29a; color: #ffe29a; box-shadow: 0 0 14px rgba(255,226,154,.25); }

@media (max-height: 760px) {
  .setup-panel { padding-top: 8px !important; padding-bottom: 8px !important; }
  .setup-panel .eyebrow, .setup-panel .lead { display: none; }
  .realm-card { min-height: 55px; }
  .hero-preview { grid-template-columns: repeat(3, 1fr); }
  .power-guide p, .rules-guide > p { display: none; }
}
.game-screen {
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(5px, .65vh, 9px);
  padding: clamp(5px, .65vh, 9px);
  overflow: hidden;
}
.game-header, .turn-footer {
  min-height: 0;
  padding: clamp(7px, .75vh, 11px) clamp(10px, 1vw, 16px);
}
.game-header strong { font-size: clamp(1rem, 1.35vw, 1.3rem); }
.resource-bar span, .turn-order span { padding: 5px 9px; font-size: clamp(.7rem, .75vw, .86rem); }
.realm-overview {
  min-width: 0 !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.realm-stat { padding: 5px 8px; gap: 5px; }
.realm-stat > span { font-size: 1.05rem; }
.realm-stat > b { font-size: .95rem; }
.realm-stat small { font-size: .61rem; }
.game-layout {
  min-width: 0 !important;
  min-height: 0;
  height: 100%;
  grid-template-columns: clamp(178px, 13vw, 225px) minmax(0, 1fr) clamp(245px, 19vw, 330px);
  align-items: stretch;
  gap: clamp(6px, .7vw, 11px);
}
.ruler-panel, .territory-panel {
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  gap: clamp(5px, .65vh, 9px);
  padding: clamp(7px, .8vw, 12px);
  overflow: hidden;
}
.world-map {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}
.ruler-portrait.has-character-art {
  flex: 0 1 clamp(132px, 22vh, 225px);
  min-height: 112px;
}
.realm-status { padding: 3px 2px; }
.hero-roster {
  min-height: 0;
  padding: 6px;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.hero-roster button { min-height: 43px; padding: 4px 6px; }
.quick-rules { padding: 7px; font-size: .73rem; }
.quick-rules p { margin-top: 5px; }
.territory-panel h2 { font-size: clamp(1.15rem, 1.55vw, 1.65rem); }
.territory-panel dl { gap: 3px; margin: 0; }
.territory-panel dl div { padding-bottom: 4px; font-size: clamp(.72rem, .8vw, .86rem); }
.territory-command, .neighbor-list, .action-box { padding: 6px; gap: 4px; }
.territory-command > button { min-height: 48px; }
.neighbor-list > div { gap: 4px; }
.neighbor-chip { min-height: 39px; padding: 4px 6px; }
.action-buttons { gap: 4px; }
.action-buttons button, .action-box button { min-height: 36px; padding: 6px 9px; }
.message-box { min-height: 48px; max-height: 70px; padding: 7px 9px; overflow-y: auto; font-size: .77rem; }
.war-log { min-height: 48px; max-height: 105px; padding: 7px; gap: 4px; }
.war-log p { padding-top: 4px; font-size: .68rem; }
.turn-footer { flex-shrink: 0; }

/* Látványosabb hőskártyák */
.hero-roster button.has-hero-art,
.territory-command > button.has-hero-art {
  grid-template-columns: 48px minmax(0, 1fr);
  border-color: color-mix(in srgb, var(--realm-color, #e4c36f) 52%, #e4c36f);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--realm-color, #7650b8) 24%, transparent), transparent 75%),
    rgba(255,255,255,.035);
  box-shadow: inset 0 0 18px rgba(255,255,255,.025), 0 4px 12px rgba(0,0,0,.22);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.hero-roster button.has-hero-art:hover,
.territory-command > button.has-hero-art:hover {
  z-index: 3;
  transform: translateY(-1px);
  border-color: #ffe29a;
  box-shadow: 0 0 18px color-mix(in srgb, var(--realm-color, #e4c36f) 42%, transparent), 0 7px 18px rgba(0,0,0,.45);
}
.hero-thumbnail {
  width: 43px;
  height: 43px;
  border: 2px solid rgba(255, 226, 154, .75);
  border-radius: 9px;
  filter: saturate(1.08) contrast(1.04);
}
.hero-roster button strong { color: #fff1be; }
.hero-roster button small { color: #b8c8e5; }

/* A térképen az emoji helyett a hős arca jelenik meg. */
.territory-node .hero-marker.has-map-portrait {
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-width: 2px;
  background: #090e19;
}
.map-hero-portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.territory-node .hero-marker.has-map-portrait > sup { z-index: 2; }
.territory-node .hero-marker.has-map-portrait > .map-hero-portrait + sup { display: grid; }

@media (max-height: 820px) {
  .ruler-portrait.has-character-art { flex-basis: 120px; }
  .ruler-portrait.has-character-art > strong { padding-top: 28px; font-size: .85rem; }
  .quick-rules { display: none; }
  .war-log { max-height: 72px; }
  .message-box { max-height: 55px; }
  .territory-node { transform: translate(-50%,-50%) scale(.86); }
}

@media (max-width: 1250px) {
  .game-layout { grid-template-columns: 165px minmax(0, 1fr) 235px; }
  .realm-stat small { display: none; }
  .turn-order span { padding: 4px 6px; }
}

.ruler-portrait.has-character-art {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  justify-content: end;
  background: #080d18;
}

.ruler-portrait.has-character-art > span:first-child { display: none; }
.ruler-portrait.has-character-art > strong {
  position: relative;
  z-index: 2;
  width: calc(100% + 32px);
  margin: 0 -16px -16px;
  padding: 45px 14px 14px;
  background: linear-gradient(transparent, rgba(4, 7, 14, .96) 56%);
}

.character-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero-roster button,
.territory-command > button { position: relative; overflow: hidden; }
.hero-roster button.has-hero-art,
.territory-command > button.has-hero-art { grid-template-columns: 42px 1fr; }
.hero-roster button.has-hero-art > span:first-child,
.territory-command > button.has-hero-art > b:first-child { display: none; }

.hero-thumbnail {
  width: 43px;
  height: 43px;
  border: 1px solid rgba(255, 226, 154, .65);
  border-radius: 7px;
  object-fit: cover;
  object-position: center 18%;
  box-shadow: 0 3px 9px rgba(0, 0, 0, .55);
}
