/* ===== CSS VARIABLES ===== */
:root {
  --primary: #1d6fd6;
  --primary-dark: #1557b0;
  --primary-light: #3b82f6;
  --primary-subtle: #eff6ff;
  --accent: #0ea5e9;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(29,111,214,0.10);
  --shadow-lg: 0 8px 32px rgba(29,111,214,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-h: 64px;
  font-family: 'Noto Sans JP', 'Outfit', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--surface-2); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

/* ===== TYPOGRAPHY ===== */
h1 { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 2rem; }
h2 { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.5rem; }
h3 { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 1.2rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  box-shadow: var(--shadow-sm);
}
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: 'Outfit', sans-serif; font-weight: 800;
}
.logo-icon {
  width: 36px; height: 36px; background: var(--primary); color: white;
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800;
}
.logo-text { font-size: 1.3rem; color: var(--text); }
.logo-accent { color: var(--primary); }

.nav-menu {
  display: flex; align-items: center; gap: 0.25rem;
}
.nav-link {
  padding: 0.5rem 0.85rem; border-radius: var(--radius-sm); color: var(--text-muted);
  font-weight: 500; font-size: 0.9rem; text-decoration: none; transition: all 0.2s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-subtle); text-decoration: none; }
.nav-admin { color: var(--warning) !important; }
.nav-user { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.5rem; }
.nav-profile { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--text); text-decoration: none; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--primary); object-fit: cover; }
.nav-auth { display: flex; gap: 0.5rem; margin-left: 0.5rem; }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.hamburger span {
  width: 24px; height: 2px; background: var(--text);
  border-radius: 2px; transition: all 0.3s;
  display: block;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--primary); color: white; border: none; border-radius: var(--radius-sm);
  padding: 0.6rem 1.4rem; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; font-family: inherit;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; color: white; }

.btn-outline {
  background: transparent; color: var(--primary); border: 2px solid var(--primary);
  border-radius: var(--radius-sm); padding: 0.55rem 1.3rem; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; font-family: inherit;
}
.btn-outline:hover { background: var(--primary-subtle); text-decoration: none; }

.btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.55rem 1.1rem; font-weight: 500; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center;
  text-decoration: none; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.btn-danger { background: var(--danger); color: white; border: none; border-radius: var(--radius-sm); padding: 0.4rem 0.9rem; font-weight: 600; font-size: 0.85rem; cursor: pointer; font-family: inherit; }
.btn-danger:hover { background: #dc2626; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 2px solid var(--danger); border-radius: var(--radius-sm); padding: 0.55rem 1.3rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-danger-outline:hover { background: #fef2f2; }

.btn-lg { padding: 0.8rem 2rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.82rem; }

.btn-nav-login { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); border-radius: var(--radius-sm); padding: 0.4rem 1rem; font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: all 0.2s; }
.btn-nav-login:hover { background: var(--primary-subtle); text-decoration: none; }
.btn-nav-register { background: var(--primary); color: white; border: 1.5px solid var(--primary); border-radius: var(--radius-sm); padding: 0.4rem 1rem; font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: all 0.2s; }
.btn-nav-register:hover { background: var(--primary-dark); text-decoration: none; color: white; }
.btn-logout { background: none; border: none; color: var(--text-muted); font-size: 0.85rem; cursor: pointer; padding: 0.3rem 0.5rem; font-family: inherit; }
.btn-logout:hover { color: var(--danger); }

/* ===== PAGE LAYOUT ===== */
.page-wrapper { flex: 1; }
.page-container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); }
.icon-title { margin-right: 0.3rem; }
.back-link { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; display: inline-block; }
.back-link:hover { color: var(--primary); }

.admin-page-header { display: flex; justify-content: space-between; align-items: flex-end; }

/* ===== ALERTS ===== */
.alert {
  max-width: 1100px; margin: 1rem auto 0; padding: 0.85rem 1.25rem; border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px; font-weight: 500;
  animation: slideDown 0.3s ease;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== HERO ===== */
.hero {
  min-height: calc(100vh - var(--nav-h)); position: relative; overflow: hidden;
  display: flex; align-items: center;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f2ff 50%, #f5f8ff 100%);
  padding: 4rem 2rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 40%, rgba(29,111,214,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 70%, rgba(14,165,233,0.06) 0%, transparent 50%);
}
.hero-content { max-width: 1200px; margin: 0 auto; flex: 1; position: relative; z-index: 1; }
.hero-badge {
  display: inline-block; background: var(--primary-subtle); color: var(--primary);
  padding: 0.35rem 1rem; border-radius: 100px; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 1.5rem; border: 1px solid rgba(29,111,214,0.2);
}
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); font-family: 'Outfit', sans-serif; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero-accent { color: var(--primary); }
.hero-desc { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 480px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual { position: relative; width: 320px; flex-shrink: 0; }
.hero-card {
  position: absolute; background: white; border-radius: var(--radius);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); min-width: 140px;
}
.hcard-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.hcard-label { font-size: 0.75rem; color: var(--text-muted); }
.hcard-value { font-size: 1.6rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--primary); }
.hcard-value span { font-size: 0.9rem; color: var(--text-muted); margin-left: 2px; }

.floating { animation: float 4s ease-in-out infinite; }
.delay-1 { animation-delay: 1.5s; }
.delay-2 { animation-delay: 3s; }
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* ===== FEATURES ===== */
.features { padding: 5rem 2rem; background: white; }
.section-title { text-align: center; margin-bottom: 3rem; font-size: 2rem; }
.container { max-width: 1100px; margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 800px; margin: 0 auto; }
.feature-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 3rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1rem; }
.feature-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { background: var(--primary-subtle); color: var(--primary); border-radius: 100px; padding: 0.2rem 0.75rem; font-size: 0.8rem; font-weight: 600; }
.feature-arrow { position: absolute; right: 1.5rem; bottom: 1.5rem; font-size: 1.5rem; color: var(--primary); opacity: 0; transition: all 0.3s; }
.feature-card:hover .feature-arrow { opacity: 1; transform: translateX(4px); }

/* ===== GENRES SECTION ===== */
.genres-section { padding: 4rem 2rem; }
.genre-grid { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.genre-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 2rem; text-align: center; min-width: 120px;
  transition: all 0.2s; cursor: default;
}
.genre-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.genre-emoji { font-size: 2rem; margin-bottom: 0.5rem; }
.genre-name { font-weight: 700; font-size: 0.95rem; }

/* ===== AUTH ===== */
.auth-page { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2.5rem; width: 100%; max-width: 420px; border: 1px solid var(--border); }
.auth-card-wide { max-width: 560px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo { width: 56px; height: 56px; background: var(--primary); color: white; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; margin: 0 auto 1rem; font-family: 'Outfit', sans-serif; }
.auth-header h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.auth-header p { color: var(--text-muted); font-size: 0.95rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-demo { margin-top: 1.5rem; padding: 1rem; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px dashed var(--border); font-size: 0.82rem; color: var(--text-muted); }
.demo-title { font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.65rem 0.9rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit;
  background: white; color: var(--text); transition: border-color 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,111,214,0.1); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.check-input { width: 16px; height: 16px; accent-color: var(--primary); }
.check-label { font-size: 0.9rem; }
.form-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1.5rem; }
.form-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 2rem; box-shadow: var(--shadow-sm); }
.input-password { position: relative; }
.input-password .form-input { padding-right: 3rem; }
.pw-toggle { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1rem; }
.validation-summary { background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; color: #991b1b; }
.field-error { color: var(--danger); font-size: 0.82rem; margin-top: 0.25rem; display: block; }
.options-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.correct-answer-select { display: flex; gap: 0.75rem; }
.correct-radio-label {
  flex: 1; padding: 0.6rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; cursor: pointer; font-weight: 700; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.correct-radio-label:has(input:checked) { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary); }
.correct-radio-label input { display: none; }
.correct-radio-label.A:has(input:checked) { border-color: var(--primary); background: var(--primary-subtle); }

/* ===== ICON PICKER ===== */
.icon-picker { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 1rem; background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--border); }
.icon-option {
  width: 52px; height: 52px; border-radius: var(--radius-sm); border: 2px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; overflow: hidden; background: white;
}
.icon-option:hover { border-color: var(--primary); transform: scale(1.05); }
.icon-option.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,111,214,0.2); }
.icon-option img { width: 100%; height: 100%; object-fit: cover; }
.icon-fallback { font-size: 1.5rem; }

/* ===== COLOSSEUM ===== */
.colosseum-section { margin-bottom: 2.5rem; }
.section-badge { display: inline-block; padding: 0.35rem 1rem; border-radius: 100px; font-weight: 700; font-size: 0.9rem; margin-bottom: 1rem; }
.active-badge { background: #fef3c7; color: #92400e; }
.upcoming-badge { background: #eff6ff; color: var(--primary); }
.past-badge { background: var(--surface-2); color: var(--text-muted); }

.colosseum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.colosseum-card {
  background: white; border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 1.5rem; transition: all 0.2s;
}
.colosseum-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.active-card { border-left: 4px solid var(--warning); }
.upcoming-card { border-left: 4px solid var(--primary); }
.past-card { border-left: 4px solid var(--border); opacity: 0.8; }

.colosseum-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
.colosseum-header h3 { font-size: 1.1rem; }
.colosseum-status { padding: 0.2rem 0.65rem; border-radius: 100px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.colosseum-status.active { background: #fef3c7; color: #92400e; }
.colosseum-status.upcoming { background: var(--primary-subtle); color: var(--primary); }
.colosseum-status.past { background: var(--surface-2); color: var(--text-muted); }

.colosseum-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.colosseum-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }
.colosseum-actions { display: flex; gap: 0.75rem; align-items: center; }
.answered-badge { font-size: 0.85rem; font-weight: 600; color: var(--success); }

/* ===== QUIZ ===== */
.quiz-page { max-width: 760px; margin: 0 auto; padding: 1.5rem; min-height: calc(100vh - var(--nav-h)); }
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; background: white; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.quiz-title { font-weight: 700; font-size: 1rem; }
.quiz-progress-info { font-weight: 700; color: var(--primary); font-family: 'Outfit', sans-serif; font-size: 1.1rem; }
.progress-bar-wrapper { height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 1.5rem; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 3px; transition: width 0.5s ease; }

.quiz-container { }
.question-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 2rem; box-shadow: var(--shadow-sm); }
.question-genre-tag { display: inline-block; padding: 0.25rem 0.75rem; background: var(--primary-subtle); color: var(--primary); border-radius: 100px; font-size: 0.82rem; font-weight: 700; margin-bottom: 1rem; }
.question-text { font-size: 1.1rem; font-weight: 500; line-height: 1.8; margin-bottom: 1.5rem; white-space: pre-line; }

.options-grid { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }
.option-card {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
  border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: all 0.2s; background: white;
}
.option-card:hover { border-color: var(--primary); background: var(--primary-subtle); }
.option-card.selected { border-color: var(--primary); background: var(--primary-subtle); }
.option-card.correct { border-color: var(--success); background: #ecfdf5; }
.option-card.incorrect { border-color: var(--danger); background: #fef2f2; }
.option-card.answering { border-color: var(--primary); background: var(--primary-subtle); }
.option-radio { display: none; }
.option-label {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
}
.option-card.selected .option-label, .option-card:hover .option-label { border-color: var(--primary); background: var(--primary); color: white; }
.option-card.correct .option-label { border-color: var(--success); background: var(--success); color: white; }
.option-card.incorrect .option-label { border-color: var(--danger); background: var(--danger); color: white; }
.option-text { font-size: 0.97rem; flex: 1; }

.quiz-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.shuttle-end-section { text-align: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px dashed var(--border); }

/* ===== SHUTTLE RUN ===== */
.genre-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.genre-select-card {
  background: white; border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; cursor: pointer; transition: all 0.25s; display: block;
}
.genre-select-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); }
.genre-select-card.selected { border-color: var(--primary); background: var(--primary-subtle); box-shadow: var(--shadow); }
.genre-select-card.selected .genre-card-name { color: var(--primary); }
.genre-radio { display: none; }
.genre-big-emoji { font-size: 2.5rem; margin-bottom: 0.75rem; }
.genre-card-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.25rem; }
.genre-card-desc { font-size: 0.82rem; color: var(--text-muted); }
.shuttle-start-action { text-align: center; }
.shuttle-stats { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.stat-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px; padding: 0.3rem 0.85rem; font-size: 0.85rem; }
.correct-chip { background: #ecfdf5; border-color: #a7f3d0; }
.rate-chip { background: var(--primary-subtle); border-color: rgba(29,111,214,0.2); }

.explanation-box {
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 0.75rem;
  font-size: 0.92rem; line-height: 1.6; border: 1.5px solid;
}
.correct-exp { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.incorrect-exp { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ===== RESULT ===== */
.result-page { max-width: 760px; margin: 0 auto; }
.result-header { text-align: center; margin-bottom: 3rem; }
.result-header h1 { font-size: 1.8rem; margin-bottom: 2rem; }
.result-score-card { display: flex; align-items: center; justify-content: center; gap: 3rem; background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 2rem; margin-bottom: 2rem; }
.score-circle { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.score-circle svg { width: 120px; height: 120px; }
.score-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-pct { font-size: 1.5rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--primary); }
.score-label { font-size: 0.72rem; color: var(--text-muted); }
.score-details { display: flex; gap: 1.5rem; }
.score-stat { text-align: center; }
.score-stat-value { display: block; font-size: 2rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--primary); }
.score-stat-label { font-size: 0.8rem; color: var(--text-muted); }
.result-actions { display: flex; gap: 1rem; justify-content: center; }
.result-details h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.result-list { display: flex; flex-direction: column; gap: 0.75rem; }
.result-item { background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 1.25rem; }
.result-item.correct { border-left: 4px solid var(--success); }
.result-item.incorrect { border-left: 4px solid var(--danger); }
.result-item-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.result-num { font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--text-muted); }
.result-verdict { font-weight: 700; font-size: 0.9rem; }
.result-question { font-size: 0.95rem; margin-bottom: 0.75rem; white-space: pre-line; }
.result-answers { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.88rem; margin-bottom: 0.5rem; }
.your-answer.correct { color: var(--success); }
.your-answer.wrong { color: var(--danger); }
.correct-answer { color: var(--success); }
.result-explanation { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.75rem; font-size: 0.88rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ===== RANKING ===== */
.ranking-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; align-items: center; }
.filter-label { font-size: 0.9rem; color: var(--text-muted); }
.filter-btn { padding: 0.35rem 0.85rem; border-radius: 100px; font-size: 0.85rem; font-weight: 600; border: 1.5px solid var(--border); color: var(--text-muted); text-decoration: none; transition: all 0.2s; }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.ranking-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0; }
.tab-btn { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 0.6rem 1.2rem; font-weight: 600; cursor: pointer; color: var(--text-muted); font-family: inherit; font-size: 0.95rem; transition: all 0.2s; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--primary); }

.ranking-table-wrap { }
.ranking-table-title { font-size: 1.2rem; margin-bottom: 1rem; }
.rank-note { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }
.ranking-table { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.ranking-table-header { display: grid; grid-template-columns: 60px 1fr 80px 80px 80px; gap: 1rem; padding: 0.75rem 1.25rem; background: var(--surface-2); font-size: 0.82rem; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.ranking-row { display: grid; grid-template-columns: 60px 1fr 80px 80px 80px; gap: 1rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); align-items: center; transition: background 0.15s; font-size: 0.92rem; }
.ranking-row:last-child { border-bottom: none; }
.ranking-row:hover { background: var(--surface-2); }
.ranking-row.rank-1 { background: linear-gradient(90deg, #fffbeb, white); }
.ranking-row.rank-2 { background: linear-gradient(90deg, #f8fafc, white); }
.ranking-row.rank-3 { background: linear-gradient(90deg, #fff7ed, white); }
.rank-num { font-size: 1.2rem; text-align: center; }
.rank-user { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; }
.rank-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }
.rank-year { color: var(--text-muted); font-size: 0.85rem; }
.rank-score { color: var(--primary); font-weight: 700; font-family: 'Outfit', sans-serif; }
.ranking-empty { padding: 2rem; text-align: center; color: var(--text-muted); }

/* ===== PROFILE ===== */
.profile-page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.profile-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 2rem; }
.profile-avatar-section { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--primary); object-fit: cover; }
.profile-info h2 { margin-bottom: 0.25rem; }
.profile-email { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.profile-year-badge { background: var(--primary-subtle); color: var(--primary); padding: 0.2rem 0.75rem; border-radius: 100px; font-size: 0.82rem; font-weight: 700; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat-box { text-align: center; padding: 1rem; background: var(--surface-2); border-radius: var(--radius); }
.stat-value { font-size: 1.6rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--primary); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.profile-edit-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 2rem; }
.profile-edit-card h3 { margin-bottom: 1.5rem; }

/* ===== ADMIN ===== */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.admin-stat-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.5rem; text-align: center; }
.admin-stat-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.admin-stat-value { font-size: 2.5rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--primary); }
.admin-stat-label { font-size: 0.85rem; color: var(--text-muted); }

.admin-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.admin-menu-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.75rem; transition: all 0.2s; display: block; text-decoration: none; color: inherit; }
.admin-menu-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-3px); text-decoration: none; }
.admin-menu-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.admin-menu-card h3 { margin-bottom: 0.3rem; }
.admin-menu-card p { color: var(--text-muted); font-size: 0.88rem; }

.admin-table { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; margin-bottom: 1rem; }
.admin-table-header { display: grid; grid-template-columns: 60px 1fr 100px 80px 80px; gap: 1rem; padding: 0.75rem 1.25rem; background: var(--surface-2); font-size: 0.82rem; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.admin-table-row { display: grid; grid-template-columns: 60px 1fr 100px 80px 80px; gap: 1rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); align-items: center; font-size: 0.9rem; }
.admin-table-row:last-child { border-bottom: none; }
.admin-table-row:hover { background: var(--surface-2); }
.table-id { color: var(--text-muted); font-family: monospace; }
.table-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-actions { display: flex; gap: 0.5rem; }
.table-dates { font-size: 0.82rem; color: var(--text-muted); }
.table-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.table-email { font-size: 0.85rem; color: var(--text-muted); }

.genre-badge { background: var(--primary-subtle); color: var(--primary); padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.78rem; font-weight: 700; }
.genre-badge-sm { background: var(--primary-subtle); color: var(--primary); padding: 0.15rem 0.5rem; border-radius: 100px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.correct-answer-badge { font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--success); }
.admin-badge { background: #fef3c7; color: #92400e; padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.8rem; font-weight: 700; }
.user-badge { background: var(--surface-2); color: var(--text-muted); padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.8rem; font-weight: 700; }

.question-select-list { max-height: 400px; overflow-y: auto; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.question-check-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0.5rem; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s; }
.question-check-item:hover { background: var(--surface-2); }
.question-checkbox { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.question-check-text { font-size: 0.88rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 1rem; }
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { margin-bottom: 0.5rem; }

/* ===== FOOTER ===== */
.footer { background: white; border-top: 1px solid var(--border); padding: 1.25rem 2rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-logo { font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--primary); }
.footer-copy { font-size: 0.82rem; color: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; padding: 3rem 1.5rem; }
  .hero-desc { margin: 0 auto 2rem; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .feature-grid { grid-template-columns: 1fr; max-width: 100%; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .ranking-table-header, .ranking-row { grid-template-columns: 50px 1fr 70px 70px; }
  .ranking-table-header span:nth-child(5), .ranking-row span:nth-child(5) { display: none; }
  .admin-table-header, .admin-table-row { grid-template-columns: 50px 1fr 80px 70px; }
  .admin-table-header span:last-child, .admin-table-row span:last-child { }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .hamburger { display: flex; }
  .nav-menu {
    display: none; flex-direction: column; position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: white; border-bottom: 1px solid var(--border);
    padding: 1rem; gap: 0.25rem; box-shadow: var(--shadow);
  }
  .nav-menu.open { display: flex; }
  .nav-link { padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
  .nav-user { flex-direction: column; align-items: flex-start; padding: 0.75rem 1rem; border-top: 1px solid var(--border); margin-top: 0.25rem; }
  .nav-auth { flex-direction: row; padding: 0.75rem 1rem; border-top: 1px solid var(--border); margin-top: 0.25rem; }
  .navbar { position: sticky; }
  
  .auth-card { padding: 1.75rem; }
  .form-row { grid-template-columns: 1fr; }
  .options-form-grid { grid-template-columns: 1fr; }
  
  .colosseum-grid { grid-template-columns: 1fr; }
  .genre-select-grid { grid-template-columns: repeat(2, 1fr); }
  
  .result-score-card { flex-direction: column; gap: 1.5rem; }
  .score-details { justify-content: center; }
  
  .admin-page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  
  .quiz-header { flex-direction: column; gap: 0.5rem; }
  .shuttle-stats { justify-content: flex-start; }
  
  .ranking-table-header, .ranking-row { grid-template-columns: 50px 1fr 70px 70px; gap: 0.5rem; }
}

@media (max-width: 480px) {
  .genre-select-grid { grid-template-columns: 1fr 1fr; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 2.2rem; }
  .ranking-table-header, .ranking-row { grid-template-columns: 50px 1fr 70px; }
  .ranking-table-header span:nth-child(4), .ranking-row span:nth-child(4) { display: none; }
}

/* Colosseum Detail */
.colosseum-detail { max-width: 760px; margin: 0 auto; }

/* ===== SUB GENRE CHIPS ===== */
.subgenre-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.subgenre-chip {
  padding: 0.5rem 1.1rem; border-radius: 100px;
  border: 2px solid var(--border); background: white;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; color: var(--text-muted);
}
.subgenre-chip:hover { border-color: var(--primary); color: var(--primary); }
.subgenre-chip.selected { border-color: var(--primary); background: var(--primary); color: white; }
