:root {
  --bg: #07152c;
  --panel: rgba(9, 28, 56, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --text: #f2f7ff;
  --muted: #b6c6de;
  --accent: #f28b1a;
  --accent-2: #44a9ff;
  --danger: #d45c5c;
  --success: #6ac28b;
  --border: rgba(255, 255, 255, 0.1);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(68, 169, 255, 0.18), transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(242, 139, 26, 0.14), transparent 22%),
    linear-gradient(135deg, #07152c 0%, #0b2347 55%, #102142 100%);
  min-height: 100vh;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 12, 26, 0.5);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav a, .button {
  color: var(--text);
  text-decoration: none;
  background: var(--panel-soft);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.nav a:hover, .button:hover, button:hover { border-color: rgba(242, 139, 26, 0.5); }
.page-shell { padding: 1.25rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.grid { display: grid; gap: 1rem; }
.two-col { grid-template-columns: 2fr 1fr; }
.stack-form { display: grid; gap: 0.75rem; }
label { font-weight: 700; }
input, select, textarea, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
}
input, select, textarea {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
button {
  cursor: pointer;
  background: linear-gradient(180deg, #f59a31 0%, #e67e0b 100%);
  color: #091222;
  font-weight: 700;
}
.code-block {
  width: 100%;
  min-height: 320px;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
}
.code-block.compact { min-height: 200px; white-space: pre-wrap; }
.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.alert-success { background: rgba(106, 194, 139, 0.12); border-color: rgba(106, 194, 139, 0.35); }
.alert-error { background: rgba(212, 92, 92, 0.12); border-color: rgba(212, 92, 92, 0.35); }
.hidden { display: none !important; }
.toolbar, .button-grid { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.button-grid button { min-width: 145px; }
.button.ghost { background: rgba(255,255,255,0.05); color: var(--text); }
.list-cards { display: grid; gap: 0.75rem; }
.list-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.list-card span, .muted { color: var(--muted); }
.login-body {
  display: grid;
  place-items: center;
  padding: 2rem;
}
.login-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}
.display-shell {
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}
.display-left, .display-right {
  background: rgba(4, 15, 32, 0.5);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
}
.stage-chip {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(242, 139, 26, 0.16);
  color: #ffd8aa;
  text-transform: capitalize;
  font-weight: 700;
}
#stageTitle {
  font-size: clamp(2rem, 4vw, 4rem);
  margin: 0 0 0.5rem;
}
.stage-subtitle { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.25rem; }
.assignment-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}
.assignment-table th, .assignment-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  font-size: 1.15rem;
}
.assignment-table th { text-align: left; background: rgba(68, 169, 255, 0.12); }
.timer-ring {
  min-height: 100%;
  border-radius: 50px;
  border: 2px solid rgba(242, 139, 26, 0.4);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  background: radial-gradient(circle at center, rgba(242, 139, 26, 0.08), transparent 55%);
}
.timer-label { color: var(--muted); font-size: 1.25rem; }
.timer-value { font-size: clamp(4rem, 10vw, 8rem); font-weight: 700; line-height: 1; }
.timer-status { margin-top: 0.8rem; text-transform: capitalize; color: #ffd8aa; font-weight: 700; }
.progress-bar-wrap { margin-top: 1.25rem; }
.progress-bar {
  height: 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.progress-text { margin-top: 0.55rem; color: var(--muted); }
.media-loop {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255,255,255,0.25);
  border-radius: 18px;
  color: var(--muted);
  font-size: 1.1rem;
  background: rgba(255,255,255,0.03);
}
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
@media (max-width: 980px) {
  .two-col, .display-shell { grid-template-columns: 1fr; }
}
