:root {
     --bg: #05070b;
     --panel: rgba(10, 18, 28, 0.72);
     --line: rgba(92, 224, 255, 0.22);
     --cyan: #66e6ff;
     --cyan-strong: #9cf2ff;
     --text: #d9f7ff;
     --muted: #84b7c4;
     --danger: #ff6487;
     --good: #96ffcf;
     --glow: 0 0 14px rgba(102, 230, 255, 0.22), 0 0 36px rgba(102, 230, 255, 0.08);
     --radius: 20px;
     --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
     --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	    --led-red-on: #ff0000;
	    --led-red-glow: rgba(255, 0, 0, 0.6);
	    --led-off: #444444;
	    --led-bg: #1a1a1a; /* Matches terminal background */
}


 * { box-sizing: border-box; }
 html, body {
   margin: 0;
   height: 100%;
   background: radial-gradient(circle at 50% 20%, #0b1220 0%, #04060a 55%, #020304 100%);
   color: var(--text);
   font-family: var(--font);
   overflow: hidden;
 }

 .noise,
 .scanlines,
 .vignette,
 .grid {
   position: fixed;
   inset: 0;
   pointer-events: none;
 }

 .grid {
   background-image:
     linear-gradient(rgba(102,230,255,0.06) 1px, transparent 1px),
     linear-gradient(90deg, rgba(102,230,255,0.04) 1px, transparent 1px);
   background-size: 32px 32px;
   mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
   opacity: 0.22;
 }

 .scanlines {
   background: repeating-linear-gradient(
     to bottom,
     rgba(255,255,255,0.024) 0px,
     rgba(255,255,255,0.024) 1px,
     transparent 2px,
     transparent 4px
   );
   mix-blend-mode: soft-light;
   opacity: 0.18;
   animation: drift 10s linear infinite;
 }

 .noise {
   background-image: radial-gradient(rgba(255,255,255,0.05) 0.6px, transparent 0.6px);
   background-size: 5px 5px;
   opacity: 0.06;
   mix-blend-mode: screen;
 }

 .vignette {
   box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.82), inset 0 0 50px rgba(0,0,0,0.4);
 }

 @keyframes drift {
   from { transform: translateY(0); }
   to { transform: translateY(8px); }
 }

 .app {
   position: relative;
   height: 100%;
   width: min(100vw, calc(100vh * 9 / 16));
   margin: 0 auto;
   aspect-ratio: 9 / 16;
   display: grid;
   grid-template-rows: auto minmax(0, 1fr) auto auto;
   gap: 14px;
   padding: 18px;
 }

 .panel {
   background: linear-gradient(180deg, rgba(12, 20, 31, 0.78), rgba(7, 12, 19, 0.72));
   border: 1px solid var(--line);
   border-radius: var(--radius);
   box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,0.04);
   backdrop-filter: blur(12px);
   overflow: hidden;
 }

 .hero {
   position: relative;
   display: grid;
   grid-template-rows: auto auto minmax(0, 1fr);
   min-height: 0;
 }

 .header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 16px 18px 14px;
   border-bottom: 1px solid var(--line);
   background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
 }

 .brand {
   display: flex;
   flex-direction: column;
   gap: 4px;
 }
 
 .initialTitle {
   margin: auto 0;
 }
 
  .audioDisabled {
   display:none;
 }

 .uninitialised {
 	 min-height: 780px;
 	 margin: 0 auto;
 	 display: flex;
 }

 .brand .kicker {
   font-size: 10px;
   letter-spacing: 0.3em;
   text-transform: uppercase;
   color: var(--muted);
   font-family: var(--mono);
 }

 .brand .title {
   font-size: 34px;
   line-height: 1;
   letter-spacing: 0.06em;
   text-transform: uppercase;
   font-weight: 800;
   text-shadow: 0 0 20px rgba(102,230,255,0.22);
 }

 .status {
   display: inline-flex;
   align-items: center;
   gap: 10px;
   padding: 8px 12px;
   border-radius: 999px;
   border: 1px solid rgba(102,230,255,0.22);
   color: var(--cyan-strong);
   font-family: var(--mono);
   font-size: 11px;
   letter-spacing: 0.08em;
   text-transform: uppercase;
   background: rgba(102,230,255,0.06);
   white-space: nowrap;
 }

 .dot-online {
   width: 10px;
   height: 10px;
   border-radius: 50%;
   background: var(--good);
   box-shadow: 0 0 14px rgba(150,255,207,0.8);
   animation: pulse 1.8s ease-in-out infinite;
 }
 
 .dot-offline {
 width: 10px;
 height: 10px;
 border-radius: 50%;
 background: #ff4d4d; /* High-visibility red */
box-shadow: 0 0 12px rgba(255, 77, 77, 0.7); /* Deep red glow */
  animation: pulse-offline 2s ease-in-out infinite;
}

@keyframes pulse-offline {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(255, 77, 77, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0);
  }
}

  .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 14px rgba(150,255,207,0.8);
    animation: pulse 1.8s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { transform: scale(0.88); opacity: 0.75; }
    50% { transform: scale(1.12); opacity: 1; }
  }

  .strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  }

  .metaCard {
    background: rgba(3, 7, 12, 0.58);
    border: 1px solid rgba(102,230,255,0.14);
    border-radius: 14px;
    padding: 10px 12px;
    min-width: 0;
  }

  .metaCard .label {
    display: block;
    font-family: var(--mono);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }

  .metaCard .value {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .entity {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 8px 12px 12px;
  }

  .entityWrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 0 36px rgba(102,230,255,0.22));
  }

  canvas {
    width: 100%;
    height: 100%;
    display: block;
  }

  .analysisPanel {
    padding: 16px 18px;
    display: grid;
    gap: 10px;
    min-height: 0;
  }

  .analysisTop {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }

  .sectionTitle {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 10px;
  }

  .small {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
    line-height: 1.5;
  }

  .analysisList {
    display: grid;
    gap: 10px;
    max-height: 220px;
    overflow: auto;
    padding-right: 2px;
  }

  .analysisItem {
    border: 1px solid rgba(102,230,255,0.12);
    background: rgba(3, 7, 12, 0.58);
    border-radius: 14px;
    padding: 12px 14px;
  }

  .analysisItem .tag {
    display: inline-block;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(102,230,255,0.08);
    border: 1px solid rgba(102,230,255,0.16);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--cyan-strong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .analysisItem .body {
    color: var(--text);
    line-height: 1.45;
    font-size: 14px;
  }

  .terminal {
    height: 100%;
    background: rgba(3, 7, 12, 0.78);
    border: 1px solid rgba(102,230,255,0.16);
    border-radius: 14px;
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--cyan-strong);
    white-space: pre-wrap;
    overflow: auto;
    min-height: 240px;
  }

  .footer {
    padding: 12px 18px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .footerStatus {
    color: var(--cyan-strong);
  }
  
  .led-container {
    display: inline-flex;
    align-items: center;
    background: var(--led-bg);
    padding: 6px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace; /* Terminal font */
    letter-spacing: 1px;
    user-select: none;
}

.led-bulb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 12px;
    transition: all 0.2s ease;
}

.led-text {
    font-size: 0.85rem;
    font-weight: bold;
}

/* --- STATE: ON --- */
.led-on .led-bulb {
    background-color: var(--led-red-on);
    box-shadow: 
        0 0 4px #fff, 
        0 0 10px var(--led-red-on), 
        0 0 15px var(--led-red-glow);
}

.led-on .led-text {
    color: var(--led-red-on);
    text-shadow: 0 0 8px var(--led-red-glow);
}

/* --- STATE: OFF --- */
.led-off .led-bulb {
    background-color: var(--led-off);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.5);
}

.led-off .led-text {
    color: #666;
}

  @media (max-width: 720px) {
    .app {
      width: 100vw;
      padding: 12px;
      gap: 10px;
    }
    .brand .title { font-size: 26px; }
  }