:root {
  --bg-deep: #0a2a33;
  --bg-panel: #0f3d4a;
  --bg-panel-light: #145261;
  --accent: #3ec6e0;
  --accent-glow: #6ee7ff;
  --gold: #f5c842;
  --danger: #ff5c5c;
  --text: #e8f6fa;
  --text-dim: #9ec5d0;
  --grid-light: #2a6b5a;
  --grid-dark: #1f5348;
  --card-bg: #123f4d;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  /* ninenine-nav + Rechtsfooter — gesetzt von ng-nav.js / legal-footer.css */
  --ltr-chrome-top: calc(var(--ng-nav-h, 56px) + env(safe-area-inset-top, 0px));
  --ltr-chrome-bottom: calc(var(--ng-legal-footer-reserve, 0px) + env(safe-area-inset-bottom, 0px));
  --scrollbar-size: 6px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(62, 198, 224, 0.48);
  --scrollbar-thumb-hover: rgba(110, 231, 255, 0.72);
  --scrollbar-inset: 10px;
}

/* ── Scrollbars (überall, außer .world-map) ── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-track {
  background: transparent;
  margin-block: var(--scrollbar-inset);
}

*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: none;
  min-height: 28px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Engere Scrollbar in Panels/Overlays */
.location-info-panel,
.overlay-scroll,
.combat-log,
.village-panel {
  scrollbar-gutter: stable;
}

.location-info-panel::-webkit-scrollbar-track,
.overlay-scroll::-webkit-scrollbar-track,
.combat-log::-webkit-scrollbar-track,
.village-panel::-webkit-scrollbar-track {
  margin-block: 6px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, #1a5c6e 0%, transparent 55%),
    linear-gradient(180deg, #0a2a33 0%, #061a20 100%);
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
}

.screen[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Menü ── */
.menu-screen {
  justify-content: center;
  gap: 24px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.menu-header {
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--accent-glow);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-header h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 800;
  background: linear-gradient(180deg, #fff 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.4;
}

.menu-panel {
  background: rgba(15, 61, 74, 0.85);
  border: 1px solid rgba(110, 231, 255, 0.25);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.menu-panel h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scenario-btn,
.btn-primary,
.btn-secondary,
.btn-end-turn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.scenario-btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-end-turn:active {
  transform: scale(0.97);
}

.scenario-btn {
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--bg-panel-light), var(--bg-panel));
  color: var(--text);
  border: 1px solid rgba(110, 231, 255, 0.2);
  font-weight: 700;
  text-align: left;
}

.menu-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.loadout-hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

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

.loadout-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(110, 231, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.loadout-slot.empty {
  opacity: 0.5;
}

.loadout-slot-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.loadout-slot-icon {
  font-size: 1.4rem;
}

.loadout-slot-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.loadout-slot-extra {
  font-size: 0.75rem;
  color: var(--accent-glow);
}

/* ── Kampf ── */
.battle-screen {
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.battle-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.hero-hp {
  flex: 1;
  min-width: 0;
}

.hero-hp .hero-portrait {
  display: none;
}

.hero-hp .hero-stats {
  background: rgba(15, 61, 74, 0.9);
  border: 1px solid rgba(110, 231, 255, 0.2);
  border-radius: 12px;
  padding: 8px 12px;
}

.hero-hp strong {
  font-size: 0.95rem;
}

.hero-tag {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.selected-unit {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  min-height: 1.4em;
}

.selected-unit strong {
  color: var(--accent-glow);
}

.selected-stats {
  margin-left: 6px;
}

.hp-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  margin: 6px 0 4px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #3ddc84, #2eb86a);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.battle-meta {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.element-gauges {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  justify-content: flex-end;
}

.gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 28px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid color-mix(in srgb, var(--el-color) 50%, transparent);
}

.gauge-label {
  font-size: 0.65rem;
  color: var(--el-color);
  font-weight: 800;
}

.gauge-value {
  font-size: 0.9rem;
  font-weight: 800;
}

.battle-body {
  display: flex;
  gap: 6px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.companions-column {
  width: 52px;
  flex-shrink: 0;
}

.companions-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.companion-slot-wrap,
.spell-card-wrap {
  position: relative;
}

.companion-slot-wrap .info-btn,
.spell-card-wrap .info-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 2;
}

.companion-slot {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--el-color) 60%, transparent);
  background: var(--card-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  cursor: pointer;
  font: inherit;
}

.companion-slot.selected {
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.companion-slot.summoned {
  opacity: 0.35;
}

.companion-slot.disabled:not(.summoned) {
  opacity: 0.5;
}

.btn-companion-dismiss {
  position: absolute;
  bottom: -4px;
  left: -4px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--card-bg);
  color: var(--accent);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.companion-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.companion-cost {
  font-size: 0.55rem;
  color: var(--text-dim);
}

.grid-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battle-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-size), 1fr);
  gap: 3px;
  width: 100%;
  max-width: min(100%, 360px);
  aspect-ratio: 1;
  padding: 6px;
  background:
    linear-gradient(180deg, rgba(20, 82, 97, 0.6), rgba(10, 42, 51, 0.8));
  border: 2px solid rgba(110, 231, 255, 0.25);
  border-radius: 14px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}

.grid-cell {
  position: relative;
  border: none;
  border-radius: 6px;
  padding: 0;
  min-height: 0;
  aspect-ratio: 1;
  background: var(--grid-dark);
  cursor: pointer;
  font: inherit;
}

.grid-cell.cell-light {
  background: var(--grid-light);
}

.grid-cell.cell-preview {
  box-shadow: inset 0 0 0 2px rgba(110, 231, 255, 0.7);
}

.grid-cell.cell-target {
  background: color-mix(in srgb, var(--accent) 35%, var(--grid-dark));
}

.unit {
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.unit-hero {
  background: rgba(62, 198, 224, 0.25);
  border: 2px solid var(--accent-glow);
}

.unit-hero .unit-icon {
  font-size: clamp(1rem, 4vw, 1.4rem);
}

.unit-enemy {
  background: rgba(255, 92, 92, 0.2);
  border: 2px solid var(--danger);
}

.unit-hero.team-hero,
.unit-hero {
  /* companion uses team hero too */
}

.unit-companion {
  background: rgba(245, 200, 66, 0.15);
  border: 2px solid var(--gold);
}

.unit-elite {
  background: rgba(199, 125, 255, 0.22);
  border: 2px solid #c77dff;
}

.unit-boss {
  background: rgba(255, 92, 92, 0.28);
  border: 2px solid #ff3b3b;
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.4);
}

.unit-mimic {
  background: rgba(245, 200, 66, 0.28);
  border: 2px dashed var(--gold);
}

.unit-selected {
  box-shadow: 0 0 0 2px var(--accent-glow), 0 0 12px rgba(110, 231, 255, 0.5);
}

.unit-hpbar {
  position: absolute;
  bottom: 1px;
  left: 10%;
  width: 80%;
  height: 3px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  overflow: hidden;
}

.unit-hpbar span {
  display: block;
  height: 100%;
  background: #3ddc84;
}

.unit-enemy .unit-hpbar span,
.unit-elite .unit-hpbar span,
.unit-boss .unit-hpbar span,
.unit-mimic .unit-hpbar span {
  background: #ff6b6b;
}

.unit-info {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  z-index: 3;
}

.empty-hand,
.empty-companions {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin: 0;
  padding: 8px;
  text-align: center;
}

.detail-rarity {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 800;
}

.slot-blocked {
  opacity: 0.5;
}

.unit-icon {
  font-size: clamp(0.85rem, 3.5vw, 1.2rem);
  line-height: 1;
}

.unit-hp {
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.mode-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent-glow);
  min-height: 1.2em;
}

.battle-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn-battle-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn-battle-icon-glyph {
  font-size: 1.2rem;
  line-height: 1;
}

.btn-battle-icon:active:not(:disabled) {
  transform: scale(0.94);
}

.btn-battle-icon.is-active {
  border-color: rgba(110, 231, 255, 0.65);
  background: rgba(110, 231, 255, 0.18);
  box-shadow: 0 0 10px rgba(110, 231, 255, 0.35);
}

.btn-battle-icon--end {
  background: linear-gradient(180deg, #2a9db8, #1a7a92);
  border-color: rgba(110, 231, 255, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-battle-icon--end .btn-battle-icon-glyph {
  font-size: 1.35rem;
  font-weight: 800;
}

.btn-battle-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-secondary:disabled,
.btn-end-turn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ap-pips {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.ap-pip {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(110, 231, 255, 0.3);
}

.ap-pip.filled {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent));
  box-shadow: 0 0 8px rgba(110, 231, 255, 0.5);
}

.btn-end-turn {
  padding: 12px 16px;
  background: linear-gradient(180deg, #2a9db8, #1a7a92);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hand-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.spell-card-wrap {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.spell-card {
  flex: 0 0 72px;
  height: 96px;
  scroll-snap-align: start;
  border-radius: 10px;
  border: 2px solid color-mix(in srgb, var(--el-color) 55%, transparent);
  background: linear-gradient(180deg, var(--card-bg), #0a2a33);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
  font: inherit;
  position: relative;
}

.spell-card.selected {
  box-shadow: 0 0 0 2px var(--accent-glow), 0 4px 16px rgba(62, 198, 224, 0.35);
  transform: translateY(-4px);
}

.spell-card.disabled {
  opacity: 0.45;
}

.card-cost {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon {
  font-size: 1.5rem;
}

.card-name {
  font-size: 0.55rem;
  text-align: center;
  line-height: 1.1;
  color: var(--text-dim);
}

.combat-log {
  max-height: 64px;
  overflow-y: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
}

.combat-log p {
  margin: 0 0 2px;
}

.result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 26, 32, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 12px;
}

.result-overlay[hidden] {
  display: none !important;
}

.result-panel {
  text-align: center;
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid rgba(110, 231, 255, 0.3);
  border-radius: 16px;
  max-width: 90%;
}

.result-panel h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.result-panel p {
  margin: 0 0 20px;
  color: var(--text-dim);
}

.btn-primary {
  padding: 14px 24px;
  background: linear-gradient(180deg, var(--accent-glow), var(--accent));
  color: #062028;
  font-weight: 800;
}

.info-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 26, 32, 0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.detail-panel[hidden] {
  display: none !important;
}

.detail-card {
  position: relative;
  width: min(100%, 400px);
  background: var(--bg-panel);
  border: 1px solid rgba(110, 231, 255, 0.35);
  border-radius: 16px 16px 12px 12px;
  padding: 20px 16px 16px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.detail-icon {
  font-size: 1.8rem;
}

.detail-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.reward-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
  font-size: 0.9rem;
  color: var(--accent-glow);
}

.reward-list li {
  padding: 4px 0;
}

/* Globale Nav (ninenine-nav) + eigene Auth-Leiste */
body:has(ninenine-nav) #auth-bar {
  display: none !important;
}

#app.app-shell {
  position: fixed;
  top: var(--ltr-chrome-top);
  left: 0;
  right: 0;
  bottom: var(--ltr-chrome-bottom);
  min-height: auto;
  max-height: none;
  overflow: hidden;
}

.world-base {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  transition: filter 0.2s ease;
}

.world-base.world-behind {
  filter: brightness(0.55) saturate(0.85);
  pointer-events: none;
}

.world-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #083752;
  overflow: auto;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.world-ui-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ── Oben: Ort + Gold ── */
.world-top-bar {
  position: relative;
  pointer-events: none;
  min-height: 48px;
  padding:
    0
    max(12px, env(safe-area-inset-right, 0px))
    0
    max(12px, env(safe-area-inset-left, 0px));
}

.world-location {
  pointer-events: auto;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(72vw, 360px);
  padding: 6px 14px;
  background: rgba(8, 20, 28, 0.72);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.world-location-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.world-location-ring {
  border-radius: 50%;
  border: 2px solid var(--region-color, #6ee7ff);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 8px color-mix(in srgb, var(--region-color) 40%, transparent);
}

.world-location-name {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-location-enter,
.btn-location-info {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(110, 231, 255, 0.35);
  background: rgba(15, 61, 74, 0.9);
  color: var(--accent-glow);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-location-enter {
  border-color: rgba(120, 220, 160, 0.45);
  color: #9ef0b8;
  font-size: 0.95rem;
}

.btn-location-enter:hover,
.btn-location-info:hover {
  background: rgba(25, 80, 95, 0.95);
}

.btn-location-enter:hover {
  background: rgba(30, 90, 65, 0.95);
}

.world-gold {
  pointer-events: auto;
  position: absolute;
  top: 10px;
  right: max(12px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(8, 20, 28, 0.78);
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 80, 0.25);
  backdrop-filter: blur(8px);
  font-weight: 800;
  color: var(--gold);
  font-size: 0.85rem;
}

.world-gold-icon {
  font-size: 1rem;
  line-height: 1;
}

.world-key-progress {
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  color: #9ef0b8;
  font-weight: 700;
}

/* ── Unten: Avatar + Menüleiste ── */
.world-bottom-bar {
  pointer-events: none;
  padding:
    8px
    max(12px, env(safe-area-inset-right, 0px))
    10px
    max(12px, env(safe-area-inset-left, 0px));
}

.world-player-dock {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: 0;
  max-width: 100%;
}

.world-avatar {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(8, 20, 28, 0.88);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.world-avatar-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.75rem;
  line-height: 1;
}

.world-menu-rail {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: -4px;
  padding: 6px 10px 6px 14px;
  background: rgba(8, 20, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: none;
  border-radius: 0 12px 12px 0;
  backdrop-filter: blur(8px);
  transform: translateX(-8px) scaleX(0.6);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.world-menu-rail.is-open {
  transform: translateX(0) scaleX(1);
  opacity: 1;
}

.world-menu-rail[hidden] {
  display: none !important;
}

.world-menu-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(15, 45, 58, 0.85);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.world-menu-btn:hover {
  background: rgba(25, 70, 88, 0.95);
  border-color: rgba(110, 231, 255, 0.35);
}

/* ── Ortsinfo-Popup ── */
.location-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding:
    calc(56px + var(--safe-top))
    12px
    12px;
  background: rgba(4, 16, 22, 0.35);
  pointer-events: auto;
}

.location-info-overlay[hidden] {
  display: none !important;
}

.location-info-shell {
  width: min(100%, 400px);
  max-height: min(70dvh, 520px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(8, 34, 43, 0.96);
  border: 2px solid rgba(110, 231, 255, 0.3);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.location-info-panel {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-height: min(70dvh, 520px);
  overflow-y: auto;
  padding: 14px 8px 18px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  -webkit-overflow-scrolling: touch;
}

.loc-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.loc-info-title {
  font-weight: 800;
  font-size: 1rem;
}

.btn-loc-close {
  position: static;
  width: 32px;
  height: 32px;
}

.loc-info-meta {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.loc-info-note {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text);
}

.location-info-panel h3 {
  margin: 12px 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-glow);
}

.loc-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loc-info-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(15, 61, 74, 0.45);
  border-radius: 8px;
  font-size: 0.82rem;
}

.loc-info-icon {
  margin-right: 4px;
}

.loc-info-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(110, 231, 255, 0.15);
  color: var(--accent-glow);
  flex-shrink: 0;
}

.loc-info-chance {
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.loc-info-empty {
  color: var(--text-dim);
  font-style: italic;
}

.loc-info-foot {
  margin: 12px 0 0;
  color: var(--text-dim);
}

.game-overlay--player {
  max-height: calc(85dvh - var(--safe-top) - var(--safe-bottom));
}

.player-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(110, 231, 255, 0.15);
}

.player-header h2 {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}

.encounter-skip {
  margin-top: 8px;
  width: 100%;
}

.minigame-sequence {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
  min-height: 44px;
}

.minigame-chip {
  font-size: 1.5rem;
  padding: 6px 10px;
  background: rgba(15, 61, 74, 0.6);
  border-radius: 10px;
}

.minigame-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.minigame-opt {
  width: 52px;
  height: 52px;
  font-size: 1.4rem;
  padding: 0;
}

.minigame-opt.minigame-flash {
  border-color: var(--accent-glow);
  background: rgba(110, 231, 255, 0.25);
  box-shadow: 0 0 12px rgba(110, 231, 255, 0.45);
}

.btn-location-enter:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tag-craft-village {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-glow);
}

.village-row.craft-wrong-village {
  opacity: 0.72;
}

.inventory-mats {
  line-height: 1.5;
}

.world-map.grabbing {
  cursor: grabbing;
}

.world-map::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.world-map {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.overlay-backdrop {
  position: fixed;
  top: var(--ltr-chrome-top);
  right: 0;
  bottom: var(--ltr-chrome-bottom);
  left: 0;
  z-index: 15;
  background: rgba(6, 26, 32, 0.45);
}

.overlay-backdrop[hidden] {
  display: none !important;
}

.game-overlay {
  position: fixed;
  z-index: 20;
  top: calc(var(--ltr-chrome-top) + 8px);
  bottom: calc(var(--ltr-chrome-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  max-width: 520px;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border: 2px solid rgba(110, 231, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.game-overlay[hidden] {
  display: none !important;
}

.game-overlay--battle {
  max-height: calc(100dvh - var(--ltr-chrome-top) - var(--ltr-chrome-bottom) - 16px);
}

.game-overlay--encounter {
  max-height: min(70dvh, calc(100dvh - var(--ltr-chrome-top) - var(--ltr-chrome-bottom) - 24px));
  top: auto;
  bottom: calc(var(--ltr-chrome-bottom) + 12px);
}

.overlay-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay-header {
  flex-shrink: 0;
}

.overlay-body {
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.encounter-text {
  margin: 0;
  line-height: 1.45;
  color: var(--text);
}

.encounter-question {
  margin: 0;
  color: var(--accent-glow);
}

.encounter-choices,
.encounter-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.encounter-choice {
  width: 100%;
  text-align: left;
  padding: 12px;
}

.btn-battle-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: none;
}

.game-overlay--battle .battle-top {
  position: relative;
  padding-right: 40px;
}

/* ── Weltkarte (Knoten & Regionen) ── */

.world-canvas {
  position: relative;
}

/* ── Weltkarten-Schichten: Meer → Insel → Insel-FX → Wolken → UI ── */
.world-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.world-layer--art {
  z-index: 0;
  overflow: visible;
}

.world-layer--cloud {
  z-index: 4;
  overflow: hidden;
}

.world-layer--art canvas,
.world-layer--cloud canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.world-map-under { z-index: 0; }
.world-map-islands { z-index: 1; }

.world-map-under,
.world-map-islands {
  width: 100%;
  height: 100%;
}

/* Pixel-Retro-Weltkarte (Mana Seed / 16×16) */
.world-layer--pixel {
  z-index: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.world-map-pixel {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.world-region-label--pixel {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-shadow:
    1px 0 0 rgba(0, 0, 0, 0.85),
    -1px 0 0 rgba(0, 0, 0, 0.85),
    0 1px 0 rgba(0, 0, 0, 0.85),
    0 -1px 0 rgba(0, 0, 0, 0.85);
  transform: translate(-50%, 0);
}

.world-layer--island-fx {
  z-index: 2;
  overflow: visible;
}

.world-layer--foam {
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.world-shore-foam {
  position: absolute;
  pointer-events: none;
}

.world-shore-foam__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  mix-blend-mode: screen;
  pointer-events: none;
}

.world-fx-sink {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.world-map-cloud {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.world-layer--sea {
  z-index: 0;
}

.world-sea-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: var(--sea-opacity, 0.42);
  mix-blend-mode: screen;
}

.world-layer--islands {
  z-index: 2;
  overflow: visible;
}

.world-island {
  position: absolute;
  pointer-events: none;
  overflow: visible;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
  opacity: 0.92;
}

.world-layer--labels {
  z-index: 5;
}

.world-region-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85), 0 0 12px color-mix(in srgb, var(--region-color) 60%, transparent);
  white-space: nowrap;
  pointer-events: none;
}

.world-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  z-index: 8;
  min-width: 0;
  box-shadow: none;
}

.region-zone {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--region-color) 32%, transparent) 0%, transparent 72%);
  border: 1.5px dashed color-mix(in srgb, var(--region-color) 55%, transparent);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
  z-index: 1;
}

.region-label {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.region-label small {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.9;
}

.world-node-spot {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--region-color) 88%, white);
  background: rgba(255, 255, 255, 0.03);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 0 14px rgba(0, 0, 0, 0.22),
    0 2px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.world-node:hover .world-node-spot {
  border-color: color-mix(in srgb, var(--region-color) 70%, white);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 0 10px rgba(0, 0, 0, 0.15),
    0 0 14px color-mix(in srgb, var(--region-color) 45%, transparent);
}

.world-node-here .world-node-spot {
  border-width: 3px;
  animation: world-spot-pulse 2.4s ease-in-out infinite;
  box-shadow:
    0 0 0 2px var(--accent-glow),
    0 0 18px rgba(110, 231, 255, 0.55),
    inset 0 0 12px rgba(110, 231, 255, 0.12);
}

@keyframes world-spot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.world-node-village .world-node-spot {
  width: 58px;
  height: 58px;
  border-width: 3px;
}

.world-node-wild .world-node-spot {
  width: 46px;
  height: 46px;
  border-style: dashed;
  border-width: 2px;
}

.world-node-boss .world-node-spot {
  border-width: 3.5px;
  box-shadow:
    0 0 0 2px rgba(255, 210, 80, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 0 14px rgba(0, 0, 0, 0.25),
    0 2px 10px rgba(0, 0, 0, 0.3);
}

.world-node-cleared .world-node-spot {
  position: relative;
}

.world-node-cleared .world-node-spot::after {
  content: '✓';
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  right: -4px;
  bottom: -2px;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
  color: #3ddc84;
  background: rgba(8, 34, 43, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.world-node-boss-badge {
  position: absolute;
  top: -2px;
  right: calc(50% - 34px);
  font-size: 0.72rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
  pointer-events: none;
}

.world-node-name {
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(8, 34, 43, 0.82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

/* Tier-Farben (Schwierigkeit) */
.tier-1 { --region-color: #2aa7b5; }
.tier-2 { --region-color: #e2a03a; }
.tier-3 { --region-color: #5fa8e0; }
.tier-4 { --region-color: #c77dff; }

.hint-tier {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #08243b;
  background: var(--region-color, #6ee7ff);
}

/* Mechanik-Badge im Kampf */
.mechanic-badge {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.mech-scorch { background: rgba(226, 112, 58, 0.4); border-color: #e2703a; }
.mech-frost { background: rgba(95, 168, 224, 0.4); border-color: #5fa8e0; }
.mech-toxic { background: rgba(123, 192, 67, 0.4); border-color: #7bc043; }
.mech-tempest { background: rgba(168, 111, 224, 0.4); border-color: #a86fe0; }
.mech-gale { background: rgba(126, 232, 168, 0.4); border-color: #7ee8a8; }

/* ── Dorf ── */
.village-screen {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  gap: 10px;
}

.village-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.village-header h1 {
  margin: 0;
  font-size: 1.3rem;
  text-align: center;
}

.btn-back {
  align-self: flex-start;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.village-resources {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  padding: 8px 12px;
  background: rgba(15, 61, 74, 0.85);
  border-radius: 10px;
}

.village-tabs {
  display: flex;
  gap: 6px;
}

.village-tabs button {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.village-tabs button.active {
  background: var(--bg-panel-light);
  color: var(--accent-glow);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 255, 0.3);
}

.village-panel {
  flex: 1;
  overflow-y: auto;
  background: rgba(15, 61, 74, 0.6);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(110, 231, 255, 0.15);
}

.village-panel h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.village-panel h3 {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}

.panel-hint {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.village-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.village-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.village-row.locked {
  opacity: 0.55;
}

.village-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.village-row-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.village-row-cost {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.village-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.tag-locked {
  display: block;
  font-size: 0.65rem;
  color: var(--gold);
}

.tag-god {
  display: block;
  font-size: 0.65rem;
  color: #fff4a8;
}

.tag-unique {
  display: block;
  font-size: 0.65rem;
  color: #ff6b9d;
}

.btn-craft {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a9db8, #1a7a92);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-craft:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-small {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-small:disabled {
  opacity: 0.35;
}

.btn-buy {
  background: rgba(62, 198, 224, 0.25);
}

.btn-sell {
  background: rgba(245, 200, 66, 0.2);
}

.btn-icon-info {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  font-style: italic;
  cursor: pointer;
}

.equip-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.equip-slot-card {
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.equip-slot-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.equip-slot-icon {
  font-size: 1.4rem;
}

.equip-slot-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-unequip {
  margin-top: 4px;
}

@media (min-width: 480px) {
  .hero-hp {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .hero-hp .hero-portrait {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(15, 61, 74, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(110, 231, 255, 0.2);
  }
}

/* ── Auth (NINE-NINE) ── */
.auth-gate {
  position: fixed;
  top: var(--ltr-chrome-top);
  right: 0;
  bottom: var(--ltr-chrome-bottom);
  left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, rgba(62, 198, 224, 0.12), transparent 55%),
    linear-gradient(180deg, #0a2a33 0%, #061a20 100%);
}

.auth-gate[hidden],
.auth-gate-error[hidden] {
  display: none !important;
}

.auth-gate-panel {
  width: min(100%, 380px);
  padding: 28px 24px;
  border-radius: 20px;
  background: rgba(15, 61, 74, 0.96);
  border: 1px solid rgba(110, 231, 255, 0.25);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.auth-gate-title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--accent-glow);
}

.auth-gate-text {
  margin: 0 0 20px;
  color: var(--text-dim);
  line-height: 1.5;
}

.auth-gate-btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-glow), var(--accent));
  color: #062028;
  font-weight: 800;
  text-decoration: none;
}

.auth-gate-error {
  margin-top: 16px;
  color: var(--danger);
  font-size: 0.9rem;
}

.auth-bar {
  position: fixed;
  top: calc(8px + var(--safe-top));
  right: 8px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 61, 74, 0.92);
  border: 1px solid rgba(110, 231, 255, 0.2);
  font-size: 0.85rem;
}

.auth-bar[hidden] {
  display: none !important;
}

.auth-username {
  color: var(--text);
  font-weight: 700;
}

.auth-logout {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
