:root {
  --bg: #0b1020;
  --bg2: #131a35;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #9aa3c7;
  --accent: #6c8cff;
  --accent2: #9b6cff;
  --danger: #ff6b8b;
  --ok: #46d39a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, #1d2a55, transparent),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

h1 { margin: 0 0 8px; font-size: 2rem; }
.subtitle { color: var(--muted); margin: 0 0 24px; }
.hint { color: var(--muted); font-size: 0.85em; font-weight: 400; }
a { color: var(--accent); }

/* Card */
.card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.95rem; }

input[type="text"], input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 1rem;
}
input[name="code"] { letter-spacing: 0.4em; text-align: center; font-size: 1.3rem; }

button, .btn {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  transition: transform 0.08s ease, opacity 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
button:hover, .btn:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.55; cursor: progress; }
.secondary { background: rgba(255, 255, 255, 0.1); }

.result { margin-top: 18px; padding: 14px; border-radius: 12px; }
.result.ok { background: rgba(70, 211, 154, 0.15); border: 1px solid var(--ok); }
.result.err { background: rgba(255, 107, 139, 0.15); border: 1px solid var(--danger); }
.footer-link { margin-top: 22px; }

/* Loader overlay */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 24, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 50;
}
.spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Presentation */
#present-root { width: 100%; max-width: 1100px; }
.choice { text-align: center; }
.choice h1 { font-size: 3rem; }
.choice-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.big { font-size: 1.5rem; padding: 22px 48px; border-radius: 18px; }

.slideshow { width: 100%; }
.slides {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide {
  display: none;
  text-align: center;
  width: 100%;
}
.slide.active { display: block; animation: fade 0.4s ease; }
.slide h1 { font-size: 4rem; }
.slide h2 { font-size: 2.6rem; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

.code-slide .qr { display: inline-block; background: white; padding: 14px; border-radius: 16px; }
.code-slide .qr img { display: block; width: 260px; height: 260px; }
.code-box { margin-top: 24px; }
.join-code {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.code-meta { color: var(--muted); }
.slide-nav { display: flex; gap: 18px; align-items: center; justify-content: center; margin-top: 24px; }
.slide-nav button { padding: 8px 20px; font-size: 1.4rem; }
#slide-pos { color: var(--muted); }

/* Dashboard */
.dashboard { width: 100%; max-width: 1000px; }
.dash-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.dash-header .btn { padding: 9px 16px; font-size: 0.9rem; margin-left: 8px; }
table { width: 100%; border-collapse: collapse; margin-top: 18px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.dl { color: var(--accent); font-weight: 700; }
code { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 6px; font-size: 0.85em; }
