/* LOKI-10 – Retro Submarine Terminal
   Palette stile Game Boy (4 green tones)
   #001b00, #0f380f, #306230, #8bac0f, #9bbc0f
*/

/* Font Syne Mono */
@font-face {
  font-family: 'SyneMono';
  src: url('SyneMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #001b00;
  color: #9bbc0f;
  font-family: 'SyneMono', monospace;
  text-shadow: 0 0 4px rgba(155, 188, 15, 0.4);
}

/* Header */

header {
  padding: 8px 12px;
  background: #0f380f;
  border-bottom: 2px solid #306230;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header::after {
  content: "DEEP SEA INTERFACE";
  font-size: 10px;
  opacity: 0.7;
}

/* Layout principale */

#main {
  display: flex;
  gap: 12px;
  padding: 10px;
  align-items: flex-start;
}

/* Colonna sinistra: viewport + sonar */

#leftColumn {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* Frame per mantenere canvas SEMPRE quadrato */

.viewport-frame,
.sonar-frame {
  position: relative;
  width: 260px;
  height: 260px;           /* quadrato fisso */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Viewport circolare stile oblò sottomarino */

.viewport-frame {
  border-radius: 50%;
  padding: 10px;
  background:
    radial-gradient(circle at 30% 30%, rgba(155, 188, 15, 0.2), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(15, 56, 15, 0.5), #001b00 80%);
  border: 3px solid #306230;
  box-shadow:
    0 0 12px rgba(0, 0, 0, 0.8),
    0 0 18px rgba(155, 188, 15, 0.4) inset;
}

/* Canvas viewport: quadrato, riempie il frame ma resta tondo visivamente */

#viewport {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  background: #000;
  border: 2px solid #0f380f;
}

/* Leggenda sotto la viewport */

.viewport-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.7;
}

/* Sonar */

.sonar-frame {
  border-radius: 50%;
  padding: 8px;
  background: radial-gradient(circle, #0f380f 0%, #001b00 75%);
  border: 2px solid #306230;
  box-shadow:
    0 0 10px rgba(0, 0, 0, 0.9),
    0 0 14px rgba(48, 98, 48, 0.6) inset;
}

#sonar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  background: radial-gradient(circle, #001b00 0%, #000 70%);
}

/* Terminale a destra */

#terminalWrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 2px solid #306230;
  background: #001500;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
}

/* Effetto scanlines sul terminale */

#terminalWrapper::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12),
    rgba(0, 0, 0, 0.12) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.9;
}

/* Effetto bagliore bordo interno */

#terminalWrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(155, 188, 15, 0.18);
  box-shadow: 0 0 18px rgba(155, 188, 15, 0.2) inset;
  pointer-events: none;
}

/* TOOLBAR TERMINALE + MINI QUADRANTE AUDIO */

#terminalToolbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-bottom: 1px solid #0f380f;
  background: linear-gradient(to bottom, #001b00 0%, #000f00 100%);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#terminalToolbar .toolbar-left,
#terminalToolbar .toolbar-right {
  opacity: 0.8;
  white-space: nowrap;
}

#terminalToolbar .toolbar-right {
  text-align: right;
}

#audioScope {
  image-rendering: pixelated;
  background: #000;
  border: 1px solid #306230;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8) inset;
}

/* Area output log */

#terminalOutput {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 6px;
  background: transparent;
  font-size: 12px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

/* Barre di scorrimento in stile CRT */

#terminalOutput::-webkit-scrollbar {
  width: 6px;
}

#terminalOutput::-webkit-scrollbar-track {
  background: #001000;
}

#terminalOutput::-webkit-scrollbar-thumb {
  background: #306230;
}

/* Riga di input */

.inputLine {
  display: flex;
  align-items: center;
  padding: 6px 8px 8px;
  border-top: 1px solid #0f380f;
  background: rgba(0, 10, 0, 0.9);
  position: relative;
  z-index: 1;
}

.inputLine span {
  color: #8bac0f;
  margin-right: 6px;
  font-size: 12px;
}

/* Input del terminale */

#terminalInput {
  flex: 1;
  background: #000;
  color: #9bbc0f;
  border: 1px solid #306230;
  padding: 4px 6px;
  font-family: 'SyneMono', monospace;
  font-size: 12px;
  outline: none;
  text-shadow: 0 0 4px rgba(155, 188, 15, 0.6);
}

#terminalInput:focus {
  border-color: #9bbc0f;
  box-shadow: 0 0 8px rgba(155, 188, 15, 0.5);
}

/* Colori di sistema:
   - sys: normale (verde)
   - warn / warning: giallo-oliva
   - err / error: rosso smorzato
*/

.sys {
  color: #9bbc0f;
}

.warn,
.warning {
  color: #c4c92d;
  text-shadow: 0 0 4px rgba(196, 201, 45, 0.7);
}

.err,
.error {
  color: #8b4131;
  text-shadow: 0 0 4px rgba(139, 65, 49, 0.9);
}

/* Piccolo lampeggio cursore per sensazione "viva" */

@keyframes lokiGlow {
  0%, 100% {
    text-shadow: 0 0 4px rgba(155, 188, 15, 0.6);
  }
  50% {
    text-shadow: 0 0 8px rgba(155, 188, 15, 1);
  }
}

#terminalOutput,
#terminalInput {
  animation: lokiGlow 2.8s ease-in-out infinite;
}

/* Responsive: su schermi stretti, terminale sotto */

@media (max-width: 800px) {
  #main {
    flex-direction: column;
    align-items: center;
  }

  #terminalWrapper {
    width: 100%;
  }
}

/* ============================
   MISSION BRIEFING OVERLAY
   ============================ */

#briefingOverlay {
  position: fixed;
  inset: 0;
  background: #001b00;
  color: #9bbc0f;
  font-family: 'SyneMono', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

#briefingOverlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#briefingBox {
  max-width: 700px;
  border: 2px solid #306230;
  padding: 20px;
  background: #000f00;
  box-shadow: 0 0 18px rgba(155,188,15,0.4) inset;
}

#briefingBox h1 {
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

#briefingBox pre {
  font-size: 12px;
  white-space: pre-wrap;
  letter-spacing: 0.05em;
  line-height: 1.3;
  margin: 0;
}

#startMissionBtn {
  margin-top: 20px;
  padding: 10px 20px;
  font-family: inherit;
  background: #0f380f;
  border: 2px solid #306230;
  color: #9bbc0f;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

#startMissionBtn:hover {
  background: #306230;
  color: #001b00;
}

