/* =====================================================
   EDU — Design System
   Aprender. Jogar. Evoluir.
   Colors: #7B61FF (purple) | #00C2FF (blue) | #00FF9D (green)
   ===================================================== */

:root {
  --purple:        #7B61FF;
  --blue:          #00C2FF;
  --green:         #00FF9D;
  --pink:          #FF69B4;
  --red:           #FF6B6B;
  --orange:        #FF8C42;
  --yellow:        #FCD34D;
  --bg:            #0a0a1a;
  --bg-surface:    #111128;
  --bg-card:       rgba(255,255,255,0.05);
  --border:        rgba(255,255,255,0.1);
  --text:          #ffffff;
  --text-muted:    rgba(255,255,255,0.6);
  --text-dim:      rgba(255,255,255,0.35);
  --navbar-h:      64px;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 24px rgba(123,97,255,0.25);
  --transition:    0.2s ease;
  --font:          'Poppins', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: var(--navbar-h);
  padding-bottom: env(safe-area-inset-bottom);
}
body.play-page { padding-top: 0; padding-bottom: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

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

/* ── Container ──────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Glass Card ─────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: var(--navbar-h);
  background: rgba(10,10,26,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
}
.navbar-brand { display: flex; align-items: center; gap: .5rem; }
.brand-logo { width: 32px; height: 32px; }
.brand-text {
  font-size: 1.5rem; font-weight: 900;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar-links { display: flex; align-items: center; gap: 1.25rem; }
.navbar-links a { color: var(--text-muted); font-weight: 500; font-size: .9rem; transition: color var(--transition); }
.navbar-links a:hover { color: var(--text); }

.btn-nav {
  padding: .4rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  transition: all var(--transition);
}
.btn-google {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: var(--text); display: flex; align-items: center;
}
.btn-google:hover { background: rgba(255,255,255,0.18); }
.btn-nav-admin { background: rgba(123,97,255,0.2); color: var(--purple); }
.btn-nav-logout { background: rgba(255,107,107,0.15); color: var(--red); }

.nav-user { display: flex; align-items: center; gap: .4rem; }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.navbar-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 4px; cursor: pointer;
}
.navbar-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }

/* ── Mobile Menu ────────────────────────────────────────────────────────── */
.mobile-menu {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,10,26,0.98); z-index: 400;
  display: flex; flex-direction: column; padding: 5rem 2rem 2rem;
  gap: 1rem; transform: translateX(100%); transition: transform .3s ease;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  background: none; border: none; color: var(--text); font-size: 1.5rem;
}
.mobile-link { font-size: 1.1rem; font-weight: 600; padding: .75rem 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.mobile-link:hover, .mobile-link.active { color: var(--text); }
.mobile-logout { color: var(--red); }
.mobile-google { color: var(--green); }

/* ── Bottom Nav ─────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(10,10,26,0.95); border-top: 1px solid var(--border);
  display: none; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: .6rem .5rem; color: var(--text-dim); font-size: .7rem; font-weight: 600;
  transition: color var(--transition);
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--purple); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65rem 1.5rem; border-radius: 999px; font-weight: 700;
  font-size: .95rem; border: none; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.btn-lg { padding: .8rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff; box-shadow: 0 4px 20px rgba(123,97,255,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(123,97,255,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--purple); color: var(--purple); }
.btn-google-hero {
  background: #fff; color: #333; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.btn-google-hero:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.btn-google-footer {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .5rem 1.2rem; background: #fff; color: #333;
  border-radius: 999px; font-weight: 700; font-size: .85rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.btn-icon { background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 4px; }
.btn-danger:hover { opacity: .7; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-dark { background: var(--bg-surface); }
.section-title {
  font-size: 2rem; font-weight: 900; text-align: center; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text), var(--text-muted));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-title.left { text-align: left; -webkit-text-fill-color: var(--text); }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 3rem; font-size: 1.05rem; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: calc(100vh - var(--navbar-h));
  display: flex; align-items: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 40%, rgba(123,97,255,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 60%, rgba(0,194,255,0.1) 0%, transparent 60%);
}
.hero-content {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;
  align-items: center; padding: 3rem 1.25rem;
}
.hero-logo { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.hero-logo-img { width: 72px; height: 72px; }
.hero-title {
  font-size: 3.5rem; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--purple), var(--blue), var(--green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-tagline { font-size: 1rem; color: var(--text-muted); font-weight: 500; margin-top: .25rem; }
.hero-desc { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 480px; line-height: 1.8; }
.hero-desc strong { color: var(--text); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.badge {
  padding: .35rem .8rem; border-radius: 999px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  font-size: .8rem; font-weight: 500; color: var(--text-muted);
}

/* ── Phone Mockup ───────────────────────────────────────────────────────── */
.hero-right { display: flex; justify-content: center; }
.phone-mockup {
  width: 260px;
  background: rgba(20,20,40,0.9);
  border: 2px solid rgba(123,97,255,0.4);
  border-radius: 36px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(123,97,255,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.phone-screen { min-height: 500px; display: flex; flex-direction: column; gap: 8px; }
.phone-header { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 6px 0 4px; }
.phone-greeting { font-size: .8rem; font-weight: 600; text-align: center; color: var(--text-muted); padding: 4px 0 8px; }
.phone-subjects {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; flex: 1;
}
.phone-subject-card {
  border-radius: 10px; padding: 10px 8px; text-align: center;
  border: 1px solid transparent;
  display: flex; flex-direction: column; gap: 4px;
}
.phone-subject-icon { font-size: 1.2rem; }
.phone-subject-name { font-size: .65rem; font-weight: 700; }
.phone-btn {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff; border: none; border-radius: 8px; padding: 8px;
  font-size: .7rem; font-weight: 700; width: 100%;
}
.phone-bottom-nav {
  display: flex; justify-content: space-around; padding: 6px 0;
  border-top: 1px solid var(--border); font-size: 1.1rem;
}

/* ── Features Grid ──────────────────────────────────────────────────────── */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  margin-top: 3rem;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 1.5rem;
  transition: all var(--transition);
}
.feature-card:hover { border-color: rgba(123,97,255,0.4); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.feature-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }

/* ── Subjects Grid ──────────────────────────────────────────────────────── */
.subjects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.subject-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(var(--sc, 123,97,255),0.3);
  border-radius: var(--radius); padding: 1.25rem 1rem; text-align: center;
  display: flex; flex-direction: column; gap: .4rem; align-items: center;
  transition: all var(--transition); cursor: pointer;
  box-shadow: 0 0 0 transparent;
}
.subject-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--sc); transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.subject-icon { font-size: 1.8rem; }
.subject-name { font-size: .82rem; font-weight: 700; }
.subject-area { font-size: .7rem; color: var(--text-muted); }

.subjects-grid-sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); gap: .75rem; }
.subject-card-sm {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); padding: .9rem .5rem; text-align: center;
  display: flex; flex-direction: column; gap: .3rem; align-items: center;
  transition: all var(--transition);
}
.subject-card-sm:hover { border-color: var(--sc); background: rgba(255,255,255,0.07); }
.subject-card-sm .subject-icon { font-size: 1.4rem; }
.subject-card-sm .subject-name { font-size: .72rem; font-weight: 700; }

.grades-row { margin-top: 1rem; }
.grades-row p { color: var(--text-muted); font-size: .9rem; margin-bottom: .75rem; }
.grades-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.grade-tag {
  padding: .35rem .85rem; background: rgba(255,255,255,0.06);
  border: 1px solid var(--border); border-radius: 999px; font-size: .8rem;
}
.grade-tag.highlight { background: rgba(123,97,255,0.15); border-color: rgba(123,97,255,0.4); color: var(--purple); }

/* ── Examples Grid ──────────────────────────────────────────────────────── */
.examples-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.25rem; margin: 3rem 0 1.5rem; }
.example-card {
  border-radius: var(--radius); padding: 1.25rem;
  border: 1px solid var(--border);
}
.example-mat  { background: rgba(79,158,255,0.08); border-color: rgba(79,158,255,0.25); }
.example-cien { background: rgba(0,212,170,0.08); border-color: rgba(0,212,170,0.25); }
.example-geo  { background: rgba(255,140,66,0.08); border-color: rgba(255,140,66,0.25); }
.example-hist { background: rgba(255,107,107,0.08); border-color: rgba(255,107,107,0.25); }
.example-label { font-size: .78rem; font-weight: 700; opacity: .7; margin-bottom: .5rem; }
.example-card p { font-size: .85rem; margin-bottom: .75rem; }
.example-visual { display: flex; align-items: center; justify-content: center; min-height: 70px; }
.angle-demo { position: relative; width: 80px; height: 60px; }
.angle-line { position: absolute; bottom: 0; left: 0; width: 60px; height: 2px; background: var(--blue); }
.angle-45 { transform: rotate(-45deg); transform-origin: left bottom; }
.angle-text { position: absolute; bottom: 10px; left: 30px; font-size: .75rem; font-weight: 700; color: var(--yellow); }
.waveform { display: flex; align-items: center; gap: 3px; }
.wave-bar { width: 4px; background: linear-gradient(to top, var(--green), var(--blue)); border-radius: 2px; }
.phone-tilt-demo { font-size: 2.5rem; animation: tilt 2s ease-in-out infinite; }
@keyframes tilt { 0%,100%{transform:rotate(-15deg)} 50%{transform:rotate(15deg)} }
.drag-demo { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.drag-item {
  padding: 6px 12px; background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  border-radius: 8px; font-size: .8rem; font-weight: 700; cursor: grab;
}
.drag-active { border-color: var(--purple); background: rgba(123,97,255,0.2); }
.examples-more { text-align: center; color: var(--text-muted); font-size: .9rem; }

/* ── Sensors Grid ───────────────────────────────────────────────────────── */
.sensors-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; margin-top: 3rem; }
.sensor-card {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.25rem; text-align: center;
  transition: all var(--transition);
}
.sensor-card:hover { border-color: rgba(0,194,255,0.4); transform: translateY(-4px); }
.sensor-icon { font-size: 2.5rem; margin-bottom: .75rem; display: block; }
.sensor-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; }
.sensor-card p { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

/* ── Create Preview ─────────────────────────────────────────────────────── */
.create-preview-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.create-steps { list-style: none; display: flex; flex-direction: column; gap: .6rem; margin: 1.25rem 0 2rem; }
.create-steps li { font-size: .9rem; color: var(--text-muted); }
.create-card-demo {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.demo-field label { font-size: .78rem; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: .3rem; }
.demo-select {
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .9rem; font-size: .85rem; font-weight: 600;
}
.demo-slider {
  height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px;
  position: relative; margin-top: .3rem;
}
.demo-slider-fill { height: 100%; background: linear-gradient(90deg,var(--purple),var(--blue)); border-radius: 3px; }
.demo-modes { display: flex; gap: .5rem; }
.demo-mode {
  flex: 1; text-align: center; padding: .6rem;
  background: rgba(255,255,255,0.05); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .82rem; font-weight: 700; cursor: pointer;
}
.demo-mode.active { background: rgba(123,97,255,0.2); border-color: var(--purple); color: var(--purple); }
.demo-created { text-align: center; }
.demo-created p { font-size: .9rem; font-weight: 700; color: var(--green); margin-bottom: .5rem; }
.demo-link {
  background: rgba(0,255,157,0.08); border: 1px solid rgba(0,255,157,0.3);
  border-radius: var(--radius-sm); padding: .5rem .75rem; font-size: .8rem;
  color: var(--green); font-weight: 600; word-break: break-all;
}

/* ── Gameplay Demo ──────────────────────────────────────────────────────── */
.gameplay-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; }
.gameplay-question-demo {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.gq-timer {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg,var(--purple),var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900; margin-bottom: 1rem;
}
.gq-text { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.gq-options { display: flex; flex-direction: column; gap: .5rem; }
.gq-opt {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .65rem 1rem; font-size: .85rem;
}
.gq-correct { border-color: var(--green); background: rgba(0,255,157,0.12); color: var(--green); font-weight: 700; }
.gameplay-ranking-demo {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.grd-title { font-weight: 700; margin-bottom: 1rem; }
.grd-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.grd-row:last-child { border-bottom: none; }
.grd-me { background: rgba(123,97,255,0.08); border-radius: 8px; padding: .6rem .5rem; }
.grd-rank { width: 20px; font-weight: 700; font-size: .85rem; color: var(--text-muted); }
.grd-name { flex: 1; font-size: .85rem; }
.grd-score { font-weight: 700; color: var(--green); font-size: .9rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; }
.footer-inner { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.5rem; margin-bottom: 2rem; }
.footer-col {
  display: flex; align-items: flex-start; gap: .75rem; font-size: .85rem; color: var(--text-muted);
}
.footer-icon { font-size: 1.5rem; }
.footer-col small { display: block; margin-top: 2px; font-size: .78rem; opacity: .6; }
.footer-bottom { text-align: center; border-top: 1px solid var(--border); padding-top: 1.5rem; font-size: .85rem; color: var(--text-muted); }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.dashboard-container {
  max-width: 900px; margin: 0 auto; padding: 2rem 1.25rem 6rem;
}
.page-title { font-size: 1.75rem; font-weight: 900; margin-bottom: 1.5rem; }

.dash-profile-card {
  padding: 1.75rem; display: flex; align-items: center; gap: 1.5rem;
  flex-wrap: wrap; margin-bottom: 2rem;
}
.dash-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--purple); }
.dash-profile-info { flex: 1; min-width: 180px; }
.dash-profile-info h2 { font-size: 1.2rem; font-weight: 800; }
.dash-email { font-size: .8rem; color: var(--text-muted); margin-bottom: .6rem; }
.dash-level-badge { display: flex; align-items: center; gap: .6rem; }
.level-circle {
  background: linear-gradient(135deg,var(--purple),var(--blue));
  color: #fff; font-size: .75rem; font-weight: 800;
  padding: .2rem .7rem; border-radius: 999px; white-space: nowrap;
}
.level-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; min-width: 80px; }
.level-bar-fill { height: 100%; background: linear-gradient(90deg,var(--purple),var(--blue)); border-radius: 3px; transition: width .5s; }
.level-xp { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.dash-stats-mini { display: flex; gap: 1.5rem; }
.dash-stat { text-align: center; }
.dash-stat-val { display: block; font-size: 1.5rem; font-weight: 900; color: var(--purple); }
.dash-stat-label { font-size: .75rem; color: var(--text-muted); }

.dash-section { margin: 2rem 0; }
.dash-section-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 1rem; }
.dash-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }

.recent-games { display: flex; flex-direction: column; gap: .75rem; }
.recent-game-card {
  padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem;
  transition: all var(--transition); cursor: pointer;
}
.recent-game-card:hover { border-color: rgba(123,97,255,0.4); }
.rg-left { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.rg-subject { font-size: .9rem; font-weight: 700; }
.rg-grade { font-size: .75rem; color: var(--text-muted); }
.rg-center { display: flex; flex-direction: column; gap: .2rem; align-items: flex-end; }
.rg-score { font-size: 1rem; font-weight: 800; color: var(--purple); }
.rg-acc { font-size: .78rem; font-weight: 600; }
.rg-right .rg-date { font-size: .78rem; color: var(--text-muted); }
.acc-good { color: var(--green); }
.acc-bad  { color: var(--red); }

.dash-empty { padding: 3rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }

/* ── Ranking ─────────────────────────────────────────────────────────────── */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 1rem; padding: 2rem 0; }
.podium-place { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.podium-crown { font-size: 1.5rem; }
.podium-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid; }
.p1 .podium-avatar { border-color: #FFD700; }
.p2 .podium-avatar { border-color: #C0C0C0; }
.p3 .podium-avatar { border-color: #CD7F32; }
.podium-name { font-size: .85rem; font-weight: 700; }
.podium-xp  { font-size: .78rem; color: var(--text-muted); }
.podium-block { display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 900; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.p1-block { width: 64px; height: 64px; background: linear-gradient(135deg,#FFD700,#FFA000); color: #fff; }
.p2-block { width: 54px; height: 48px; background: linear-gradient(135deg,#C0C0C0,#909090); color: #fff; }
.p3-block { width: 54px; height: 36px; background: linear-gradient(135deg,#CD7F32,#8B4513); color: #fff; }

.ranking-list { padding: .5rem; }
.rank-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .75rem; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-me { background: rgba(123,97,255,0.1); border-radius: var(--radius-sm); }
.rank-pos { width: 28px; font-weight: 800; font-size: .9rem; color: var(--text-muted); }
.rank-gold   { color: #FFD700; }
.rank-silver { color: #C0C0C0; }
.rank-bronze { color: #CD7F32; }
.rank-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.rank-info { flex: 1; display: flex; flex-direction: column; }
.rank-name  { font-size: .9rem; font-weight: 700; }
.rank-level { font-size: .75rem; color: var(--text-muted); }
.rank-xp { font-weight: 800; color: var(--purple); font-size: .9rem; }
.rank-you { font-size: .75rem; color: var(--purple); font-weight: 600; }

/* ── Room Create Form ───────────────────────────────────────────────────── */
.create-room-form { padding: 2rem; margin-bottom: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: .5rem; }
.form-group-full { grid-column: 1 / -1; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.form-select, .form-input {
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem 1rem;
  color: var(--text); font-size: .9rem; width: 100%;
  transition: border-color var(--transition);
}
.form-select:focus, .form-input:focus { outline: none; border-color: var(--purple); }
.form-select option { background: #1e1e3a; color: #ffffff; }
.form-textarea {
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem 1rem;
  color: var(--text); font-size: .9rem; width: 100%; resize: vertical;
}
.form-textarea:focus { outline: none; border-color: var(--purple); }
.form-range {
  width: 100%; height: 6px; background: rgba(255,255,255,0.1);
  border-radius: 3px; appearance: none; cursor: pointer;
}
.form-range::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg,var(--purple),var(--blue)); cursor: pointer;
}
.range-hints { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-dim); margin-top: .25rem; }
.mode-toggle { display: flex; gap: .5rem; }
.mode-btn {
  flex: 1; padding: .65rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05); border: 1.5px solid var(--border);
  color: var(--text-muted); font-size: .9rem; font-weight: 700; cursor: pointer;
  transition: all var(--transition);
}
.mode-btn.active { background: rgba(123,97,255,0.2); border-color: var(--purple); color: var(--purple); }

.create-info { padding: 1.5rem; }
.create-info h4 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.create-info ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.create-info li { font-size: .88rem; color: var(--text-muted); }

/* ── Lobby ──────────────────────────────────────────────────────────────── */
.lobby-card { padding: 2rem; }
.lobby-header { margin-bottom: 1.5rem; }
.lobby-header h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: .75rem; }
.lobby-meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.lobby-badge {
  padding: .3rem .8rem; background: rgba(255,255,255,0.08);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: .8rem; font-weight: 600;
}
.badge-desafio { background: rgba(255,107,107,0.15); border-color: rgba(255,107,107,0.3); color: var(--red); }

.lobby-share { margin-bottom: 1.5rem; }
.lobby-share-label { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.lobby-link-wrap { display: flex; gap: .5rem; }
.lobby-link-input {
  flex: 1; background: rgba(0,255,157,0.06); border: 1px solid rgba(0,255,157,0.25);
  border-radius: var(--radius-sm); padding: .65rem 1rem; color: var(--green);
  font-size: .85rem; font-weight: 600;
}
.btn-copy {
  background: rgba(0,255,157,0.15); border: 1px solid rgba(0,255,157,0.3);
  color: var(--green); border-radius: var(--radius-sm); padding: .65rem 1rem;
  font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.btn-copy:hover { background: rgba(0,255,157,0.25); }
.lobby-share-hint { font-size: .78rem; color: var(--text-dim); margin-top: .4rem; }

.lobby-players-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.lobby-players-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.lobby-player { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.lobby-player-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--purple);
}
.lobby-player-name { font-size: .78rem; font-weight: 700; }
.lobby-player-host { font-size: .9rem; }

.lobby-actions { text-align: center; }
.lobby-hint { font-size: .8rem; color: var(--text-dim); margin-top: .75rem; }
.lobby-waiting { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem; color: var(--text-muted); }
.waiting-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(123,97,255,0.2); border-top-color: var(--purple);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Play Screen ────────────────────────────────────────────────────────── */
.play-container {
  min-height: 100vh; background: var(--bg);
  display: grid;
  grid-template-areas:
    "header header"
    "timer  ranking"
    "question ranking"
    "options  ranking";
  grid-template-columns: 1fr 240px;
  grid-template-rows: auto auto 1fr auto;
  gap: 1rem; padding: 1rem;
  position: relative;
}

.play-header {
  grid-area: header; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1.25rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.play-header-left { display: flex; gap: .75rem; align-items: center; }
.play-subject { font-weight: 700; font-size: .9rem; }
.play-grade { font-size: .8rem; color: var(--text-muted); }
.play-progress { font-size: .85rem; font-weight: 700; color: var(--text-muted); }
.play-score-label { font-size: .8rem; color: var(--text-muted); }
.play-score { font-size: 1.1rem; font-weight: 900; color: var(--green); }

.play-timer-wrap { grid-area: timer; display: flex; justify-content: center; padding: .5rem 0; }
.play-timer-ring { position: relative; width: 80px; height: 80px; }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 6; }
.timer-fill { fill: none; stroke: var(--purple); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .5s linear, stroke .3s; }
.timer-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900;
}

.play-question-wrap { grid-area: question; }
.play-question { padding: 1.25rem 1.5rem; }
.play-q-text { font-size: 1.05rem; font-weight: 700; line-height: 1.6; }

.play-options {
  grid-area: options;
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding-bottom: 1rem;
}
.play-option {
  background: rgba(255,255,255,0.06); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1.1rem; text-align: left;
  font-size: .9rem; font-weight: 600; color: var(--text);
  transition: all var(--transition); cursor: pointer;
}
.play-option:hover:not(:disabled) { border-color: var(--purple); background: rgba(123,97,255,0.12); }
.play-option:disabled { cursor: default; }
.opt-selected { border-color: var(--purple) !important; background: rgba(123,97,255,0.2) !important; }
.opt-correct  { border-color: var(--green) !important; background: rgba(0,255,157,0.15) !important; color: var(--green) !important; }
.opt-wrong    { border-color: var(--red) !important; background: rgba(255,107,107,0.12) !important; opacity: .6; }

.play-feedback {
  position: fixed; inset: 0; z-index: 100; background: rgba(10,10,26,0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.feedback-icon { font-size: 4rem; }
.feedback-text { font-size: 1.5rem; font-weight: 900; }
.feedback-explanation { font-size: .9rem; color: var(--text-muted); max-width: 400px; text-align: center; }
.feedback-points { font-size: 1.2rem; font-weight: 700; color: var(--green); }

.play-ranking {
  grid-area: ranking; padding: 1rem; height: fit-content;
  position: sticky; top: 1rem;
}
.rank-title { font-size: .9rem; font-weight: 800; margin-bottom: .75rem; }
.rank-item { display: flex; align-items: center; gap: .4rem; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.rank-item:last-child { border-bottom: none; }
.rank-item.rank-me { background: rgba(123,97,255,0.1); border-radius: 6px; padding: .4rem .4rem; }
.rank-pos { width: 18px; font-weight: 700; color: var(--text-muted); }
.rank-avatar-sm { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.rank-name-sm { flex: 1; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-score-sm { font-weight: 800; color: var(--green); }

.play-finished {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.finished-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.finished-icon { font-size: 5rem; animation: bounce .6s ease infinite alternate; }
@keyframes bounce { to { transform: scale(1.15); } }

/* ── Results ────────────────────────────────────────────────────────────── */
.results-card { padding: 2rem; }
.results-title { font-size: 1.6rem; font-weight: 900; text-align: center; margin-bottom: 1rem; }
.results-meta { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1.5rem; }
.results-podium { margin-bottom: 1.5rem; }
.results-table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.results-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.results-table th, .results-table td {
  padding: .75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.results-table th { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.results-table tr:hover td { background: rgba(255,255,255,0.03); }
.results-me td { background: rgba(123,97,255,0.08) !important; }
.td-correct { color: var(--green); font-weight: 700; }
.td-wrong   { color: var(--red); font-weight: 700; }

.my-results-card {
  background: rgba(123,97,255,0.08); border: 1px solid rgba(123,97,255,0.25);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.my-results-card h4 { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-muted); }
.my-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.my-stat { text-align: center; display: flex; flex-direction: column; gap: .3rem; }
.my-stat-val { font-size: 1.6rem; font-weight: 900; }
.my-stat span:last-child { font-size: .78rem; color: var(--text-muted); }
.my-stat-val.correct { color: var(--green); }
.my-stat-val.wrong   { color: var(--red); }
.my-stat-val.score   { color: var(--purple); }
.results-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Admin ──────────────────────────────────────────────────────────────── */
.admin-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.admin-stat-card { padding: 1.5rem; text-align: center; }
.ast-icon { font-size: 2rem; margin-bottom: .5rem; }
.ast-val { font-size: 2rem; font-weight: 900; color: var(--purple); }
.ast-label { font-size: .8rem; color: var(--text-muted); }

.admin-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-nav-btn {
  padding: .5rem 1.1rem; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  transition: all var(--transition);
}
.admin-nav-btn.active, .admin-nav-btn:hover { background: rgba(123,97,255,0.2); border-color: var(--purple); color: var(--purple); }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.admin-panel { padding: 1.5rem; overflow: hidden; }
.admin-panel-title { font-size: 1rem; font-weight: 800; margin-bottom: 1rem; }
.admin-rooms-list { display: flex; flex-direction: column; gap: .75rem; }
.admin-room-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.admin-room-row:last-child { border-bottom: none; }
.rg-date { font-size: .78rem; color: var(--text-muted); }
.admin-empty { color: var(--text-dim); font-size: .9rem; text-align: center; padding: 1rem 0; }
.admin-quick-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-filters { padding: 1rem 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }

.toggle-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; }
.toggle-btn.inactive { opacity: .5; }

/* ── Misc ───────────────────────────────────────────────────────────────── */
code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: .85rem; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-content    { grid-template-columns: 1fr; gap: 2rem; }
  .hero-right      { display: none; }
  .features-grid   { grid-template-columns: repeat(2,1fr); }
  .sensors-grid    { grid-template-columns: repeat(2,1fr); }
  .gameplay-demo   { grid-template-columns: 1fr; }
  .create-preview-wrapper { grid-template-columns: 1fr; }
  .footer-inner    { grid-template-columns: repeat(2,1fr); }
  .admin-stats-grid { grid-template-columns: repeat(2,1fr); }
  .admin-grid      { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .navbar-links    { display: none; }
  .navbar-toggle   { display: flex; }
  .bottom-nav      { display: grid; }
  body             { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.play-page   { padding-bottom: 0; }

  .hero-title      { font-size: 2.5rem; }
  .features-grid   { grid-template-columns: 1fr; }
  .examples-grid   { grid-template-columns: 1fr; }
  .sensors-grid    { grid-template-columns: repeat(2,1fr); }
  .form-grid       { grid-template-columns: 1fr; }
  .footer-inner    { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: repeat(2,1fr); }
  .my-stats-grid   { grid-template-columns: repeat(2,1fr); }
  .subjects-grid   { grid-template-columns: repeat(auto-fill,minmax(100px,1fr)); }

  .play-container  {
    grid-template-areas: "header" "timer" "question" "options" "ranking";
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    padding: .75rem;
  }
  .play-ranking { position: static; }
  .play-options { grid-template-columns: 1fr; }

  .podium { gap: .5rem; }
  .p1-block { width: 52px; height: 52px; }
  .p2-block,.p3-block { width: 44px; }

  .results-table th, .results-table td { padding: .5rem .6rem; font-size: .8rem; }
  .dash-profile-card { flex-direction: column; text-align: center; }
  .dash-stats-mini { justify-content: center; }
}
