/* Radio Mosquito — finestra estiva italiana */

:root {
  --body: #2A2A35;
  --citronella: #F4E04D;
  --sangue: #C73E1D;
  --teal: #4ECDC4;
  --skin: #F7E3AF;
  --glow: #FFB84D;
  --dusk-1: #0d0d1a;
  --dusk-2: #1c1c40;
  --dusk-3: #3c2a50;
  --dusk-4: #f4a26160;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--dusk-1);
  color: var(--skin);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  cursor: default;
}

/* ============ NIGHT SKY BACKDROP ============ */

.night {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 70% 100%, var(--dusk-4) 0%, transparent 60%),
    linear-gradient(180deg, var(--dusk-1) 0%, var(--dusk-2) 40%, var(--dusk-3) 80%, #7a3f4a 100%);
}

.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff, transparent),
    radial-gradient(1px 1px at 82% 18%, #fff, transparent),
    radial-gradient(1px 1px at 34% 45%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 68% 62%, #fff8d0, transparent),
    radial-gradient(1px 1px at 55% 15%, #fff, transparent),
    radial-gradient(1px 1px at 25% 78%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 55%, #fff8d0, transparent),
    radial-gradient(1px 1px at 8% 52%, #fff, transparent),
    radial-gradient(1px 1px at 46% 88%, #fff, transparent);
  opacity: 0.8;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle { from { opacity: 0.6 } to { opacity: 0.95 } }

.cricket-hint {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  color: #ffffff70; font-size: 12px; z-index: 3;
  letter-spacing: 0.05em; text-shadow: 0 0 8px #000a;
}

/* ============ WINDOW FRAME ============ */

.window {
  position: fixed; inset: 40px; z-index: 2;
  border: 14px solid #4a3020;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px #2a1a10 inset,
    0 0 0 4px #6a4530 inset,
    0 20px 60px #0009,
    inset 0 0 80px #ffb84d20;
  background: transparent;
  overflow: hidden;
}

.frame-h, .frame-v {
  position: absolute; background: #4a3020;
  box-shadow: 0 0 0 2px #2a1a10 inset;
  z-index: 4;
}
.frame-h { left: 0; right: 0; top: 50%; height: 12px; transform: translateY(-50%); }
.frame-v { top: 0; bottom: 0; left: 50%; width: 12px; transform: translateX(-50%); }

.pane {
  position: absolute; z-index: 3;
  background:
    radial-gradient(ellipse at 30% 20%, #ffe3a020 0%, transparent 60%),
    linear-gradient(160deg, #ffffff08 0%, transparent 30%);
}
.pane-tl { left: 0; top: 0; width: 50%; height: 50%; }
.pane-tr { right: 0; top: 0; width: 50%; height: 50%; }
.pane-bl { left: 0; bottom: 0; width: 50%; height: 50%; }
.pane-br { right: 0; bottom: 0; width: 50%; height: 50%; }

/* Zanzariera (mosquito screen mesh overlay) */
.mesh {
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
  background-image:
    linear-gradient(0deg, #00000018 1px, transparent 1px),
    linear-gradient(90deg, #00000018 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.6;
}

/* ============ CARD ============ */

.card {
  position: relative; z-index: 6;
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 28px 24px;
  text-align: center;
  height: 100%;
  display: flex; flex-direction: column;
  justify-content: space-between;
}

header h1 {
  font-family: 'Lilita One', cursive;
  font-size: clamp(48px, 12vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--citronella);
  text-shadow:
    2px 2px 0 var(--sangue),
    0 0 30px #f4e04d40;
  transform: rotate(-3deg);
  margin-bottom: 12px;
}

.freq {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--skin);
  opacity: 0.8;
}

.on-air {
  color: var(--sangue);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.3 } }

/* ============ SPIRAL PLAY BUTTON ============ */

.spiral-wrap {
  position: relative;
  width: 180px; height: 180px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}

.spiral {
  position: relative;
  width: 180px; height: 180px;
  border: none;
  background: radial-gradient(circle at 50% 50%, #3a2010 0%, #1a0a05 90%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 0 40px #f4e04d40,
    inset 0 0 20px #0009;
  transition: transform 0.2s;
}

.spiral:hover { transform: scale(1.03); box-shadow: 0 0 60px #f4e04d70, inset 0 0 20px #0009; }
.spiral:active { transform: scale(0.98); }

.coil {
  position: absolute; inset: 12px;
  width: calc(100% - 24px); height: calc(100% - 24px);
  animation: rotate 30s linear infinite;
  filter: drop-shadow(0 0 6px #f4e04d);
}

.spiral.playing .coil { animation: rotate 8s linear infinite; }

@keyframes rotate { to { transform: rotate(360deg); } }

.smoke {
  position: absolute; top: 10%; left: 50%; transform: translateX(-50%);
  width: 40px; height: 60px;
  background: radial-gradient(ellipse at 50% 80%, #ffffff40 0%, transparent 60%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s;
}

.spiral.playing .smoke {
  opacity: 1;
  animation: smoke 3s ease-out infinite;
}

@keyframes smoke {
  0% { transform: translate(-50%, 0) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -80px) scale(2); opacity: 0; }
}

.glyph {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 46px;
  color: var(--citronella);
  z-index: 2;
  filter: drop-shadow(0 0 8px #0009);
}

/* ============ NOW PLAYING ============ */

.now {
  margin: 8px 0;
  min-height: 68px;
}

.np-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  opacity: 0.6;
  margin-bottom: 6px;
}

.np-title {
  font-family: 'Lilita One', cursive;
  font-size: 22px;
  color: var(--citronella);
  line-height: 1.1;
}

.np-artist {
  font-size: 14px;
  opacity: 0.8;
  font-style: italic;
  margin-top: 4px;
}

/* ============ CONTROLS ============ */

.controls {
  display: flex; gap: 8px; justify-content: center;
  margin: 12px 0;
}

.skip, .share {
  background: transparent;
  color: var(--skin);
  border: 1.5px solid #f7e3af40;
  border-radius: 20px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.skip:hover, .share:hover {
  border-color: var(--citronella);
  color: var(--citronella);
  transform: translateY(-1px);
}

.skip:disabled {
  opacity: 0.3; cursor: not-allowed; transform: none;
}

.swat-counter {
  font-family: 'Lilita One', cursive;
  color: var(--sangue);
  font-size: 14px;
  letter-spacing: 0.15em;
  margin-top: 8px;
  opacity: 0.75;
}

footer {
  padding-top: 14px;
  font-size: 11px;
  opacity: 0.5;
  line-height: 1.5;
}

.tiny { font-size: 10px; opacity: 0.7; }

footer a { color: var(--citronella); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ============ ZANZ ============ */

.zanz {
  position: absolute; z-index: 7;
  bottom: 12%; right: 6%;
  animation: hover 3s ease-in-out infinite;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px #0009);
}

@keyframes hover {
  0%,100% { transform: translate(0,0) rotate(-4deg); }
  33%     { transform: translate(-8px,-12px) rotate(6deg); }
  66%     { transform: translate(6px,-4px) rotate(-2deg); }
}

.wing {
  transform-origin: center;
  animation: flap 0.05s linear infinite alternate;
}
@keyframes flap { to { transform: scaleY(0.4); } }

/* ============ SWARM ============ */

#swarm {
  position: absolute; inset: 0; z-index: 8;
  pointer-events: none;
}

.mini-zanz {
  position: absolute;
  width: 14px; height: 14px;
  pointer-events: none;
  transition: transform 0.15s ease-out;
  font-size: 12px;
  filter: drop-shadow(0 0 3px #0006);
}

/* ============ SPLAT ============ */

.splat {
  position: fixed;
  width: 50px; height: 50px;
  pointer-events: none;
  z-index: 999;
  animation: splat 0.6s ease-out forwards;
  transform-origin: center;
}

@keyframes splat {
  0%   { transform: scale(0.3); opacity: 1; }
  50%  { transform: scale(1.2); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ============ MODAL ============ */

.modal {
  position: fixed; inset: 0; z-index: 100;
  background: #000c;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}

.modal.open { display: flex; }

.modal-inner {
  background: var(--dusk-1);
  border: 3px solid var(--citronella);
  border-radius: 12px;
  padding: 28px;
  max-width: 480px;
  color: var(--skin);
  box-shadow: 0 20px 60px #000c, inset 0 0 40px #f4e04d20;
}

.modal-inner h2 {
  font-family: 'Lilita One', cursive;
  color: var(--citronella);
  font-size: 28px;
  margin-bottom: 12px;
}

.modal-inner p { margin-bottom: 12px; font-size: 14px; line-height: 1.5; }
.modal-inner a { color: var(--citronella); }
.modal-inner .close {
  margin-top: 12px;
  background: var(--citronella);
  color: var(--dusk-1);
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.modal-inner .close:hover { background: var(--glow); }

/* ============ RESPONSIVE ============ */

@media (max-width: 480px) {
  .window { inset: 12px; border-width: 8px; }
  .card { padding: 24px 16px; }
  .spiral-wrap, .spiral { width: 150px; height: 150px; }
  .glyph { font-size: 40px; }
  .zanz { transform: scale(0.7); bottom: 8%; right: 2%; }
}

@media (max-height: 700px) {
  header h1 { font-size: 44px; }
  .spiral-wrap, .spiral { width: 130px; height: 130px; }
}
