/* ============================================
   QUIZ - Negroni Design System
   Inter font, dark theme, brand-orange primary
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === TOKENS === */
:root {
  /* Brand colors */
  --brand-orange-60: #ff4d00;
  --brand-orange-55: #e54400;
  --brand-orange-65: #ff5f29;
  --brand-orange-70: #ff9371;
  --brand-orange-75: #ffbfab;
  --brand-orange-85: #fee5de;
  --brand-orange-10: #2f0800;

  --brand-pinky-60: #ff36a2;
  --brand-pinky-50: #cc2980;
  --brand-pinky-70: #ff8cbf;
  --brand-pinky-85: #fce4ec;

  --brand-blue-40: #2554af;
  --brand-blue-50: #4574cd;
  --brand-blue-60: #6b92d7;
  --brand-blue-85: #e6ebf6;

  /* Midnight (neutral dark) */
  --midnight-5:  #0a0d12;
  --midnight-10: #10141a;
  --midnight-15: #161b22;
  --midnight-20: #1b2129;
  --midnight-25: #222933;
  --midnight-30: #2c3541;
  --midnight-35: #394351;
  --midnight-40: #485566;
  --midnight-50: #64748b;
  --midnight-60: #a0aab9;
  --midnight-70: #cad0d7;
  --midnight-80: #e8eaec;
  --midnight-85: #f1f2f3;

  /* Neutral */
  --neutral-15: #1b1b1b;
  --neutral-20: #202020;
  --neutral-30: #343434;
  --neutral-40: #545454;
  --neutral-55: #949494;
  --neutral-65: #bebebe;
  --neutral-80: #e9e9e9;

  /* Semantic */
  --bg-primary:    #111318;
  --bg-secondary:  #1b2129;
  --bg-card:       #222933;
  --bg-card-hover: #2c3541;
  --bg-input:      #1b2129;

  --text-primary:   #f1f2f3;
  --text-secondary: #a0aab9;
  --text-muted:     #64748b;
  --text-inverse:   #111318;

  --border-default:  #2c3541;
  --border-subtle:   #222933;
  --border-brand:    #ff4d00;
  --border-focus:    #ff4d00;

  --accent:         #ff4d00;
  --accent-hover:   #e54400;
  --accent-muted:   #2f0800;
  --accent-text:    #ff9371;

  --positive:  #53b53f;
  --warning:   #bb7600;
  --critical:  #fc052c;

  /* Border radius */
  --radius-xs: 4px;
  --radius-s:  6px;
  --radius-m:  10px;
  --radius-b:  14px;
  --radius-xb: 18px;
  --radius-l:  24px;
  --radius-xl: 32px;
  --radius-xxl: 40px;
  --radius-circular: 9999px;

  /* Shadows */
  --shadow-raised:  0 2px 8px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-overlay: 0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);

  /* Typography scale */
  --font: 'Inter', sans-serif;
  --text-xs:   11px;
  --text-s:    13px;
  --text-m:    15px;
  --text-l:    17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  32px;
  --text-4xl:  40px;
  --text-5xl:  56px;
  --text-6xl:  72px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Transitions */
  --transition: 180ms ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: var(--text-m);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === TYPOGRAPHY === */
.title-xxl { font-size: var(--text-6xl); font-weight: 700; line-height: 1.05; letter-spacing: -2px; }
.title-xl  { font-size: var(--text-5xl); font-weight: 700; line-height: 1.1;  letter-spacing: -1.5px; }
.title-l   { font-size: var(--text-4xl); font-weight: 700; line-height: 1.15; letter-spacing: -1px; }
.title-m   { font-size: var(--text-3xl); font-weight: 600; line-height: 1.2;  letter-spacing: -0.5px; }
.title-s   { font-size: var(--text-2xl); font-weight: 600; line-height: 1.3; }
.title-xs  { font-size: var(--text-xl);  font-weight: 600; line-height: 1.35; }

.body-xl   { font-size: var(--text-xl);  font-weight: 400; line-height: 1.5; }
.body-l    { font-size: var(--text-l);   font-weight: 400; line-height: 1.55; }
.body-m    { font-size: var(--text-m);   font-weight: 400; line-height: 1.6; }
.body-s    { font-size: var(--text-s);   font-weight: 400; line-height: 1.6; }

.caption   { font-size: var(--text-xs);  font-weight: 500; line-height: 1.4; letter-spacing: 0.3px; }
.uppercase { font-size: var(--text-xs);  font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-b);
  font-family: var(--font);
  font-size: var(--text-m);
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-solid {
  background: var(--accent);
  color: #fff;
}
.btn-solid:hover:not(:disabled) { background: var(--accent-hover); }

.btn-faded {
  background: var(--accent-muted);
  color: var(--accent-text);
}
.btn-faded:hover:not(:disabled) { background: #3d1000; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-card); color: var(--text-primary); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover:not(:disabled) { background: var(--accent-muted); }

.btn-sm { height: 36px; padding: 0 var(--sp-4); font-size: var(--text-s); border-radius: var(--radius-m); }
.btn-lg { height: 52px; padding: 0 var(--sp-8); font-size: var(--text-l); border-radius: var(--radius-xb); }
.btn-xl { height: 64px; padding: 0 var(--sp-10); font-size: var(--text-xl); border-radius: var(--radius-l); }
.btn-full { width: 100%; }

.btn-danger { background: var(--critical); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #d40024; }

.btn-positive { background: var(--positive); color: #fff; }
.btn-positive:hover:not(:disabled) { background: #48a037; }

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xb);
  padding: var(--sp-6);
}
.card-sm { padding: var(--sp-4); border-radius: var(--radius-b); }
.card-lg { padding: var(--sp-8); border-radius: var(--radius-xl); }

/* === INPUTS === */
.input-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.input-label { font-size: var(--text-s); font-weight: 500; color: var(--text-secondary); }

.input {
  height: 44px;
  padding: 0 var(--sp-4);
  background: var(--bg-input);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-m);
  font-family: var(--font);
  font-size: var(--text-m);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.input:focus { border-color: var(--border-focus); }
.input::placeholder { color: var(--text-muted); }

.textarea {
  padding: var(--sp-3) var(--sp-4);
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* === BADGE / TAG === */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-circular);
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge-brand   { background: var(--accent-muted); color: var(--accent-text); }
.badge-neutral { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-default); }
.badge-positive { background: rgba(83,181,63,0.15); color: var(--positive); }
.badge-critical { background: rgba(252,5,44,0.15); color: var(--critical); }

/* === DIVIDER === */
.divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--sp-6) 0;
}

/* === SCORE TABLE === */
.score-table {
  width: 100%;
  border-collapse: collapse;
}
.score-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}
.score-table td {
  padding: var(--sp-4);
  font-size: var(--text-m);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.score-table tr:last-child td { border-bottom: none; }
.score-table .place-1 td:first-child { color: #ffd700; font-weight: 700; }
.score-table .place-2 td:first-child { color: #c0c0c0; font-weight: 600; }
.score-table .place-3 td:first-child { color: #cd7f32; font-weight: 600; }

/* === TIMER === */
.timer-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .timer-text {
  position: absolute;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
}
.timer-ring.warning .timer-text { color: var(--critical); }
.timer-ring.warning circle.progress { stroke: var(--critical); }

/* === SLIDE SYSTEM === */
.slide {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.slide.active { display: flex; }

/* Slide layouts */
.slide-center {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-16);
}
.slide-split {
  flex-direction: row;
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 3px;
  background: var(--border-default);
  border-radius: var(--radius-circular);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-circular);
  transition: width 400ms ease;
}

/* === CONFETTI (JS-driven) === */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
  pointer-events: none;
  z-index: 9999;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* === UTILITIES === */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.w-full { width: 100%; }
.text-accent    { color: var(--accent); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-positive  { color: var(--positive); }
.text-critical  { color: var(--critical); }
.text-center    { text-align: center; }
.font-bold      { font-weight: 700; }
.font-semi      { font-weight: 600; }
.rounded-full   { border-radius: var(--radius-circular); }

.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--midnight-50); }
