/* GLOBOGATE Language Tests - Main Stylesheet */
/* Design System aligned with GLOBOGATE Platform (DM Sans, Purple, Light Theme) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* GLOBOGATE Brand Colors */
  --gg-primary: #15005A;
  --gg-primary-light: #C2BCFF;
  --gg-primary-bg: #f5f4fb;
  --gg-accent: #5F50FF;
  --gg-accent-hover: #4A3DE6;
  --gg-accent-dark: #4A3DE6;
  --gg-secondary: #C2BCFF;
  --gg-secondary-light: #d4ccfc;
  --gg-white: #FFFFFF;
  --gg-light: #f5f4fb;
  --gg-gray: #6b7280;
  --gg-dark-gray: #4A5568;
  --gg-danger: #ef4444;
  --gg-warning: #f59e0b;
  --gg-success: #22c55e;
  --gg-text: #15005A;
  --gg-text-dark: #15005A;
  --gg-card-bg: #FFFFFF;
  --gg-card-border: #e2e8f0;
  --gg-shadow: 0 4px 24px rgba(21,0,90,0.08);
  --gg-radius: 12px;
  --gg-radius-sm: 8px;
  --gg-radius-lg: 20px;
  --gg-radius-pill: 9999px;
  --gg-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gg-mint: #DBFFDC;
  --gg-lavender: #C2BCFF;
}

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

html, body {
  height: 100%;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--gg-primary-bg);
  color: var(--gg-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Container */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Logo / Brand */
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 28px;
  width: auto;
}

/* Header */
header {
  padding: 16px 0;
  background: var(--gg-white);
  border-bottom: 1px solid var(--gg-card-border);
  position: relative;
  z-index: 10;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header nav a {
  color: var(--gg-gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-left: 24px;
  transition: var(--gg-transition);
}

header nav a:hover {
  color: var(--gg-accent);
}

/* Footer */
footer {
  padding: 24px 0;
  background: var(--gg-white);
  border-top: 1px solid var(--gg-card-border);
  position: relative;
  z-index: 1;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

footer .copyright {
  color: var(--gg-gray);
  font-size: 13px;
}

footer nav a {
  color: var(--gg-gray);
  text-decoration: none;
  font-size: 13px;
  margin-left: 16px;
  transition: var(--gg-transition);
}

footer nav a:hover { color: var(--gg-accent); }

/* Hero */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--gg-gray);
  max-width: 600px;
  margin: 0 auto;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px 0 60px;
}

.card {
  background: var(--gg-card-bg);
  border: 1px solid var(--gg-card-border);
  border-radius: var(--gg-radius);
  padding: 32px 24px;
  text-align: center;
  text-decoration: none;
  color: var(--gg-text);
  transition: var(--gg-transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gg-accent), var(--gg-secondary));
  opacity: 0;
  transition: var(--gg-transition);
}

.card:hover {
  border-color: var(--gg-accent);
  transform: translateY(-4px);
  box-shadow: var(--gg-shadow);
}

.card:hover::before { opacity: 1; }

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(95,80,255,0.1), rgba(194,188,255,0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  font-weight: 700;
  color: var(--gg-accent);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p {
  font-size: 13px;
  color: var(--gg-gray);
  line-height: 1.5;
}

.card .badge {
  display: inline-block;
  background: rgba(95,80,255,0.1);
  color: var(--gg-accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 12px;
}

/* Test Page Layout */
.test-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Panels */
.panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeIn 0.4s ease;
}

.panel.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Card (for test panels) */
.section-card {
  background: var(--gg-card-bg);
  border: 1px solid var(--gg-card-border);
  border-radius: var(--gg-radius);
  padding: 40px;
  width: 100%;
  max-width: 700px;
  box-shadow: var(--gg-shadow);
}

.section-card h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--gg-primary);
}

.section-card p {
  color: var(--gg-gray);
  margin-bottom: 12px;
  font-size: 15px;
}

/* Form Elements */
.form-group {
  margin-top: 24px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gg-gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--gg-white);
  border: 1px solid var(--gg-card-border);
  border-radius: var(--gg-radius-sm);
  color: var(--gg-text);
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  transition: var(--gg-transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--gg-accent);
  box-shadow: 0 0 0 3px rgba(95,80,255,0.15);
}

.form-input::placeholder { color: var(--gg-gray); }

.form-input.invalid {
  border-color: var(--gg-danger);
}

.form-error {
  color: var(--gg-danger);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.form-error.visible { display: block; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--gg-radius-pill);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--gg-transition);
  text-decoration: none;
  outline: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gg-accent);
  color: var(--gg-white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gg-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(95,80,255,0.3);
}

.btn-secondary {
  background: var(--gg-white);
  color: var(--gg-text);
  border: 1px solid var(--gg-card-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gg-light);
  border-color: var(--gg-accent);
}

.btn-accent {
  background: var(--gg-primary);
  color: var(--gg-white);
}

.btn-accent:hover:not(:disabled) {
  background: rgba(21,0,90,0.85);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--gg-danger);
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.2);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--gg-radius-pill);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-wide { min-width: 160px; }

/* Test Action Buttons */
.action-btn {
  padding: 16px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--gg-radius-pill);
  min-width: 140px;
}

.btn-new {
  background: var(--gg-accent);
  color: var(--gg-white);
}

.btn-new:hover:not(:disabled) {
  background: var(--gg-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(95,80,255,0.4);
}

.btn-repeat {
  background: var(--gg-primary);
  color: var(--gg-white);
}

.btn-repeat:hover:not(:disabled) {
  background: rgba(21,0,90,0.85);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(21,0,90,0.3);
}

/* Counter / Progress */
.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(95,80,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gg-accent), var(--gg-secondary));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.counter {
  font-size: 14px;
  color: var(--gg-gray);
  font-weight: 600;
  text-align: center;
}

.counter strong {
  color: var(--gg-accent);
  font-size: 18px;
}

/* Timer */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(95,80,255,0.08);
  border: 1px solid rgba(95,80,255,0.2);
  border-radius: var(--gg-radius-sm);
  padding: 8px 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--gg-accent);
  font-variant-numeric: tabular-nums;
}

.timer-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gg-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.timer.warning,
.timer.timer-warning {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.2);
  color: #d97706;
}

.timer.expired {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
  color: var(--gg-danger);
}

/* Prompt */
.prompt {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--gg-primary);
  padding: 12px;
}

.prompt.subtle {
  font-size: 15px;
  color: var(--gg-gray);
  font-weight: 400;
}

/* Image Grid (for LLAMA B) */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  width: 100%;
}

.image-cell {
  position: relative;
  text-align: center;
  cursor: pointer;
  transition: var(--gg-transition);
}

.image-cell img {
  width: 80px;
  height: 80px;
  border-radius: var(--gg-radius-sm);
  border: 2px solid transparent;
  transition: var(--gg-transition);
  object-fit: cover;
}

.image-cell:hover img {
  border-color: var(--gg-accent);
  transform: scale(1.05);
}

.image-cell .tooltip-label {
  display: none;
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gg-accent);
  color: var(--gg-white);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 10;
}

.image-cell:hover .tooltip-label,
.image-cell .tooltip-label.shown {
  display: block;
}

.image-cell.selected img {
  border-color: var(--gg-accent);
  box-shadow: 0 0 0 3px rgba(95,80,255,0.3);
}

/* Audio-cell: play button overlay on images */
.audio-cell {
  position: relative;
}
.audio-cell .play-audio-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--gg-accent);
  color: var(--gg-white);
  font-size: 12px;
  cursor: pointer;
  opacity: 0.8;
  transition: var(--gg-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.audio-cell:hover .play-audio-btn { opacity: 1; }
.audio-cell.playing img {
  border-color: var(--gg-accent);
  box-shadow: 0 0 0 3px rgba(95,80,255,0.3);
}

/* Symbol Grid (for word building blocks) */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.symbol-btn {
  padding: 10px 6px;
  background: var(--gg-white);
  border: 1px solid var(--gg-card-border);
  border-radius: var(--gg-radius-sm);
  color: var(--gg-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--gg-transition);
  text-align: center;
}

.symbol-btn:hover {
  background: rgba(95,80,255,0.08);
  border-color: var(--gg-accent);
  color: var(--gg-accent);
}

.symbol-btn:active {
  transform: scale(0.95);
}

/* Word Buttons (for compound word test / grammar test) */
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  width: 100%;
}

.word-btn {
  padding: 12px 8px;
  background: var(--gg-white);
  border: 1px solid var(--gg-card-border);
  border-radius: var(--gg-radius-sm);
  color: var(--gg-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--gg-transition);
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}

.word-btn:hover {
  background: rgba(95,80,255,0.08);
  border-color: var(--gg-accent);
  color: var(--gg-accent);
}

.word-btn:active {
  transform: scale(0.95);
}

/* LLAMA F Item Buttons */
.item-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.item-btn {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--gg-danger), #dc2626);
  border: none;
  border-radius: var(--gg-radius-sm);
  color: var(--gg-white);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--gg-transition);
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}

.item-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239,68,68,0.5);
}

/* Test Display Image */
.test-image {
  border-radius: var(--gg-radius);
  box-shadow: var(--gg-shadow);
  max-width: 200px;
  border: 2px solid var(--gg-card-border);
}

/* Output Display */
.output-display {
  background: rgba(95,80,255,0.05);
  border: 1px solid var(--gg-card-border);
  border-radius: var(--gg-radius-sm);
  padding: 12px 20px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gg-accent);
  text-align: center;
  width: 100%;
  font-family: 'DM Sans', monospace;
}

/* Results */
.results-card {
  text-align: center;
  padding: 48px 40px;
}

.results-card .score {
  font-size: 64px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gg-primary), var(--gg-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}

.results-card .score-label {
  font-size: 16px;
  color: var(--gg-gray);
  margin-bottom: 32px;
}

.results-card .next-test {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gg-card-border);
}

.results-card .next-test p {
  color: var(--gg-gray);
  font-size: 14px;
}

.results-card .next-test a {
  color: var(--gg-accent);
  font-weight: 600;
  text-decoration: none;
}

.results-card .next-test a:hover {
  text-decoration: underline;
}

/* Chart container */
.chart-container {
  width: 100%;
  max-width: 500px;
  margin: 24px auto;
}

/* Button Row */
.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Soundcheck */
.soundcheck-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px;
}

.play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gg-accent), var(--gg-accent-dark));
  border: none;
  color: var(--gg-white);
  font-size: 36px;
  cursor: pointer;
  transition: var(--gg-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(95,80,255,0.3);
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(95,80,255,0.5);
}

.play-btn:active { transform: scale(0.95); }

/* Rotate Warning */
.rotate-warning {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gg-white);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

@media screen and (orientation: portrait) and (max-width: 768px) {
  .rotate-warning { display: flex; }
}

.rotate-warning svg { width: 64px; height: 64px; fill: var(--gg-accent); }
.rotate-warning p { color: var(--gg-gray); font-size: 16px; }

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gg-white);
  border-top: 1px solid var(--gg-card-border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 100;
  font-size: 13px;
  color: var(--gg-gray);
  box-shadow: 0 -4px 24px rgba(21,0,90,0.08);
}

.cookie-banner.hidden { display: none; }

.cookie-banner .cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--gg-gray); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.w-full { width: 100%; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .section-card { padding: 24px; }
  .symbol-grid { grid-template-columns: repeat(4, 1fr); }
  .item-grid { grid-template-columns: repeat(4, 1fr); }
  header nav a { margin-left: 12px; font-size: 12px; }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 30px; }
  .btn-row { flex-direction: column; }
  .action-btn { width: 100%; }
}

/* ── Language Selector ── */
.lang-selector {
  display: flex;
  gap: 4px;
  background: rgba(95,80,255,0.08);
  border-radius: 20px;
  padding: 3px;
}
.lang-selector button {
  padding: 5px 14px;
  border: none;
  border-radius: 16px;
  background: none;
  color: var(--gg-gray);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--gg-transition);
}
.lang-selector button.active {
  background: var(--gg-accent);
  color: var(--gg-white);
}
.lang-selector button:hover:not(.active) {
  color: var(--gg-primary);
}

/* ── Celebration Overlay ── */
.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(21,0,90,0.88);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.celebration-overlay.visible { opacity: 1; }
.celebration-content {
  text-align: center;
  animation: celebrationPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebration-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(34,197,94,0.15);
  color: var(--gg-success);
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 3px solid var(--gg-success);
}
.celebration-content h2 {
  color: var(--gg-white);
  font-size: 28px;
  margin: 0 0 8px;
}
.celebration-content p {
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  margin: 0;
}
@keyframes celebrationPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Fullscreen Exit Hint ── */
.fullscreen-hint {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9998;
  background: rgba(21,0,90,0.85);
  color: var(--gg-white);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.fullscreen-hint.fade-out { opacity: 0; }

/* ── Demo / Practice Panel ── */
.demo-highlight {
  animation: demo-pulse 1.5s infinite !important;
  position: relative;
  z-index: 2;
}
@keyframes demo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95,80,255,0.4); }
  50% { box-shadow: 0 0 0 14px rgba(95,80,255,0); }
}

.demo-tooltip {
  position: absolute;
  z-index: 100;
  background: var(--gg-accent);
  color: var(--gg-white);
  padding: 10px 18px;
  border-radius: var(--gg-radius-sm);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(95,80,255,0.35);
  animation: tooltipFade 0.3s ease;
}
.demo-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--gg-accent);
}
@keyframes tooltipFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.demo-feedback {
  text-align: center;
  padding: 24px;
  animation: fadeIn 0.4s ease;
}
.demo-feedback .demo-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(34,197,94,0.1);
  color: var(--gg-success);
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.demo-feedback p {
  font-size: 18px;
  font-weight: 600;
  color: var(--gg-success);
  margin-bottom: 20px;
}

/* Bigger touch targets for low-IT-literacy users */
.panel .action-btn,
.panel .btn-primary.btn-wide,
.panel .btn-new,
.panel .btn-repeat {
  min-height: 56px;
  font-size: 17px;
}

/* Keyboard shortcut hints */
kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: 'DM Sans', monospace;
  color: var(--gg-gray);
  background: rgba(95,80,255,0.06);
  border: 1px solid var(--gg-card-border);
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Toast Notifications ── */
.toast {
  padding: 12px 20px;
  border-radius: var(--gg-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--gg-white);
  box-shadow: 0 4px 20px rgba(21,0,90,0.15);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.visible {
  opacity: 1;
  transform: translateX(0);
}
.toast-icon { font-size: 16px; }
.toast-success { background: var(--gg-success); }
.toast-error { background: var(--gg-danger); }
.toast-info { background: var(--gg-accent); }
.toast-warning { background: #d97706; }

/* ── Offline Banner ── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: #d97706;
  color: var(--gg-white);
  text-align: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-100%);
  transition: all 0.3s ease;
}
.offline-banner.visible {
  opacity: 1;
  transform: translateY(0);
}
.offline-banner span {
  margin-right: 8px;
}

/* ── Loading Spinner ── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(95,80,255,0.2);
  border-top-color: var(--gg-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.spinner-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: var(--gg-white);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile Responsive (Batch 3) ── */
@media (max-width: 768px) {
  .action-btn {
    min-height: 52px;
    font-size: 16px;
    padding: 14px 20px;
  }
  .word-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .play-btn {
    width: 90px;
    height: 90px;
    font-size: 40px;
  }
  .btn-row {
    gap: 8px;
  }
  .section-card h2 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .symbol-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .symbol-btn {
    padding: 12px 4px;
    font-size: 16px;
    min-height: 44px;
  }
  .word-btn {
    padding: 14px 6px;
    font-size: 14px;
    min-height: 44px;
  }
  .word-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .image-cell img {
    width: 70px;
    height: 70px;
  }
  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
  }
  .timer {
    font-size: 18px;
    padding: 6px 12px;
  }
}

/* ── Sentence Pair (MLAT-IV Test F) ── */
.sentence-pair { margin: 20px 0; }
.sentence {
  font-size: 18px;
  line-height: 1.6;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: var(--gg-radius-sm);
}
.sentence-a {
  background: var(--gg-primary-light);
  color: var(--gg-primary);
  font-weight: 600;
}
.sentence-a .highlight {
  background: var(--gg-accent);
  color: var(--gg-white);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}
.sentence-b {
  background: rgba(0,0,0,0.03);
}

/* Options Grid (MLAT-IV) */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.option-btn {
  padding: 14px 16px;
  border: 2px solid var(--gg-card-border);
  border-radius: var(--gg-radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  background: var(--gg-white);
  color: var(--gg-primary);
  text-align: center;
  transition: var(--gg-transition);
}
.option-btn:hover:not(:disabled) {
  border-color: var(--gg-accent);
  background: rgba(95,80,255,0.04);
}
.option-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.option-btn.selected {
  border-color: var(--gg-accent);
  background: rgba(95,80,255,0.1);
  color: var(--gg-accent);
}
.option-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

@media (max-width: 480px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
  .sentence {
    font-size: 16px;
    padding: 10px 12px;
  }
}

/* ── Print Styles ── */
@media print {
  header, footer, .cookie-banner, .lang-selector,
  .offline-banner, #toast-container, .fullscreen-hint { display: none !important; }
  body { background: white; color: black; }
  .section-card, .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
