@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Itfrayat font ── */
@font-face { font-family: 'Itfrayat'; src: url('../fonts/itfrayat/itfrayat-Light.woff2') format('woff2'), url('../fonts/itfrayat/itfrayat-Light.woff') format('woff'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Itfrayat'; src: url('../fonts/itfrayat/itfrayat-Regular.woff2') format('woff2'), url('../fonts/itfrayat/itfrayat-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Itfrayat'; src: url('../fonts/itfrayat/itfrayat-Medium.woff2') format('woff2'), url('../fonts/itfrayat/itfrayat-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Itfrayat'; src: url('../fonts/itfrayat/itfrayat-Bold.woff2') format('woff2'), url('../fonts/itfrayat/itfrayat-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Itfrayat'; src: url('../fonts/itfrayat/itfrayat-Black.woff2') format('woff2'), url('../fonts/itfrayat/itfrayat-Black.woff') format('woff'); font-weight: 900; font-display: swap; }

:root {
  --bg:          #07070e;
  --surface:     #0f0f1a;
  --surface2:    #171725;
  --border:      #24243a;
  --accent:      #f0b429;
  --accent2:     #e05c2a;
  --text:        #eeeef8;
  --text-dim:    #7070a0;
  --correct:     #22c55e;
  --wrong:       #ef4444;
  --radius:      16px;
  --radius-sm:   10px;
  --glow-accent: rgba(240,180,41,0.15);
  --grad-accent: linear-gradient(135deg, #f0b429 0%, #e08020 100%);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Itfrayat', sans-serif;
  font-weight: 800;
}

button {
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: 'DM Sans', sans-serif;
  outline: none;
}

/* ── Utility ── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Spinner ── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pulse dot ── */
.pulse-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--correct);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.4);
  animation: pulse-ring 1.5s ease infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ── Btn ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--grad-accent);
  color: #07070e;
  box-shadow: 0 4px 20px rgba(240,180,41,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #f5c440 0%, #e89030 100%);
  box-shadow: 0 6px 30px rgba(240,180,41,0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(240,180,41,0.2); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--glow-accent); }
.btn-danger { background: var(--wrong); color: white; box-shadow: 0 4px 16px rgba(239,68,68,0.25); }
.btn-danger:hover { background: #dc2626; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; border-radius: var(--radius); }

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none; align-items: center;
}
.toast {
  background: rgba(23,23,37,0.95); border: 1px solid var(--border);
  color: var(--text); padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm); font-size: 0.9rem;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
  max-width: 90vw; text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.success { border-color: var(--correct); color: var(--correct); }
.toast.error   { border-color: var(--wrong); color: var(--wrong); }
@keyframes toast-in  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }

/* ── Logo card with blur ── */
.logo-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 3/2;
  overflow: hidden;
}
.logo-card img, .logo-card object {
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: blur(12px) brightness(0.6);
  transition: filter 0.6s ease;
  pointer-events: none;
}
.logo-card.revealed img, .logo-card.revealed object {
  filter: blur(0) brightness(1);
}

/* ── Timer ring ── */
.timer-ring { position: relative; width: 64px; height: 64px; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .track { stroke: var(--border); fill: none; }
.timer-ring .progress { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer-ring .label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Itfrayat', sans-serif; font-weight: 800; font-size: 1rem;
}

/* ── Answer choice button ── */
.answer-btn {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
  color: var(--text);
}
.answer-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(240,180,41,0.04);
  box-shadow: 0 0 0 3px rgba(240,180,41,0.1), 0 4px 16px rgba(240,180,41,0.08);
}
.answer-btn.selected {
  border-color: var(--accent);
  background: rgba(240,180,41,0.08);
  box-shadow: 0 0 0 3px rgba(240,180,41,0.15), 0 6px 24px rgba(240,180,41,0.12);
}
.answer-btn:disabled { cursor: default; }
.answer-letter {
  font-family: 'Itfrayat', sans-serif; font-weight: 800;
  font-size: 0.85rem; color: var(--accent);
  min-width: 24px;
}

/* ── Progress bar ── */
.progress-track {
  width: 100%; height: 4px;
  background: var(--border); border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px; transition: width 0.4s ease;
}

/* ── Fade in animation ── */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Slide up ── */
.slide-up { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1); }
@keyframes slideUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }

/* ── Site footer ── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.875rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-family: 'Itfrayat', 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1;
}
.site-footer a {
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  text-decoration: none;
}
.site-footer a:hover { opacity: 1; }
.site-footer img {
  height: 15px;
  width: auto;
  display: block;
  margin-top: 1px;
}
