:root{
  --bg:#0b0f14;
  --panel:#101826;
  --panel2:#0f1b2c;
  --text:#e8f1ff;
  --muted:#8aa4c2;
  --accent:#5df2c2;
  --danger:#ff4d6d;
  --gold:#ffd166;
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  font-family: "Press Start 2P", system-ui, sans-serif;
  background: radial-gradient(circle at 20% 20%, #122038 0%, #06080b 60%, #000 100%);
  color: var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
}

#crt{
  width:min(860px, 100%);
  filter: saturate(1.2) contrast(1.05);
}

#bezel{
  border: 10px solid #1e2a3c;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #101826, #070b10);
  box-shadow: 0 20px 60px rgba(0,0,0,.65);
  position:relative;
  overflow:hidden;
}

/* Scanlines + subtle screen glow */
#bezel::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.04) 1px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: overlay;
  opacity:.35;
}
#bezel::after{
  content:"";
  position:absolute;
  inset:-40px;
  pointer-events:none;
  background: radial-gradient(circle at 40% 30%, rgba(93,242,194,.20), rgba(0,0,0,0) 55%);
  opacity:.85;
}

#game{
  position:relative;
  background: linear-gradient(180deg, #0b1220 0%, #07101e 100%);
  border: 4px solid #2b3b55;
  border-radius: 10px;
  width: 100%;
  height: min(620px, 80vh);
  overflow:hidden;
}

.screen{
  height: 100%;
  padding: 18px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.row{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items:center;
}

.title{
  font-size: 18px;
  line-height: 1.35;
  color: var(--accent);
  text-shadow: 0 2px 0 rgba(0,0,0,.75);
}

.subtitle{
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}

.panel{
  background: linear-gradient(180deg, rgba(16,24,38,.85), rgba(7,12,18,.85));
  border: 3px solid #2b3b55;
  border-radius: 10px;
  padding: 14px;
}

hr.pixel{
  border:0;
  height: 3px;
  background: #2b3b55;
  margin: 10px 0;
}

.btn{
  cursor:pointer;
  border: 3px solid #2b3b55;
  background: linear-gradient(180deg, #16243a, #0d1626);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: .2px;
  box-shadow: 0 6px 0 rgba(0,0,0,.5);
  user-select:none;
}

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

.btn.primary{
  border-color: rgba(93,242,194,.7);
}

.btn.danger{
  border-color: rgba(255,77,109,.7);
}

.btn.small{
  padding: 10px 10px;
  font-size: 9px;
}

.kbd{
  display:inline-block;
  border: 2px solid #2b3b55;
  border-bottom-width: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 9px;
  color: var(--muted);
  background: rgba(0,0,0,.25);
}

.question{
  font-size: 11px;
  line-height: 1.85;
}

.choices{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 10px;
}

.choice{
  border: 3px solid #2b3b55;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,.20);
  font-size: 10px;
  line-height: 1.6;
  cursor:pointer;
}

.choice.selected{
  outline: 3px solid rgba(93,242,194,.65);
  box-shadow: 0 0 0 4px rgba(93,242,194,.12);
}

.choice.correct{
  border-color: rgba(93,242,194,.85);
}
.choice.wrong{
  border-color: rgba(255,77,109,.85);
}

.hud{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 9px;
  color: var(--muted);
}

.badge{
  display:inline-block;
  padding: 6px 8px;
  border: 2px solid #2b3b55;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
}

.badge.good{ border-color: rgba(93,242,194,.65); color: var(--accent); }
.badge.warn{ border-color: rgba(255,209,102,.7); color: var(--gold); }
.badge.bad{ border-color: rgba(255,77,109,.7); color: var(--danger); }

.smalltext{
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
}

textarea, input[type="text"], select{
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 10px;
  color: var(--text);
  background: rgba(0,0,0,.25);
  border: 3px solid #2b3b55;
  border-radius: 10px;
}

textarea{ min-height: 140px; resize: vertical; }

.table{
  width:100%;
  border-collapse: collapse;
  font-size: 9px;
  line-height: 1.7;
}
.table th, .table td{
  border-bottom: 2px solid #2b3b55;
  padding: 10px 8px;
  text-align:left;
  vertical-align:top;
}
.table th{ color: var(--accent); }

.footer{
  margin-top:auto;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.glitch{
  text-shadow:
    2px 0 rgba(255,77,109,.35),
    -2px 0 rgba(93,242,194,.35),
    0 2px rgba(255,209,102,.25);
}

@media (max-width: 520px){
  .title{ font-size: 14px; }
  .btn{ width: 100%; }
}
