:root {
  color-scheme: dark;
  --bg: #080a16;
  --surface: rgba(18, 22, 45, 0.78);
  --surface-solid: #11152b;
  --line: rgba(164, 174, 255, 0.14);
  --text: #f6f7ff;
  --muted: #969dbd;
  --mint: #66f2b2;
  --purple: #8b7cff;
  --pink: #ff79b7;
  --orange: #ffbd6f;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 8%, rgba(92, 55, 186, 0.19), transparent 29rem),
    linear-gradient(155deg, #080a16 0%, #0b1022 55%, #090a17 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 22rem;
  height: 22rem;
  filter: blur(90px);
  opacity: 0.13;
  pointer-events: none;
}
.ambient-one { top: 35%; left: -13rem; background: var(--purple); }
.ambient-two { right: -14rem; bottom: 5%; background: var(--pink); }

main {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: max(34px, env(safe-area-inset-top)) 18px max(42px, env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 2px 28px;
}

.eyebrow, .section-title span, .mini-label {
  margin: 0 0 7px;
  color: var(--mint);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.5rem); letter-spacing: -0.055em; }
h1 span { color: var(--purple); }
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

.live-chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 17, 35, 0.72);
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
}
.live-chip i { width: 8px; height: 8px; border-radius: 50%; background: #69708a; }
.live-chip.live i { background: var(--mint); box-shadow: 0 0 14px rgba(102, 242, 178, 0.8); }
.live-chip.live { color: #dfffee; }

.world-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(115deg, rgba(28, 33, 67, 0.9), rgba(15, 18, 38, 0.8));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
}
.world-strip article { padding: 18px; }
.world-strip article + article { border-left: 1px solid var(--line); }
.world-strip strong { display: block; font-size: 1.5rem; }
.world-strip strong b { color: var(--mint); }
.world-strip small { display: block; margin-top: 5px; color: var(--muted); }

section { margin-top: 34px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 3px 13px; }
.section-title span { color: var(--purple); }
.section-title h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.035em; }
.section-title p { max-width: 45%; margin: 0; color: var(--muted); font-size: 0.72rem; text-align: right; }

.player-grid, .production-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.player-card, .panel, .empty-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 16px 48px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(15px);
}
.empty-card { grid-column: 1 / -1; padding: 30px; color: var(--muted); text-align: center; }
.player-card { position: relative; overflow: hidden; padding: 18px; }
.player-card::after { content: ""; position: absolute; top: -60px; right: -50px; width: 130px; height: 130px; border-radius: 50%; background: var(--accent); opacity: 0.12; filter: blur(20px); }
.player-top { display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid color-mix(in srgb, var(--accent), transparent 55%); border-radius: 13px; background: color-mix(in srgb, var(--accent), transparent 86%); font-weight: 900; }
.player-name { flex: 1; min-width: 0; }
.player-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-name small { color: var(--muted); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b6177; }
.online-dot.on { background: var(--mint); box-shadow: 0 0 12px rgba(102, 242, 178, 0.7); }
.vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 17px; }
.vital { padding: 9px; border-radius: 11px; background: rgba(5, 8, 22, 0.5); text-align: center; }
.vital small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.65rem; }
.vital b { font-size: 0.86rem; }
.location { margin: 14px 0; padding: 10px 11px; border-left: 2px solid var(--accent); border-radius: 3px 10px 10px 3px; background: rgba(4, 7, 19, 0.38); color: #ced3ea; font-size: 0.75rem; line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { min-width: 0; }
.stats small { display: block; color: var(--muted); font-size: 0.62rem; white-space: nowrap; }
.stats b { display: block; margin-top: 2px; font-size: 0.9rem; }

.map-heading { align-items: center; }
.dimension-tabs { display: flex; gap: 5px; }
.dimension-tabs button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.68rem; cursor: pointer; }
.dimension-tabs button.active { border-color: rgba(139, 124, 255, 0.6); background: rgba(139, 124, 255, 0.18); color: #e8e4ff; }
.map-card { position: relative; min-height: 310px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background-color: #0c1022; background-image: linear-gradient(rgba(123, 137, 202, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(123, 137, 202, .045) 1px, transparent 1px); background-size: 22px 22px; }
#trail-map { display: block; width: 100%; height: 310px; }
.map-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); text-align: center; pointer-events: none; }
.map-empty span { color: var(--purple); font-size: 1.5rem; }
.map-empty strong { color: #d8dcf1; font-size: 0.88rem; }
.map-empty small { font-size: 0.7rem; }
.map-legend { position: absolute; left: 13px; bottom: 12px; display: flex; gap: 12px; }
.map-legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.66rem; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--legend); }

.poi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.poi-card { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(18,22,45,.62); }
.poi-card > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: rgba(255,189,111,.11); color: var(--orange); }
.poi-card div { min-width: 0; }
.poi-card strong { display: block; overflow: hidden; color: #f3f0e9; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.poi-card small { display: block; margin-top: 2px; color: var(--muted); font-size: .61rem; }
.poi-card > b { color: #c4c9df; font-size: .6rem; font-weight: 500; }
.poi-empty { grid-column: 1 / -1; padding: 12px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: .68rem; text-align: center; }

.panel { padding: 17px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.panel-heading h3 { margin: 0; font-size: 0.94rem; }
.panel-heading span { font-size: 1.05rem; }
.stack-list { display: grid; gap: 8px; }
.list-item { padding: 11px; border: 1px solid rgba(164,174,255,.09); border-radius: 13px; background: rgba(5,8,22,.38); }
.list-item-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.list-item strong { font-size: .8rem; }
.list-item small, .muted-empty { color: var(--muted); font-size: .68rem; }
.item-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.item-chips span { padding: 4px 7px; border-radius: 7px; background: rgba(102,242,178,.09); color: #c6f9e2; font-size: .65rem; }
.how-to { margin: 13px 1px 0; color: var(--muted); font-size: .67rem; line-height: 1.5; }
.how-to b { color: #cdd2eb; }

.timeline { padding: 5px 17px; }
.timeline-row { position: relative; display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 13px 0; }
.timeline-row + .timeline-row { border-top: 1px solid var(--line); }
.event-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 8px; background: rgba(139,124,255,.12); font-size: .72rem; }
.timeline-row strong { display: block; font-size: .77rem; }
.timeline-row small { color: var(--muted); font-size: .65rem; }
.timeline-row time { color: var(--muted); font-size: .63rem; }

.spoiler-promise { display: flex; gap: 12px; margin-top: 30px; padding: 15px 16px; border: 1px solid rgba(102,242,178,.17); border-radius: 17px; background: rgba(16,48,43,.28); }
.spoiler-promise > span { color: var(--mint); }
.spoiler-promise strong { font-size: .8rem; }
.spoiler-promise p { margin: 4px 0 0; color: #9abcb1; font-size: .69rem; line-height: 1.45; }
footer { padding: 28px 0 8px; color: #686f8d; font-size: .65rem; text-align: center; }

@media (max-width: 680px) {
  .player-grid, .production-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-end; }
  .live-chip { padding: 8px 10px; }
  .live-chip span { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .world-strip article { padding: 15px; }
  .world-strip strong { font-size: 1.25rem; }
  .section-title p { display: none; }
  .map-heading { align-items: flex-end; }
  .dimension-tabs { max-width: 55%; overflow-x: auto; }
  .poi-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .live-chip.live i { animation: pulse 2s infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 2px rgba(102,242,178,.3); } }
}
