/* ---- Reset minimo e font ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #111827;
  background:
    radial-gradient(1200px 800px at 10% 10%, #e0f2fe 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 20%, #fce7f3 0%, transparent 60%),
    radial-gradient(900px 900px at 50% 90%, #fef3c7 0%, transparent 60%),
    linear-gradient(120deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ---- Layout reattivo: metà/metà ---- */
.split {
  display: flex;
  min-height: 100dvh;
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(10px, 2vw, 20px);
}

@media (orientation: portrait) {
  .split { flex-direction: column; }
}

@media (orientation: landscape) {
  .split { flex-direction: row; }
}

/* ---- Pannelli "glass" ---- */
.panel {
  flex: 1;
  position: relative;
  border-radius: 18px;
  padding: clamp(16px, 3vw, 32px);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 10px 25px rgba(2, 8, 23, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
}

.panel.song {
  background-image:
    radial-gradient(600px 300px at 10% 10%, rgba(59,130,246,0.12) 0%, transparent 60%);
}

.panel.animal {
  background-image:
    radial-gradient(600px 300px at 90% 10%, rgba(234,88,12,0.12) 0%, transparent 60%);
}

/* ---- Titoli e valori ---- */
.panel h2 {
  margin: 0 0 8px 0;
  letter-spacing: 0.4px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  font-size: clamp(14px, 1.8vw, 18px);
  opacity: 0.9;
}

.value {
  text-align: center;
  width: 100%;
  max-width: 90%;
  color: #0b1220;
  text-wrap: balance;
  line-height: 1.1;
  /* Dimensione testuale grande, adattiva */
  font-size: clamp(28px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 220ms ease, filter 220ms ease;
  will-change: transform;
  user-select: none;
}

.value.pop {
  transform: scale(1.035);
  filter: drop-shadow(0 6px 12px rgba(2,8,23,0.15));
}

/* ---- Pulsanti ---- */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
}

button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: clamp(14px, 1.8vw, 16px);
  font-weight: 700;
  cursor: pointer;
  color: #0b1220;
  background: linear-gradient(180deg, #ffffff, #f3f4f6);
  box-shadow:
    0 8px 20px rgba(2, 8, 23, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.9);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 26px rgba(2, 8, 23, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.95);
}

button:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

/* Varianti colore (opzionali) */
button.primary {
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  color: #0b1220;
}
button.accent {
  background: linear-gradient(180deg, #ffedd5, #fed7aa);
  color: #0b1220;
}
button.ghost {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  padding: 10px 14px;
  border-radius: 10px;
  color: #0b1220;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 24px rgba(2,8,23,0.12);
  font-weight: 600;
  font-size: 14px;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}