* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #0d6fa3; color: white; overscroll-behavior: none; }
p { line-height: 1.5; }
#worldDescription {font-size: 14px;}
.map-wrap { width: 100%; min-height: 100vh; margin: 0; padding: 0; }
.map-stage { position: relative; width: 100%; max-width: 2048px; aspect-ratio: 2048 / 1757; margin: 0 auto; overflow: hidden; background: #0d6fa3; box-shadow: none; border-radius: 0; }
.tile-map { position: absolute; inset: 0; z-index: 1; display: grid; grid-template-columns: repeat(var(--cols, 8), 1fr); grid-template-rows: repeat(var(--rows, 6), 1fr); user-select: none; pointer-events: none; }
.tile { background-repeat: no-repeat; background-origin: border-box; background-clip: border-box; transform: translateZ(0); }
#mapSvg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; }

.topbar { position: absolute; z-index: 20; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding: clamp(12px, 2.2vw, 34px); pointer-events: none; }
.title-block, .filter-wrapper, .filters { pointer-events: auto; }
.title-block { max-width: 660px; padding: 0; border-radius: 0; background: none; backdrop-filter: none; text-shadow: 0 3px 12px rgba(0,0,0,.45); }
h1 { margin: 0; font-size: clamp(26px, 4.4vw, 58px); line-height: 1; }
.topbar p { margin: 8px 0 0; color: #e0f2fe; font-size: clamp(13px, 1.2vw, 17px); }
.filter-wrapper { position: relative; display: flex; justify-content: flex-end; }
.filter-toggle { display: none; border: 0; border-radius: 999px; padding: 10px 14px; background: rgba(3, 45, 78, .72); color: white; font-weight: 900; cursor: pointer; box-shadow: 0 12px 35px rgba(0,0,0,.25); backdrop-filter: blur(8px); }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; background: rgba(3, 45, 78, .62); padding: 10px; border-radius: 20px; align-items: center; backdrop-filter: blur(8px); box-shadow: 0 12px 35px rgba(0,0,0,.25); }
.search-row { display: flex; gap: 8px; align-items: center; }
.filters input[type="search"] { border: 0; border-radius: 12px; padding: 11px 13px; min-width: 210px; outline: none; }
.random-btn { border: 0; border-radius: 12px; padding: 11px 13px; background: rgba(255,255,255,.18); color: white; font-weight: 900; cursor: pointer; white-space: nowrap; transition: transform .18s ease, background .18s ease; }
.random-btn:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.random-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.filters label { background: rgba(255,255,255,.14); padding: 10px 12px; border-radius: 12px; font-weight: 700; cursor: pointer; user-select: none; }

.world-group { cursor: pointer; }
.world-path { transition: .2s; fill: rgba(14,165,233,.08); }
.world-group:hover .world-path { fill: rgba(56,189,248,.32); stroke: white; }
.world-group.random-highlight .world-path { fill: rgba(250,204,21,.48) !important; stroke: #fff7ad !important; stroke-width: 7 !important; filter: drop-shadow(0 0 12px rgba(250,204,21,.95)); }
.world-group.random-highlight .world-label { fill: #fff7ad; }
.world-label { pointer-events: none; fill: white; font-size: 21px; font-weight: 900; paint-order: stroke; stroke: rgba(0,0,0,.42); stroke-width: 2px; letter-spacing: .01em; }
.world-icon { pointer-events: none; opacity: .95; }

.info-panel { position: fixed; z-index: 100; right: 18px; top: 18px; width: min(440px, calc(100vw - 36px)); max-height: calc(100vh - 36px); overflow-y: auto; background: rgba(255,255,255,.97); color: #0f172a; border-radius: 24px; padding: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.5); transform: translateX(120%); transition: transform .28s ease; }
.info-panel.open { transform: translateX(0); }
.close { border: 0; background: #e2e8f0; border-radius: 999px; width: 42px; height: 42px; font-size: 30px; line-height: 1; cursor: pointer; }
.info-panel .close { position: absolute; right: 14px; top: 14px; }
.eyebrow { color: #0369a1; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin: 0 50px 6px 0; }
h2 { margin: 0 48px 14px 0; font-size: 32px; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.meta div { background: #f1f5f9; padding: 14px; border-radius: 16px; }
.meta span { display: block; font-size: 12px; color: #64748b; }
.meta strong { display: block; margin-top: 4px; font-size: 18px; }
.image-button { position: relative; display: block; width: 100%; border: 0; border-radius: 20px; overflow: hidden; padding: 0; cursor: zoom-in; background: #e2e8f0; }
.image-button img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.image-button span { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.75); color: white; padding: 9px 12px; border-radius: 999px; font-weight: 800; }
iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 20px; margin-top: 16px; background: black; }
.hint { margin-top: 16px; padding: 15px; border-radius: 18px; font-size: 14px; line-height: 1.5; }
.hint.blue { background: #e0f2fe; color: #082f49; }
.hint.green { background: #fff; color: #2c2c2c; }
.hint a { color: inherit; font-weight: 900; }
.merch-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin-bottom: 12px; background: #bbf7d0; }
.lightbox { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 20px; object-fit: contain; }
.lightbox-close { position: absolute; right: 20px; top: 20px; }

.site-footer { position: relative; z-index: 10; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 18px; background: #06283d; color: #dff6ff; font-size: 14px; }
.site-footer a { color: inherit; font-weight: 800; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; }
  .filter-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .filters { display: none; position: absolute; right: 0; top: calc(100% + 10px); width: min(82vw, 330px); flex-direction: column; align-items: stretch; justify-content: flex-start; border-radius: 18px; background: rgba(3, 23, 43, .9); }
  .filters.open { display: flex; }
  .search-row { width: 100%; }
  .filters input[type="search"] { width: 100%; min-width: 0; }
  .random-btn { flex: 0 0 auto; }
  .filters label { display: flex; align-items: center; gap: 8px; }
  .title-block { width: min(68vw, 560px); }
}

@media (max-width: 640px) {
  .map-stage { min-width: 980px; min-height: calc(980px * 1757 / 2048); }
  .map-wrap { overflow: auto; }
  .topbar { position: sticky; left: 0; width: min(100vw, 980px); }
  .info-panel { left: 10px; right: 10px; top: 10px; width: auto; max-height: calc(100vh - 20px); }
}
