:root {
  color-scheme: light;
  --ink: #2c241d;
  --ink-soft: #625345;
  --paper: #f3e8ce;
  --paper-2: #ead8b5;
  --paper-3: #dfc599;
  --line: rgba(76, 57, 39, .28);
  --line-strong: rgba(76, 57, 39, .55);
  --gold: #b98743;
  --gold-dark: #7c5526;
  --red: #8e2f1f;
  --red-dark: #5d1c13;
  --green: #4b6548;
  --blue: #4d6f86;
  --orange: #b65b2e;
  --shadow: 0 18px 50px rgba(48, 34, 21, .16);
  --shadow-soft: 0 8px 24px rgba(48, 34, 21, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 72px;
  --sidebar-w: 280px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.55), transparent 35%),
    linear-gradient(135deg, #f7efd9, #e9d5af 70%, #dcc092);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .18;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(76,57,39,.025) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(76,57,39,.018) 8px 9px);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--red); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  border-radius: 8px;
}
.skip-link:focus { top: 10px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto minmax(130px, 260px) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(44, 36, 29, .96);
  color: #f8edcf;
  border-bottom: 1px solid rgba(185,135,67,.6);
  backdrop-filter: blur(16px);
}
.brand {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 170px;
  height: 56px;
  overflow: hidden;
  border-radius: 10px;
}
.brand img { width: 100%; height: 100%; object-fit: cover; object-position: center 54%; }
.header-status { min-width: 0; display: flex; align-items: center; gap: 12px; color: #d9c9a7; font-size: .84rem; }
.save-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-status.is-saving::before { content: "● "; color: #e0b15e; }
.save-status.is-saved::before { content: "✓ "; color: #9bc38d; }
.header-player { font-weight: 700; color: #fff3d6; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #fff4d8;
  cursor: pointer;
}
.icon-button:hover, .icon-button:focus-visible { background: rgba(255,255,255,.16); outline: 2px solid #d9af66; outline-offset: 2px; }
.mobile-only { display: none; }

.app-layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 18px 14px;
  background: rgba(55, 43, 32, .97);
  color: #eadfc5;
  border-right: 1px solid rgba(185,135,67,.42);
}
.sidebar-user {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(218,190,137,.22);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.055);
}
.sidebar-user strong { display: block; color: #fff4d9; }
.sidebar-user small { color: #cdbd9d; }
.nav-group { margin: 12px 0 18px; }
.nav-group-title {
  display: block;
  margin: 0 8px 7px;
  color: #bda77f;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e8ddc5;
  text-align: left;
  cursor: pointer;
}
.nav-button:hover, .nav-button:focus-visible { background: rgba(255,255,255,.08); outline: 2px solid rgba(218,175,102,.72); outline-offset: 1px; }
.nav-button.is-active { background: linear-gradient(90deg, rgba(185,135,67,.3), rgba(142,47,31,.24)); color: white; box-shadow: inset 3px 0 0 #d2a151; }
.nav-button.is-locked { opacity: .46; cursor: not-allowed; }
.nav-button .badge { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.12); text-align: center; font-size: .75rem; }
.sidebar-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer p { margin: 12px 8px 0; color: #a99677; font-size: .75rem; }

main { min-width: 0; padding: clamp(18px, 3vw, 42px); }
.page { max-width: 1280px; margin: 0 auto; animation: page-in .22s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.panel, .card, .hero-card {
  border: 1px solid var(--line);
  background: rgba(248, 239, 215, .86);
  box-shadow: var(--shadow-soft);
}
.panel { padding: clamp(18px, 3vw, 32px); border-radius: var(--radius); }
.card { padding: 18px; border-radius: var(--radius-sm); }
.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border-radius: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  align-items: center;
}
.hero-copy { position: relative; z-index: 2; padding: clamp(28px, 5vw, 64px); }
.hero-visual { height: 100%; min-height: 560px; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(76,57,39,.18);
}
.kicker { color: var(--red); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
h1, h2, h3 { line-height: 1.15; margin-top: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 4.7rem); margin-bottom: 18px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); margin-bottom: 14px; }
h3 { font-size: 1.2rem; }
p { margin-top: 0; }
.lead { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--ink-soft); }
.small { font-size: .86rem; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button {
  appearance: none;
  border: 1px solid var(--red-dark);
  border-radius: 12px;
  padding: 11px 17px;
  background: linear-gradient(180deg, #a23e2b, #762719);
  color: #fff9e9;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(85,28,18,.18);
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible { outline: 3px solid rgba(185,135,67,.7); outline-offset: 3px; }
.button:disabled { opacity: .42; cursor: not-allowed; transform: none; filter: none; }
.button-secondary { background: rgba(255,255,255,.45); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.button-ghost { background: transparent; color: var(--red-dark); border-color: transparent; box-shadow: none; }
.button-danger { background: linear-gradient(#7d271e, #53150f); }
.button-small { padding: 8px 13px; border-radius: 10px; font-size: .9rem; }
.button-wide { width: 100%; justify-content: center; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.section { margin-top: clamp(24px, 4vw, 52px); }
.section-header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; margin-bottom: 16px; }
.section-header p { margin-bottom: 0; max-width: 68ch; }

.feature-card { min-height: 190px; }
.feature-card .feature-icon { font-size: 2rem; margin-bottom: 12px; }
.figure-card { padding: 0; overflow: hidden; }
.figure-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.figure-card figcaption { padding: 12px 16px; color: var(--ink-soft); font-size: .9rem; }

.route-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.route-title h1 { font-size: clamp(2rem, 4vw, 3.4rem); margin-bottom: 8px; }
.route-title p { color: var(--ink-soft); margin-bottom: 0; }

.auth-layout, .creation-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.auth-visual, .creation-visual { overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-visual img, .creation-visual img { width: 100%; height: 100%; min-height: 520px; object-fit: cover; }

.form-grid { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
label { display: grid; gap: 6px; font-weight: 700; }
label > span { font-size: .92rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(255,255,255,.58);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(185,135,67,.3); border-color: var(--gold-dark); }
.field-help { color: var(--ink-soft); font-size: .8rem; font-weight: 400; }
.field-error { color: #8b1f17; font-size: .82rem; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.choice-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 130px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.38);
  cursor: pointer;
}
.choice-card:hover { border-color: var(--gold-dark); box-shadow: var(--shadow-soft); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card.is-selected { border: 2px solid var(--red); background: rgba(185,135,67,.17); }
.choice-symbol { font-size: 2rem; }
.choice-card small { color: var(--ink-soft); }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 22px; }
.step-pill { padding: 8px; border-radius: 10px; background: rgba(76,57,39,.08); text-align: center; font-size: .8rem; }
.step-pill.is-active { background: var(--ink); color: #fff2d6; }
.step-pill.is-done { background: rgba(75,101,72,.18); color: #314a2f; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.summary-list { display: grid; grid-template-columns: minmax(120px, .35fr) 1fr; gap: 8px 16px; }
.summary-list dt { font-weight: 700; color: var(--ink-soft); }
.summary-list dd { margin: 0; }

.player-strip {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(4, minmax(90px, .7fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat-chip { padding: 11px 13px; border-radius: 12px; background: rgba(248,239,215,.82); border: 1px solid var(--line); }
.stat-chip strong { display: block; }
.stat-chip small { color: var(--ink-soft); }
.meter { height: 7px; margin-top: 7px; border-radius: 999px; overflow: hidden; background: rgba(76,57,39,.13); }
.meter > span { display: block; height: 100%; width: var(--value, 0%); background: linear-gradient(90deg, var(--red), var(--gold)); }

.command-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 18px; align-items: start; }
.map-panel { min-width: 0; }
.map-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.map-scroll { overflow: auto; padding: 28px 10px 10px 28px; border: 1px solid var(--line); border-radius: 14px; background: rgba(66,52,39,.08); }
.game-map {
  --cell: clamp(25px, 3.2vw, 43px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(20, var(--cell));
  grid-template-rows: repeat(20, var(--cell));
  width: max-content;
  min-width: 100%;
}
.map-cell {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  border: 1px solid rgba(56,43,29,.13);
  padding: 0;
  background: #d8c29a;
  cursor: pointer;
  font-size: clamp(.68rem, 1vw, .9rem);
}
.map-cell:hover { filter: brightness(1.08); z-index: 2; }
.map-cell:focus-visible { z-index: 3; outline: 3px solid #242018; outline-offset: -3px; }
.map-cell.is-selected { z-index: 4; outline: 3px solid #8e2f1f; outline-offset: -3px; }
.map-cell.is-player { z-index: 5; box-shadow: inset 0 0 0 3px #fff6d8, 0 0 0 3px #aa7d34; }
.map-cell.is-adjacent::after { content: ""; position: absolute; inset: 3px; border: 1px dashed rgba(60,84,55,.9); border-radius: 3px; }
.map-cell.terrain-sand { background: #d7bf8c; }
.map-cell.terrain-path { background: #c8ad7a; }
.map-cell.terrain-water { background: #94b8c1; }
.map-cell.terrain-forest { background: #8ea27b; }
.map-cell.terrain-ruin { background: #a99b83; }
.map-cell.terrain-wind { background: #c8cfb5; }
.map-cell.terrain-blocked { background: #756d61; color: #f0dfbd; }
.map-cell.terrain-arena { background: #c58d69; }
.map-cell.terrain-camp { background: #e0c770; }
.map-coord-x, .map-coord-y { position: absolute; color: var(--ink-soft); font-size: .7rem; pointer-events: none; }
.map-coord-x { top: -22px; }
.map-coord-y { left: -22px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; color: var(--ink-soft); font-size: .78rem; }

.action-panel { position: sticky; top: calc(var(--header-h) + 18px); }
.action-panel h2 { font-size: 1.5rem; }
.action-buttons { display: grid; gap: 9px; }
.action-explanation { min-height: 78px; padding: 12px; border-radius: 10px; background: rgba(76,57,39,.07); color: var(--ink-soft); }
.active-action { margin-bottom: 14px; padding: 14px; border: 1px solid rgba(142,47,31,.3); border-radius: 12px; background: rgba(142,47,31,.08); }
.timer-line { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.timer-progress { height: 9px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgba(76,57,39,.14); }
.timer-progress span { display: block; height: 100%; width: var(--progress, 0%); background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .3s linear; }

.quest-card { border-left: 4px solid var(--gold); }
.quest-card.is-complete { border-left-color: var(--green); opacity: .88; }
.objective-list { display: grid; gap: 8px; margin: 14px 0; padding: 0; list-style: none; }
.objective { display: flex; gap: 9px; align-items: flex-start; }
.objective .check { width: 22px; height: 22px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--line-strong); }
.objective.is-done .check { background: var(--green); color: white; border-color: var(--green); }

.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.item-card { position: relative; min-height: 150px; }
.item-icon { font-size: 2rem; margin-bottom: 8px; }
.item-qty { position: absolute; top: 10px; right: 10px; min-width: 28px; padding: 2px 7px; border-radius: 999px; background: var(--ink); color: white; text-align: center; }
.rarity-common { border-top: 3px solid #8b7c67; }
.rarity-uncommon { border-top: 3px solid #5e7e58; }
.rarity-rare { border-top: 3px solid #4d6f86; }
.rarity-quest { border-top: 3px solid #a7782f; }
.new-pulse { animation: pulse 1.2s ease 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(185,135,67,.22); } }

.log-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.log-entry { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-entry:last-child { border-bottom: 0; }
.log-time { color: var(--ink-soft); font-size: .8rem; }
.log-entry.success { border-left: 3px solid var(--green); padding-left: 10px; }
.log-entry.error { border-left: 3px solid var(--red); padding-left: 10px; }
.log-entry.info { border-left: 3px solid var(--blue); padding-left: 10px; }

.trophy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.trophy-card { text-align: center; }
.trophy-card.is-locked { filter: grayscale(1); opacity: .5; }
.trophy-icon { font-size: 2.3rem; }

.tutorial-shell { display: grid; grid-template-columns: minmax(280px,.8fr) minmax(0,1.2fr); gap: 20px; align-items: start; }
.tutorial-visual { overflow: hidden; border-radius: var(--radius); }
.tutorial-visual img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.dialogue { position: relative; padding: 22px; border-radius: 18px; background: #fff7e4; border: 1px solid var(--line-strong); }
.dialogue::before { content: ""; position: absolute; left: -12px; top: 34px; width: 22px; height: 22px; background: #fff7e4; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); transform: rotate(45deg); }

.empty-state { padding: 30px; border: 1px dashed var(--line-strong); border-radius: 14px; text-align: center; color: var(--ink-soft); }
.notice { padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(77,111,134,.35); background: rgba(77,111,134,.1); }
.notice-warning { border-color: rgba(182,91,46,.42); background: rgba(182,91,46,.1); }
.notice-success { border-color: rgba(75,101,72,.4); background: rgba(75,101,72,.1); }

.toast-region { position: fixed; right: 18px; bottom: calc(18px + var(--safe-bottom)); z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 14px; border-radius: 13px; color: white; background: rgba(44,36,29,.97); box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast.success { border-left: 5px solid #7aa16e; }
.toast.error { border-left: 5px solid #c35743; }
.toast.info { border-left: 5px solid #6c93ac; }
.toast button { appearance: none; border: 0; background: transparent; color: white; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.modal-root:empty { display: none; }
.modal-root { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 18px; background: rgba(30,24,19,.66); backdrop-filter: blur(4px); }
.modal { width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 24px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.mobile-bottom-nav { display: none; }
.loading-state { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink-soft); }
.spinner { width: 25px; height: 25px; border: 3px solid rgba(76,57,39,.15); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 48px; height: 28px; }
.switch input { opacity: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #9b8b76; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

@media (max-width: 1020px) {
  :root { --sidebar-w: 250px; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-visual { min-height: 420px; }
  .command-grid { grid-template-columns: 1fr; }
  .action-panel { position: static; }
  .player-strip { grid-template-columns: repeat(3, 1fr); }
  .player-strip .stat-chip:first-child { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  :root { --header-h: 64px; }
  body { padding-bottom: calc(70px + var(--safe-bottom)); }
  .site-header { height: var(--header-h); grid-template-columns: auto minmax(100px, 1fr) auto; padding: 7px 10px; }
  .mobile-only { display: inline-grid; }
  .brand { width: 138px; height: 49px; }
  .header-status, #music-toggle { display: none; }
  .header-actions .button { padding: 8px 10px; font-size: .82rem; }
  .app-layout { display: block; }
  .sidebar {
    position: fixed;
    inset: var(--header-h) auto 0 0;
    z-index: 120;
    width: min(86vw, 320px);
    height: auto;
    transform: translateX(-105%);
    transition: transform .23s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }
  main { padding: 14px; }
  .hero-card { min-height: auto; }
  .hero-copy { padding: 24px 20px; }
  .hero-visual { min-height: 320px; }
  .grid-2, .grid-3, .grid-4, .auth-layout, .creation-layout, .tutorial-shell { grid-template-columns: 1fr; }
  .auth-visual img, .creation-visual img { min-height: 330px; }
  .dialogue::before { display: none; }
  .route-title { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(5, minmax(70px,1fr)); overflow-x: auto; padding-bottom: 5px; }
  .player-strip { grid-template-columns: repeat(2, 1fr); }
  .game-map { --cell: 34px; }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: calc(62px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(44,36,29,.98);
    border-top: 1px solid rgba(185,135,67,.55);
  }
  .mobile-bottom-nav button { appearance: none; border: 0; background: transparent; color: #ddcfb2; display: grid; place-items: center; align-content: center; gap: 2px; font-size: .68rem; cursor: pointer; }
  .mobile-bottom-nav button span:first-child { font-size: 1.15rem; }
  .mobile-bottom-nav button.is-active { color: white; background: rgba(185,135,67,.17); }
  .toast-region { bottom: calc(78px + var(--safe-bottom)); }
}

@media (max-width: 480px) {
  h1 { font-size: 2.25rem; }
  .button-row { display: grid; }
  .button-row .button { width: 100%; }
  .player-strip { grid-template-columns: 1fr 1fr; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .summary-list { grid-template-columns: 1fr; }
  .summary-list dt { margin-top: 6px; }
  .map-scroll { padding-left: 25px; }
}

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

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