﻿:root {
  --bg-0: #111413;
  --bg-1: #17211d;
  --bg-2: #2d2432;
  --card: rgba(20, 24, 23, 0.86);
  --card-2: rgba(33, 38, 35, 0.9);
  --line: #4b5a4f;
  --text: #f4f1e8;
  --muted: #b6c0b4;
  --accent: #7fc7a4;
  --accent-2: #f2c166;
  --warn: #e59163;
  --danger: #df6f6f;
  --gold: #ffd166;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 560px at 10% -10%, rgba(127, 199, 164, 0.16), transparent 60%),
    radial-gradient(800px 440px at 90% -10%, rgba(242, 193, 102, 0.12), transparent 58%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button {
  border: 0;
  color: white;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #4f9272, #7fc7a4);
  font-weight: 700;
}
button.alt { background: linear-gradient(135deg, #5a5363, #7a6c86); }
button.ok { background: linear-gradient(135deg, #3f8b67, #74c69d); }
button.warn { background: linear-gradient(135deg, #db7044, #ff9a6b); }
button.danger { background: linear-gradient(135deg, #cf495d, #ff6f7d); }
button.ghost {
  color: var(--muted);
  border: 1px solid #59645a;
  background: rgba(244, 241, 232, .06);
}
button:disabled { opacity: .55; cursor: default; }
input, select {
  border: 1px solid #59645a;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 140px;
  color: var(--text);
  background: rgba(14, 17, 16, 0.9);
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(6, 12, 24, 0.74);
  border-radius: 18px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
}

.branding h1 {
  margin: 0;
  font: 700 34px 'Rajdhani', sans-serif;
  letter-spacing: 1px;
}
.branding p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.authbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.main-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 14px;
  margin-top: 14px;
}

.sidebar, .panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.sidebar {
  padding: 14px;
  position: sticky;
  top: 16px;
  height: fit-content;
}

.user-card {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(18, 29, 51, .95), rgba(13, 22, 39, .92));
  border: 1px solid #35507b;
}
.user-card strong {
  display: block;
  font-size: 17px;
}
.user-card span {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.nav-link {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(15, 24, 41, .78);
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
}
.nav-link.active {
  color: white;
  border-color: #4d74af;
  background: linear-gradient(135deg, rgba(49, 121, 255, .28), rgba(67, 240, 199, .16));
}

.content {
  display: grid;
  gap: 14px;
}
.panel {
  padding: 16px;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
}
.panel p.meta {
  margin: 0;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: center;
}
.avatar {
  width: 220px;
  height: 220px;
  border-radius: 24px;
  position: relative;
  border: 1px solid #426291;
  background:
    linear-gradient(180deg, #1c2e4a, #101829),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 8px);
  overflow: hidden;
}
.avatar::before {
  content: '';
  position: absolute;
  inset: auto 66px 44px 66px;
  height: 78px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #f7d2a3, #d1935f);
  box-shadow: 0 -52px 0 14px #e8edf9, 0 -72px 0 8px #8fa2c9;
}

.stat-grid, .tile-grid, .card-grid {
  display: grid;
  gap: 12px;
}
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat, .tile, .card {
  border: 1px solid #35507b;
  border-radius: 16px;
  padding: 14px;
  background: var(--card-2);
}
.stat label, .tile label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stat strong, .tile strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-family: 'Rajdhani', sans-serif;
}

.progress {
  margin-top: 10px;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.progress-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #304866;
  background: rgba(7, 14, 24, .85);
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3cd6b3, #7effdd);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.action-timer {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #4d6c6a;
  border-radius: 8px;
  background: rgba(14, 29, 28, .78);
}

.action-timer strong {
  display: block;
  margin-top: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.timer-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid #43635f;
  border-radius: 999px;
  background: rgba(6, 14, 15, .82);
}

.timer-track i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f2c166, #7fc7a4);
  transition: width .25s ease;
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .001ms !important;
}

.timer-actions button {
  min-width: 92px;
}

.primary-actions button.ready-to-complete {
  border-color: #ffd166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, .18), 0 10px 26px rgba(255, 209, 102, .16);
}

.list {
  display: grid;
  gap: 10px;
}
.list-item {
  border: 1px solid #35507b;
  border-radius: 14px;
  padding: 12px;
  background: rgba(13, 22, 39, .72);
}
.list-item strong { display: block; font-size: 15px; }
.list-item .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.chain-item.skipped {
  border-color: rgba(240, 143, 108, .58);
}

.chain-item.replaced {
  border-color: rgba(127, 199, 164, .58);
}

.chain-item.deferred {
  border-color: rgba(242, 193, 102, .54);
}

.chain-item.skipped .sub,
.chain-item.replaced .sub,
.chain-item.deferred .sub {
  color: var(--accent-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #3e5c8f;
  color: var(--muted);
  font-size: 11px;
}
.badge.good { color: var(--accent-2); }
.badge.warn { color: var(--warn); }
.badge.gold { color: var(--gold); }

.costume-charge.ready {
  color: var(--accent-2);
}

.costume-charge.waiting {
  color: var(--warn);
}

.empty {
  color: var(--muted);
  padding: 20px;
  text-align: center;
  border: 1px dashed #36527c;
  border-radius: 14px;
}

.log-panel {
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
  font-size: 11px;
  color: #c7d5ef;
}

.app-toast {
  margin-top: 14px;
  padding: 10px 14px;
}

.log-card {
  margin-top: 14px;
  padding: 12px;
}

.log-card h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.settings-toggle input {
  min-width: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.goal-form {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.quick-goal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.quick-goal-input {
  display: grid;
  gap: 6px;
}

.quick-goal-input span {
  color: var(--muted);
  font-size: 12px;
}

.quick-goal-input input {
  width: 100%;
}

.quick-goal-row button {
  min-height: 48px;
}

.quick-goal-meta {
  margin-top: 8px !important;
}

.goal-details {
  margin-top: 12px;
  border: 1px solid #35507b;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(13, 22, 39, .48);
}

.goal-details summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 700;
}

.goal-details .meta {
  margin-top: 8px;
}

.goal-form label {
  display: grid;
  gap: 6px;
}

.goal-form label span {
  color: var(--muted);
  font-size: 12px;
}

.goal-form input,
.goal-form select {
  width: 100%;
  min-width: 0;
}

.reminder-form {
  grid-template-columns: minmax(140px, 220px);
}

.reminder-action-box {
  margin-top: 12px;
  border: 1px solid #59645a;
  border-radius: 14px;
  padding: 12px;
  background: rgba(14, 17, 16, .58);
}

.reminder-action-box.due {
  border-color: rgba(242, 193, 102, .74);
  box-shadow: inset 0 0 0 1px rgba(242, 193, 102, .18);
}

.tile-grid .stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.village-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.village-scene {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  margin: 4px 0 16px;
  border: 2px solid #6f854e;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(115, 184, 202, .48) 0 20%, transparent 20%),
    linear-gradient(180deg, #9acb72, #6fa85c 58%, #5c8e54);
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.14),
    inset 0 -20px 0 rgba(52, 93, 48, .22);
}

.village-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 34%;
  pointer-events: none;
}

.village-sky i {
  position: absolute;
  width: 48px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  box-shadow: 22px 2px 0 rgba(255,255,255,.62), 10px -7px 0 rgba(255,255,255,.74);
  animation: cloud-drift 16s linear infinite;
}

.village-sky i:nth-child(1) { left: 8%; top: 22%; }
.village-sky i:nth-child(2) { left: 42%; top: 12%; animation-duration: 21s; animation-delay: -6s; }
.village-sky i:nth-child(3) { left: 76%; top: 28%; animation-duration: 18s; animation-delay: -10s; }

.village-board {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 5%;
  height: 76%;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(135deg, #82bd63, #6ba958);
  background-size: 48px 48px, 48px 48px, auto;
  transform: perspective(900px) rotateX(2deg);
  box-shadow: inset 0 0 0 2px rgba(39, 79, 44, .35);
}

.village-board::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  border-radius: 999px;
  border: 14px solid rgba(230, 189, 111, .56);
  transform: rotate(-8deg);
}

.village-river {
  position: absolute;
  left: -8%;
  right: -8%;
  top: 48%;
  height: 36px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 18px, transparent 18px 42px),
    linear-gradient(180deg, #6cc7dd, #3b92bd);
  transform: rotate(-12deg);
  box-shadow: 0 5px 0 rgba(24, 75, 100, .26);
}

.village-path {
  position: absolute;
  background: #d2a860;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.24), inset 0 -3px 0 rgba(113, 78, 37, .2);
}

.path-a {
  left: 47%;
  top: 3%;
  width: 36px;
  height: 88%;
  transform: rotate(12deg);
}

.path-b {
  left: 10%;
  top: 47%;
  width: 78%;
  height: 32px;
  transform: rotate(-6deg);
}

.village-tile {
  position: absolute;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background: rgba(242, 220, 140, .56);
  box-shadow: 0 2px 0 rgba(69, 112, 54, .22);
}

.village-tile:nth-of-type(1) { left: 9%; top: 69%; }
.village-tile:nth-of-type(2) { left: 18%; top: 32%; }
.village-tile:nth-of-type(3) { left: 31%; top: 61%; }
.village-tile:nth-of-type(4) { left: 44%; top: 25%; }
.village-tile:nth-of-type(5) { left: 53%; top: 77%; }
.village-tile:nth-of-type(6) { left: 69%; top: 28%; }
.village-tile:nth-of-type(7) { left: 82%; top: 59%; }
.village-tile:nth-of-type(8) { left: 74%; top: 79%; }

.village-building {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 78px;
  height: calc(66px + (var(--rank) * 4px));
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #2a1f21;
  background: transparent;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 9px 0 rgba(48, 58, 42, .28));
  z-index: calc(10 + var(--rank));
}

.village-building .body {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 9px;
  height: calc(38px + (var(--rank) * 3px));
  border: 3px solid #513d32;
  background:
    linear-gradient(90deg, rgba(255,255,255,.22) 0 45%, transparent 45%),
    #e7c27b;
}

.village-building .roof {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: calc(41px + (var(--rank) * 3px));
  height: 24px;
  border: 3px solid #513d32;
  background: #d85d4a;
  clip-path: polygon(50% 0, 100% 78%, 92% 100%, 8% 100%, 0 78%);
  z-index: 2;
}

.village-building .door {
  position: absolute;
  left: 34px;
  bottom: 10px;
  width: 13px;
  height: 22px;
  border: 2px solid #513d32;
  background: #6d4a36;
}

.village-building small {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 34px;
  padding: 2px 4px;
  border: 2px solid #513d32;
  border-radius: 4px;
  background: #fff0b2;
  color: #513d32;
  font-size: 11px;
  line-height: 1;
}

.village-building.active {
  animation: building-bob 2.8s ease-in-out infinite;
}

.village-building.tower .body {
  left: 24px;
  right: 24px;
  height: calc(54px + (var(--rank) * 5px));
  background: #d7d6c5;
}

.village-building.tower .roof {
  bottom: calc(57px + (var(--rank) * 5px));
  background: #5578b8;
}

.village-building.forge .body { background: #c98d62; }
.village-building.forge .roof { background: #6b5b54; }
.village-building.scribe .body { background: #c9b07c; }
.village-building.scribe .roof { background: #815da6; }
.village-building.training .body { background: #c78258; }
.village-building.training .roof { background: #7a8d51; }
.village-building.inn .body { background: #e1a769; }
.village-building.inn .roof { background: #cf5d70; }
.village-building.hall .body { background: #d2c183; }
.village-building.hall .roof { background: #4f9272; }
.village-building.garden .body {
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 42%, #f7d05f 0 9px, transparent 10px),
    radial-gradient(circle at 64% 34%, #e56b6f 0 8px, transparent 9px),
    #78b760;
}
.village-building.garden .roof { display: none; }

.player-character,
.villager,
.tiny-monster {
  position: absolute;
  width: 24px;
  height: 28px;
  z-index: 60;
}

.player-character i,
.villager i,
.tiny-monster i {
  position: absolute;
  inset: 0;
  border: 3px solid #422f2c;
  box-shadow: inset 5px 0 rgba(255,255,255,.18), 0 4px 0 rgba(41, 61, 38, .25);
}

.player-character {
  left: 46%;
  top: 59%;
  z-index: 72;
  animation: player-patrol 7s ease-in-out infinite;
}

.player-character i {
  border-radius: 9px 9px 5px 5px;
  background:
    radial-gradient(circle at 32% 28%, #382824 0 2px, transparent 3px),
    radial-gradient(circle at 68% 28%, #382824 0 2px, transparent 3px),
    linear-gradient(#f1c48b 0 42%, #f2c166 42% 72%, #8f5db8 72%);
}

.villager i {
  border-radius: 9px 9px 5px 5px;
  background:
    radial-gradient(circle at 32% 30%, #422f2c 0 2px, transparent 3px),
    radial-gradient(circle at 68% 30%, #422f2c 0 2px, transparent 3px),
    linear-gradient(#f6c98b 0 45%, #5aa6c8 45%);
}

.villager-a {
  left: 17%;
  top: 58%;
  animation: walk-a 9s ease-in-out infinite;
}

.villager-b {
  left: 69%;
  top: 57%;
  animation: walk-b 11s ease-in-out infinite;
}

.villager-b i {
  background:
    radial-gradient(circle at 32% 30%, #422f2c 0 2px, transparent 3px),
    radial-gradient(circle at 68% 30%, #422f2c 0 2px, transparent 3px),
    linear-gradient(#f1b783 0 45%, #9d73c9 45%);
}

.tiny-monster {
  left: 81%;
  top: 74%;
  animation: monster-hop 3.4s ease-in-out infinite;
}

.tiny-monster i {
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 36% 38%, #19373a 0 2px, transparent 3px),
    radial-gradient(circle at 64% 38%, #19373a 0 2px, transparent 3px),
    #6fd0a0;
}

@keyframes cloud-drift {
  from { transform: translateX(-18px); }
  to { transform: translateX(34px); }
}

@keyframes building-bob {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 3px)); }
}

@keyframes player-patrol {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(96px, -24px); }
  72% { transform: translate(-72px, 18px) scaleX(-1); }
}

@keyframes walk-a {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(150px, -28px); }
  70% { transform: translate(260px, 36px); }
}

@keyframes walk-b {
  0%, 100% { transform: translate(0, 0) scaleX(-1); }
  45% { transform: translate(-180px, 34px) scaleX(-1); }
  78% { transform: translate(-310px, -10px) scaleX(-1); }
}

@keyframes monster-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-9px) scale(1.05, .94); }
}

.village-facility {
  min-width: 0;
  border: 1px solid #35507b;
  border-radius: 8px;
  padding: 14px;
  background: var(--card-2);
}

.village-facility strong,
.village-facility span,
.village-facility .sub {
  min-width: 0;
  overflow-wrap: anywhere;
}

.village-facility .sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.facility-detail {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.facility-example,
.facility-next {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.facility-next {
  color: var(--accent-2);
}

.costume-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.costume-card {
  min-width: 0;
  border: 1px solid #35507b;
  border-radius: 16px;
  padding: 14px;
  background: var(--card-2);
}

.costume-card.equipped {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(242, 193, 102, .28);
}

.costume-card.locked {
  opacity: .78;
}

.costume-card strong,
.costume-card span,
.costume-card .sub {
  min-width: 0;
  overflow-wrap: anywhere;
}

.costume-card .sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.costume-card .sub b {
  color: var(--text);
  font-weight: 700;
}

.expedition-grid {
  align-items: start;
}

.dungeon-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid #35507b;
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(127, 199, 164, .08), rgba(242, 193, 102, .04)),
    var(--card-2);
}

.dungeon-card + .dungeon-card {
  margin-top: 12px;
}

.dungeon-card.paused {
  opacity: .82;
}

.dungeon-facts {
  display: grid;
  grid-template-columns: .8fr repeat(2, minmax(0, 1.2fr));
  gap: 10px;
}

.dungeon-facts .stat {
  min-width: 0;
}

.dungeon-facts strong {
  overflow-wrap: anywhere;
}

.step-runner {
  display: grid;
  gap: 14px;
  min-height: 320px;
  align-content: center;
  background:
    linear-gradient(145deg, rgba(127, 199, 164, .12), rgba(242, 193, 102, .06)),
    var(--card);
}

.step-runner h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
}

.focus-page {
  display: grid;
  gap: 16px;
}

.focus-runner {
  min-height: min(620px, calc(100vh - 170px));
  border-color: rgba(127, 199, 164, .76);
  background:
    linear-gradient(145deg, rgba(127, 199, 164, .18), rgba(242, 193, 102, .05)),
    var(--card);
}

.focus-runner .reward-preview {
  opacity: .72;
}

.rest-runner {
  border-color: #6a5b31;
  background:
    linear-gradient(145deg, rgba(242, 193, 102, .13), rgba(127, 199, 164, .05)),
    var(--card);
}

.rest-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 760px;
}

.rest-card .stat strong {
  overflow-wrap: anywhere;
}

.rest-actions {
  margin-top: 2px;
}

.runner-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reward-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 120px));
  gap: 10px;
}

.reward-preview div {
  border: 1px solid #59645a;
  border-radius: 12px;
  padding: 10px;
  background: rgba(14, 17, 16, .58);
}

.reward-preview strong,
.reward-preview span {
  display: block;
}

.reward-preview strong {
  color: var(--accent-2);
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
}

.reward-preview span {
  color: var(--muted);
  font-size: 12px;
}

.reward-pulse {
  border-color: rgba(242, 193, 102, .74);
  background:
    linear-gradient(145deg, rgba(242, 193, 102, .14), rgba(127, 199, 164, .08)),
    var(--card);
}

.reward-pulse h2 {
  margin: 8px 0 0;
  font-size: 18px;
}

.reward-pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.reward-pulse-grid div {
  min-width: 0;
  border: 1px solid #59645a;
  border-radius: 12px;
  padding: 10px;
  background: rgba(14, 17, 16, .58);
}

.reward-pulse-grid strong,
.reward-pulse-grid span {
  display: block;
}

.reward-pulse-grid strong {
  color: var(--accent-2);
  font-family: 'Rajdhani', sans-serif;
  font-size: 24px;
}

.reward-pulse-grid span {
  color: var(--muted);
  font-size: 12px;
}

.reward-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.recent-trace {
  margin-top: 14px;
}

.trace-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.trace-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  border: 1px solid #334541;
  border-radius: 10px;
  padding: 9px;
  background: rgba(11, 22, 22, .42);
}

.trace-item strong,
.trace-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trace-item small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.reward-pulse-grid .facility-reward strong {
  font-size: 18px;
  line-height: 1.12;
}

.next-entrance {
  margin-top: 12px;
  border: 1px solid #4d6c6a;
  border-radius: 12px;
  padding: 10px;
  background: rgba(11, 22, 22, .56);
}

.next-entrance span,
.next-entrance strong {
  display: block;
  overflow-wrap: anywhere;
}

.next-entrance span {
  color: var(--muted);
  font-size: 12px;
}

.next-entrance strong {
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 16px;
}

.undo-actions {
  margin-top: 12px;
}

.undo-pulse {
  border-color: rgba(180, 202, 196, .64);
}

.undo-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.undo-map div {
  min-width: 0;
  border: 1px solid #4d6c6a;
  border-radius: 12px;
  padding: 10px;
  background: rgba(11, 22, 22, .64);
}

.undo-map span,
.undo-map strong {
  display: block;
  overflow-wrap: anywhere;
}

.undo-map span {
  color: var(--muted);
  font-size: 12px;
}

.undo-map strong {
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 16px;
}

.shrink-pulse {
  border-color: rgba(127, 199, 164, .72);
}

.shrink-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.shrink-map div {
  min-width: 0;
  border: 1px solid #4d6c6a;
  border-radius: 12px;
  padding: 10px;
  background: rgba(11, 22, 22, .64);
}

.shrink-map span,
.shrink-map strong {
  display: block;
  overflow-wrap: anywhere;
}

.shrink-map span {
  color: var(--muted);
  font-size: 12px;
}

.shrink-map strong {
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 15px;
  line-height: 1.28;
}

.costume-pulse {
  border-color: rgba(169, 139, 255, .72);
  background:
    linear-gradient(145deg, rgba(169, 139, 255, .13), rgba(127, 199, 164, .07)),
    var(--card);
}

.costume-pulse-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr repeat(2, minmax(0, .7fr));
  gap: 10px;
  margin-top: 12px;
}

.costume-pulse-grid div {
  min-width: 0;
  border: 1px solid #5b5588;
  border-radius: 12px;
  padding: 10px;
  background: rgba(18, 16, 30, .62);
}

.costume-pulse-grid span,
.costume-pulse-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.costume-pulse-grid span {
  color: var(--muted);
  font-size: 12px;
}

.costume-pulse-grid strong {
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 15px;
  line-height: 1.28;
}

.skip-pulse {
  border-color: rgba(240, 143, 108, .72);
  background:
    linear-gradient(145deg, rgba(240, 143, 108, .11), rgba(127, 199, 164, .06)),
    var(--card);
}

.skip-map {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr minmax(0, .7fr);
  gap: 10px;
  margin-top: 12px;
}

.skip-map div {
  min-width: 0;
  border: 1px solid #70513f;
  border-radius: 12px;
  padding: 10px;
  background: rgba(28, 17, 13, .58);
}

.skip-map span,
.skip-map strong {
  display: block;
  overflow-wrap: anywhere;
}

.skip-map span {
  color: var(--muted);
  font-size: 12px;
}

.skip-map strong {
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 15px;
  line-height: 1.28;
}

.primary-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(2, minmax(120px, 1fr));
  gap: 10px;
  max-width: 680px;
}

.primary-actions button {
  min-height: 54px;
}

.shrink-panel {
  max-width: 760px;
  border: 1px solid #59645a;
  border-radius: 14px;
  padding: 12px;
  background: rgba(14, 17, 16, .72);
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.reason-button {
  color: var(--text);
  border: 1px solid #6b705c;
  background: rgba(244, 241, 232, .08);
}

.quiet-actions {
  margin-top: 0;
}

.chain-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.chain-list {
  margin-top: 12px;
}

.chain-item.done {
  opacity: .72;
}

@media (max-width: 1080px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero { grid-template-columns: 1fr; }
  .avatar { width: 180px; height: 180px; }
  .stat-grid, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .village-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dungeon-facts { grid-template-columns: 1fr; }
  .goal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr; }
  .authbar { justify-content: flex-start; }
  .stat-grid, .tile-grid, .card-grid { grid-template-columns: 1fr; }
  .goal-form,
  .quick-goal-row,
  .primary-actions,
  .reason-grid,
  .rest-card,
  .reward-preview,
  .reward-pulse-grid,
  .shrink-map,
  .costume-pulse-grid,
  .skip-map,
  .village-grid,
  .costume-grid {
    grid-template-columns: 1fr;
  }
  .step-runner { min-height: 280px; }
  .step-runner h2 { font-size: 34px; }
  .village-scene { min-height: 300px; }
  .village-building {
    width: 58px;
    height: calc(52px + (var(--rank) * 3px));
  }
  .village-building .body {
    left: 10px;
    right: 10px;
    bottom: 7px;
    height: calc(30px + (var(--rank) * 2px));
  }
  .village-building .roof {
    left: 5px;
    right: 5px;
    bottom: calc(32px + (var(--rank) * 2px));
    height: 20px;
  }
  .village-building .door {
    left: 25px;
    bottom: 8px;
    width: 10px;
    height: 17px;
  }
  .village-building.tower .body {
    left: 18px;
    right: 18px;
    height: calc(42px + (var(--rank) * 3px));
  }
  .village-building.tower .roof {
    bottom: calc(44px + (var(--rank) * 3px));
  }
  .village-building small { font-size: 10px; min-width: 28px; }
  .player-character,
  .villager,
  .tiny-monster {
    width: 19px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

.v02-mode .hero,
.v02-mode .nav-list {
  display: none;
}

.v02-runner,
.v02-expedition,
.v02-anchor,
.v02-obstacle,
.v02-camp,
.v02-storage-warning,
.v02-storage-status {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.v02-wallet,
.v02-outcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 16px;
}

.v02-wallet span {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
}

.v02-wallet b {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font: 700 26px 'Rajdhani', sans-serif;
}

.v02-runner,
.v02-anchor,
.v02-obstacle {
  display: grid;
  gap: 16px;
}

.v02-runner h2,
.v02-expedition h2,
.v02-anchor h2,
.v02-obstacle h2 {
  margin: 0;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.v02-runner p,
.v02-expedition p,
.v02-anchor p,
.v02-obstacle p {
  margin: 0;
  color: var(--muted);
}

.v02-kicker {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}

.v02-camp {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  text-align: center;
}

.v02-camp-visual {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.v02-camp-visual > span {
  font-size: clamp(52px, 12vw, 96px);
  line-height: 1;
}

.v02-camp-visual strong {
  font-size: 20px;
}

.v02-camp-visual small,
.v02-camp p {
  color: var(--muted);
}

.v02-camp-badge {
  grid-column: 1 / -1;
  text-align: center;
}

.v02-camp-message {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--accent-2);
}

.v02-camp-message button {
  min-height: 36px;
  padding-block: 6px;
}

.v02-expedition {
  min-height: 360px;
  display: grid;
  gap: 18px;
  align-content: center;
  text-align: center;
}

.v02-expedition button,
.v02-runner > button,
.v02-anchor > button,
.v02-obstacle > button {
  min-height: 54px;
}

.v02-anchor label,
.v02-obstacle label,
.v02-goal-label {
  display: grid;
  gap: 8px;
  margin-block: 4px;
  color: var(--muted);
  font-weight: 700;
}

.v02-anchor input,
.v02-anchor textarea,
.v02-obstacle input,
.v02-goal-label input {
  width: 100%;
}

.v02-anchor textarea {
  min-height: 96px;
  resize: vertical;
  border: 1px solid #59645a;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(14, 17, 16, .9);
  font: inherit;
}

.v02-outcome-grid button,
.v02-obstacle .reason-button {
  min-height: 54px;
}

.v02-obstacle .reason-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v02-storage-warning {
  border-color: #a88445;
}

.v02-storage-warning p,
.v02-storage-status small {
  color: var(--muted);
}

.v02-storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.v02-character-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(112px, 180px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 190px;
  border: 1px solid color-mix(in srgb, var(--v02-character-accent) 58%, var(--line));
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at 22% 68%, color-mix(in srgb, var(--v02-character-accent) 18%, transparent), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01));
  text-align: left;
}

.v02-character-art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 156px;
}

#v02-character-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .42));
}

.v02-default-character {
  position: relative;
  display: block;
  width: 86px;
  height: 132px;
  border-radius: 46% 46% 35% 35%;
  background: linear-gradient(145deg, var(--v02-character-accent), #26333d 72%);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, .06),
    0 16px 28px rgba(0, 0, 0, .38);
}

.v02-default-character::before {
  content: '';
  position: absolute;
  top: -29px;
  left: 18px;
  width: 50px;
  height: 50px;
  border: 4px solid color-mix(in srgb, var(--v02-character-accent) 65%, white);
  border-radius: 50%;
  background: #26333d;
}

.v02-default-character::after {
  content: '';
  position: absolute;
  right: -26px;
  top: 22px;
  width: 54px;
  height: 10px;
  border-radius: 999px;
  background: var(--v02-character-accent);
  box-shadow: -108px 0 var(--v02-character-accent);
  transform: rotate(-17deg);
}

.v02-default-character i {
  position: absolute;
  left: 13px;
  bottom: -18px;
  width: 22px;
  height: 45px;
  border-radius: 0 0 12px 12px;
  background: #26333d;
  box-shadow: 38px 0 #26333d;
}

.v02-character-caption {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.v02-character-caption strong {
  color: var(--text);
  font: 700 clamp(24px, 5vw, 38px) 'Rajdhani', sans-serif;
  overflow-wrap: anywhere;
}

.v02-character-caption small,
.v02-character-notice,
.v02-character-settings > p {
  color: var(--muted);
}

.v02-character-notice {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

.v02-character-settings {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.v02-character-settings summary {
  cursor: pointer;
  font-weight: 800;
}

.v02-character-settings[open] summary {
  margin-bottom: 14px;
}

.v02-character-settings > p {
  margin: 0 0 14px;
}

.v02-character-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.v02-character-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.v02-character-form label:first-child,
.v02-character-form button {
  grid-column: 1 / -1;
}

.v02-character-form input,
.v02-character-form select {
  width: 100%;
}

.v02-fx-previews {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.v02-fx-previews button {
  grid-column: auto;
}

.v02-fx-overlay,
.v02-fx-layer {
  position: absolute;
  inset: 0;
}

.v02-fx-overlay {
  z-index: 30;
  overflow: hidden;
  border-radius: inherit;
  outline: none;
  background: rgba(4, 7, 9, .1);
  touch-action: none;
}

.v02-fx-overlay [data-v02-fx-skip] {
  position: absolute;
  z-index: 60;
  top: 10px;
  right: 10px;
  min-height: 36px;
  border-color: rgba(255, 255, 255, .42);
  padding: 6px 10px;
  color: #fff;
  background: rgba(5, 8, 11, .72);
  font-size: 12px;
}

.v02-fx-overlay [data-v02-fx-skip]:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.v02-fx-layer {
  z-index: 32;
  pointer-events: none;
}

.v02-fx-flash {
  z-index: 50;
  background: #fff;
  opacity: 0;
}

.v02-fx-shockring {
  inset: 52% auto auto 50%;
  width: 42%;
  aspect-ratio: 1;
  border: 5px solid var(--v02-fx-color);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--v02-fx-color), inset 0 0 18px var(--v02-fx-color);
  opacity: 0;
}

.v02-fx-bolt,
.v02-fx-arc {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  filter: drop-shadow(0 0 5px var(--v02-fx-color));
}

.v02-fx-bolt {
  opacity: 0;
}

.v02-fx-bolt polyline {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v02-fx-arc path {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  opacity: 0;
}

.v02-fx-afterimage {
  position: absolute;
  z-index: 34;
  object-fit: contain;
  pointer-events: none;
  filter: sepia(1) saturate(3) hue-rotate(145deg) drop-shadow(0 0 8px var(--v02-fx-color));
  opacity: 0;
}

.v02-fx-cutin {
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(100deg, transparent 0 8%, rgba(5, 8, 11, .92) 18% 82%, transparent 92%);
  opacity: 0;
}

.v02-fx-cutin strong {
  max-width: 92%;
  text-align: center;
  text-shadow: 0 0 14px currentColor, 3px 3px 0 #000;
  font: 800 clamp(28px, 8vw, 68px) 'Rajdhani', sans-serif;
  letter-spacing: .12em;
  overflow-wrap: anywhere;
}

.v02-fx-speedlines {
  display: grid;
  place-items: center;
  opacity: 0;
}

.v02-fx-speedlines i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  transform-origin: left center;
}

.v02-fx-speedlines i:nth-child(1) { transform: rotate(0deg); }
.v02-fx-speedlines i:nth-child(2) { transform: rotate(30deg); }
.v02-fx-speedlines i:nth-child(3) { transform: rotate(60deg); }
.v02-fx-speedlines i:nth-child(4) { transform: rotate(90deg); }
.v02-fx-speedlines i:nth-child(5) { transform: rotate(120deg); }
.v02-fx-speedlines i:nth-child(6) { transform: rotate(150deg); }
.v02-fx-speedlines i:nth-child(7) { transform: rotate(180deg); }
.v02-fx-speedlines i:nth-child(8) { transform: rotate(210deg); }
.v02-fx-speedlines i:nth-child(9) { transform: rotate(240deg); }
.v02-fx-speedlines i:nth-child(10) { transform: rotate(270deg); }
.v02-fx-speedlines i:nth-child(11) { transform: rotate(300deg); }
.v02-fx-speedlines i:nth-child(12) { transform: rotate(330deg); }

.v02-fx-summoning-circle {
  inset: 58% auto auto 50%;
  width: 48%;
  aspect-ratio: 1;
  border: 4px dashed var(--v02-fx-color);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--v02-fx-color), inset 0 0 20px var(--v02-fx-color);
  opacity: 0;
}

#v02-live {
  width: 100%;
  max-width: 760px;
  min-height: 1px;
  margin-inline: auto;
}

.v02-mode #page-root,
.v02-mode #page-root > *,
.v02-runner,
.v02-expedition,
.v02-character-stage,
.v02-character-settings {
  min-width: 0;
  max-width: 100%;
}

.v02-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  background: rgba(10, 15, 14, .72);
}

.v02-navigation a {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 800;
}

.v02-navigation a[aria-current="page"] {
  color: #101714;
  background: linear-gradient(135deg, var(--accent), #b7e7ce);
}

.v02-mode :focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.v02-mode button,
.v02-mode select,
.v02-mode input:not([type="radio"]),
.v02-character-settings > summary,
.v02-navigation a {
  min-height: 44px;
}

.v02-character-settings > summary {
  display: flex;
  align-items: center;
  width: 100%;
  padding-block: 8px;
}

.v02-character-form input,
.v02-character-form select {
  min-width: 0;
  max-width: 100%;
}

.v02-character-form input[type="file"] {
  overflow: hidden;
  padding-block: 3px;
}

.v02-character-form input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 8px;
  border: 0;
  border-radius: 8px;
  padding-inline: 10px;
  color: #101714;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
}

[role="radiogroup"][aria-labelledby="v02-expedition-duration-label"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#v02-expedition-duration-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
}

[role="radiogroup"][aria-labelledby="v02-expedition-duration-label"] label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
}

[role="radiogroup"][aria-labelledby="v02-expedition-duration-label"] input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-2);
}

[data-v02-expedition-teaser],
[data-v02-encounter] {
  width: 100%;
  border: 1px solid rgba(242, 193, 102, .34);
  border-radius: 13px;
  padding: 12px 14px;
  background: rgba(242, 193, 102, .07);
}

[data-v02-encounter] {
  display: grid;
  gap: 4px;
}

[data-v02-encounter] span {
  color: var(--muted);
  font-size: 13px;
}

[data-v02-encounter] strong {
  color: var(--accent-2);
  font-size: clamp(20px, 5vw, 30px);
  overflow-wrap: anywhere;
}

[data-v02-countdown] {
  display: block;
  color: var(--text);
  text-shadow: 0 0 18px rgba(242, 193, 102, .24);
  font: 800 clamp(48px, 14vw, 82px) / 1 'Rajdhani', sans-serif;
  letter-spacing: .04em;
}

#v02-expedition-ready {
  border-color: rgba(242, 193, 102, .66);
  background:
    radial-gradient(circle at 50% 0, rgba(242, 193, 102, .16), transparent 48%),
    var(--card);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .26), inset 0 0 0 1px rgba(242, 193, 102, .08);
}

[data-v02-character-media] {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .42));
}

video[data-v02-character-media] {
  border-radius: 12px;
}

[data-v02-monster-state] {
  display: grid;
  gap: 10px;
  width: min(100%, 520px);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  background: rgba(7, 12, 11, .66);
}

[data-v02-monster-hp] {
  --v02-hp-width: 100%;
  position: relative;
  width: 100%;
  height: 20px;
  overflow: hidden;
  border: 2px solid #d8dfd7;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
}

[data-v02-monster-hp]::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--v02-hp-width);
  background: linear-gradient(90deg, #d86858, #f2c166);
  transition: width .24s ease-out;
}

[data-v02-monster-hp]::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 calc(50% - 1px);
  width: 2px;
  background: #d8dfd7;
  pointer-events: none;
}

[data-v02-monster-hp][aria-valuenow="1"] { --v02-hp-width: 50%; }
[data-v02-monster-hp][aria-valuenow="0"] { --v02-hp-width: 0%; }

[data-v02-monster-state="hit"] {
  border-color: rgba(242, 193, 102, .72);
}

[data-v02-monster-state="defeated"] {
  border-color: rgba(127, 199, 164, .72);
}

[data-v02-combat-status],
[data-v02-damage] {
  min-height: 24px;
}

[data-v02-damage] {
  color: var(--accent-2) !important;
  font: 800 24px 'Rajdhani', sans-serif;
}

[data-v02-damage]:not(:empty) {
  animation: v02-damage-pop .28s ease-out;
}

@keyframes v02-damage-pop {
  from { opacity: 0; transform: translateY(8px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#v02-battle-report {
  border-color: rgba(242, 193, 102, .58);
  background:
    linear-gradient(155deg, rgba(242, 193, 102, .12), rgba(127, 199, 164, .055)),
    var(--card);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .3);
}

#v02-battle-report [data-v02-report-monster] {
  color: var(--text);
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 800;
}

#v02-battle-report [data-v02-report-route],
#v02-battle-report [data-v02-report-discovery] {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

#v02-battle-report [data-v02-report-gold] {
  color: var(--gold);
  font: 800 clamp(28px, 7vw, 44px) 'Rajdhani', sans-serif;
}

.v02-codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

[data-v02-codex-entry] {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .035);
  text-align: center;
}

[data-v02-codex-entry] h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

[data-v02-codex-count] {
  margin-top: 8px;
  color: var(--accent-2);
  font: 800 24px 'Rajdhani', sans-serif;
}

[data-v02-codex-entry][aria-label="미발견 몬스터"] {
  border-style: dashed;
  color: var(--muted);
  background: rgba(255, 255, 255, .018);
  font: 800 28px 'Rajdhani', sans-serif;
}

#v02-dialogue,
#v02-next-desire {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  overflow-wrap: anywhere;
}

#v02-dialogue {
  position: relative;
  margin-bottom: 14px;
  border: 1px solid rgba(127, 199, 164, .52);
  border-radius: 16px;
  padding: 13px 16px;
  color: var(--text);
  background: rgba(15, 29, 23, .92);
}

#v02-dialogue::after {
  content: '';
  position: absolute;
  left: 22px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(127, 199, 164, .52);
  border-bottom: 1px solid rgba(127, 199, 164, .52);
  background: rgba(15, 29, 23, .92);
  transform: rotate(45deg);
}

#v02-dialogue[aria-busy="true"] {
  color: var(--muted);
}

#v02-next-desire {
  margin-top: 14px;
  border: 1px solid rgba(242, 193, 102, .46);
  border-radius: 13px;
  padding: 12px 14px;
  color: var(--accent-2);
  background: rgba(242, 193, 102, .075);
  font-weight: 800;
  text-align: center;
}

.reduce-motion [data-v02-animated],
.reduce-motion [data-v02-character-media="idle"],
.reduce-motion [data-v02-character-media="skill"] {
  display: none !important;
}

.reduce-motion [data-v02-monster-state],
.reduce-motion [data-v02-damage],
.reduce-motion [data-v02-monster-hp]::before {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  [data-v02-animated],
  [data-v02-character-media="idle"],
  [data-v02-character-media="skill"] {
    display: none !important;
  }

  [data-v02-monster-state],
  [data-v02-damage],
  [data-v02-monster-hp]::before {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

@media (max-width: 720px) {
  .v02-wallet,
  .v02-outcome-grid,
  .v02-obstacle .reason-grid {
    grid-template-columns: 1fr;
  }

  .v02-mode button {
    min-height: 44px;
  }

  .v02-expedition {
    min-height: 280px;
  }

  .v02-character-stage {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 260px;
    text-align: center;
  }

  .v02-character-art {
    height: 170px;
  }

  .v02-character-form {
    grid-template-columns: 1fr;
  }

  .v02-fx-previews {
    grid-template-columns: 1fr;
  }

  [role="radiogroup"][aria-labelledby="v02-expedition-duration-label"] {
    grid-template-columns: 1fr;
  }

  .v02-codex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .v02-codex-grid {
    grid-template-columns: 1fr;
  }
}
