:root {
  --bg: #f4f1e8;
  --bg-strong: #e8e1d2;
  --surface: #fffdf7;
  --surface-2: #f7f3ea;
  --ink: #18211d;
  --muted: #69736c;
  --line: #d9d0bd;
  --forest: #173b2f;
  --forest-2: #255d49;
  --amber: #d98b2b;
  --amber-2: #f0b35f;
  --blue: #316f9f;
  --danger: #a33c2f;
  --ok: #2f7a55;
  --shadow: 0 18px 45px rgba(32, 37, 30, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
}

body {
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.home-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(23, 59, 47, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(217, 139, 43, 0.12), transparent 48%),
    var(--bg);
}

.entry-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.entry-main {
  width: min(980px, 100%);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
}

.brand-lockup.compact {
  margin-bottom: 24px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--forest);
  color: #fff9e8;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
  box-shadow: none;
}

.overline {
  margin: 0 0 6px;
  color: var(--forest-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.entry-main h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.02;
}

.entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.entry-tile {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.entry-tile:hover {
  transform: translateY(-3px);
  border-color: var(--forest-2);
}

.entry-tile strong {
  font-size: 1.7rem;
}

.entry-tile span:last-child {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.5;
}

.tile-icon,
.icon-btn svg,
.ghost-btn svg {
  width: 26px;
  height: 26px;
}

.tile-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--forest);
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Neue Hauptseite: dunkler Sternenhimmel wie die alte Referenz, aber edler und tiefer. */
.home-page {
  --home-space: #080a18;
  --home-space-2: #101733;
  --home-glow: #76a6ff;
  --home-cyan: #56d8ff;
  --home-amber: #f0b35f;
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
  color: #f4f7ff;
  background:
    radial-gradient(circle at 50% 34%, rgba(88, 128, 255, .24), transparent 16%),
    radial-gradient(circle at 78% 18%, rgba(86, 216, 255, .12), transparent 22%),
    radial-gradient(circle at 16% 78%, rgba(240, 179, 95, .08), transparent 22%),
    linear-gradient(180deg, #080a18 0%, #0a0c1d 46%, #070914 100%);
}

.home-page::before,
.home-page::after,
.entry-shell::before,
.entry-shell::after {
  content: "";
  position: fixed;
  pointer-events: none;
}

.home-page::before {
  inset: 0;
  z-index: -4;
  background:
    radial-gradient(circle, rgba(255,255,255,.88) 0 1px, transparent 1.5px) 6% 18% / 142px 118px,
    radial-gradient(circle, rgba(210,226,255,.72) 0 1px, transparent 1.6px) 42% 10% / 188px 154px,
    radial-gradient(circle, rgba(255,255,255,.55) 0 1px, transparent 1.5px) 71% 32% / 132px 166px,
    radial-gradient(circle, rgba(118,166,255,.7) 0 1.2px, transparent 1.8px) 20% 64% / 210px 180px,
    radial-gradient(circle, rgba(255,255,255,.42) 0 1px, transparent 1.6px) 86% 72% / 170px 136px;
  opacity: .78;
  animation: pfp-home-stars 26s linear infinite;
}

.home-page::after {
  width: min(720px, 72vw);
  height: min(250px, 25vw);
  left: 50%;
  top: 44%;
  z-index: -3;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-7deg);
  background:
    radial-gradient(ellipse at center, rgba(99, 174, 255, .88) 0 5%, rgba(44, 82, 211, .72) 6% 21%, rgba(18, 26, 80, .7) 22% 35%, transparent 36%),
    radial-gradient(ellipse at center, transparent 0 54%, rgba(132, 184, 255, .96) 55% 57%, rgba(26, 70, 214, .78) 58% 61%, transparent 62%);
  box-shadow:
    0 0 42px rgba(91, 145, 255, .7),
    0 0 110px rgba(72, 114, 255, .42),
    inset 0 0 46px rgba(255,255,255,.28);
  filter: saturate(1.15);
  opacity: .82;
}

.entry-shell {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 23%),
    radial-gradient(ellipse at 50% 100%, rgba(45, 93, 118, .18), transparent 46%);
}

.entry-shell::before {
  left: 50%;
  top: 47%;
  z-index: -2;
  width: min(860px, 88vw);
  height: min(250px, 27vw);
  border: 1px solid rgba(124, 159, 245, .55);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  box-shadow:
    0 0 24px rgba(124,159,245,.48),
    inset 0 0 22px rgba(124,159,245,.24);
  opacity: .72;
}

.entry-shell::after {
  inset: auto 0 0 0;
  z-index: -1;
  height: 38%;
  background:
    linear-gradient(rgba(86,216,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86,216,255,.07) 1px, transparent 1px),
    linear-gradient(180deg, transparent, rgba(6, 10, 22, .72));
  background-size: 46px 46px;
  mask-image: linear-gradient(transparent, #000 36%);
  transform: perspective(900px) rotateX(64deg) translateY(42%);
  transform-origin: 50% 100%;
}

.home-page .entry-main {
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
}

.home-page .brand-lockup {
  color: #f4f7ff;
  text-shadow: 0 12px 42px rgba(0,0,0,.42);
}

.home-page .brand-mark {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.36), transparent 26%),
    linear-gradient(145deg, #8fb3ff, #4e6ef2 58%, #273177);
  color: #fff;
  border: 1px solid rgba(190, 211, 255, .58);
  box-shadow:
    0 18px 42px rgba(35, 72, 189, .38),
    0 0 28px rgba(124,159,245,.34);
}

.home-page .overline {
  color: #9dbbff;
}

.home-page .entry-main h1 {
  max-width: 820px;
  color: #f7f9ff;
  text-shadow:
    0 2px 0 rgba(255,255,255,.05),
    0 24px 64px rgba(0,0,0,.46);
}

.home-page .entry-actions {
  perspective: 1300px;
}

.home-page .entry-tile {
  position: relative;
  overflow: hidden;
  color: #f7f9ff;
  background:
    linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.045)),
    rgba(13, 18, 38, .76);
  border-color: rgba(146, 176, 255, .24);
  box-shadow:
    0 28px 80px rgba(0,0,0,.44),
    0 0 0 1px rgba(255,255,255,.055) inset,
    0 -1px 0 rgba(255,255,255,.13) inset;
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  transform: rotateX(4deg) rotateY(-2deg) translateZ(0);
  transform-style: preserve-3d;
}

.home-page .entry-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 12%, rgba(255,255,255,.22), transparent 22%),
    linear-gradient(120deg, transparent 0 42%, rgba(118,166,255,.16) 43% 47%, transparent 48%);
  opacity: .9;
  pointer-events: none;
}

.home-page .entry-tile::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, var(--home-glow), var(--home-cyan), transparent);
  opacity: .85;
  box-shadow: 0 0 26px rgba(86,216,255,.45);
}

.home-page .entry-tile:hover {
  transform: rotateX(2deg) rotateY(1deg) translateY(-8px) translateZ(22px);
  border-color: rgba(157, 187, 255, .7);
  box-shadow:
    0 36px 94px rgba(0,0,0,.5),
    0 0 44px rgba(96, 143, 255, .22),
    0 0 0 1px rgba(255,255,255,.08) inset;
}

.home-page .entry-tile strong,
.home-page .entry-tile span,
.home-page .entry-tile .tile-icon {
  position: relative;
  z-index: 1;
}

.home-page .entry-tile span:last-child {
  color: rgba(231, 238, 255, .74);
}

.home-page .tile-icon {
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.28), transparent 28%),
    rgba(124,159,245,.14);
  color: #b9d1ff;
  border: 1px solid rgba(185,209,255,.32);
  box-shadow: 0 14px 28px rgba(0,0,0,.28);
}

.home-page .builder-tile {
  --home-glow: #8fb3ff;
  --home-cyan: #56d8ff;
}

.home-page .player-tile {
  --home-glow: #74f0b3;
  --home-cyan: #9dbbff;
  transform: rotateX(4deg) rotateY(2deg) translateZ(0);
}

.home-page .tts-tile {
  --home-glow: #f0b35f;
  --home-cyan: #8fb3ff;
}

.home-page .trophy-tile {
  --home-glow: #f1bd61;
  --home-cyan: #76d59b;
  transform: rotateX(4deg) rotateY(-2deg) translateZ(0);
}

@keyframes pfp-home-stars {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-48px, 32px, 0); }
}

@media (max-width: 760px) {
  .home-page::after {
    top: 31%;
    width: 94vw;
    height: 34vw;
  }

  .entry-shell::before {
    top: 31%;
    width: 112vw;
    height: 36vw;
  }

  .home-page .brand-lockup {
    align-items: flex-start;
  }

  .home-page .entry-actions {
    grid-template-columns: 1fr;
  }

  .home-page .entry-tile,
  .home-page .player-tile {
    min-height: 210px;
    transform: none;
  }

  .home-page .entry-tile:hover {
    transform: translateY(-5px);
  }
}

.app-page {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: 2.1rem;
}

.field,
.field-row {
  display: grid;
  gap: 7px;
}

.field {
  margin-bottom: 14px;
}

.field span,
.field-row span,
.section-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(37, 93, 73, 0.14);
}

.primary-btn,
.ghost-btn,
.icon-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.primary-btn {
  background: var(--forest);
  color: #fff9e8;
}

.primary-btn:hover {
  background: var(--forest-2);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary-btn:disabled {
  background: #7f8a82;
}

.ghost-btn,
.icon-btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--forest-2);
}

.ghost-btn.small,
.icon-btn.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.icon-btn.wide {
  width: 100%;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.form-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.danger {
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--forest);
  color: #fff9e8;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 900;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.sidebar-section {
  display: grid;
  gap: 10px;
}

.sidebar .section-label {
  color: rgba(255, 249, 232, 0.62);
}

.adventure-list {
  display: grid;
  gap: 8px;
}

.adventure-list button,
.published-list button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
}

.sidebar .adventure-list button {
  background: rgba(255, 249, 232, 0.1);
  border-color: rgba(255, 249, 232, 0.18);
  color: #fff9e8;
}

.sidebar .adventure-list button .list-meta {
  color: rgba(255, 249, 232, 0.68);
}

.adventure-list button.is-active,
.published-list button:hover {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(37, 93, 73, 0.12);
}

.sidebar .adventure-list button.is-active {
  border-color: rgba(255, 249, 232, 0.65);
  background: rgba(255, 249, 232, 0.18);
  box-shadow: none;
}

.list-title {
  display: block;
  margin-bottom: 5px;
  font-weight: 900;
}

.list-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: auto;
}

.nav-item {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255, 249, 232, 0.76);
  padding: 0 12px;
  text-align: left;
  font-weight: 800;
}

.nav-item.is-active,
.nav-item:hover {
  background: rgba(255, 249, 232, 0.14);
  color: #fff9e8;
}

.builder-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 232, 0.88);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.15;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 440px);
  gap: 18px;
  padding: 18px;
}

.map-panel,
.inspector,
.player-panel,
.task-card,
.inventory-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-panel {
  min-height: 620px;
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  overflow: hidden;
}

.map-toolbar,
.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.map-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.map-canvas {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background:
    linear-gradient(rgba(23, 59, 47, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 59, 47, 0.12) 1px, transparent 1px),
    #dfe8db;
  background-size: 48px 48px;
}

.map-canvas.real-map {
  min-height: 520px;
  background: #dfe8db;
  isolation: isolate;
}

.map-canvas.real-map::before {
  display: none;
}

.leaflet-container {
  font: inherit;
}

.leaflet-control-attribution {
  font-size: 0.68rem;
}

.zone-map-label {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--forest);
  font-weight: 900;
  text-shadow: 0 1px 0 #fff;
}

.start-marker {
  min-width: 48px;
  border-radius: 999px;
  background: var(--forest);
  color: #fff9e8;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 18px rgba(23, 59, 47, 0.3);
}

.map-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 32% 38%, rgba(49, 111, 159, 0.18), transparent 20%),
    linear-gradient(120deg, transparent 42%, rgba(23, 59, 47, 0.14) 42%, rgba(23, 59, 47, 0.14) 45%, transparent 45%);
  pointer-events: none;
}

.start-pin,
.zone-dot {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
}

.start-pin {
  left: 50%;
  top: 50%;
  min-width: 56px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--forest);
  color: #fff9e8;
  font-size: 0.74rem;
  font-weight: 900;
}

.zone-dot {
  display: grid;
  place-items: center;
  border: 2px solid rgba(23, 59, 47, 0.65);
  background: rgba(217, 139, 43, 0.22);
  color: var(--forest);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  padding: 8px;
}

.zone-dot.is-active {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(217, 139, 43, 0.2);
}

.map-hint {
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.inspector {
  min-height: 620px;
  overflow: auto;
}

.save-state {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

#inspector-content {
  padding: 16px;
}

.panel-stack {
  display: grid;
  gap: 16px;
}

.panel-card {
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.panel-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.compact-row button {
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.compact-row.is-active {
  border-color: var(--forest-2);
  background: #eef5eb;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e6efe7;
  color: var(--forest);
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.badge.amber {
  background: #fff2da;
  color: #92580f;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 50;
  transform: translateX(-50%) translateY(18px);
  max-width: min(460px, calc(100vw - 24px));
  border-radius: var(--radius-sm);
  background: var(--forest);
  color: #fff9e8;
  padding: 12px 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.player-page {
  background:
    linear-gradient(180deg, #173b2f 0 260px, var(--bg) 260px),
    var(--bg);
}

.player-shell {
  width: min(540px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.player-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff9e8;
}

.player-header .brand-mark {
  background: #fff9e8;
  color: var(--forest);
}

.player-header .ghost-btn {
  background: rgba(255, 249, 232, 0.12);
  color: #fff9e8;
  border-color: rgba(255, 249, 232, 0.35);
}

.player-panel,
.task-card,
.inventory-panel,
.player-map-panel,
.dialogue-stage {
  margin-top: 14px;
  padding: 18px;
}

.player-panel h1,
.task-card h1,
.finish-screen h1 {
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  line-height: 1.05;
}

.published-list {
  display: grid;
  gap: 10px;
}

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

.status-pill {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: #e6efe7;
  color: var(--forest);
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
}

.status-pill.amber {
  background: #fff2da;
  color: #8c520c;
}

.task-card {
  margin-top: 10px;
}

.zone-banner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.task-card h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.task-card p {
  color: var(--muted);
  line-height: 1.55;
}

.answer-area {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.player-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.player-map-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.player-map-panel h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.player-map {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #dfe8db;
}

.dialogue-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialogue-preview-shell {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.dialogue-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  padding: 16px;
}

.dialogue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dialogue-speaker {
  font-weight: 900;
}

.dialogue-kind {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialogue-text {
  margin: 0;
  color: inherit;
  line-height: 1.55;
}

.dialogue-radio {
  background:
    linear-gradient(135deg, #1d2320, #0e1412),
    #141b18;
  color: #d7f8d9;
  border: 1px solid #2d3a34;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.dialogue-radio::before {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 74px;
  height: 28px;
  border-radius: 18px;
  background: repeating-linear-gradient(90deg, #27352f 0 4px, #111917 4px 8px);
  opacity: 0.55;
}

.dialogue-radio .dialogue-kind {
  background: #d7f8d9;
  color: #0e1412;
}

.dialogue-sms {
  background: #eef4f1;
  color: #15211c;
}

.dialogue-sms .dialogue-text {
  display: inline-block;
  max-width: 88%;
  border-radius: 18px 18px 18px 4px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: 0 8px 18px rgba(20, 35, 28, 0.12);
}

.dialogue-sms .dialogue-kind {
  background: #dcebe5;
  color: var(--forest);
}

.dialogue-mission {
  background:
    linear-gradient(0deg, rgba(23, 59, 47, 0.08), rgba(23, 59, 47, 0.08)),
    #f6f1de;
  color: #1b211c;
  border: 1px solid #a99466;
}

.dialogue-mission::after {
  content: "TOP SECRET";
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: rgba(163, 60, 47, 0.36);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  transform: rotate(-9deg);
}

.dialogue-mission .dialogue-kind {
  background: var(--danger);
  color: #fff9e8;
}

.dialogue-letter {
  transform-origin: top center;
  animation: unfoldLetter 780ms cubic-bezier(.2,.8,.2,1) both;
  background:
    radial-gradient(circle at 20% 18%, rgba(139, 82, 34, 0.12), transparent 25%),
    linear-gradient(135deg, #f3dfb4, #fff1c9 45%, #e3c184);
  color: #442b17;
  border: 1px solid #b88a49;
  font-family: Georgia, "Times New Roman", serif;
}

.dialogue-letter::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c7513b, #8f241b);
  transform: translateX(-50%);
  opacity: 0.18;
}

.dialogue-letter .dialogue-kind {
  background: #74401f;
  color: #fff1c9;
}

.dialogue-box {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), transparent 34%),
    linear-gradient(135deg, #744a22, #3f2816);
  color: #fff1c9;
  border: 1px solid #27170c;
}

.dialogue-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 38px;
  background: linear-gradient(90deg, transparent 0 46%, rgba(255, 217, 126, 0.4) 46% 54%, transparent 54%);
  border-bottom: 2px solid rgba(0,0,0,0.25);
}

.dialogue-box .dialogue-kind {
  background: #f0b35f;
  color: #3f2816;
}

.dialogue-anime {
  background:
    radial-gradient(circle at 88% 12%, rgba(49, 111, 159, 0.28), transparent 28%),
    linear-gradient(135deg, #fff, #eef7ff);
  color: #142236;
  border: 2px solid #18211d;
  box-shadow: 8px 8px 0 #18211d;
}

.dialogue-anime .dialogue-text {
  font-weight: 700;
}

.dialogue-anime .dialogue-kind {
  background: #316f9f;
  color: #fff;
}

.dialogue-cartoon {
  background: #fff;
  color: #121212;
  border: 3px solid #121212;
  box-shadow: 6px 6px 0 #f0b35f;
}

.dialogue-cartoon::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: -18px;
  width: 32px;
  height: 32px;
  background: #fff;
  border-right: 3px solid #121212;
  border-bottom: 3px solid #121212;
  transform: rotate(45deg);
}

.dialogue-cartoon .dialogue-kind {
  background: #f0b35f;
  color: #121212;
}

@keyframes unfoldLetter {
  0% {
    opacity: 0;
    transform: perspective(700px) rotateX(-76deg) scaleY(0.55);
  }
  72% {
    opacity: 1;
    transform: perspective(700px) rotateX(6deg) scaleY(1.02);
  }
  100% {
    opacity: 1;
    transform: perspective(700px) rotateX(0) scaleY(1);
  }
}

.inventory-panel {
  display: grid;
  gap: 14px;
}

.inventory-panel h2 {
  margin: 0;
  font-size: 1.15rem;
}

.inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 8px 11px;
  font-size: 0.84rem;
  font-weight: 800;
}

.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
}

.finish-screen {
  min-height: 360px;
  display: grid;
  align-content: center;
}

.tts-page {
  background:
    linear-gradient(180deg, #173b2f 0 220px, var(--bg) 220px),
    var(--bg);
}

.tts-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.tts-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff9e8;
}

.tts-header .brand-mark {
  background: #fff9e8;
  color: var(--forest);
}

.tts-header .ghost-btn {
  background: rgba(255, 249, 232, 0.12);
  color: #fff9e8;
  border-color: rgba(255, 249, 232, 0.35);
}

.tts-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  margin-top: 18px;
}

.tts-editor,
.tts-output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.tts-editor h1 {
  max-width: 680px;
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.04;
}

.tts-editor textarea {
  min-height: 220px;
  font-size: 1rem;
  line-height: 1.55;
}

.tts-counter {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.tts-range-field output {
  min-width: 34px;
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(49, 111, 159, 0.1);
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 900;
}

.tts-range-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.tts-range-row span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.tts-range-row input {
  width: 100%;
  accent-color: var(--forest-2);
}

.tts-output {
  display: grid;
  align-content: start;
  gap: 14px;
}

.tts-output h2 {
  margin: 0;
  font-size: 1.25rem;
}

.tts-status {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(49, 111, 159, 0.08), transparent),
    var(--surface-2);
  color: var(--forest);
  font-weight: 900;
  text-align: center;
}

.tts-output audio {
  width: 100%;
}

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

.tts-presets button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.tts-presets button:hover {
  border-color: var(--forest-2);
}

.immersive-4d {
  perspective: 1200px;
  background:
    linear-gradient(145deg, rgba(49, 111, 159, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(163, 60, 47, 0.08), transparent 44%),
    var(--bg);
}

.immersive-4d .map-panel,
.immersive-4d .inspector,
.immersive-4d .player-panel,
.immersive-4d .device-shell,
.immersive-4d .tts-editor,
.immersive-4d .tts-output {
  box-shadow:
    0 22px 55px rgba(12, 19, 16, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.immersive-4d .dialogue-card {
  transform: translateZ(0);
  box-shadow:
    0 18px 34px rgba(18, 24, 22, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.ghost-btn.is-active,
.icon-btn.is-active {
  border-color: var(--amber);
  background: #fff2da;
  color: #6b410b;
  box-shadow: 0 0 0 3px rgba(217, 139, 43, 0.18);
}

.builder-page .map-panel {
  grid-template-rows: auto minmax(520px, 1fr) auto;
}

.builder-page .map-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
}

.address-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
  gap: 8px;
}

.address-search .primary-btn.small {
  min-height: 40px;
}

.map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.address-results {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
}

.address-results button {
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.address-results button:hover {
  background: #eaf2f6;
}

.address-results small,
.address-loading {
  color: var(--muted);
  font-size: 0.76rem;
}

.polygon-vertex-label {
  border: 0;
  border-radius: 999px;
  background: var(--forest);
  color: #fff9e8;
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(23, 59, 47, 0.24);
}

.player-page {
  background:
    linear-gradient(180deg, #0d1714 0 310px, transparent 310px),
    linear-gradient(135deg, rgba(49, 111, 159, 0.18), transparent 42%),
    var(--bg);
}

.player-shell {
  width: min(760px, 100%);
}

.wherigo-device {
  margin-top: 14px;
}

.device-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 232, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(145deg, #1d2a25, #09110f 58%, #22352f);
  color: #fff9e8;
  padding: 16px;
  transform-style: preserve-3d;
}

.device-shell::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  pointer-events: none;
}

.device-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 310px);
  gap: 12px;
  align-items: start;
}

.device-top h1 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2.45rem);
  line-height: 1.06;
}

.device-top .overline {
  color: #91d7bd;
}

.device-top .status-strip {
  margin: 0;
}

.player-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 12px;
}

.player-tab {
  min-height: 42px;
  border: 1px solid rgba(255, 249, 232, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 249, 232, 0.08);
  color: rgba(255, 249, 232, 0.76);
  font-size: 0.78rem;
  font-weight: 900;
}

.player-tab.is-active {
  background: #fff9e8;
  color: var(--forest);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.device-screen {
  position: relative;
  z-index: 1;
  min-height: 540px;
  border: 1px solid rgba(22, 37, 31, 0.78);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 243, 234, 0.94)),
    var(--surface);
  color: var(--ink);
  padding: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.72),
    inset 0 18px 40px rgba(49, 111, 159, 0.08);
}

.player-view {
  display: none;
}

.player-view.is-active {
  display: grid;
  gap: 12px;
}

.player-view .task-card,
.player-view .player-map-panel,
.player-view .inventory-panel,
.player-view .dialogue-stage,
.log-panel {
  margin-top: 0;
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: none;
}

.player-view .dialogue-stage {
  padding: 12px;
}

.player-view .task-card {
  padding: 16px;
}

.player-view .task-card h2 {
  font-size: 1.45rem;
}

.player-map {
  height: 390px;
}

.log-panel {
  border: 1px solid var(--line);
  padding: 18px;
}

.player-log {
  display: grid;
  gap: 8px;
}

.log-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.log-row > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff9e8;
  font-weight: 900;
}

.log-row strong,
.log-row small {
  display: block;
}

.log-row small {
  color: var(--muted);
  margin-top: 2px;
}

.log-row.is-active {
  border-color: var(--amber);
  background: #fff7e8;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 0;
  }

  .nav-item {
    text-align: center;
    padding: 0 8px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .tts-workspace {
    grid-template-columns: 1fr;
  }

  .address-search,
  .device-top {
    grid-template-columns: 1fr;
  }

  .inspector {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .entry-shell {
    padding: 18px;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }

  .entry-tile {
    min-height: 190px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
  }

  .toolbar,
  .toolbar > * {
    width: 100%;
  }

  .workspace {
    padding: 10px;
  }

  .map-panel,
  .inspector {
    min-height: 520px;
  }

  .split-fields,
  .status-strip,
  .player-actions {
    grid-template-columns: 1fr;
  }

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

  .player-shell {
    padding: 8px;
  }

  .device-shell {
    border-radius: 12px;
    padding: 10px;
  }

  .device-screen {
    min-height: 500px;
    padding: 10px;
  }

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

  .player-map {
    height: 310px;
  }
}

/* Alpine homepage v20260822 */
.home-page {
  color: #f5f2e8;
  background: #0d1411;
}

.home-page::before,
.home-page::after,
.home-page .entry-shell::before,
.home-page .entry-shell::after {
  content: none;
}

.home-page .entry-shell {
  position: relative;
  min-height: 520px;
  height: min(860px, calc(100svh - 64px));
  display: block;
  overflow: hidden;
  padding: 0;
  color: #fffdf4;
  background:
    linear-gradient(180deg, rgba(5, 9, 7, .55) 0%, rgba(5, 9, 7, .08) 34%, rgba(5, 9, 7, .24) 68%, rgba(5, 9, 7, .72) 100%),
    linear-gradient(90deg, rgba(5, 9, 7, .34), transparent 45%, rgba(5, 9, 7, .12)),
    url('/pfadfinderplus/assets/home-hero-alpine-v2.webp') center center / cover no-repeat;
}

.hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(28px, calc((100% - 1320px) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, .13);
  background: rgba(8, 14, 11, .58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fffdf4;
  font-size: 1rem;
  font-weight: 800;
}

.home-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 207, 139, .78);
  border-radius: 6px;
  color: #f0cf8b;
  background: rgba(19, 33, 25, .86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.hero-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-nav-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(255, 253, 244, .86);
  font-weight: 700;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.hero-nav-links a:hover,
.hero-nav-links a:focus-visible {
  color: #fff;
  border-color: rgba(240, 207, 139, .45);
  background: rgba(16, 29, 22, .66);
}

.home-page .entry-main {
  position: relative;
  z-index: 2;
  width: min(900px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 0 72px;
  text-align: center;
  transform: none;
}

.hero-kicker {
  margin: 0 0 14px;
  color: #f0cf8b;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .8);
}

.home-page .entry-main h1 {
  max-width: none;
  margin: 0;
  color: #fffdf4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 76px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 4px 4px rgba(0, 0, 0, .54), 0 18px 46px rgba(0, 0, 0, .56);
}

.home-page .entry-main h1 span {
  color: #f0cf8b;
}

.hero-lead {
  max-width: 660px;
  margin: 20px 0 34px;
  color: rgba(255, 253, 244, .9);
  font-size: 1.12rem;
  line-height: 1.55;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .82);
}

.home-page .entry-actions {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  perspective: none;
}

.home-page .entry-tile,
.home-page .player-tile,
.home-page .map-tile {
  min-height: 88px;
  display: grid;
  grid-template-columns: 52px 1fr 30px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 2px solid rgba(240, 207, 139, .72);
  border-radius: 6px;
  color: #fffdf4;
  text-align: left;
  background: rgba(15, 27, 20, .82);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(255, 255, 255, .07);
  transform: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.home-page .entry-tile::before,
.home-page .entry-tile::after {
  content: none;
}

.home-page .entry-tile:hover,
.home-page .entry-tile:focus-visible {
  border-color: #f6dc9d;
  background: rgba(24, 43, 31, .94);
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(0, 0, 0, .44), inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.home-page .entry-tile .tile-icon {
  position: static;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(240, 207, 139, .5);
  border-radius: 6px;
  color: #f0cf8b;
  background: rgba(7, 13, 10, .44);
  box-shadow: none;
}

.home-page .entry-tile .tile-icon svg {
  width: 28px;
  height: 28px;
}

.home-page .entry-tile strong {
  position: static;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.home-page .entry-tile .entry-arrow,
.home-page .entry-tile span:last-child {
  position: static;
  color: #f0cf8b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.hero-next {
  position: absolute;
  left: 50%;
  bottom: 20px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: rgba(255, 253, 244, .86);
  font-size: .82rem;
  font-weight: 800;
  transform: translateX(-50%);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
}

.hero-next span {
  color: #f0cf8b;
  font-size: 1.15rem;
}

.improvements-section,
.adventure-map-section {
  scroll-margin-top: 16px;
}

@media (max-width: 760px) {
  .home-page .entry-shell {
    min-height: 560px;
    height: calc(100svh - 48px);
    max-height: 760px;
    background-position: 36% center;
  }

  .hero-nav {
    min-height: 62px;
    padding: 10px 14px;
  }

  .home-brand {
    font-size: .9rem;
  }

  .home-brand-mark {
    width: 40px;
    height: 40px;
  }

  .hero-nav-links {
    display: none;
  }

  .home-page .entry-main {
    width: min(100% - 28px, 520px);
    justify-content: flex-end;
    padding: 80px 0 64px;
  }

  .hero-kicker {
    margin-bottom: 10px;
    font-size: .7rem;
  }

  .home-page .entry-main h1 {
    font-size: 48px;
  }

  .hero-lead {
    max-width: 460px;
    margin: 14px 0 22px;
    font-size: .98rem;
    line-height: 1.45;
  }

  .home-page .entry-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-page .entry-tile,
  .home-page .player-tile,
  .home-page .map-tile {
    min-height: 68px;
    grid-template-columns: 42px 1fr 24px;
    gap: 12px;
    padding: 10px 14px;
    transform: none;
  }

  .home-page .entry-tile .tile-icon {
    width: 42px;
    height: 42px;
  }

  .home-page .entry-tile .tile-icon svg {
    width: 23px;
    height: 23px;
  }

  .home-page .entry-tile strong {
    font-size: 1.25rem;
  }

  .hero-next {
    bottom: 10px;
    white-space: nowrap;
  }
}

@media (max-width: 380px), (max-height: 650px) {
  .home-page .entry-shell {
    min-height: 520px;
  }

  .home-page .entry-main {
    padding-top: 70px;
    padding-bottom: 56px;
  }

  .home-page .entry-main h1 {
    font-size: 40px;
  }

  .hero-lead {
    margin: 10px 0 16px;
    font-size: .9rem;
  }

  .home-page .entry-tile,
  .home-page .player-tile,
  .home-page .map-tile {
    min-height: 60px;
  }

  .hero-next {
    font-size: .74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .entry-tile {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Reference-inspired Builder / Player skin */
.reference-login {
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 58, 237, 0.18), transparent 32%),
    radial-gradient(circle at 82% 86%, rgba(59, 130, 246, 0.16), transparent 34%),
    #0f1021;
  color: #ffffff;
}

.reference-login-card {
  width: min(420px, 100%);
  border-color: rgba(255, 255, 255, 0.1);
  background: #17182d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.login-logo {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
  font-size: 2.2rem;
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.32);
}

.login-brand {
  margin: 0;
  color: #ffffff;
  font-size: 1.85rem;
  line-height: 1.12;
}

.login-brand span,
.viewmode-logo {
  color: #a855f7;
}

.login-sub {
  margin: 10px 0 22px;
  color: rgba(255, 255, 255, 0.62);
}

.reference-login .field {
  text-align: left;
}

.reference-login .field span {
  color: rgba(255, 255, 255, 0.66);
}

.reference-login input {
  border-color: rgba(255, 255, 255, 0.14);
  background: #101125;
  color: #ffffff;
}

.reference-login input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

.reference-login .primary-btn,
.reference-player .primary-btn,
.reference-builder .primary-btn {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
}

.reference-login .primary-btn:hover,
.reference-player .primary-btn:hover,
.reference-builder .primary-btn:hover {
  background: linear-gradient(135deg, #6d28d9, #9333ea);
}

.login-step {
  display: grid;
  gap: 14px;
}

.login-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  border: 1px solid rgba(124, 159, 245, 0.25);
  border-radius: 8px;
  background: rgba(124, 159, 245, 0.1);
  padding: 10px 14px;
  text-align: left;
}

.login-actions {
  display: grid;
  grid-template-columns: auto 1fr;
}

.reference-builder {
  background: #101125;
}

.reference-builder .app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
  background: #101125;
}

.reference-builder .sidebar {
  min-height: auto;
  display: grid;
  grid-template-columns: auto auto minmax(230px, 340px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #17182d;
  color: #ffffff;
  padding: 12px 16px;
}

.reference-builder .brand-row .brand-mark {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
}

.reference-builder .sidebar-actions {
  min-width: 170px;
}

.reference-builder .sidebar-section {
  min-width: 0;
}

.reference-builder .sidebar .section-label {
  display: none;
}

.reference-builder .adventure-list {
  max-height: 62px;
  overflow: auto;
}

.reference-builder .sidebar .adventure-list button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 9px 10px;
}

.reference-builder .sidebar-nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(96px, 1fr));
  gap: 7px;
  margin-top: 0;
  overflow-x: auto;
}

.reference-builder .nav-item {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #22243b;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.reference-builder .nav-item.is-active,
.reference-builder .nav-item:hover {
  border-color: rgba(168, 85, 247, 0.8);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(168, 85, 247, 0.95));
  color: #ffffff;
}

.reference-builder .builder-main {
  background: #f3f5fb;
}

.reference-builder .topbar {
  background: #ffffff;
}

.reference-builder .topbar .overline,
.reference-builder .inspector .overline,
.reference-builder .map-hint {
  color: #6d28d9;
}

.reference-builder .map-panel,
.reference-builder .inspector,
.reference-builder .panel-card {
  border-color: #d8dbea;
  background: #ffffff;
}

.reference-builder .map-toolbar {
  background: #ffffff;
}

.reference-builder .ghost-btn.is-active,
.reference-builder .icon-btn.is-active {
  border-color: #8b5cf6;
  background: #f0ebff;
  color: #5b21b6;
}

.compact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-heading h2 {
  margin: 0;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.78rem;
  font-weight: 900;
}

.file-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.file-stats p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.flow-list {
  display: grid;
  gap: 10px;
}

.flow-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px;
}

.flow-step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #17182d;
  color: #ffffff;
  font-weight: 900;
}

.flow-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.link-button {
  border: 0;
  background: transparent;
  color: #5b21b6;
  padding: 0;
  font-weight: 900;
  text-align: left;
}

.reference-player {
  background: #0f1021;
}

.viewmode-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 20%, rgba(124, 58, 237, 0.2), transparent 30%),
    #0f1021;
  color: #ffffff;
  text-align: center;
}

.viewmode-logo {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
}

.viewmode-screen h1 {
  margin: 0;
  font-size: clamp(1.45rem, 6vw, 2rem);
}

.viewmode-screen p {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
}

.viewmode-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}

.viewmode-btn {
  min-width: 150px;
  min-height: 58px;
  border-radius: 12px;
  font-size: 1.05rem;
}

.reference-player .player-page,
.reference-player.player-page {
  background:
    linear-gradient(180deg, #0f1021 0 330px, #15172a 330px),
    #15172a;
}

.reference-player .player-header {
  color: #ffffff;
}

.reference-player .player-header .brand-mark {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
}

.reference-player .player-panel,
.reference-player .task-card,
.reference-player .inventory-panel,
.reference-player .player-map-panel,
.reference-player .dialogue-stage {
  border-color: rgba(255, 255, 255, 0.1);
  background: #20223a;
  color: #ffffff;
}

.reference-player .browse-panel {
  display: grid;
  gap: 14px;
}

.browse-topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
}

.browse-topbar h1 {
  margin: 0;
  font-size: clamp(1.5rem, 7vw, 2.25rem);
}

.player-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.player-search-bar input {
  border-color: rgba(255, 255, 255, 0.12);
  background: #111326;
  color: #ffffff;
}

.search-hint {
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
  line-height: 1.45;
}

.reference-player .published-list button {
  border-color: rgba(255, 255, 255, 0.1);
  background: #15172a;
  color: #ffffff;
}

.reference-player .published-list button:hover {
  border-color: rgba(168, 85, 247, 0.75);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
}

.reference-player .published-list .list-meta,
.reference-player .form-note,
.reference-player .task-card p,
.reference-player .log-row small {
  color: rgba(255, 255, 255, 0.62);
}

.reference-player .device-shell {
  background: linear-gradient(145deg, #20223a, #0f1021 62%, #2d1d47);
}

.reference-player .device-screen {
  background: #111326;
  color: #ffffff;
}

.reference-player .player-view .task-card,
.reference-player .player-view .player-map-panel,
.reference-player .player-view .inventory-panel,
.reference-player .player-view .dialogue-stage,
.reference-player .log-panel {
  background: #20223a;
  color: #ffffff;
}

.reference-player .zone-banner,
.reference-player .inventory-chip,
.reference-player .log-row {
  border-color: rgba(255, 255, 255, 0.1);
  background: #15172a;
  color: #ffffff;
}

@media (max-width: 1100px) {
  .reference-builder .sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .reference-builder .sidebar-actions,
  .reference-builder .sidebar-section {
    min-width: 0;
  }

  .reference-builder .sidebar-nav {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}

@media (max-width: 700px) {
  .reference-builder .sidebar {
    padding: 10px;
  }

  .reference-builder .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-search-bar,
  .file-stats {
    grid-template-columns: 1fr;
  }

  .viewmode-actions {
    width: min(330px, 100%);
  }

  .viewmode-btn {
    width: 100%;
  }
}

/* Homepage adventure map */
html {
  scroll-behavior: smooth;
}

.home-page .entry-shell {
  min-height: calc(100svh - 64px);
}

.home-page .map-tile {
  --home-glow: #f3c969;
  --home-cyan: #73e2ae;
  transform: rotateX(4deg) rotateY(2deg) translateZ(0);
  grid-column: 1 / -1;
  min-height: 220px;
}

.adventure-map-section {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 72px 32px 96px;
  color: #f5f8f2;
  background:
    linear-gradient(180deg, rgba(8, 10, 24, .2), rgba(7, 18, 16, .94) 18%),
    linear-gradient(110deg, #0b1c18, #10241d 48%, #111827);
  border-top: 1px solid rgba(115, 226, 174, .22);
  box-shadow: 0 -24px 80px rgba(0, 0, 0, .32);
}

.adventure-map-inner {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.adventure-map-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.adventure-map-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.adventure-map-section .overline {
  color: #82e8b7;
}

.adventure-map-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: #d8f7e7;
  border: 1px solid rgba(115, 226, 174, .32);
  border-radius: 6px;
  background: rgba(13, 47, 37, .76);
  font-size: .86rem;
  font-weight: 800;
}

.adventure-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  align-items: stretch;
}

.adventure-map-frame {
  position: relative;
  min-width: 0;
  min-height: 600px;
  overflow: hidden;
  border: 1px solid rgba(180, 216, 198, .3);
  border-radius: 8px;
  background: #15201b;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .38);
}

#adventure-map {
  width: 100%;
  height: 100%;
  min-height: 600px;
  background: #d8e5d0;
}

.adventure-map-status {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #dcebe3;
  background: rgba(9, 25, 20, .9);
  font-weight: 750;
  text-align: center;
}

.adventure-map-status[hidden] {
  display: none;
}

.adventure-map-status.is-message {
  background: rgba(9, 25, 20, .84);
}

.adventure-map-list {
  max-height: 600px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding-right: 5px;
  scrollbar-color: #477862 rgba(255, 255, 255, .05);
}

.adventure-map-item {
  padding: 20px;
  border: 1px solid rgba(180, 216, 198, .22);
  border-radius: 8px;
  background: rgba(249, 252, 247, .07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.adventure-map-item h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.adventure-map-meta {
  margin-bottom: 10px;
  color: #8de4b9;
  font-size: .78rem;
  font-weight: 800;
}

.adventure-map-item p {
  margin: 0;
  color: rgba(232, 242, 236, .72);
  font-size: .9rem;
  line-height: 1.5;
}

.adventure-map-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.adventure-map-actions button,
.adventure-map-actions a,
.adventure-popup a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 6px;
  font-size: .84rem;
  font-weight: 850;
  transition: transform .16s ease, background-color .16s ease;
}

.adventure-map-actions button {
  color: #dcf7e9;
  border: 1px solid rgba(115, 226, 174, .32);
  background: rgba(27, 76, 56, .6);
}

.adventure-map-actions a,
.adventure-popup a {
  color: #152018;
  border: 1px solid #f2c45f;
  background: #f2c45f;
}

.adventure-map-actions button:hover,
.adventure-map-actions a:hover,
.adventure-popup a:hover {
  transform: translateY(-2px);
}

.adventure-pin-wrapper {
  border: 0;
  background: transparent;
}

.adventure-pin {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #172018;
  background: linear-gradient(145deg, #ffe293, #e9ad35);
  border: 3px solid #fff7d8;
  border-radius: 50% 50% 50% 10px;
  box-shadow: 0 10px 24px rgba(23, 47, 35, .42), 0 0 0 5px rgba(115, 226, 174, .2);
  transform: rotate(-45deg);
}

.adventure-pin b {
  font-size: .92rem;
  transform: rotate(45deg);
}

.adventure-popup {
  color: #18211d;
}

.adventure-popup article + article {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d6ddda;
}

.adventure-popup strong {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
}

.adventure-popup p {
  margin: 8px 0;
  color: #55625c;
  font-size: .82rem;
  line-height: 1.45;
}

.adventure-popup-meta {
  margin-bottom: 10px;
  color: #28704d;
  font-size: .76rem;
  font-weight: 800;
}

.adventure-popup a {
  min-height: 34px;
  color: #172018;
}

.adventure-map-section .leaflet-control-zoom a {
  color: #173b2f;
}

.adventure-map-section .leaflet-control-attribution {
  color: #40524a;
  background: rgba(255, 255, 255, .86);
}

@media (max-width: 900px) {
  .adventure-map-layout {
    grid-template-columns: 1fr;
  }

  .adventure-map-list {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 700px) {
  .home-page .entry-shell {
    min-height: auto;
    padding-bottom: 48px;
  }

  .home-page .map-tile {
    transform: none;
  }

  .home-page .trophy-tile {
    grid-column: auto;
    min-height: 190px;
    transform: none;
  }

  .adventure-map-section {
    padding: 48px 16px 72px;
  }

  .adventure-map-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .adventure-map-frame,
  #adventure-map {
    min-height: 500px;
  }

  .adventure-map-list {
    grid-template-columns: 1fr;
  }
}

/* Public improvements */
.improvements-section {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 64px 32px 72px;
  color: #f8f6ef;
  background:
    linear-gradient(100deg, rgba(240, 179, 95, .1), transparent 38%),
    linear-gradient(180deg, #151728, #111522);
  border-top: 1px solid rgba(240, 179, 95, .24);
  border-bottom: 1px solid rgba(115, 226, 174, .18);
}

.improvements-inner {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.improvements-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.improvements-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.improvements-section .overline {
  color: #f0c16d;
}

.improvements-live {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(247, 242, 227, .76);
  font-size: .84rem;
  font-weight: 750;
}

.improvements-live span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #69e29e;
  box-shadow: 0 0 14px rgba(105, 226, 158, .8);
}

.improvements-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.improvement-item,
.improvements-empty {
  min-height: 150px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.improvements-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: rgba(236, 239, 247, .62);
  text-align: center;
}

.improvement-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.improvement-status {
  padding: 5px 8px;
  border-radius: 5px;
  color: #201c12;
  background: #f0c16d;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.improvement-item.status-soon .improvement-status {
  color: #102018;
  background: #79e1aa;
}

.improvement-item.status-improvement .improvement-status {
  color: #102036;
  background: #8dc5ff;
}

.improvement-item.status-in_progress .improvement-status {
  color: #111b26;
  background: #84c7ff;
}

.improvement-item.status-done .improvement-status {
  color: #fff;
  background: #477862;
}

.improvement-item time {
  color: rgba(229, 234, 244, .5);
  font-size: .75rem;
}

.improvement-item h3 {
  margin: 0 0 9px;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.improvement-item p {
  margin: 0;
  color: rgba(229, 234, 244, .7);
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Chat and support */
.support-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.support-launch-button {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  background: #245a45;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .36);
  font-size: .88rem;
  font-weight: 850;
}

.support-launch-button.has-unread {
  border-color: #fff;
  box-shadow:
    0 0 0 3px rgba(114, 217, 165, .28),
    0 14px 34px rgba(0, 0, 0, .36);
}

.support-launch-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  color: #fff;
  border: 2px solid #101a17;
  border-radius: 13px;
  background: #c73b46;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .32);
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
}

.support-launch-badge[hidden] {
  display: none;
}

.support-launch-button.error {
  color: #281e12;
  background: #f0b35f;
}

.support-launch-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.support-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: end;
  padding: 18px;
  background: rgba(5, 8, 16, .62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.support-dialog-backdrop[hidden] {
  display: none;
}

.support-dialog-open {
  overflow: hidden;
}

.support-dialog {
  width: min(460px, 100%);
  max-height: min(760px, calc(100svh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #edf4f0;
  border: 1px solid rgba(150, 201, 177, .28);
  border-radius: 8px;
  background: #101a17;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.support-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.support-dialog-header .overline {
  color: #83dfb1;
}

.support-dialog-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.support-dialog-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: #dceae3;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  font-size: 1.7rem;
  line-height: 1;
}

.support-create-form {
  display: grid;
  gap: 13px;
  overflow: auto;
  padding: 18px 20px 10px;
}

.support-create-form[hidden],
.support-conversation[hidden] {
  display: none;
}

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

.support-create-form label[hidden] {
  display: none;
}

.support-create-form label > span {
  color: #a9c1b5;
  font-size: .78rem;
  font-weight: 800;
}

.support-create-form input,
.support-create-form textarea,
.support-reply-form textarea {
  width: 100%;
  color: #f4f8f6;
  border: 1px solid rgba(158, 195, 178, .25);
  border-radius: 6px;
  outline: none;
  background: #182520;
}

.support-create-form input {
  min-height: 44px;
  padding: 10px 12px;
}

.support-create-form input[type="file"] {
  padding: 7px;
  color: #b9cec3;
}

.support-create-form input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  padding: 5px 10px;
  color: #122019;
  border: 0;
  border-radius: 5px;
  background: #72d9a5;
  font-weight: 850;
}

.support-image-field small,
.support-reply-tools small {
  color: #8fa99d;
  font-size: .7rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.support-create-form textarea,
.support-reply-form textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

.support-create-form input:focus,
.support-create-form textarea:focus,
.support-reply-form textarea:focus {
  border-color: #72d9a5;
  box-shadow: 0 0 0 3px rgba(114, 217, 165, .13);
}

.support-submit,
.support-reply-form button {
  min-height: 44px;
  color: #122019;
  border: 0;
  border-radius: 6px;
  background: #72d9a5;
  font-weight: 900;
}

.support-conversation {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0 20px;
}

.support-thread-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.support-thread-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.support-thread-summary strong {
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-thread-summary span {
  width: max-content;
  color: #8de4b9;
  font-size: .74rem;
  font-weight: 850;
}

.support-thread-summary span.is-closed {
  color: #efb975;
}

.support-thread-summary button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #d9e7e0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  font-size: .76rem;
  font-weight: 800;
}

.support-messages {
  min-height: 180px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 14px 2px;
}

.support-message {
  width: min(86%, 340px);
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 7px;
}

.support-message.is-user {
  align-self: flex-end;
  background: #234d3d;
}

.support-message.is-admin {
  align-self: flex-start;
  background: #242b42;
}

.support-message-meta {
  margin-bottom: 5px;
  color: rgba(230, 240, 235, .58);
  font-size: .69rem;
  font-weight: 800;
}

.support-message p {
  margin: 0;
  color: #f3f7f5;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-message-code {
  width: max-content;
  max-width: 100%;
  display: block;
  margin: 7px 0 0;
  padding: 5px 8px;
  overflow-wrap: anywhere;
  color: #ffe7a6;
  border: 1px solid rgba(255, 218, 128, .24);
  border-radius: 5px;
  background: rgba(10, 14, 22, .34);
  font: 800 .74rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.support-message-image-link {
  display: block;
  margin-top: 9px;
}

.support-message-image {
  width: min(100%, 320px);
  max-height: 290px;
  display: block;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  background: #0c1210;
}

.support-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 9px;
  padding: 12px 0 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.support-reply-tools {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.support-reply-tools > input[type="text"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #f4f8f6;
  border: 1px solid rgba(158, 195, 178, .25);
  border-radius: 6px;
  outline: none;
  background: #182520;
}

.support-file-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  color: #d9e7e0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 850;
}

.support-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.support-reply-tools small {
  grid-column: 1 / -1;
}

.support-dialog-status {
  min-height: 29px;
  padding: 7px 20px 10px;
  color: #8de4b9;
  font-size: .77rem;
}

.support-dialog-status.is-error {
  color: #ffaf9f;
}

@media (max-width: 900px) {
  .improvements-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .improvements-section {
    padding: 48px 16px 56px;
  }

  .improvements-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .improvements-list {
    grid-template-columns: 1fr;
  }

  .support-launcher {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .support-launch-button {
    min-height: 44px;
    padding: 9px 12px;
  }

  .support-dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .support-dialog {
    width: 100%;
    max-height: 92svh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .support-reply-form {
    grid-template-columns: 1fr;
  }

  .support-reply-tools {
    grid-template-columns: 1fr;
  }

  .support-reply-tools small {
    grid-column: auto;
  }
}

/* Keep the alpine hero rules after the legacy homepage additions. */
.home-page .entry-shell {
  min-height: 520px;
  height: min(860px, calc(100svh - 64px));
  padding: 0;
}

.home-page .map-tile {
  min-height: 88px;
  grid-column: auto;
  transform: none;
}

@media (max-width: 760px) {
  .home-page .entry-shell {
    min-height: 560px;
    height: calc(100svh - 48px);
    max-height: 760px;
    padding: 0;
  }

  .home-page .map-tile {
    min-height: 68px;
  }

  .support-launcher {
    gap: 8px;
  }

  .support-launch-button {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 50%;
  }

  .support-launch-button > span:not(.support-launch-badge) {
    display: none;
  }

  .support-launch-button svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 380px), (max-height: 650px) {
  .home-page .entry-shell {
    min-height: 520px;
  }

  .home-page .map-tile {
    min-height: 60px;
  }
}

/* Standalone adventure map */
.adventure-map-page {
  min-height: 100vh;
  color: #f5f8f2;
  background: #0b1c18;
}

.map-page-nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(24px, calc((100% - 1240px) / 2));
  border-bottom: 1px solid rgba(240, 207, 139, .22);
  background: #0d1813;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
}

.map-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-page-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(240, 207, 139, .42);
  border-radius: 6px;
  color: #fffdf4;
  font-weight: 800;
  background: rgba(255, 255, 255, .04);
}

.map-page-actions .map-player-link {
  color: #172018;
  border-color: #f0cf8b;
  background: #f0cf8b;
}

.adventure-map-page .standalone-map {
  min-height: calc(100svh - 72px);
  padding-top: 44px;
  border-top: 0;
  box-shadow: none;
}

.adventure-map-page .adventure-map-header h1 {
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.4rem;
  line-height: 1;
  letter-spacing: 0;
}

@media (max-width: 700px) {
  .map-page-nav {
    min-height: 64px;
    padding: 10px 12px;
  }

  .map-page-nav .home-brand > span:last-child {
    display: none;
  }

  .map-page-actions {
    gap: 7px;
  }

  .map-page-actions a {
    min-height: 40px;
    padding: 0 12px;
    font-size: .86rem;
  }

  .adventure-map-page .standalone-map {
    min-height: calc(100svh - 64px);
    padding-top: 34px;
  }

  .adventure-map-page .adventure-map-header h1 {
    font-size: 2.35rem;
  }

  .adventure-map-page .adventure-map-frame,
  .adventure-map-page #adventure-map {
    min-height: 54svh;
  }
}
