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

:root {
  --bg: #0f1b2d;
  --bg-soft: #16273f;
  --panel: #1b2f4a;
  --panel-2: #21365a;
  --text: #e6eef7;
  --text-soft: #aebccb;
  --accent: #6fb3d6;
  --accent-2: #8fd0f0;
  --danger: #e08a8a;
  --border: rgba(255, 255, 255, 0.08);
  --focus: #9fd6f2;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --maxw: 1100px;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1c3556 0%, rgba(28, 53, 86, 0) 60%),
    var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: 0.2px;
}

h2 {
  margin-top: 1.4em;
}

p {
  margin: 0 0 1em;
}

.skip-link {
  position: absolute;
  left: -1000px;
  top: 0;
  background: var(--accent);
  color: #06223a;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 27, 45, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand:hover {
  text-decoration: none;
}

/* Small, calm mark beside the brand name (not an animated fan). */
.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent-2) 0%, var(--accent) 60%, #2d4a6e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex: none;
}

.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}

/* ===== Ad slots ===== */
.ad-slot {
  margin: 20px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  width: 100%;
  min-height: 90px;
  max-width: 970px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
}

/* ===== Player ===== */
.player {
  position: relative;
  background:
    radial-gradient(420px 280px at 50% 18%, rgba(111, 179, 214, 0.16) 0%, rgba(111, 179, 214, 0) 70%),
    linear-gradient(180deg, var(--panel) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 24px 28px;
  margin: 20px 0;
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

/* Faint low-contrast texture across the panel. */
.player::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px);
  border-radius: inherit;
}

.player > * {
  position: relative;
}

/* ===== Fan image ===== */
.fan-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2px auto 10px;
}

.fan-image {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(111, 179, 214, 0.18);
  background: #0b1830;
  object-fit: contain;
}

.player-title {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin: 4px 0 0;
}

.player-subtitle {
  color: var(--text-soft);
  margin: 0 0 16px;
}

/* ===== Play / pause ===== */
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #06223a;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: none;
  border-radius: 999px;
  padding: 16px 34px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  min-height: 64px;
  min-width: 160px;
  transition: transform 0.08s ease, filter 0.2s ease;
}
.play-btn:hover { filter: brightness(1.05); }
.play-btn:active { transform: translateY(1px); }
.play-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #e6eef7, #c7d8e6);
  color: #0c223a;
}

.play-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  position: relative;
}
.play-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  border-radius: 2px;
}
.play-btn[aria-pressed="true"] .play-icon::before {
  clip-path: polygon(0 0, 32% 0, 32% 100%, 0 100%, 0 0, 68% 0, 68% 100%, 100% 100%, 100% 0);
}

.audio-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.audio-status.error {
  color: var(--danger);
  font-weight: 600;
}

/* ===== Controls ===== */
.control-row {
  margin: 18px auto 0;
  max-width: 560px;
  text-align: left;
}
.control-row--checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
}
.control-row--volume {
  margin-top: 20px;
}
.control-row--timer {
  margin-top: 18px;
}

.control-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 2px solid #06223a;
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 2px solid #06223a;
  cursor: pointer;
}

.checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}
.checkbox-label {
  cursor: pointer;
  font-weight: 500;
}

.help-text {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin: 6px 0 0 34px;
  max-width: 560px;
}

/* ===== Timer ===== */
.timer-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.timer-btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.timer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}
.timer-btn.active {
  background: rgba(111, 179, 214, 0.22);
  border-color: var(--accent);
  color: #fff;
}
.timer-cancel {
  color: var(--text-soft);
  border-color: var(--border);
  grid-column: 1 / -1;
}
.timer-cancel:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
/* When no timer is running, Cancel is disabled and visually inert so it does
   not look active, alarming, or prominent. */
.timer-cancel:disabled {
  opacity: 0.4;
  background: transparent;
  border-color: var(--border);
  cursor: not-allowed;
}

/* ===== Countdown ===== */
.countdown {
  margin: 14px auto 0;
  max-width: 560px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
}
.countdown-text {
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.fade-note {
  color: var(--accent-2);
  font-weight: 600;
}

/* ===== Content ===== */
.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 4px 20px;
}
.content h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.ownership-note {
  font-style: italic;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 16px;
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq details {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 16px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 1.3rem;
  color: var(--text-soft);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  content: "\2212";
}
.faq p {
  margin: 0 0 12px;
  color: var(--text-soft);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  margin-top: 28px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
  text-align: center;
}
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
}
.footer-inner nav a {
  color: var(--text-soft);
  font-size: 0.92rem;
}
.copyright {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin: 0;
}

/* ===== Dark-screen mode ===== */
body.dark-screen .site-header,
body.dark-screen main,
body.dark-screen .site-footer {
  display: none !important;
}
body.dark-screen {
  background: #000;
}
.dark-restore {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: var(--accent);
  color: #06223a;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  min-height: 48px;
}
.dark-restore:hover { filter: brightness(1.08); }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .header-inner {
    min-height: auto;
    padding: 8px 0;
  }
  .player {
    padding: 20px 16px 24px;
  }
  .fan-image {
    max-width: 200px;
  }
  .timer-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
  .timer-cancel {
    grid-column: 1 / -1;
  }
  .play-btn {
    width: 100%;
    justify-content: center;
  }
  .help-text {
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .fan-image {
    max-width: 170px;
  }
  .timer-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Respect reduced motion globally (no longer used for fan animation). */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Print */
@media print {
  .player, .ad-slot, .site-header, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
}