:root {
  /* Philips CD-i Authentic Palette */
  --cdi-bg-deep: #051320;
  --cdi-bg-mid: #0d2b45;
  --cdi-bg-teal: #143e5e;
  --cdi-panel-bg: #10263c;
  --cdi-panel-header: #1b3d5c;
  --cdi-border-outer: #3d6a8f;
  --cdi-border-inner: #071725;
  --cdi-border-highlight: #709fc5;
  --cdi-philips-blue: #00539f;
  --cdi-cyan-glow: #00f0ff;
  --cdi-cyan-dim: #0099aa;
  --cdi-amber: #ffaa00;
  --cdi-green-led: #00ff66;
  --cdi-text-light: #eaf3fa;
  --cdi-text-muted: #8aa9c4;
  --cdi-input-bg: #071522;
  --cdi-button-gradient: linear-gradient(180deg, #2b618f 0%, #173e63 50%, #0e2b47 100%);
  --cdi-button-hover: linear-gradient(180deg, #3775ac 0%, #1f507e 50%, #123759 100%);
  
  --font-display: 'Chakra Petch', -apple-system, sans-serif;
  --font-retro: 'VT323', monospace;
  --font-body: 'Inter', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at 50% 20%, #153e63 0%, #0a2137 45%, #04101c 100%);
  background-attachment: fixed;
  color: var(--cdi-text-light);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 36px 16px;
  position: relative;
}

/* Subtle scanlines effect reminiscent of a 90s Trinitron TV / CD-i monitor */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.18) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 6px 100%;
  z-index: 100;
  opacity: 0.6;
}

.container {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 2;
}

/* 1. PHILIPS TOP HEADER */
.cdi-header {
  background: #091a29;
  border: 2px solid var(--cdi-border-outer);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: inset 1px 1px 0 #588db6, 0 8px 24px rgba(0, 0, 0, 0.5);
}

.philips-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(180deg, #163654 0%, #0b2034 100%);
}

.philips-box {
  background: var(--cdi-philips-blue);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 3px;
  padding: 4px 14px;
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.4), inset -1px -1px 0 rgba(0,0,0,0.5);
}

.system-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 2px;
  font-size: 0.88rem;
  color: #d1e7fa;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.led-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #000;
}

.led-green {
  background-color: var(--cdi-green-led);
  box-shadow: 0 0 8px var(--cdi-green-led), inset 1px 1px 2px #fff;
  animation: pulse-led 3s infinite ease-in-out;
}

@keyframes pulse-led {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.led-label {
  font-family: var(--font-retro);
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--cdi-green-led);
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.6);
}

/* The signature CD-i Rainbow Stripe */
.rainbow-stripe {
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg, 
    #e52521 0%, 
    #f26f21 16.6%, 
    #f9a01b 33.3%, 
    #fed100 50%, 
    #8ec33e 66.6%, 
    #00a0dc 83.3%, 
    #7f3f98 100%
  );
}

/* 2. PLAYER SHELL (MAIN CARD) */
.cdi-shell {
  background: var(--cdi-panel-bg);
  border: 2px solid var(--cdi-border-outer);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: inset 1px 1px 0 #588db6, 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.shell-titlebar {
  background: var(--cdi-panel-header);
  border-bottom: 2px solid var(--cdi-border-inner);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.window-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  color: #b9d8f3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.disc-icon {
  font-size: 1.15rem;
  display: inline-block;
  animation: spin 10s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.shell-indicators {
  display: flex;
  gap: 8px;
}

.badge-dvc, .badge-os9 {
  font-family: var(--font-retro);
  font-size: 1.05rem;
  padding: 1px 8px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.badge-dvc {
  background: #3b2805;
  color: var(--cdi-amber);
  border: 1px solid var(--cdi-amber);
  text-shadow: 0 0 5px rgba(255, 170, 0, 0.5);
}

.badge-os9 {
  background: #062b3a;
  color: var(--cdi-cyan-glow);
  border: 1px solid var(--cdi-cyan-dim);
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

.shell-body {
  padding: 24px 22px;
}

.lead-text {
  font-size: 0.92rem;
  color: var(--cdi-text-muted);
  margin-bottom: 22px;
  border-left: 3px solid var(--cdi-cyan-glow);
  padding-left: 12px;
  background: rgba(0, 240, 255, 0.04);
  padding-top: 6px;
  padding-bottom: 6px;
}

/* 3. FORM FIELDS */
.field-block {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 1px;
  color: #cbe3f8;
}

.num-badge {
  font-family: var(--font-retro);
  background: #091b2c;
  color: var(--cdi-cyan-glow);
  border: 1px solid var(--cdi-cyan-dim);
  padding: 0 6px;
  font-size: 1.1rem;
  border-radius: 3px;
}

.select-frame {
  position: relative;
}

select, textarea, input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--cdi-input-bg);
  border: 2px solid #23486a;
  border-radius: 4px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.6);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300f0ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 42px;
}

select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #172d42;
}

select:focus, textarea:focus, input[type="text"]:focus {
  border-color: var(--cdi-cyan-glow);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8), 0 0 8px rgba(0, 240, 255, 0.4);
}

.opt-other {
  color: #ffa834;
  font-weight: 600;
  background: #191b20;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.helper-bar {
  font-size: 0.8rem;
  color: var(--cdi-text-muted);
  font-family: var(--font-display);
}

/* 4. RETRO DETAILS DRAWER */
.retro-details {
  margin-bottom: 22px;
  border: 1px solid #224a6e;
  background: rgba(8, 22, 36, 0.5);
  border-radius: 4px;
  padding: 10px 14px;
}

.retro-details summary {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cdi-cyan-glow);
  cursor: pointer;
  outline: none;
  user-select: none;
}

.details-content {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-row label {
  font-size: 0.82rem;
  color: var(--cdi-text-muted);
  font-family: var(--font-display);
}

/* 5. ACTION BUTTON */
.action-dock {
  margin-top: 10px;
}

.cdi-btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: var(--cdi-button-gradient);
  border: 2px solid #5a8ab8;
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.3), 
              inset -1px -1px 0 rgba(0, 0, 0, 0.6), 
              0 6px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.15s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.cdi-btn-primary:hover {
  background: var(--cdi-button-hover);
  border-color: var(--cdi-cyan-glow);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.5), 
              inset -1px -1px 0 rgba(0, 0, 0, 0.6), 
              0 0 15px rgba(0, 240, 255, 0.4);
}

.cdi-btn-primary:active {
  transform: translateY(2px);
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.cdi-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-disc {
  font-size: 1.25rem;
}

/* STATUS MESSAGE */
.status-panel {
  margin-top: 18px;
  padding: 14px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.status-panel.success {
  background: rgba(0, 255, 102, 0.1);
  border: 2px solid var(--cdi-green-led);
  color: #a3ffc7;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.4);
}

.status-panel.error {
  background: rgba(255, 51, 68, 0.15);
  border: 2px solid #ff3344;
  color: #ff99aa;
  text-shadow: 0 0 8px rgba(255, 51, 68, 0.4);
}

.hidden {
  display: none;
}

/* FOOTER */
.cdi-footer {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: #4a6d8c;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-dot {
  color: #274561;
}

.admin-link {
  color: var(--cdi-cyan-glow);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed var(--cdi-cyan-dim);
}

.admin-link:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}
