﻿:root {
  color-scheme: light;
  --bg: #0f1a2a;
  --fg: #e7f2ff;
  --accent: #4bc0ff;
  --accent-dark: #2980b9;
  --warning: #f39c12;
  --error: #e74c3c;
  --success: #2ecc71;
  --card: rgba(12, 29, 56, 0.92);
  --dialog: rgba(11, 17, 29, 0.95);
  --font-scale: 1;
  --viewport-height: 1vh;
  --viewport-width: 1vw;
  font-size: calc(16px * var(--font-scale));
}

@supports (height: 100svh) {
  :root {
    --viewport-height: 1svh;
    --viewport-width: 1svw;
  }
}

@supports (height: 100dvh) {
  :root {
    --viewport-height: 1dvh;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #142b47 0%, #040914 80%);
  color: var(--fg);
  min-height: calc(var(--viewport-height) * 100);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  touch-action: manipulation;
}

.app {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: calc(var(--viewport-height) * 100);
}

.game-container {
  width: min(100%, calc(var(--viewport-height) * 100 * 9 / 16));
  max-width: min(960px, calc(var(--viewport-width) * 100));
  aspect-ratio: 9 / 16;
  background: rgba(5, 10, 19, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  position: relative;
  max-height: calc(var(--viewport-height) * 100);
}

.game-container > canvas {

  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0; /* keep canvas below DOM overlay */
}

.cutscene-layer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3, 8, 18, 0.92);
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease-out;
  padding: 0;
  overflow: hidden;
}

.cutscene-layer.is-active {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

.cutscene-layer video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  flex: 1 1 auto;
  border-radius: 0;
  box-shadow: none;
  background: #000;
}

.cutscene-layer .cutscene-skip-hint {
  position: absolute;
  bottom: 6vh;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(231, 242, 255, 0.85);
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  letter-spacing: 0.04em;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.cutscene-layer .cutscene-skip-button {
  position: absolute;
  bottom: 6vh;
  right: min(6vw, 64px);
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(75, 192, 255, 0.45);
  background: rgba(14, 34, 58, 0.8);
  color: #ecf7ff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: background 120ms ease, transform 120ms ease;
}

.cutscene-layer .cutscene-skip-button:hover,
.cutscene-layer .cutscene-skip-button:focus {
  background: rgba(75, 192, 255, 0.25);
  transform: translateY(-1px);
  outline: none;
}

.no-js {
  text-align: center;
  padding: 1rem;
}

.toast-layer {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 1000;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(15, 37, 63, 0.92);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  min-width: 220px;
  animation: fade-in 150ms ease-out;
}

.toast.toast-success {
  border-color: rgba(46, 204, 113, 0.8);
}

.toast.toast-error {
  border-color: rgba(231, 76, 60, 0.8);
}

.dialog-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 900;
}

.dialog {
  background: var(--dialog);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 420px;
  width: calc(100% - 2.5rem);
  display: grid;
  gap: 1rem;
  pointer-events: auto;
  animation: fade-in 160ms ease-out;
}

.dialog button {
  background: var(--accent);
  color: #041020;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease;
}

.dialog button:hover,
.dialog button:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.button,
button {
  font-family: inherit;
  font-size: 1rem;
  background: var(--accent);
  color: #031629;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.button:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(75, 192, 255, 0.4);
  outline-offset: 2px;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
}

input,
select {
  font: inherit;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 31, 58, 0.9);
  color: var(--fg);
}

label {
  font-size: 0.9rem;
  font-weight: 600;
}

fieldset {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1rem;
  margin: 0;
  margin-top: 2rem;
}

legend {
  padding: 0 0.4rem;
}

.progress-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.progress-ring::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.fade-in {
  animation: fade-in 260ms ease-out;
}

.fade-out {
  animation: fade-out 200ms ease-in forwards;
}

.pulse-success {
  animation: pulse-success 300ms ease-out;
}

.shake {
  animation: shake 300ms ease-in-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes pulse-success {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@media (min-width: 960px) {
  .game-container {
    aspect-ratio: 9 / 16;
    max-height: 90vh;
  }
}

@media (max-width: 600px) {
  :root {
    font-size: calc(17px * var(--font-scale));
  }

  .game-container {
    margin: 0;
    border-radius: 0;
  }

  .menu-wrapper {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .menu-card {
    gap: 0.85rem;
    padding: 1.25rem 1.2rem;
  }

  .menu-card h1 {
    line-height: 1.15;
  }

  .menu-card .tagline,
  .menu-card .group-label {
    font-size: 1.05rem;
  }

  .menu-actions {
    padding-top: 1.25rem;
  }
}

@media (max-width: 480px) {
  .avatar-option {
    width: 120px;
    padding: 0.35rem 0.3.5rem;
  }

  .avatar-option img {
    width: 96px;
    height: 96px;
  }
}

.menu-wrapper {
  width: 100%;
  max-width: 520px;
  position: relative;   /* sits above absolutely positioned canvas */
  z-index: 1;
  padding-top: 12px;    /* small breathing room from the very top */
  padding-bottom: 12px;
  margin: 0 auto;
  max-height: 100%;
  overflow: auto;
  padding-left: 12px;
  padding-right: 12px;
}

.menu-card {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
}

.menu-card h1 {
  margin: 0;
  font-size: 1.8rem;
}

.menu-card .tagline {
  margin: -0.5rem 0 0.5rem 0;
  font-size: 0.95rem;
  color: rgba(231, 242, 255, 0.78);
}

.camper-ident {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 18, 34, 0.6);
}

.camper-ident-avatar {
  font-size: 2.2rem;
  line-height: 1;
}

.camper-ident-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.camper-ident-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(231, 242, 255, 0.65);
}

.camper-ident-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(231, 242, 255, 0.92);
}

.menu-card .input-group {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.2rem;
}
.input-group {
  padding-top: 1rem;
}
.menu-card .group-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.avatar-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: .5rem;
  padding-bottom: 1rem
}

.avatar-option {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  background: rgba(8, 24, 45, 0.7);
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  width: 150px;
}

.avatar-option:hover,
.avatar-option input:checked + img {
  border-color: rgba(75, 192, 255, 0.6);
}

.avatar-option input {
  display: none;
}

.avatar-option img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.avatar-option span {
  font-weight: 600;
}

.settings-grid {
  display: grid;
  gap: 0.75rem;
}

.settings-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.settings-grid .checkbox {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.settings-row .checkbox {
  justify-content: flex-start;
}

.menu-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 2rem;
}

.menu-actions button[disabled],
.menu-actions button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.menu-actions.secondary {
  justify-content: flex-start;
}

.menu-actions.secondary .danger {
  background: #e74c3c;
  color: #ffeae6;
}

.upload {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 520px) {
  .settings-row {
    grid-template-columns: 1fr;
  }
}

.version-badge {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 0.75rem;
  opacity: 0.75;
  background: rgba(11, 25, 46, 0.7);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.user-selector-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 9, 20, 0.82);
  z-index: 400;
  padding: 1.5rem;
}

.user-selector-card {
  width: min(380px, 100%);
  background: rgba(10, 22, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
}

.user-selector-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.user-selector-header p {
  margin: 0;
  color: rgba(231, 242, 255, 0.7);
  font-size: 0.95rem;
}

.user-selector-tabs {
  display: flex;
  gap: 0.35rem;
}

.user-selector-tab {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(75, 192, 255, 0.2);
  background: rgba(8, 20, 38, 0.6);
  color: var(--fg);
  cursor: pointer;
  transition: all 120ms ease-in-out;
}

.user-selector-tab.is-active,
.user-selector-tab:hover {
  background: rgba(75, 192, 255, 0.18);
  border-color: rgba(75, 192, 255, 0.5);
}

.user-selector-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
}

.user-selector-list {
  display: grid;
  gap: 0.6rem;
}

.user-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.6rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 18, 34, 0.7);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.user-card.is-active {
  border-color: rgba(75, 192, 255, 0.65);
  background: rgba(18, 38, 60, 0.8);
}

.user-card-avatar {
  font-size: 2rem;
  line-height: 1;
}

.user-card-name {
  font-weight: 600;
}

.user-card-meta {
  grid-column: span 2;
  font-size: 0.78rem;
  color: rgba(231, 242, 255, 0.65);
  margin-left: 2.1rem;
}

.user-selector-hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(231, 242, 255, 0.65);
}

.user-create-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-create-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.user-create-input {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 20, 38, 0.7);
  color: inherit;
}

.user-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 0.35rem;
}

.user-avatar-option {
  padding: 0.4rem 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 18, 34, 0.65);
  font-size: 1.5rem;
  cursor: pointer;
}

.user-avatar-option.is-selected,
.user-avatar-option:hover {
  border-color: rgba(75, 192, 255, 0.65);
  background: rgba(18, 38, 60, 0.8);
}

.user-create-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.user-create-actions .primary,
.user-create-actions .secondary {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.user-create-actions .primary {
  background: linear-gradient(90deg, #4bc0ff, #64e3ff);
  color: #03080f;
}

.user-create-actions .secondary {
  background: rgba(8, 22, 40, 0.75);
  color: rgba(231, 242, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-manage-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-manage-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 18, 34, 0.7);
}

.user-manage-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.user-manage-line--primary {
  justify-content: flex-start;
}

.user-manage-line--secondary select {
  width: 100%;
}

.user-manage-name {
  flex: 1;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 20, 38, 0.7);
  color: inherit;
}

.user-manage-select {
  flex: 1;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 20, 38, 0.7);
  color: inherit;
}

.user-manage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.user-manage-actions .secondary,
.user-manage-actions .danger {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}

.user-manage-actions .secondary {
  background: rgba(8, 22, 40, 0.75);
  color: rgba(231, 242, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-manage-actions .danger {
  background: #e74c3c;
  color: #ffece9;
}

.user-manage-active {
  margin-left: auto;
  font-size: 0.75rem;
  color: rgba(75, 192, 255, 0.85);
  font-weight: 600;
}
.load-game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: rgba(4, 9, 20, 0.96);
  z-index: 450;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vh, 32px) clamp(16px, 4vw, 48px);
}

.load-game-panel {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
  overflow-y: auto;
}


.load-game-panel {
  width: min(560px, 100%);
  background: rgba(10, 22, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
  max-height: 90vh;
  overflow-y: auto;
}

.load-game-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.load-game-header p {
  margin: 0.25rem 0 0;
  color: rgba(231, 242, 255, 0.75);
}

.load-game-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.load-game-controls button {
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(75, 192, 255, 0.35);
  background: rgba(9, 26, 46, 0.85);
  color: #ecf7ff;
  cursor: pointer;
}

.load-game-controls button.primary {
  background: linear-gradient(90deg, #4bc0ff, #64e3ff);
  border-color: transparent;
  color: #031021;
}

.load-game-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-game-helper {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(231, 242, 255, 0.7);
}

.load-game-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.load-game-card {
  background: rgba(6, 18, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.load-game-card.is-empty {
  align-items: center;
  justify-content: center;
  min-height: 180px;
  text-align: center;
}

.load-game-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.load-game-card button {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(75, 192, 255, 0.35);
  background: rgba(11, 24, 40, 0.8);
  color: #ecf7ff;
  cursor: pointer;
}

.load-game-card button.primary {
  background: linear-gradient(90deg, #4bc0ff, #64e3ff);
  border-color: transparent;
  color: #031021;
}

.load-game-card button.danger {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #ffe2de;
}

.load-game-card button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.load-game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.load-game-autosave-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(75, 192, 255, 0.25);
  border: 1px solid rgba(75, 192, 255, 0.45);
  color: #4bc0ff;
}

.load-game-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(231, 242, 255, 0.8);
}

.load-game-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 520px) {
  .load-game-panel {
    padding: 1.1rem;
  }
  .load-game-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .load-game-grid {
    grid-template-columns: 1fr;
  }
}
.settings-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: rgba(4, 9, 20, 0.96);
  z-index: 460;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vh, 32px) clamp(16px, 4vw, 48px);
}

.settings-panel {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
  overflow-y: auto;
  width: min(
    calc(var(--viewport-height) * 100 * 9 / 16),
    calc(var(--viewport-width) * 100)
  );
  max-width: min(960px, calc(var(--viewport-width) * 100));
  background: rgba(10, 22, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
  max-height: calc(var(--viewport-height) * 100 - clamp(32px, 8vh, 72px));
}

.settings-selector {
  display: flex;
  justify-content: flex-start;
}

.settings-selector select {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(75, 192, 255, 0.4);
  background: rgba(9, 26, 46, 0.85);
  color: #ecf7ff;
  font-size: 1rem;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(8, 20, 38, 0.72);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(8, 20, 38, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ecf7ff;
}

.settings-row-action {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.settings-row-action button {
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(4, 65, 120, 0.75);
  border: 1px solid rgba(75, 192, 255, 0.4);
  color: #ecf7ff;
  cursor: pointer;
}

.settings-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: rgba(8, 20, 38, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ecf7ff;
}

.settings-toggle input {
  transform: scale(1.2);
  margin-right: 0.5rem;
}

.settings-toggle > span {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(231, 255, 255, 0.7);
}

.settings-slider {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(8, 20, 38, 0.72);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
  color: #ecf7ff;
}

.settings-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.settings-slider input[type="range"] {
  width: 100%;
}

.settings-radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(8, 20, 38, 0.72);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
  color: #ecf7ff;
}

.settings-radio-label {
  font-weight: 600;
}

.settings-radio-group {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.settings-radio {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.settings-scaling-group {
  display: grid;
  gap: 0.75rem;
}

.settings-select-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(8, 20, 38, 0.72);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
  color: #ecf7ff;
}

.settings-select-row select {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(75, 192, 255, 0.35);
  background: rgba(8, 22, 40, 0.8);
  color: #ecf7ff;
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
}

.settings-footer button {
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(75, 192, 255, 0.35);
  background: rgba(9, 26, 46, 0.7);
  color: #ecf7ff;
  cursor: pointer;
}

.settings-footer button:hover {
  background: rgba(75, 192, 255, 0.25);
}

@media (max-width: 520px) {
  .settings-panel {
    padding: 1.2rem;
  }
  .settings-tabs {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}



