/* Stili del visore 3D della mappa (plastico in creta) per la landing di Extraction.
   Tutte le classi sono prefissate .m3d per non collidere con la landing.
   I caratteri sono quelli del gioco (serviti da /assets/fonts): ridichiarati qui cosi' il
   componente e' autonomo anche se incluso da solo. */

@font-face { font-family: 'Barlow Condensed'; src: url('/assets/fonts/BarlowCondensed-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/assets/fonts/BarlowCondensed-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/assets/fonts/IBMPlexMono-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }

.m3d {
  --m3d-acc: #c5603a;      /* ruggine, i luoghi */
  --m3d-estr: #2f9e6b;     /* verde, le estrazioni */
  --m3d-spawn: #5f7d93;    /* acciaio, gli inserimenti */
  --m3d-mono: 'Plex Mono', ui-monospace, monospace;
  --m3d-cond: 'Barlow Condensed', system-ui, sans-serif;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8e1cf;
  isolation: isolate;
}

.m3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* --- poster (prima del 3D) --- */
.m3d-poster {
  position: absolute; inset: 0; z-index: 2;
  background-size: cover; background-position: center;
  transition: opacity 0.6s ease;
}
.m3d-poster.m3d-via { opacity: 0; pointer-events: none; }
.m3d-velo {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 90% 90% at 50% 45%, rgba(10, 11, 12, 0.18), rgba(10, 11, 12, 0.58));
}

/* --- pulsante Esplora --- */
.m3d-btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--m3d-cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; font-size: 18px; color: #f4efe2;
  padding: 14px 26px; border: 1px solid rgba(244, 239, 226, 0.5);
  background: rgba(16, 17, 19, 0.55); backdrop-filter: blur(6px);
  border-radius: 3px; cursor: pointer; transition: all 0.18s ease;
}
.m3d-btn:hover { background: var(--m3d-acc); border-color: var(--m3d-acc); color: #fff; }
.m3d-btn-ic {
  width: 16px; height: 16px; display: inline-block;
  border: 2px solid currentColor; border-radius: 50%;
  position: relative;
}
.m3d-btn-ic::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  border: 1px solid currentColor; opacity: 0.6;
}

/* --- barra di avanzamento --- */
.m3d-barra {
  width: min(70%, 320px);
  font-family: var(--m3d-mono); font-size: 12px; color: #f4efe2; text-transform: uppercase; letter-spacing: 1px;
}
.m3d-barra-fill {
  height: 3px; width: 0%; background: var(--m3d-acc);
  transition: width 0.2s ease; margin-bottom: 8px;
}
.m3d-barra-txt { text-align: center; opacity: 0.85; }

/* --- nota per telefono / errore --- */
.m3d-nota {
  font-family: var(--m3d-mono); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: #f4efe2; text-align: center; padding: 10px 18px;
  border: 1px solid rgba(244, 239, 226, 0.35); background: rgba(16, 17, 19, 0.5);
  border-radius: 3px; max-width: 80%;
}

/* --- barra dei controlli (sotterranei) --- */
.m3d-controlli {
  position: absolute; left: 14px; bottom: 14px; z-index: 4;
  display: flex; gap: 8px;
}
.m3d-ctrl {
  font-family: var(--m3d-cond); font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; font-size: 13px; color: #f3eee1;
  padding: 9px 15px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 19, 21, 0.82); border-radius: 3px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.m3d-ctrl::before {
  content: ''; width: 9px; height: 9px; flex: none;
  border: 1.5px solid currentColor; border-radius: 2px;
}
.m3d-ctrl:hover { background: rgba(30, 32, 35, 0.92); }
.m3d-ctrl.m3d-on { background: var(--m3d-acc); border-color: var(--m3d-acc); color: #fff; }
.m3d-ctrl.m3d-on::before { background: #fff; border-color: #fff; }

/* --- etichette dei POI --- */
.m3d-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.m3d-label {
  position: absolute; top: 0; left: 0; will-change: transform;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--m3d-cond); font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; font-size: 13px; line-height: 1;
  color: #f3eee1; padding: 4px 9px 4px 7px;
  background: rgba(18, 19, 21, 0.78); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px; pointer-events: auto; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.05s linear, background 0.15s ease;
}
.m3d-label::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--m3d-acc);
}
.m3d-label.m3d-estrazione::before { background: var(--m3d-estr); border-radius: 1px; }
.m3d-label.m3d-spawn::before { background: var(--m3d-spawn); }
.m3d-label.m3d-spawn { opacity: 0.85; font-size: 12px; }
.m3d-label:hover { background: rgba(30, 32, 35, 0.92); }
.m3d-label.m3d-attivo {
  background: var(--m3d-acc); color: #fff; font-size: 15px;
  border-color: #fff; z-index: 5;
}
.m3d-label.m3d-attivo.m3d-estrazione { background: var(--m3d-estr); }
.m3d-label.m3d-attivo::before { background: #fff; }
