:root {
  --otl-surface-highlight: rgba(255, 255, 255, 0.055);
  --otl-surface-shadow: rgba(0, 0, 0, 0.42);
  --otl-control-bg: rgba(2, 6, 23, 0.62);
  --otl-control-border: rgba(148, 163, 184, 0.32);
}

/* Subtle texture and depth without changing the existing color palette. */
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.055) 0 0.7px, transparent 0.9px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.04) 0 0.6px, transparent 0.8px);
  background-size: 18px 18px, 23px 23px;
  mix-blend-mode: soft-light;
}

.card {
  border-color: rgba(100, 116, 139, 0.46);
  box-shadow:
    inset 0 1px 0 var(--otl-surface-highlight),
    0 18px 55px rgba(0, 0, 0, 0.30),
    0 4px 18px rgba(0, 0, 0, 0.18);
}

/* Give major areas a restrained identity while preserving the shared design. */
.trainer-card {
  box-shadow:
    inset 0 1px 0 rgba(224, 242, 254, 0.055),
    0 18px 55px rgba(0, 0, 0, 0.30),
    0 0 42px rgba(14, 165, 233, 0.035);
}

#eventsPanel {
  border-color: rgba(248, 113, 113, 0.28);
  background:
    linear-gradient(120deg, rgba(127, 29, 29, 0.055), transparent 42%),
    linear-gradient(145deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.90));
  box-shadow:
    inset 0 1px 0 rgba(254, 226, 226, 0.045),
    0 18px 55px rgba(0, 0, 0, 0.30),
    0 0 42px rgba(239, 68, 68, 0.025);
}

.game-settings-card {
  border-color: rgba(96, 165, 250, 0.27);
  background:
    linear-gradient(120deg, rgba(30, 64, 175, 0.05), transparent 42%),
    linear-gradient(145deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.90));
}

.otl-trainings-card {
  border-color: rgba(129, 140, 248, 0.28);
  background:
    linear-gradient(120deg, rgba(79, 70, 229, 0.055), transparent 42%),
    linear-gradient(145deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.90));
}

.premium-card {
  box-shadow:
    inset 0 1px 0 rgba(237, 233, 254, 0.06),
    0 18px 55px rgba(0, 0, 0, 0.31);
}

/* More deliberate section headings. */
.settings-summary-copy > strong,
.otl-trainings-title {
  color: #f8fafc;
  letter-spacing: -0.015em;
}

.settings-summary-copy > strong {
  font-size: 1.11rem;
}

.settings-summary {
  transition: background 180ms ease, border-color 180ms ease;
}

.settings-summary:hover {
  background: rgba(255, 255, 255, 0.018);
}

.settings-card[open] > .settings-summary {
  background: rgba(2, 6, 23, 0.16);
}

/* Surface-level cards should feel tactile, but never float dramatically. */
.upload-box,
.setting-box,
.event-setting,
.trainer-option,
.otl-training-row,
.otl-premium-access,
.otl-patreon-access {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 7px 20px rgba(0, 0, 0, 0.14);
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    background-color 170ms ease,
    box-shadow 170ms ease;
}

.upload-box:hover,
.setting-box:hover,
.event-setting:hover,
.trainer-option:hover,
.otl-training-row:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 11px 28px rgba(0, 0, 0, 0.21);
}

/* Preserve each light's identity inside the media boxes. */
.upload-box.green {
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.09), transparent 42%),
    linear-gradient(150deg, rgba(31, 41, 55, 0.95), rgba(15, 23, 42, 0.88));
}

.upload-box.red {
  background:
    radial-gradient(circle at 100% 0%, rgba(239, 68, 68, 0.09), transparent 42%),
    linear-gradient(150deg, rgba(31, 41, 55, 0.95), rgba(15, 23, 42, 0.88));
}

.upload-box.yellow {
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.10), transparent 42%),
    linear-gradient(150deg, rgba(31, 41, 55, 0.95), rgba(15, 23, 42, 0.88));
}

.upload-box.audio {
  background:
    radial-gradient(circle at 100% 0%, rgba(96, 165, 250, 0.075), transparent 42%),
    linear-gradient(150deg, rgba(31, 41, 55, 0.95), rgba(15, 23, 42, 0.88));
}

/* Polished native controls: accessible HTML behavior, stronger visual treatment. */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  border-color: var(--otl-control-border);
  color: #f8fafc;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.72), rgba(15, 23, 42, 0.58));
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(148, 163, 184, 0.48);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(147, 197, 253, 0.68);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.24),
    0 0 0 3px rgba(59, 130, 246, 0.11);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #60a5fa;
}

input[type="range"] {
  accent-color: #60a5fa;
}

.upload-box.green input[type="range"],
.upload-box.green input[type="checkbox"] { accent-color: var(--green); }
.upload-box.red input[type="range"],
.upload-box.red input[type="checkbox"] { accent-color: var(--red); }
.upload-box.yellow input[type="range"],
.upload-box.yellow input[type="checkbox"] { accent-color: var(--yellow); }

/* File inputs now read as deliberate upload controls instead of browser defaults. */
input[type="file"] {
  width: 100%;
  padding: 7px;
  border: 1px dashed rgba(148, 163, 184, 0.30);
  border-radius: 11px;
  color: #94a3b8;
  background: rgba(2, 6, 23, 0.28);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input[type="file"]:hover {
  border-color: rgba(148, 163, 184, 0.48);
  background: rgba(2, 6, 23, 0.40);
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(148, 163, 184, 0.30);
  border-radius: 8px;
  color: #e2e8f0;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.88), rgba(30, 41, 59, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  cursor: pointer;
  font-weight: 750;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

input[type="file"]::file-selector-button:hover {
  border-color: rgba(147, 197, 253, 0.46);
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.92), rgba(30, 41, 59, 0.94));
}

.upload-box.green input[type="file"] { border-color: rgba(34, 197, 94, 0.25); }
.upload-box.red input[type="file"] { border-color: rgba(239, 68, 68, 0.25); }
.upload-box.yellow input[type="file"] { border-color: rgba(245, 158, 11, 0.28); }

/* Buttons get consistent tactile feedback without changing their existing colors. */
button {
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:not(:disabled):active {
  transform: translateY(0);
}

.primary-btn:not(:disabled):hover,
.play-btn:not(:disabled):hover {
  box-shadow:
    0 10px 28px rgba(37, 99, 235, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.settings-summary-action,
.premium-badge,
.premium-lock,
.trainer-tier-badge,
.event-tier-badge {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

/* Give category dividers a softer illuminated edge. */
.event-category + .event-category {
  border-top-color: rgba(148, 163, 184, 0.20) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.012);
}

.event-category-heading strong {
  letter-spacing: -0.012em;
}

/* Shared footer interaction and collapsible-section reveal motion. */
.otl-site-footer a,
.otl-site-footer button {
  display: inline-block;
  transition: color 150ms ease, transform 150ms ease !important;
}

.otl-site-footer a:hover,
.otl-site-footer button:hover {
  transform: translateY(-1px) !important;
}

.otl-site-footer a:active,
.otl-site-footer button:active {
  transform: translateY(0) !important;
}

.game-settings-card[open] > .settings-content,
#eventsPanel[open] > .settings-content,
#trainerPanel[open] > .settings-content,
.premium-card[open] > .settings-content,
#otlTrainings[open] > .settings-content {
  transform-origin: top center !important;
  animation: otl-shared-section-reveal 190ms ease-out both !important;
}

@keyframes otl-shared-section-reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Motion stays restrained and respects the user's OS preference. */
@media (prefers-reduced-motion: reduce) {
  .settings-summary,
  .upload-box,
  .setting-box,
  .event-setting,
  .trainer-option,
  .otl-training-row,
  button,
  input,
  select,
  textarea,
  .otl-site-footer a {
    transition: none !important;
  }

  .upload-box:hover,
  .setting-box:hover,
  .event-setting:hover,
  .trainer-option:hover,
  .otl-training-row:hover,
  button:not(:disabled):hover,
  button:not(:disabled):active,
  .otl-site-footer a:hover,
  .otl-site-footer button:hover,
  .otl-site-footer a:active,
  .otl-site-footer button:active {
    transform: none !important;
  }

  .game-settings-card[open] > .settings-content,
  #eventsPanel[open] > .settings-content,
  #trainerPanel[open] > .settings-content,
  .premium-card[open] > .settings-content,
  #otlTrainings[open] > .settings-content {
    animation: none !important;
  }
}

/* Footer is native in index.html so its base presentation exists at first paint. */
.otl-site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin: -12px 0 -18px;
  padding: 0 4px;
  color: #64748b;
  font-size: 0.76rem;
}

.otl-site-footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.otl-site-footer a,
.otl-site-footer button {
  border: 0;
  padding: 0;
  color: #8794aa;
  background: transparent;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.otl-site-footer a:hover,
.otl-site-footer button:hover {
  color: #cbd5e1;
}

@media (max-width: 520px) {
  .otl-site-footer {
    margin: -8px 0 -10px;
  }
}
