/**
 * Pagina di errore unica (errors/page.php): codice grande, «Ops…», pulsanti e giochino della macchinina.
 * Solo tema chiaro, colori del sito (tokens.css).
 */
.im-err-main { padding: 0; }
.im-err { --err-blue: #0250ff; --err-sky: #3aa0ff; --err-line: #dbe5fa; --err-soft: #eef4ff; position: relative; overflow: hidden; padding: clamp(2rem, 6vw, 4.5rem) 1rem clamp(2.5rem, 6vw, 4.5rem); background: linear-gradient(180deg, #f5f8ff 0%, #fff 70%); }

/* Cerchi sfumati di sfondo, fermi. */
.im-err__bg span { position: absolute; border-radius: 50%; pointer-events: none; }
.im-err__bg span:nth-child(1) { width: 26rem; height: 26rem; left: -9rem; top: -10rem; background: radial-gradient(closest-side, #dfe9ff, #dfe9ff00); }
.im-err__bg span:nth-child(2) { width: 22rem; height: 22rem; right: -7rem; top: 4rem; background: radial-gradient(closest-side, #e3f1ff, #e3f1ff00); }
.im-err__bg span:nth-child(3) { width: 30rem; height: 30rem; left: 40%; bottom: -18rem; background: radial-gradient(closest-side, #edf3ff, #edf3ff00); }

.im-err__inner { position: relative; z-index: 1; max-width: 54rem; margin: 0 auto; }
.im-err__head { text-align: center; }

.im-err__code { display: flex; justify-content: center; gap: clamp(0.2rem, 1.2vw, 0.6rem); margin: 0 0 1rem; font-weight: 800; font-size: clamp(4.8rem, 17vw, 8.5rem); line-height: 1; letter-spacing: -0.05em; }
.im-err__digit { display: inline-block; background: linear-gradient(160deg, var(--err-blue) 10%, var(--err-sky) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 14px 24px #0250ff33); animation: im-err-bounce 2.8s cubic-bezier(.45, 0, .3, 1) calc(var(--i) * 180ms) infinite; }
@keyframes im-err-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px) rotate(-2deg); } }

.im-err__kicker { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.9rem; padding: 0.35rem 0.85rem; border-radius: 999px; background: #fff; border: 1px solid var(--err-line); color: var(--err-blue); font-size: var(--im-font-size-xs); font-weight: 700; letter-spacing: var(--im-letter-spacing-kicker); text-transform: uppercase; box-shadow: 0 6px 16px #0a1f440a; }
.im-err__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--im-color-warning); box-shadow: 0 0 0 3px #f7900926; }
.im-err__title { margin: 0 0 0.6rem; color: var(--im-color-navy); font-size: clamp(1.7rem, 4.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.im-err__msg { max-width: 32rem; margin: 0 auto 1.6rem; color: var(--im-color-text-muted); font-size: var(--im-font-size-md); line-height: var(--im-line-height-base); }
.im-err__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.im-err-btn { display: inline-flex; align-items: center; gap: 0.45rem; min-height: var(--im-touch-min); padding: 0.55rem 1.25rem; border-radius: 0.8rem; font-weight: 650; }
.im-err-btn.btn-primary { box-shadow: 0 10px 22px #0250ff38; }
.im-err-btn.btn-outline-primary { background: #fff; }

/* —— Gioco —— */
.im-err-game { margin-top: clamp(2rem, 5vw, 3rem); padding: 0.9rem; border: 1px solid var(--err-line); border-radius: 24px; background: #fff; box-shadow: 0 18px 40px #0a1f4414; }
.im-err-game__bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.1rem 0.35rem 0.75rem; }
.im-err-game__t { margin: 0; color: var(--im-color-navy); font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-err-game__t i { color: var(--err-blue); }
.im-err-game__score { contain: layout; display: flex; gap: 0.5rem; margin: 0; font-size: var(--im-font-size-sm); color: var(--im-color-text-muted); white-space: nowrap; }
.im-err-game__score > span { padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--err-soft); }
.im-err-game__sm { display: none; }
.im-err-game__score b { color: var(--im-color-navy); font-variant-numeric: tabular-nums; }
.im-err-game__score .im-err-game__site { background: #fff6dc; color: #92400e; }
.im-err-game__site i { color: var(--im-color-warning); }

/* Niente selezione, menu copia/incolla né zoom col doppio tocco: tutto il riquadro è il «pulsante» del gioco. */
.im-err-game { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.im-err-game__stage { position: relative; contain: layout paint; isolation: isolate; height: 230px; border-radius: 16px; overflow: hidden; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; outline: none; }
.im-err-game__stage:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #0250ff66; }
/* Il gioco su un livello suo: ridisegnarlo non costringe il telefono a ricomporre il resto della pagina. */
.im-err-game__canvas { display: block; width: 100%; height: 100%; transform: translateZ(0); }
.im-err-game__overlay { position: absolute; inset: 0; display: grid; place-content: center; gap: 0.35rem; padding: 1rem; text-align: center; background: #ffffff8c; backdrop-filter: blur(2px); transition: opacity .25s; }
.im-err-game__overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; backdrop-filter: none; transition: opacity .25s, visibility 0s .25s; }
/* Mentre si gioca il codice grande sta fermo (il suo effetto costa sui telefoni). */
.im-err-playing .im-err__digit { animation-play-state: paused; }
.im-err-game__ot { margin: 0; color: var(--im-color-navy); font-size: 1.25rem; font-weight: 800; }
.im-err-game__os { margin: 0; color: var(--im-color-text-muted); font-size: var(--im-font-size-sm); }
.im-err-game__os kbd { padding: 0.1rem 0.45rem; border: 1px solid var(--err-line); border-bottom-width: 3px; border-radius: 6px; background: #fff; color: var(--im-color-navy); font-size: 0.8em; font-family: inherit; font-weight: 700; }
/* Pulsante «Salta» sotto il gioco, solo sui telefoni: un tasto bianco come il «spazio» del gioco, che si abbassa quando premi. */
.im-err-game__jump { display: none; }
@media (pointer: coarse), (max-width: 575.98px) {
  /* Il «bordo» sotto è un ombra piena: premendo cambiano solo spostamento e ombra, mai le misure (niente ricalcolo della pagina a ogni salto). */
  .im-err-game__jump { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; height: 3.1rem; margin: 0.75rem 0 4px; border: 1px solid #c9d6f2; border-radius: 12px; background: #fff; color: var(--im-color-navy); font-size: 1rem; font-weight: 700; box-shadow: 0 4px 0 #9fb4e3; touch-action: none; -webkit-tap-highlight-color: transparent; will-change: transform; }
  .im-err-game__jump i { color: var(--err-blue); font-size: 1.25rem; }
  .im-err-game__jump.is-down { transform: translateY(3px); box-shadow: 0 1px 0 #9fb4e3; }
  .im-err-game__jump:focus-visible { outline: none; box-shadow: 0 4px 0 #9fb4e3, 0 0 0 3px #0250ff40; }
}
.im-err-game__hint {margin: 0.7rem 0.35rem 0.1rem; color: var(--im-color-text-muted); font-size: var(--im-font-size-xs); text-align: center; }
.im-err-game__hint i { color: var(--im-color-warning); }

/* Layout di riserva (senza header del sito). */
.im-err-bare__head { display: flex; justify-content: center; padding: 1rem; background: #fff; border-bottom: 1px solid var(--im-color-border); }

@media (max-width: 575.98px) {
  .im-err-game { padding: 0.6rem; border-radius: 18px; }
  .im-err-game__bar { flex-direction: column; align-items: stretch; gap: 0.5rem; padding-bottom: 0.6rem; }
  .im-err-game__score { gap: 0.35rem; font-size: var(--im-font-size-xs); }
  .im-err-game__score > span { flex: 1 1 auto; min-width: 0; padding: 0.3rem 0.45rem; text-align: center; overflow: hidden; text-overflow: ellipsis; }
  .im-err-game__score > .im-err-game__site { flex: 0 0 auto; }
  .im-err-game__lg { display: none; }
  .im-err-game__sm { display: inline; }
  .im-err__digit { filter: none; }
  .im-err-game__stage { height: 190px; border-radius: 12px; }
  .im-err__actions .im-err-btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .im-err__digit { animation: none; }
}

/* —— Pagina del gioco Opsy Road (/opsy-road, DEC-059): titolo grande al posto del codice di errore, invito alle auto —— */
.im-or .im-err__kicker i { color: var(--err-blue); }
.im-or__title { margin: 0 0 0.6rem; font-size: clamp(2.6rem, 9vw, 4.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; background: linear-gradient(160deg, var(--err-blue) 10%, var(--err-sky) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.im-or__cta { display: flex; align-items: center; gap: 0.9rem; margin-top: 1.25rem; padding: 0.9rem 1rem; border: 1px solid var(--err-line); border-radius: 18px; background: #fff; }
.im-or__cta-icon { display: grid; place-items: center; flex: 0 0 2.6rem; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--err-soft); color: var(--err-blue); font-size: 1.25rem; }
.im-or__cta-t { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--im-color-text-muted); font-size: var(--im-font-size-sm); }
@media (max-width: 575.98px) {
  .im-or__cta { flex-wrap: wrap; }
  .im-or__cta .im-err-btn { flex: 1 1 100%; justify-content: center; }
}
