:root {
  color-scheme: dark;
  --font-sans: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #0b0e14;
  --surface: #141923;
  --surface-2: #1c2230;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f3f5f8;
  --muted: #8b95a7;
  --accent: #38bdf8;
  --accent-contrast: #04131d;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --success: #4ade80;
  --danger: #f87171;
  --warning: #facc15;
  --radius: 14px;
  --radius-lg: 20px;

  /* Legacy aliases still referenced by game styles */
  --surface-subtle: var(--surface);
  --surface-strong: var(--surface);
  --border-soft: var(--border);
  --card-radius: var(--radius-lg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--text-primary);
}

body.game-shell {
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body.game-shell * {
  touch-action: manipulation;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-header .subtitle {
  margin: 0.25rem 0 0;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  color: var(--muted);
}

.app-header .subtitle:empty {
  display: none;
}

.session-meta-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.code-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.phase-pill,
.pill {
  font-size: clamp(0.8rem, 1.3vw, 0.95rem);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--accent-contrast);
  transition: filter 0.15s ease, transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

@media (hover: hover) {
  button:hover:not(:disabled) {
    filter: brightness(1.08);
  }
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.secondary,
.secondary-button,
.return-button {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-primary);
}

/* Mute button added by audio.js */
.sound-toggle {
  padding-inline: 0.8rem;
  line-height: 1;
}

.hub-header .sound-toggle {
  margin-left: auto;
  align-self: center;
}

.sound-toggle.floating {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 1.6vw, 1.5rem);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.2vw, 1.1rem);
  min-height: 0;
}

.section-title,
.card h2 {
  margin: 0;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 600;
  color: var(--muted);
}

.status-text,
.status {
  min-height: 1.5em;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: clamp(0.9rem, 1.4vw, 1rem);
}

.list-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: clamp(0.75rem, 1.2vw, 0.85rem);
}

[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-meta-wrapper {
    width: 100%;
    justify-content: space-between;
  }
}

/* The version beside the VorSpill logo */
.app-version {
  margin-left: 0.4em;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  color: var(--muted, #94a3b8);
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

