/* DinosGames Arcade — aspetto comune dei minigiochi (3/11/2026).
   Stessi colori del sito: notte stellata, ciano, oro. */
@font-face {
  font-family: "DinosDisplay";
  src: url("../../assets/font/roboto-blackitalic.ttf") format("truetype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #07111c;
  --surface: #10212f;
  --surface-2: #162c3d;
  --line: #22394b;
  --text: #eaf3fb;
  --soft: #a9bdcc;
  --cyan: #4fe3ff;
  --gold: #ffd166;
  --accent: #4fe3ff;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --accent-rgb: 79, 227, 255;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* corpo fisso: niente scorrimento, rimbalzo o "tira per aggiornare" mentre si gioca */
body.dg-body {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.dg-stage { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }
.dg-probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
a, img, button { -webkit-touch-callout: none; -webkit-user-drag: none; }
button { -webkit-appearance: none; appearance: none; font-family: inherit; touch-action: manipulation; }
a { touch-action: manipulation; }
.dg-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; -webkit-user-select: none; user-select: none; outline: none; }

/* ---- HUD */
.dg-hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l));
  pointer-events: none;
}
.dg-hud > * { pointer-events: auto; }
.dg-hud-r { justify-self: end; display: flex; gap: 8px; }
.dg-ibtn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(7, 17, 28, 0.55); border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text); cursor: pointer; padding: 0;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, transform 0.1s;
}
.dg-ibtn:hover { background: rgba(22, 44, 61, 0.85); }
.dg-ibtn:active { transform: scale(0.94); }
.dg-ibtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dg-ibtn svg .f { fill: currentColor; stroke: none; }
.dg-back { justify-self: start; }
.dg-score {
  text-align: center; line-height: 1; pointer-events: none;
  padding: 6px 16px 7px; border-radius: 16px; min-width: 84px;
  background: rgba(7, 17, 28, 0.5); border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.dg-score b { display: block; font-family: "DinosDisplay", Roboto, sans-serif; font-weight: 900; font-style: italic; font-size: clamp(26px, 5.5vw, 38px); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.dg-score small { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--soft); }
.dg-score small span { color: var(--gold); }
body.dg-menu .dg-score, body.dg-menu .dg-pause { opacity: 0; pointer-events: none; }

/* ---- schermate (titolo, pausa, fine) */
.dg-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10;
  display: flex; padding: 72px 16px 24px;
  padding: calc(64px + var(--safe-t)) calc(16px + var(--safe-r)) calc(20px + var(--safe-b)) calc(16px + var(--safe-l));
  background: radial-gradient(ellipse at 50% 40%, rgba(7, 17, 28, 0.35), rgba(7, 17, 28, 0.82));
  opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
}
.dg-overlay.on { opacity: 1; visibility: visible; transition: opacity 0.25s; }
.dg-card {
  width: min(420px, 100%); margin: auto; flex: none; text-align: center;
  background: linear-gradient(180deg, rgba(22, 44, 61, 0.92), rgba(16, 33, 47, 0.94));
  border: 1px solid var(--line); border-radius: 26px;
  padding: 28px clamp(20px, 5vw, 32px) 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transform: translateY(10px) scale(0.98); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.dg-overlay.on .dg-card { transform: none; }
.dg-icon { width: 84px; height: 84px; margin: -4px auto 14px; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.dg-icon svg, .dg-icon img { width: 100%; height: 100%; display: block; }
.dg-eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.dg-title { margin: 0; font-family: "DinosDisplay", Roboto, sans-serif; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(30px, 8vw, 40px); line-height: 1; text-wrap: balance; }
.dg-tagline { margin: 10px 0 0; color: #d9e7f2; font-size: 15.5px; line-height: 1.45; }
.dg-label { margin: 18px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
.dg-howto { list-style: none; margin: 0; padding: 12px 14px; text-align: left; background: rgba(7, 17, 28, 0.45); border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 8px; }
.dg-howto li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.4; color: #dbe8f3; }
.dg-howto li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dg-actions { display: grid; gap: 10px; margin-top: 20px; }
.dg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  font: 800 16px/1 Roboto, "Segoe UI", system-ui, sans-serif; letter-spacing: 0.02em;
  color: var(--text); background: transparent; border: 2px solid var(--line); text-decoration: none;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.dg-btn:hover { border-color: var(--accent); color: var(--accent); }
.dg-btn:active { transform: scale(0.97); }
.dg-btn svg { width: 18px; height: 18px; }
.dg-btn svg .f { fill: currentColor; }
.dg-primary { background: var(--accent); border-color: var(--accent); color: #04121a; font-size: 18px; min-height: 58px; box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.35); }
.dg-primary:hover { color: #04121a; filter: brightness(1.08); box-shadow: 0 12px 36px rgba(var(--accent-rgb), 0.5); }
.dg-fine { margin: 14px 0 0; color: var(--soft); font-size: 13.5px; }
.dg-fine b { color: var(--gold); }
.dg-kbd { font-size: 12px; opacity: 0.8; margin-top: 8px; }
.dg-final { margin: 18px 0 6px; }
.dg-final span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
.dg-final b { display: block; font-family: "DinosDisplay", Roboto, sans-serif; font-weight: 900; font-style: italic; font-size: 64px; line-height: 1.05; color: var(--accent); text-shadow: 0 0 30px rgba(var(--accent-rgb), 0.45); font-variant-numeric: tabular-nums; }
.dg-pill { display: inline-block; margin: 4px 0 0; padding: 6px 14px; border-radius: 999px; background: rgba(255, 209, 102, 0.14); color: var(--gold); font-weight: 800; font-size: 14px; border: 1px solid rgba(255, 209, 102, 0.45); animation: dg-pop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes dg-pop { from { transform: scale(0.6); opacity: 0; } }
.dg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 16px 0 0; }
.dg-stats div { background: rgba(7, 17, 28, 0.45); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px; }
.dg-stats dt { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); }
.dg-stats dd { margin: 2px 0 0; font-weight: 800; font-size: 18px; }

.dg-promo { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; border-radius: 18px; text-align: left; text-decoration: none; color: var(--text); background: rgba(7, 17, 28, 0.55); border: 1px solid rgba(79, 227, 255, 0.3); transition: border-color 0.15s, background 0.15s; }
.dg-promo:hover { border-color: var(--cyan); background: rgba(22, 44, 61, 0.8); }
.dg-promo img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.dg-promo span { flex: 1; font-size: 13.5px; line-height: 1.35; color: #dbe8f3; }
.dg-promo b { flex: none; font-size: 13px; font-weight: 800; color: #04121a; background: var(--cyan); padding: 7px 12px; border-radius: 999px; }

/* telefoni bassi (iPhone SE) e orizzontale: scheda più compatta */
@media (max-height: 700px) {
  .dg-card { padding-top: 20px; padding-bottom: 18px; }
  .dg-icon { width: 64px; height: 64px; margin-bottom: 10px; }
  .dg-final b { font-size: 52px; }
  .dg-actions { margin-top: 16px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .dg-overlay { padding-top: calc(58px + var(--safe-t)); }
  .dg-card { padding-top: 18px; }
  .dg-icon { display: none; }
}
@media (hover: none) {
  .dg-ibtn:hover { background: rgba(7, 17, 28, 0.55); }
  .dg-btn:hover { border-color: var(--line); color: var(--text); }
  .dg-primary:hover { border-color: var(--accent); color: #04121a; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-card, .dg-overlay { transition: none; }
  .dg-pill { animation: none; }
}
