:root {
  --teal: #08b8b8;
  --teal-dark: #009fa3;
  --teal-light: #e9faf9;
  --yellow: #ffc928;
  --yellow-light: #fff8e1;
  --black: #0a0a0a;
  --white: #ffffff;
  --sub: #4a4a4a;
  --gray: #9ca3af;
  --gray-light: #f3f4f6;
  --success: #31c48d;
  --alert: #ef5b5b;
  --border: #e5e5e5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 1rem;
  --radius-lg: 1.5rem;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: "Plus Jakarta Sans", sans-serif; color: var(--black); }
body.app-body {
  background: #cbddf3;
  background-image: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.15) 0deg 2deg, transparent 2deg 8deg);
  min-height: 100%;
}
.app-shell {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}
.font-display { font-family: "Baloo 2", sans-serif; }
.badge {
  font-size: 0.65rem; font-weight: 700; padding: 0.25rem 0.6rem;
  border-radius: 999px; background: var(--teal-light); color: var(--teal-dark);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.card {
  background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.card-elevated {
  background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.875rem 1.5rem; border-radius: var(--radius-lg);
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer; transition: all 0.2s ease; width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--black); color: var(--white); box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.btn-primary:hover { background: #1a1a1a; }
.btn-primary:disabled, .btn:disabled { background: #b9b9b9; box-shadow: none; cursor: not-allowed; }
.btn-secondary { background: var(--white); color: var(--black); border: 2px solid var(--black); }
.btn-teal { background: var(--teal); color: var(--white); box-shadow: 0 4px 14px rgba(8,184,184,.25); }
.input-group { margin-bottom: 1rem; }
.input-label {
  display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--sub); margin-bottom: 0.375rem;
}
.input-field {
  width: 100%; padding: 0.875rem 1rem; border: 2px solid var(--border); border-radius: var(--radius);
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 0.9375rem; font-weight: 600;
  color: var(--black); background: var(--white); outline: none;
}
.input-field:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,184,184,.1); }
.input-error { border-color: var(--alert) !important; }
.error-msg { color: var(--alert); font-size: 0.75rem; font-weight: 600; margin-top: 0.25rem; display: none; }
.error-msg.show { display: flex; }
.app-header {
  padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between;
  background: var(--white); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.logo-img { height: 36px; width: auto; }
.screen-pad { padding: 1.25rem; }
.hearts-row { display: flex; gap: 0.25rem; }
.heart { width: 20px; height: 20px; }
.heart-filled { fill: var(--yellow); color: var(--yellow); }
.heart-empty { fill: none; color: #d9d9d9; }
.timer-ring {
  width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--teal);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--white);
}
.timer-ring.urgent { border-color: var(--alert); animation: pulse 0.8s infinite; }
.timer-number { font-family: "Baloo 2", sans-serif; font-size: 1.75rem; font-weight: 800; line-height: 1; }
.timer-label { font-size: 0.625rem; color: var(--sub); font-weight: 600; }
.progress-track { width: 100%; height: 6px; background: var(--gray-light); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 999px; transition: width 0.4s ease; }
.option-btn {
  width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem;
  border: 2px solid transparent; border-radius: var(--radius); background: var(--white);
  text-align: left; font-family: "Plus Jakarta Sans", sans-serif; font-size: 0.9375rem; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-sm); margin-bottom: 0.625rem;
}
.option-btn:hover:not(:disabled) { border-color: var(--teal); transform: translateX(4px); }
.option-btn.correct { background: #e7f9f2; border-color: var(--success); }
.option-btn.wrong { background: #fdecec; border-color: var(--alert); }
.option-btn.inactive { opacity: 0.5; }
.option-letter {
  width: 28px; height: 28px; border-radius: 50%; background: var(--teal-light); color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center; font-family: "Baloo 2", sans-serif; font-weight: 700; flex-shrink: 0;
}
.option-btn.correct .option-letter { background: var(--success); color: white; }
.option-btn.wrong .option-letter { background: var(--alert); color: white; }
.ranking-chrome {
  flex-shrink: 0;
  background: #cbddf3;
  background-image: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.15) 0deg 2deg, transparent 2deg 8deg);
  position: sticky;
  top: 68px;
  z-index: 30;
  padding-bottom: 0.25rem;
}
.ranking-list { flex: 1; min-height: 0; }
.ranking-tabs { display: flex; gap: 0.5rem; padding: 0 1.25rem 0.75rem; }
.ranking-tab {
  flex: 1; padding: 0.625rem 0.4rem; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--white); font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 0.7rem;
  cursor: pointer; text-align: center; text-decoration: none; color: var(--black);
}
.ranking-tab.active { background: var(--black); color: var(--white); border-color: var(--black); }
.ranking-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--white); }
.ranking-row.me { background: var(--teal-light); }
.ranking-rank { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: "Baloo 2", sans-serif; font-weight: 800; }
.ranking-rank.gold { background: var(--yellow-light); color: #b45309; }
.ranking-rank.silver { background: #f3f4f6; color: #6b7280; }
.ranking-rank.bronze { background: #fef3c7; color: #92400e; }
.ranking-rank.normal { background: var(--gray-light); color: var(--sub); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-alias { font-weight: 700; }
.ranking-meta { font-size: 0.75rem; color: var(--sub); }
.ranking-score { text-align: right; }
.ranking-score-num { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.125rem; color: var(--teal-dark); }
.bottom-nav {
  display: flex; border-top: 1px solid var(--border); background: var(--white); padding: 0.5rem 0;
  position: sticky; bottom: 0; z-index: 40;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.375rem 0; color: var(--gray); font-size: 0.625rem; font-weight: 700;
  text-transform: uppercase; text-decoration: none; background: none; border: none; cursor: pointer;
}
.nav-item.active { color: var(--teal-dark); }
.nav-item svg { width: 22px; height: 22px; }
.cat-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.cat-card {
  background: var(--white); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 0.25rem; text-align: center; position: relative;
}
.cat-card.active { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,184,184,.15); }
.cat-card-emoji { font-size: 1.5rem; }
.cat-card-name { font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 0.65rem; }
.cat-card-check {
  position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; background: var(--teal);
  border-radius: 50%; color: white; font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
}
.prize-carousel { overflow: hidden; margin: 0; border-radius: var(--radius-lg); height: 180px; background: var(--white); border: 1px solid var(--border); }
.prize-carousel-track { display: flex; transition: transform 0.5s ease; height: 100%; }
.prize-carousel-slide { min-width: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 0.5rem; }
.prize-carousel-slide img { max-height: 110px; max-width: 90%; object-fit: contain; }
.prize-carousel-name { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1rem; text-align: center; margin-top: 0.35rem; }
.prize-carousel-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; }
.prize-carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); border: none; cursor: pointer; }
.prize-carousel-dot.active { background: var(--teal); width: 20px; border-radius: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.stat-box { background: var(--white); border-radius: var(--radius); padding: 1rem 0.5rem; text-align: center; border: 1px solid var(--border); }
.stat-value { font-family: "Baloo 2", sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--teal-dark); }
.stat-label { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; color: var(--sub); }
.qcat-tag { display: inline-block; padding: 0.25rem 0.625rem; border-radius: 6px; font-size: 0.625rem; font-weight: 800; text-transform: uppercase; }
.qcat-fin { background: #dbeafe; color: #1e40af; }
.qcat-cult { background: #fce7f3; color: #9d174d; }
.qcat-cred { background: #d1fae5; color: #065f46; }
.trophy-glow {
  width: 80px; height: 80px; border-radius: 50%; background: var(--yellow-light);
  display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 2.5rem;
}
.close-banner { background: linear-gradient(135deg, var(--alert), #dc2626); color: white; padding: 0.625rem 1rem; text-align: center; font-size: 0.75rem; font-weight: 700; }
.cat-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.875rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; border: 1.5px solid var(--teal); background: var(--white); color: var(--teal-dark); }
.login-wrap { padding: 1.25rem; display: flex; flex-direction: column; justify-content: center; min-height: 100%; }
.text-center { text-align: center; }
.text-sub { color: var(--sub); }
.text-gray { color: var(--gray); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.space-y > * + * { margin-top: 0.625rem; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.4s ease; }
.info-row { display: flex; align-items: center; justify-content: space-between; }
.lives-count { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--teal-dark); }
.empty { padding: 2rem 1.25rem; text-align: center; color: var(--sub); font-size: 0.875rem; }
