:root {
  --bg: #08111f;
  --panel: rgba(8, 17, 31, 0.82);
  --panel-soft: rgba(15, 23, 42, 0.65);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #9cb0cf;
  --primary: #f59e0b;
  --primary-strong: #ffb83d;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 20px 80px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.16), transparent 28%),
    linear-gradient(135deg, #020617, #0f172a 55%, #111827);
}

button,
input,
select {
  font: inherit;
}

.controller-body {
  min-height: 100vh;
}

.controller-shell {
  width: min(1380px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero-card,
.panel,
.session-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  padding: 32px;
  border-radius: 32px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.28), transparent 68%);
  pointer-events: none;
}

.eyebrow,
.stage-label,
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--primary-strong);
}

.hero-copy h1,
.panel-header h2,
.access-card h1 {
  margin: 10px 0 0;
  font-family: "Sora", sans-serif;
  line-height: 1.08;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  max-width: 12ch;
}

.hero-copy p,
.panel-header p,
.access-card p,
.empty-state p,
small,
dt {
  color: var(--muted);
}

.hero-stats {
  display: grid;
  gap: 14px;
}

.hero-stats article,
.session-card {
  border-radius: 24px;
  padding: 20px;
}

.hero-stats article {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stats strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.panel {
  border-radius: 28px;
  padding: 28px;
}

.panel-header {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.panel-header p,
.hero-copy p {
  max-width: 62ch;
  line-height: 1.65;
}

.shuffler-form,
.two-col {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  padding: 14px 16px;
}

input[type="file"] {
  padding: 12px;
}

input[type="color"] {
  min-height: 52px;
  padding: 6px;
}

.switch-row {
  align-items: center;
  grid-template-columns: 1fr auto;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
}

.switch-row input {
  width: 22px;
  height: 22px;
}

.form-actions,
.session-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #1b1305;
  font-weight: 800;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.danger-btn {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.26);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  text-align: center;
  border-radius: 24px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

.shuffler-list {
  display: grid;
  gap: 16px;
}

.session-top,
.session-meta {
  display: grid;
  gap: 16px;
}

.session-top {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.session-title {
  margin: 8px 0 0;
  font-size: 1.25rem;
}

.session-status {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-weight: 700;
}

.session-status.stopped {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.session-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0 22px;
}

.session-meta div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

dt {
  font-size: 0.8rem;
  margin-bottom: 6px;
}

dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.display-body {
  min-height: 100vh;
  overflow: hidden;
}

.display-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  isolation: isolate;
  background: var(--bg);
}

.display-backdrop,
.display-overlay,
.access-screen {
  position: absolute;
  inset: 0;
}

.display-backdrop {
  background-position: center;
  background-size: cover;
  transform: scale(1.04);
  filter: saturate(1.05);
}

.display-overlay {
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.62)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.04), rgba(2, 6, 23, 0.18));
}

.number-stage {
  position: relative;
  z-index: 1;
}

.number-stage {
  width: min(1180px, 100%);
}

.number-frame {
  width: 100%;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 42px;
  text-align: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 40px 120px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(18px);
}

.number-value {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(4rem, 13vw, 11rem);
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 10px 35px rgba(15, 23, 42, 0.18);
}

.access-screen {
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.92);
  z-index: 3;
}

.hidden {
  display: none;
}

.access-card {
  width: min(520px, 100%);
  padding: 32px;
  border-radius: 28px;
  text-align: center;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
  .hero-card,
  .workspace-grid,
  .two-col,
  .session-meta {
    grid-template-columns: 1fr;
  }

  .controller-shell {
    width: min(100vw - 24px, 1380px);
    padding-top: 16px;
  }

  .panel,
  .hero-card {
    padding: 22px;
  }

  .number-frame {
    border-radius: 28px;
  }
}
