:root {
  --ink: #10233f;
  --muted: #61748d;
  --blue: #1877f2;
  --panel: rgba(255, 255, 255, 0.9);
  --border: rgba(16, 35, 63, 0.12);
  --shadow: 0 18px 50px rgba(34, 68, 108, 0.18);
  --font: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #c9eafb;
  color: var(--ink);
  font-family: var(--font);
}

button,
a {
  font: inherit;
}

.tour-stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

#tour-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.tour-topbar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.tour-brand,
.icon-button,
.player-panel,
.property-panel,
.tour-actions,
.control-hint,
.mode-chip {
  pointer-events: auto;
}

.tour-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.fps-meter {
  position: absolute;
  top: 22px;
  right: 74px;
  z-index: 10;
  min-width: 64px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(16, 35, 63, 0.74);
  color: #b9f6ca;
  font: 700 0.68rem/1 var(--mono);
  text-align: center;
}

.tour-brand span,
.loading-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--ink);
  color: white;
}

.tour-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.tour-title strong {
  font-size: 0.95rem;
}

.tour-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.icon-button {
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.25rem;
}

.player-panel {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 184px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border);
  border-left: 5px solid #84cc16;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #84cc16;
  color: white;
  font-weight: 900;
}

.player-name,
.player-money {
  display: block;
}

.player-name {
  color: var(--muted);
  font-size: 0.75rem;
}

.player-money {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 0.88rem;
}

.property-panel {
  position: absolute;
  top: 82px;
  right: 18px;
  z-index: 10;
  display: flex;
  min-width: 180px;
  flex-direction: column;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.property-kicker {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.property-panel strong {
  margin-top: 2px;
  font-size: 1.05rem;
}

.property-panel > span:last-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.mode-chip {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(16, 35, 63, 0.82);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
}

.tour-actions {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  border: 1px solid #1267d6;
  background: var(--blue);
  color: white;
  box-shadow: 0 14px 30px rgba(24, 119, 242, 0.28);
}

.secondary-action {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

kbd {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(16, 35, 63, 0.08);
  font: 700 0.68rem/1.2 var(--mono);
}

.dice-icon {
  font-size: 1.2rem;
}

.control-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  color: rgba(16, 35, 63, 0.75);
  font-size: 0.72rem;
  pointer-events: none;
}

.control-hint strong {
  color: var(--ink);
}

.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  background: #c9eafb;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-screen p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .tour-title,
  .control-hint,
  .mode-chip,
  .fps-meter {
    display: none;
  }

  .property-panel {
    top: 74px;
    right: 10px;
    min-width: 150px;
  }

  .tour-topbar {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .player-panel {
    left: 10px;
    bottom: 72px;
  }

  .tour-actions {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .tour-actions button {
    flex: 1;
  }
}
