﻿:root {
  --bg: #09090b;
  --surface: #111113;
  --card: #18181b;
  --card-light: #27272a;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #71717a;
  --text-bright: #fafafa;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --good: #22c55e;
  --bad: #ef4444;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-x: hidden;
}

.background-glow { display: none; }

.app-shell { width: min(860px, 100%); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
}

/* Typography */

h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  margin: 8px 0 12px;
  color: var(--text-bright);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  margin: 8px 0 12px;
  color: var(--text-bright);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  color: var(--text-bright);
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.eyebrow {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  color: var(--accent);
  opacity: 0.8;
}

.subtitle {
  margin: 0 0 28px;
  max-width: 58ch;
  color: var(--text);
  line-height: 1.6;
}

/* Game grid */

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.game-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 18px;
  background: var(--card);
  transition: border-color 0.18s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover { border-color: var(--border-hover); }

.game-card h3 { margin: 10px 0 6px; }

.game-card p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; flex: 1; }

.game-card .badge {
  display: inline-block;
  margin: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.game-card.available .badge { background: rgba(34, 197, 94, 0.12); color: var(--good); }

.game-card button { align-self: flex-end; }

.game-card.locked { opacity: 0.4; pointer-events: none; }

.game-card.locked .badge { background: rgba(255, 255, 255, 0.06); color: var(--text); }

/* Import box */

.import-box {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  background: var(--card);
}

.import-box h3 { margin: 6px 0 8px; }

.import-box p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; }

.import-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.import-actions button {
  height: 50px;
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}


.import-actions input[type="file"] {
  height: 50px;
  min-width: 260px;
  box-sizing: border-box;
  margin-top: 0;
  /* padding: 0 10px; */
  background: var(--card-light);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-size: 15px;
}

.import-actions button {
  height: 50px;
  margin-top: 0;
  display: flex;
  align-items: center;
}

.import-actions button {
  margin-top: 0;
}

#csvInput { max-width: 340px; }

/* Form */

.login-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-bright);
  font-size: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.prefix {
  background: var(--card-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 13px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  background: var(--card-light);
  color: var(--text-bright);
  transition: border-color 0.16s ease;
  outline: none;
}

input:focus { border-color: var(--accent); }

input::placeholder { color: var(--text); opacity: 0.6; }

/* Buttons */

button {
  margin-top: 12px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #0a0a10;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, opacity 0.16s ease;
}

button:hover:not(:disabled) { background: var(--accent-hover); }

button:disabled { opacity: 0.3; cursor: not-allowed; }

.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
}

.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-bright);
  border-color: var(--border-hover);
}

/* Status / Feedback */

.hint, .status, .feedback { margin: 12px 0 0; font-size: 14px; color: var(--text); }

.status.error, .feedback.error { color: var(--bad); }

.status.loading { color: var(--accent); }

.status.ok, .feedback.ok { color: var(--good); }

.hidden { display: none; }

/* Game header */

.game-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.profile { display: flex; gap: 10px; align-items: center; }

.profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.profile div { color: var(--text); font-size: 13px; }

.profile strong { color: var(--text-bright); display: block; font-size: 15px; }

.score-box { text-align: right; }

.score-box span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text);
}

.score-box strong { font-size: 26px; color: var(--text-bright); font-weight: 700; }

/* Question box */

.question-box {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 16px;
  margin-bottom: 16px;
}

.question-box .label { margin: 0; font-size: 13px; color: var(--text); letter-spacing: 0.02em; }

#ratingDisplay {
  font-size: clamp(48px, 8vw, 76px);
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  color: var(--text-bright);
  font-weight: 700;
}

.rating-stars { margin: 0; font-size: 20px; letter-spacing: 0.08em; color: var(--accent); }

/* Poster prompt */

#posterPrompt { display: grid; gap: 10px; justify-items: center; margin-top: 14px; }

#posterPrompt.hidden { display: none; }

.poster-display {
  width: 160px;
  max-width: 38vw;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-light);
}

.poster-title {
  margin: 0;
  color: var(--text-bright);
  font-weight: 600;
  font-size: 16px;
}

/* Choices */

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.average-guess-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.average-input {
  margin: 0;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.02em;
}

.average-submit {
  margin: 0;
  white-space: nowrap;
}

.choice {
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-bright);
  text-align: left;
  padding: 12px;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-poster {
  width: 44px;
  height: 66px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--card-light);
  border: 1px solid var(--border);
}

.choice-poster.placeholder { opacity: 0.3; }

.choice-title { display: block; line-height: 1.35; font-size: 14px; }

.choice.choice-rating {
  justify-content: center;
  text-align: center;
  padding: 16px;
  min-height: 80px;
  color: var(--accent);
}

.choice-rating-stars {
  width: 100%;
  display: block;
  text-align: center;
  font-size: clamp(32px, 6vw, 44px);
  letter-spacing: 0.1em;
  line-height: 1;
  color: currentColor;
}

.choice:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.choice.correct {
  border-color: var(--good);
  background: rgba(34, 197, 94, 0.08);
  color: var(--good);
}

.choice.wrong {
  border-color: var(--bad);
  background: rgba(239, 68, 68, 0.08);
  color: var(--bad);
}

/* Actions */

.actions { display: flex; gap: 8px; margin-top: 4px; }

/* Progress */

.progress-wrap { margin-bottom: 18px; }

.progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text);
}

.progress-bar {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.progress-step {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  transition: background 0.2s ease;
}

.progress-step.current { background: var(--accent); }

.progress-step.avg-current { background: #c4b5fd; }

.progress-step.avg-done { background: #64748b; }

.progress-step.correct { background: var(--good); }

.progress-step.wrong { background: var(--bad); }

/* Responsive */

@media (max-width: 620px) {
  body { padding: 16px 12px; }
  .game-grid { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; }
  .average-guess-form { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .prefix { text-align: center; }
  .actions { flex-direction: column; }
}
