@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --ink: #141725;
  --ink-soft: #5f6475;
  --paper: #f7f8fc;
  --surface: #ffffff;
  --surface-alt: #f0f2f8;
  --line: #e3e6ef;
  --brand: #5a50e5;
  --brand-dark: #3f36bd;
  --brand-soft: #eeedff;
  --mint: #10a980;
  --mint-soft: #e5f8f2;
  --amber: #dc8a08;
  --amber-soft: #fff3dc;
  --danger: #cf3b55;
  --danger-soft: #fdecef;
  --info: #2377c9;
  --info-soft: #e8f3ff;
  --radius-xs: 10px;
  --radius-sm: 16px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --shadow-sm: 0 1px 2px #1920420d, 0 5px 14px #1920420a;
  --shadow-md: 0 16px 40px #25295b14;
  --font-body: 'DM Sans', Arial, sans-serif;
  --font-display: Outfit, 'DM Sans', Arial, sans-serif;
}

[data-theme='dark'] {
  --ink: #f4f5ff;
  --ink-soft: #b6bad0;
  --paper: #10111a;
  --surface: #191b28;
  --surface-alt: #222535;
  --line: #343849;
  --brand-soft: #292753;
  --mint-soft: #173d37;
  --amber-soft: #483718;
  --danger-soft: #47252e;
  --info-soft: #173956;
  --shadow-sm: none;
  --shadow-md: 0 16px 40px #0005;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body.platform-body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
}
:focus-visible {
  outline: 3px solid #7c76f7aa;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}

.public-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
}
.public-header {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 70px;
  align-items: center;
  gap: 20px;
  margin: 0 auto;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  box-shadow: 0 7px 14px #5a50e542;
}
.public-nav {
  display: none;
  gap: 22px;
  margin-left: 18px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}
.public-nav a:hover {
  color: var(--brand);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}
.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 18px #5a50e52e;
}
.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}
.button.ghost {
  background: transparent;
  color: var(--brand);
  box-shadow: none;
}
.button.danger {
  background: var(--danger);
}
.button.small {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 11px;
  font-size: 0.8rem;
}

.landing-hero {
  display: grid;
  gap: 32px;
  padding: 48px 0 38px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
.landing-hero h1 {
  max-width: 720px;
  margin: 13px 0 17px;
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 11vw, 5.4rem);
  letter-spacing: -0.07em;
  line-height: 0.94;
}
.landing-hero h1 em {
  color: var(--brand);
  font-style: normal;
}
.hero-description {
  max-width: 600px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: 0.83rem;
  font-weight: 700;
}
.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trust-row span::before {
  color: var(--mint);
  content: '✓';
}
.hero-preview {
  position: relative;
  min-height: 315px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #4139ae, #756ff2);
  box-shadow: var(--shadow-md);
  color: #fff;
}
.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.preview-status {
  padding: 5px 9px;
  border-radius: 999px;
  background: #ffffff21;
}
.preview-card {
  position: absolute;
  right: 17px;
  bottom: 17px;
  left: 17px;
  padding: 20px;
  border: 1px solid #fff2;
  border-radius: 20px;
  background: #fff;
  color: #20233a;
  box-shadow: 0 18px 35px #15105046;
}
.preview-card small {
  color: #73788c;
  font-weight: 700;
}
.preview-card h3 {
  margin: 6px 0 17px;
  font-family: var(--font-display);
  font-size: 1.45rem;
}
.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e6f5;
}
.progress-track i {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
}
.preview-points {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: #5f6475;
  font-size: 0.8rem;
  font-weight: 800;
}

.section {
  padding: 64px 0;
}
.section.tint {
  background: var(--surface-alt);
}
.section-title {
  max-width: 670px;
  margin-bottom: 27px;
}
.section-title h2 {
  margin: 9px 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 6vw, 3rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
}
.section-title p {
  color: var(--ink-soft);
}
.feature-grid,
.role-grid,
.metric-grid {
  display: grid;
  gap: 14px;
}
.feature-card,
.role-card,
.surface-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.feature-card {
  padding: 22px;
}
.feature-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.22rem;
}
.feature-card h3 {
  margin: 18px 0 7px;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.feature-card p,
.role-card p,
.muted {
  color: var(--ink-soft);
}
.role-card {
  padding: 24px;
}
.role-card .role-number {
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
}
.role-card h3 {
  margin: 5px 0 9px;
  font-family: var(--font-display);
}
.role-card a {
  display: inline-flex;
  margin-top: 16px;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 800;
}
.faq-list {
  display: grid;
  gap: 10px;
}
.faq-list details {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  padding: 16px 18px;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 800;
}
.faq-list p {
  margin: 13px 0 0;
  color: var(--ink-soft);
}
.closing-cta {
  padding: 34px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
}
.closing-cta h2 {
  margin-bottom: 9px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.05em;
}
.closing-cta p {
  color: #d3d5e6;
}
.closing-cta .button {
  margin-top: 10px;
  background: #fff;
  color: var(--ink);
}
.site-footer {
  padding: 36px 0 88px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.games-page {
  padding: 34px 0 74px;
}

.arcade-shelf {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius-md);
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--brand) 16%, transparent),
      transparent 46%
    ),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.arcade-shelf .section-head {
  margin-bottom: 4px;
}
.arcade-shelf h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  letter-spacing: -0.045em;
}
.arcade-shelf > .muted {
  margin: 0 0 15px;
}
.arcade-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 78%);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.arcade-card {
  display: flex;
  min-height: 94px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
  scroll-snap-align: start;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}
.arcade-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.arcade-card > :last-child {
  margin-left: auto;
  color: var(--brand);
  font-weight: 900;
}
.arcade-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  font-size: 1.5rem;
}
.arcade-card b,
.arcade-card small {
  display: block;
}
.arcade-card b {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}
.arcade-card small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.25;
}

.catalog-hero {
  display: grid;
  gap: 22px;
  align-items: end;
  padding: clamp(26px, 7vw, 68px) 0 28px;
}

.catalog-hero h1 {
  max-width: 700px;
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 9vw, 5rem);
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.catalog-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.catalog-tools {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.catalog-tools .search-input {
  width: 100%;
}

.catalog-count {
  margin: 24px 0 13px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.game-catalog-grid {
  display: grid;
  gap: 14px;
}

.learning-game-card {
  display: grid;
  gap: 15px;
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.learning-game-card > div:nth-child(2) {
  min-width: 0;
}

.learning-game-card h2 {
  margin: 11px 0 7px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.learning-game-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.learning-game-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  align-self: end;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: capitalize;
}

.game-card-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.game-page {
  padding: 30px 0 70px;
}

.game-intro,
.game-stage {
  width: min(100%, 760px);
  margin: 0 auto;
}

.game-intro {
  margin-bottom: 18px;
}

.game-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.game-title-row h1 {
  margin: 4px 0 7px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: -0.05em;
}

.game-title-row p:last-child {
  margin: 0;
  color: var(--ink-soft);
}

.game-settings {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.game-settings label {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.game-hint {
  display: grid;
  gap: 4px;
  padding: 17px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.game-hint b {
  color: var(--brand);
}

.play-card,
.result-card {
  padding: clamp(20px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.play-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 800;
}

.timer {
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
}

.play-progress {
  height: 8px;
  overflow: hidden;
  margin: 17px 0 26px;
  border-radius: 999px;
  background: var(--surface-alt);
}

.play-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.25s ease;
}

.mechanic-note {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-card h2 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 6vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.play-options {
  display: grid;
  gap: 10px;
}

.play-options button {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease;
}

.play-options button:not(:disabled):active {
  transform: scale(0.985);
}
.play-options button:not(:disabled):hover {
  border-color: var(--brand);
}
.play-options button span {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 900;
}
.play-options button.is-correct {
  border-color: var(--mint);
  background: var(--mint-soft);
}
.play-options button.is-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.answer-feedback {
  margin: 20px 0 4px;
  font-weight: 900;
}
.answer-feedback.correct {
  color: var(--mint);
}
.answer-feedback.wrong {
  color: var(--danger);
}
.answer-explanation {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.result-card h2 {
  margin: 7px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  letter-spacing: -0.05em;
}
.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.result-metrics div {
  display: grid;
  gap: 2px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-alt);
}
.result-metrics b {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.result-metrics span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}
.saved-note {
  margin: 21px 0;
  color: var(--ink-soft);
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.live-progress-bar {
  height: 8px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--surface-alt);
}

.live-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transition: width 0.25s ease;
}

.room-join-card {
  max-width: 560px;
  margin: clamp(24px, 8vw, 72px) auto;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a:hover {
  color: var(--brand);
}

.auth-page {
  display: grid;
  min-height: 100svh;
  background: var(--paper);
}
.auth-aside {
  display: none;
  padding: 50px;
  background: #29236e;
  color: #fff;
}
.auth-aside h1 {
  margin: 16px 0;
  font-family: var(--font-display);
  font-size: 3.6rem;
  letter-spacing: -0.06em;
  line-height: 0.95;
}
.auth-aside p {
  max-width: 400px;
  color: #d7d5ff;
}
.auth-main {
  display: grid;
  align-content: center;
  width: min(100% - 32px, 450px);
  margin: auto;
  padding: 35px 0;
}
.auth-brand {
  margin-bottom: 48px;
}
.form-surface {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-alt);
}
.tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 800;
}
.tabs button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.form-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}
.form-copy {
  margin: 5px 0 5px;
  color: var(--ink-soft);
  font-size: 0.93rem;
}
label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
}
.field-help {
  display: block;
  margin-top: -7px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}
.optional-label {
  font-weight: 600;
}
.room-password-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-alt);
  color: var(--ink);
  cursor: pointer;
}
.room-password-toggle input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  transition:
    border 0.18s,
    box-shadow 0.18s;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.form-message {
  min-height: 20px;
  margin: 3px 0;
  font-size: 0.86rem;
}
.form-message.error {
  color: var(--danger);
}
.form-message.success {
  color: var(--mint);
}
.form-message.info {
  color: var(--info);
}

.app-root {
  min-height: 100svh;
  background: var(--paper);
}
.app-sidebar {
  display: none;
}
.app-main {
  padding-bottom: 88px;
}
.app-content {
  width: min(100% - 28px, 1320px);
  margin: auto;
  padding: 22px 0 34px;
}
.mobile-app-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.mobile-app-header .brand {
  font-size: 1.12rem;
}
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  letter-spacing: -0.06em;
}
.page-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dashboard-grid {
  display: grid;
  gap: 14px;
}
.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.metric-card {
  min-height: 132px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.app-content > .page-head {
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 20px;
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--brand) 14%, transparent),
      transparent 55%
    ),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.app-content > .page-head h1 {
  font-size: clamp(2rem, 8vw, 3rem);
}
.metric-card {
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--brand-soft);
  content: '';
}
.metric-card strong,
.metric-card small,
.metric-card span {
  position: relative;
  z-index: 1;
}
.metric-card small {
  color: var(--ink-soft);
  font-weight: 800;
}
.metric-card strong {
  display: block;
  margin: 9px 0 5px;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.05em;
}
.metric-card span {
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
}
.surface-card {
  padding: 20px;
}
.surface-card h2,
.surface-card h3 {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}
.surface-card h2 {
  margin-bottom: 6px;
  font-size: 1.3rem;
}
.section-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
}
.list-stack {
  display: grid;
  gap: 10px;
}
.list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child {
  border-bottom: 0;
}
.list-icon {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}
.list-item b {
  display: block;
}
.list-item small {
  color: var(--ink-soft);
}
.list-item .item-action {
  margin-left: auto;
}
.progress-line {
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface-alt);
}
.progress-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}
.app-bottom-nav {
  position: fixed;
  z-index: 40;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: 0 14px 36px #1c20512b;
  backdrop-filter: blur(15px);
}
.app-bottom-nav a {
  display: grid;
  min-height: 54px;
  place-items: center;
  gap: 2px;
  border-radius: 14px;
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 800;
}
.app-bottom-nav a span {
  font-size: 1.1rem;
}
.app-bottom-nav a.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}
.desktop-top {
  display: none;
}
.search-input {
  position: relative;
}
.search-input input {
  padding-left: 38px;
}
.search-input::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  color: var(--ink-soft);
  content: '⌕';
  font-size: 1.2rem;
  transform: translateY(-55%);
}
.filter-row {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
}
.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}
.filter-chip.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.records {
  display: grid;
  gap: 11px;
}
.record-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.record-card header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.record-card h3 {
  margin: 0;
  font-size: 1rem;
}
.record-card p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
}
.badge.success {
  background: var(--mint-soft);
  color: var(--mint);
}
.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.platform-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.game-list {
  display: grid;
  gap: 11px;
}
.game-item {
  padding: 16px;
}
.game-item h3 {
  margin: 0;
  font-family: var(--font-display);
}
.game-meta {
  margin: 5px 0 13px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.data-table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.data-table th {
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.data-table td {
  font-size: 0.88rem;
}
.mobile-only {
  display: block;
}
.desktop-only {
  display: none;
}
.composer {
  display: grid;
  gap: 16px;
}
.two-cols {
  display: grid;
  gap: 14px;
}
.question-editor {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
}
.question-editor h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}
.option-grid {
  display: grid;
  gap: 9px;
}
.empty {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--ink-soft);
  text-align: center;
}

.legal-page {
  width: min(100% - 32px, 860px);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) 0;
}

.legal-page h1 {
  max-width: 680px;
  margin: 8px 0 12px;
  font-family: Outfit, sans-serif;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.legal-page .lead {
  max-width: 660px;
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.legal-copy {
  display: grid;
  gap: 8px;
  padding: clamp(22px, 5vw, 44px);
}

.legal-copy h2 {
  margin: 20px 0 2px;
  font-size: 1.1rem;
}

.legal-copy h2:first-child {
  margin-top: 0;
}

.legal-copy p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.legal-copy a,
.public-footer a {
  color: var(--brand);
  font-weight: 700;
}

.public-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 28px 0 44px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.skeleton {
  min-height: 100px;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    var(--surface-alt) 25%,
    var(--surface) 40%,
    var(--surface-alt) 60%
  );
  background-size: 300% 100%;
  animation: skeleton 1.1s infinite linear;
}
@keyframes skeleton {
  to {
    background-position: -300% 0;
  }
}
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 10px;
  background: #11132175;
}
.modal {
  width: min(100%, 540px);
  max-height: min(86svh, 760px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px 24px 16px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.modal h2 {
  font-family: var(--font-display);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.toast-region {
  position: fixed;
  z-index: 200;
  right: 14px;
  bottom: 84px;
  left: 14px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
}

@media (min-width: 680px) {
  .public-header .public-nav {
    display: flex;
  }
  .catalog-hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .arcade-grid {
    grid-auto-columns: minmax(220px, 30%);
  }
  .catalog-tools {
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: center;
  }
  .game-settings {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }
  .result-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .landing-hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    padding: 80px 0 72px;
  }
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .role-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .auth-page {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .auth-aside {
    display: block;
  }
  .auth-main {
    width: min(100% - 64px, 450px);
  }
  .two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-backdrop {
    place-items: center;
  }
  .modal {
    border-radius: 22px;
  }
  .toast-region {
    right: 18px;
    bottom: 18px;
    left: auto;
    width: 360px;
  }
}
@media (max-width: 679px) {
  .public-wrap {
    width: min(100% - 24px, 1180px);
  }
  .topbar-inner {
    min-height: 66px;
    gap: 8px;
  }
  .topbar-actions {
    gap: 7px;
  }
  .topbar-actions .button.secondary {
    display: none;
  }
  .topbar-actions .button.small {
    min-width: 72px;
    padding-right: 10px;
    padding-left: 10px;
  }
  .landing-hero {
    padding-top: 32px;
  }
  .hero-cta .button {
    flex: 1 1 100%;
  }
  .hero-cta .button.ghost {
    flex-basis: auto;
  }
  .site-footer {
    padding-bottom: 102px;
  }
}
@media (min-width: 860px) {
  .public-nav {
    display: flex;
  }
  .game-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .app-root {
    display: grid;
    grid-template-columns: 255px minmax(0, 1fr);
  }
  .app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100svh;
    flex-direction: column;
    padding: 24px 16px;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }
  .app-sidebar .brand {
    margin: 0 10px 31px;
  }
  .sidebar-section {
    margin: 14px 10px 7px;
    color: var(--ink-soft);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 700;
  }
  .sidebar-link:hover {
    background: var(--surface-alt);
    color: var(--ink);
  }
  .sidebar-link.is-active {
    background: var(--brand-soft);
    color: var(--brand);
  }
  .sidebar-foot {
    margin-top: auto;
  }
  .app-main {
    padding-bottom: 0;
  }
  .app-content {
    padding: 30px 0 55px;
  }
  .mobile-app-header {
    display: none;
  }
  .desktop-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
  }
  .desktop-top .search-input {
    width: min(420px, 45%);
  }
  .app-bottom-nav {
    display: none;
  }
  .dashboard-grid.two {
    grid-template-columns: minmax(0, 1.5fr) minmax(270px, 0.8fr);
  }
  .dashboard-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mobile-only {
    display: none;
  }
  .desktop-only {
    display: block;
  }
}

/* Cenários PlayGroupe — cada paleta muda toda a interface sem duplicar layout. */
:root,
[data-palette='city'] {
  --ink: #f8f7ff;
  --ink-soft: #c7c2df;
  --paper: #111321;
  --surface: #1b1e32;
  --surface-alt: #272b46;
  --line: #3a3f60;
  --brand: #ff718f;
  --brand-dark: #d95573;
  --brand-soft: #3a2846;
  --mint: #4ce3cf;
  --mint-soft: #173d42;
  --amber: #ffd26e;
  --amber-soft: #493c21;
  --danger: #ff8198;
  --danger-soft: #4b2635;
  --info: #78b8ff;
  --info-soft: #1d375a;
  --shadow-sm: 0 4px 0 #06081252, 0 14px 28px #02030d31;
  --shadow-md: 0 20px 55px #02030d55;
}
[data-palette='desert'] {
  --ink: #3d2a24;
  --ink-soft: #7e6457;
  --paper: #fff3df;
  --surface: #fffaf1;
  --surface-alt: #f6dfb9;
  --line: #e8cda1;
  --brand: #c96f45;
  --brand-dark: #9f4d31;
  --brand-soft: #f8d9bb;
  --mint: #70805c;
  --mint-soft: #e1e7cf;
  --amber: #b87509;
  --amber-soft: #ffebb9;
  --danger: #b95457;
  --danger-soft: #f8dada;
  --info: #6b7089;
  --info-soft: #e1e2ea;
  --shadow-sm: 0 4px 0 #a36b3b1b, 0 13px 29px #75442617;
  --shadow-md: 0 23px 54px #7544262b;
}
[data-palette='amazon'] {
  --ink: #18372c;
  --ink-soft: #587365;
  --paper: #eef6df;
  --surface: #fbfff5;
  --surface-alt: #dcecc3;
  --line: #c5dca8;
  --brand: #3f7c51;
  --brand-dark: #2b5b3b;
  --brand-soft: #d9eec9;
  --mint: #16866f;
  --mint-soft: #d4f0df;
  --amber: #97751a;
  --amber-soft: #f9eab7;
  --danger: #b35857;
  --danger-soft: #f5dddd;
  --info: #36728a;
  --info-soft: #d9edf3;
  --shadow-sm: 0 4px 0 #355e3315, 0 13px 29px #1b47231a;
  --shadow-md: 0 23px 54px #1b47232b;
}
body.platform-body {
  background: var(--paper);
  color: var(--ink);
}
[data-palette='city'] body.platform-body {
  background:
    radial-gradient(circle at 0 0, #2d2a5b 0, transparent 31rem),
    radial-gradient(circle at 100% 8%, #3a2442 0, transparent 29rem), var(--paper);
}
[data-palette='desert'] body.platform-body {
  background:
    radial-gradient(circle at 0 0, #ffdca5 0, transparent 31rem),
    radial-gradient(circle at 100% 0, #ead19f 0, transparent 29rem), var(--paper);
}
[data-palette='amazon'] body.platform-body {
  background:
    radial-gradient(circle at 0 0, #d5ebad 0, transparent 31rem),
    radial-gradient(circle at 100% 0, #cbe9d4 0, transparent 29rem), var(--paper);
}
.topbar,
.public-header {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-color: var(--line);
}
.brand-mark {
  background: var(--brand);
  box-shadow: 0 5px 0 var(--brand-dark);
}
.button {
  background: var(--brand);
  box-shadow:
    0 5px 0 var(--brand-dark),
    0 12px 20px color-mix(in srgb, var(--brand) 25%, transparent);
}
.button:hover {
  box-shadow:
    0 2px 0 var(--brand-dark),
    0 14px 25px color-mix(in srgb, var(--brand) 30%, transparent);
}
.button.secondary,
.icon-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.feature-card,
.role-card,
.surface-card,
.record-card,
.learning-game-card,
.catalog-tools,
.arcade-shelf,
.form-surface,
.modal {
  background: var(--surface);
  color: var(--ink);
}
.section.tint {
  background: color-mix(in srgb, var(--surface-alt) 66%, transparent);
}
.hero-preview {
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  box-shadow:
    0 10px 0 var(--brand-dark),
    var(--shadow-md);
}
.closing-cta {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow:
    0 11px 0 var(--brand-dark),
    var(--shadow-md);
}
.app-content > .page-head {
  background: linear-gradient(135deg, var(--surface), var(--brand-soft));
}
.app-bottom-nav {
  background: color-mix(in srgb, var(--surface) 95%, transparent);
}
.app-bottom-nav a.is-active,
.sidebar-link.is-active,
.filter-chip.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 0 var(--brand-dark);
}

.palette-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.palette-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 17px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
}
.palette-option.is-selected {
  border-color: var(--brand);
}
.palette-option b,
.palette-option small {
  display: block;
}
.palette-option small {
  margin-top: 2px;
  color: var(--ink-soft);
}
.palette-swatch {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffb992 0 33%, #ca774c 33% 65%, #78805b 65%);
}
.palette-option[data-palette='amazon'] .palette-swatch {
  background: linear-gradient(135deg, #dfeea1 0 33%, #649a49 33% 65%, #234a33 65%);
}
.palette-option[data-palette='city'] .palette-swatch {
  background: linear-gradient(135deg, #ff9e9e 0 33%, #082a47 33% 65%, #dc5c7b 65%);
}

.game-first-hero {
  padding: clamp(26px, 6vw, 68px) 0 30px;
}
.game-first-hero > div {
  padding: clamp(23px, 5vw, 54px);
  border-radius: 30px;
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  box-shadow:
    0 10px 0 var(--brand-dark),
    var(--shadow-md);
  color: #fff;
}
.game-first-hero .eyebrow {
  color: #fff;
}
.game-first-hero h1 {
  max-width: 690px;
  margin: 12px 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 6.1rem);
  letter-spacing: -0.075em;
  line-height: 0.9;
}
.game-first-hero p {
  max-width: 550px;
  margin: 0;
  color: #fffde9;
  font-size: 1.05rem;
}
.game-first-hero .hero-cta {
  margin-top: 24px;
}
.game-first-hero .button {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 5px 0 #00000024;
}
.game-first-hero .button.secondary {
  border: 1px solid #ffffff54;
  background: #ffffff18;
  color: #fff;
  box-shadow: none;
}

/* Seletor de cenário exposto na home: a mudança não fica escondida no menu. */
.home-palette-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.home-palette-picker button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #ffffff42;
  border-radius: 999px;
  background: #ffffff12;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}
.home-palette-picker button:hover,
.home-palette-picker button.is-selected {
  border-color: #fff;
  background: #fff;
  color: var(--brand-dark);
}
.home-palette-picker i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe8c5 0 34%, #c9774d 34% 68%, #78805b 68%);
}
.home-palette-picker [data-palette-choice='amazon'] i {
  background: linear-gradient(135deg, #dfeea1 0 34%, #5d9145 34% 68%, #234a33 68%);
}
.home-palette-picker [data-palette-choice='city'] i {
  background: linear-gradient(135deg, #ff9e9e 0 34%, #082a47 34% 68%, #dc5c7b 68%);
}
.game-showcase {
  display: grid;
  gap: 13px;
}
.home-game-card {
  display: grid;
  min-height: 130px;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}
.home-game-card:hover {
  transform: translateY(-3px);
}
.home-game-card .game-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 20px;
  background: var(--brand-soft);
  font-size: 1.9rem;
}
.home-game-card h2 {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}
.home-game-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.87rem;
}
.home-game-card .play-arrow {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}
.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 14px;
}
.home-section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 6vw, 2.35rem);
  letter-spacing: -0.055em;
}
.home-section-head a {
  color: var(--brand);
  font-weight: 800;
}

@media (min-width: 720px) {
  .game-showcase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   PlayGroupe Next — nova base visual mobile-first.
   A camada abaixo substitui a aparência anterior mantendo as mesmas rotas e
   componentes funcionais.                                                        */
:root {
  --ink: #241c45;
  --ink-soft: #6e668c;
  --paper: #f6f5ff;
  --surface: #ffffff;
  --surface-alt: #f0effa;
  --line: #e1ddf1;
  --brand: #6c4dff;
  --brand-dark: #4e34d4;
  --brand-soft: #eeebff;
  --mint: #02a98f;
  --mint-soft: #dcfaf2;
  --amber: #db8500;
  --amber-soft: #fff3cf;
  --danger: #df4265;
  --danger-soft: #ffebf0;
  --info: #177ad2;
  --info-soft: #e6f4ff;
  --radius-xs: 12px;
  --radius-sm: 19px;
  --radius-md: 26px;
  --radius-lg: 34px;
  --shadow-sm: 0 3px 0 #241c4510, 0 10px 25px #3f2a7b0d;
  --shadow-md: 0 20px 52px #3f2a7b1c;
  --font-body: 'DM Sans', Arial, sans-serif;
  --font-display: Outfit, 'DM Sans', Arial, sans-serif;
}

[data-theme='dark'] {
  --ink: #f7f5ff;
  --ink-soft: #bdb5d7;
  --paper: #151128;
  --surface: #201a39;
  --surface-alt: #2a2349;
  --line: #3a315c;
  --brand: #9c8bff;
  --brand-dark: #7a65ef;
  --brand-soft: #30275a;
  --mint: #35d8bd;
  --mint-soft: #173f3d;
  --amber: #ffd065;
  --amber-soft: #493b1d;
  --danger: #ff7d98;
  --danger-soft: #4b2937;
  --info: #6db8ff;
  --info-soft: #203d61;
}

body.platform-body {
  background:
    radial-gradient(circle at 4% -7%, #d8d2ff 0, transparent 25rem),
    radial-gradient(circle at 96% 5%, #c8f9ed 0, transparent 26rem), var(--paper);
}
[data-theme='dark'] body.platform-body,
body.platform-body[data-theme='dark'] {
  background: radial-gradient(circle at 4% -7%, #332761 0, transparent 25rem), var(--paper);
}

.topbar {
  border-bottom: 0;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  box-shadow: 0 1px 0 var(--line);
}
.topbar-inner,
.public-header {
  min-height: 76px;
}
.brand {
  font-size: 1.34rem;
  letter-spacing: -0.055em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7d64ff, #5c42ee);
  box-shadow: 0 7px 0 #4330bb32;
}
.public-nav {
  font-size: 0.95rem;
}
.public-nav a {
  padding: 9px 2px;
}
.public-nav a[aria-current='page'] {
  color: var(--brand);
}
.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 15px;
  background: var(--surface-alt);
}

.button {
  min-height: 50px;
  padding: 12px 19px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--brand), #8066ff);
  box-shadow:
    0 5px 0 var(--brand-dark),
    0 12px 22px #6c4dff2e;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.button:hover {
  box-shadow:
    0 3px 0 var(--brand-dark),
    0 16px 27px #6c4dff37;
  transform: translateY(2px);
}
.button:active {
  box-shadow: 0 1px 0 var(--brand-dark);
  transform: translateY(4px);
}
.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 4px 0 var(--line);
}
.button.secondary:hover {
  border-color: #c6beeb;
  box-shadow: 0 2px 0 var(--line);
}
.button.ghost {
  background: transparent;
  box-shadow: none;
}
.button.small {
  min-height: 39px;
  border-radius: 13px;
  box-shadow: 0 3px 0 var(--brand-dark);
}
.button.small.secondary {
  box-shadow: 0 3px 0 var(--line);
}

.landing-hero {
  padding: 48px 0 50px;
  gap: 27px;
}
.landing-hero h1 {
  max-width: 760px;
  font-size: clamp(3rem, 12vw, 6rem);
  letter-spacing: -0.072em;
  line-height: 0.91;
}
.landing-hero h1 em {
  color: var(--brand);
}
.hero-description {
  max-width: 590px;
  font-size: 1.1rem;
  line-height: 1.65;
}
.hero-preview {
  min-height: 325px;
  border: 0;
  border-radius: 30px;
  background: linear-gradient(145deg, #7659ff, #4d36d4 56%, #342695);
  box-shadow:
    0 10px 0 #4933b7,
    0 25px 42px #4d36d441;
}
.preview-card {
  right: 15px;
  bottom: 15px;
  left: 15px;
  border: 0;
  border-radius: 22px;
  box-shadow:
    0 10px 0 #19133d20,
    0 20px 35px #15105035;
}
.preview-status {
  background: #ffffff2e;
}
.feature-card,
.role-card,
.surface-card,
.platform-card,
.record-card,
.learning-game-card,
.catalog-tools,
.arcade-shelf,
.room-join-card,
.form-surface {
  border-color: var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}
.feature-card,
.role-card {
  border: 0;
  background: var(--surface);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
}
.role-card {
  padding: 23px;
}
.role-card .role-number {
  color: var(--brand);
}
.section {
  padding: 58px 0;
}
.section.tint {
  background: #eeecfb99;
}
.section-title h2,
.closing-cta h2 {
  font-size: clamp(2.1rem, 7vw, 3.45rem);
}
.closing-cta {
  border: 0;
  border-radius: 30px;
  background: linear-gradient(135deg, #5d42e7, #876cff);
  box-shadow:
    0 11px 0 #4330b4,
    0 26px 45px #5e44e93b;
}

.games-page {
  padding-top: 24px;
}
.catalog-hero {
  padding: 34px 0 26px;
}
.catalog-hero h1 {
  font-size: clamp(2.6rem, 10vw, 5.3rem);
}
.catalog-tools {
  gap: 11px;
  padding: 12px;
  border: 0;
  background: var(--surface);
}
.search-input input,
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
}
input,
select,
textarea {
  min-height: 48px;
  padding: 11px 13px;
}
textarea {
  min-height: 116px;
}
.search-input input {
  min-height: 52px;
  border: 0;
  background: var(--surface-alt);
}
.filter-chip {
  min-height: 40px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-alt);
}
.filter-chip.is-active {
  border: 0;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 0 var(--brand-dark);
}
.arcade-shelf {
  border: 0;
  background: linear-gradient(135deg, #fff, #f2efff);
}
.arcade-card {
  border: 0;
  background: var(--surface);
  box-shadow: 0 4px 0 #ded9f4;
}
.arcade-card:hover {
  border: 0;
}
.learning-game-card {
  position: relative;
  min-height: 230px;
  border: 0;
  overflow: hidden;
  background: var(--surface);
}
.learning-game-card::after {
  position: absolute;
  top: -32px;
  right: -32px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--brand-soft);
  content: '';
}
.learning-game-card > * {
  position: relative;
  z-index: 1;
}
.game-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}

.game-page {
  padding-top: 26px;
}
.game-intro,
.game-stage {
  border: 0;
  border-radius: 25px;
  box-shadow: var(--shadow-sm);
}
.game-title-row h1 {
  font-size: clamp(2.1rem, 9vw, 3.5rem);
}
.game-hint {
  border: 0;
  border-radius: 18px;
  background: var(--mint-soft);
}
.play-card,
.result-card {
  border: 0;
  border-radius: 27px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.play-card > header {
  padding: 4px 2px 14px;
  color: var(--ink-soft);
}
.timer {
  padding: 7px 11px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
}
.play-progress {
  height: 10px;
  background: var(--surface-alt);
}
.play-progress i {
  background: linear-gradient(90deg, var(--mint), #36d8c3);
}
.play-card h2 {
  font-size: clamp(1.55rem, 6vw, 2.4rem);
  line-height: 1.1;
}
.play-options {
  gap: 11px;
}
.play-options button {
  min-height: 66px;
  border: 0;
  border-radius: 18px;
  background: var(--surface-alt);
  box-shadow: 0 4px 0 #dad5ee;
  font-weight: 800;
}
.play-options button:hover {
  background: var(--brand-soft);
  transform: translateY(-2px);
}
.play-options button span {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--brand);
}
.play-options button.is-correct {
  background: var(--mint-soft);
  box-shadow: 0 4px 0 #71d8c3;
}
.play-options button.is-wrong {
  background: var(--danger-soft);
  box-shadow: 0 4px 0 #f0a6b7;
}
.result-metrics div {
  border: 0;
  border-radius: 18px;
  background: var(--surface-alt);
}

.app-root {
  background: transparent;
}
.app-content {
  width: min(100% - 24px, 1370px);
  padding: 16px 0 38px;
}
.mobile-app-header {
  min-height: 62px;
  margin-bottom: 14px;
}
.app-content > .page-head {
  margin-bottom: 15px;
  padding: 22px;
  border: 0;
  border-radius: 25px;
  background: linear-gradient(135deg, #fff, #ece8ff);
  box-shadow:
    0 5px 0 #ded9f4,
    var(--shadow-sm);
}
.app-content > .page-head h1 {
  font-size: clamp(2.15rem, 9vw, 3.5rem);
}
.dashboard-grid {
  gap: 16px;
}
.metric-card {
  min-height: 142px;
  border: 0;
  border-radius: 21px;
  box-shadow:
    0 5px 0 #ded9f4,
    var(--shadow-sm);
}
.metric-card:nth-child(4n + 2)::after {
  background: var(--mint-soft);
}
.metric-card:nth-child(4n + 3)::after {
  background: var(--amber-soft);
}
.metric-card:nth-child(4n + 4)::after {
  background: var(--danger-soft);
}
.metric-card strong {
  font-size: 2.2rem;
}
.surface-card {
  border: 0;
  background: var(--surface);
  box-shadow:
    0 5px 0 #ded9f4,
    var(--shadow-sm);
}
.record-card {
  border: 0;
  background: var(--surface-alt);
  box-shadow: none;
}
.record-card:hover {
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface));
}
.badge {
  min-height: 27px;
  border-radius: 11px;
  background: #e9e6f7;
  color: #5e5680;
}
.badge.success {
  background: var(--mint-soft);
  color: #008b75;
}
.badge.warn {
  background: var(--amber-soft);
  color: #b76b00;
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.app-bottom-nav {
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 6px;
  border: 0;
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow:
    0 8px 0 #ddd8ee,
    0 18px 38px #2a205629;
}
.app-bottom-nav a {
  min-height: 56px;
  border-radius: 16px;
}
.app-bottom-nav a.is-active {
  background: var(--brand);
  color: #fff;
}
.composer {
  gap: 15px;
}
.question-editor {
  padding: 17px;
  border: 0;
  border-radius: 18px;
  background: var(--surface-alt);
}
.data-table-wrap {
  border: 0;
  border-radius: 19px;
  box-shadow: var(--shadow-sm);
}
.data-table th {
  background: var(--surface-alt);
}
.modal {
  border: 0;
  border-radius: 25px;
  box-shadow: 0 24px 70px #1e173b42;
}
.toast {
  border: 0;
  border-radius: 16px;
  box-shadow:
    0 8px 0 #241c4512,
    var(--shadow-md);
}
.site-footer {
  padding-top: 42px;
  background: var(--surface);
}

@media (min-width: 680px) {
  .app-content {
    width: min(100% - 48px, 1370px);
    padding-top: 28px;
  }
  .arcade-grid {
    grid-auto-columns: minmax(230px, 29%);
  }
  .play-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 860px) {
  .app-root {
    grid-template-columns: 270px minmax(0, 1fr);
  }
  .app-sidebar {
    padding: 26px 17px;
    border: 0;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: 5px 0 35px #33255d0d;
  }
  .app-sidebar .brand {
    margin: 0 10px 35px;
  }
  .sidebar-link {
    min-height: 46px;
    border-radius: 15px;
  }
  .sidebar-link.is-active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 0 var(--brand-dark);
  }
  .app-content {
    padding-top: 34px;
  }
}

/*
 * Paletas finais: este bloco precisa permanecer no fim do arquivo porque a
 * camada visual da plataforma declara variáveis-base mais acima. Sem isso,
 * :root voltava a substituir a escolha feita na home.
 */
html[data-palette='city'] {
  --ink: #f8f7ff;
  --ink-soft: #c7c2df;
  --paper: #111321;
  --surface: #1b1e32;
  --surface-alt: #272b46;
  --line: #3a3f60;
  --brand: #ff718f;
  --brand-dark: #d95573;
  --brand-soft: #3a2846;
  --mint: #4ce3cf;
  --mint-soft: #173d42;
  --amber: #ffd26e;
  --amber-soft: #493c21;
  --danger: #ff8198;
  --danger-soft: #4b2635;
  --info: #78b8ff;
  --info-soft: #1d375a;
  --shadow-sm: 0 4px 0 #06081252, 0 14px 28px #02030d31;
  --shadow-md: 0 20px 55px #02030d55;
}
html[data-palette='desert'] {
  --ink: #3d2a24;
  --ink-soft: #7e6457;
  --paper: #fff3df;
  --surface: #fffaf1;
  --surface-alt: #f6dfb9;
  --line: #e8cda1;
  --brand: #c96f45;
  --brand-dark: #9f4d31;
  --brand-soft: #f8d9bb;
  --mint: #70805c;
  --mint-soft: #e1e7cf;
  --amber: #b87509;
  --amber-soft: #ffebb9;
  --danger: #b95457;
  --danger-soft: #f8dada;
  --info: #6b7089;
  --info-soft: #e1e2ea;
  --shadow-sm: 0 4px 0 #a36b3b1b, 0 13px 29px #75442617;
  --shadow-md: 0 23px 54px #7544262b;
}
html[data-palette='amazon'] {
  --ink: #18372c;
  --ink-soft: #587365;
  --paper: #eef6df;
  --surface: #fbfff5;
  --surface-alt: #dcecc3;
  --line: #c5dca8;
  --brand: #3f7c51;
  --brand-dark: #2b5b3b;
  --brand-soft: #d9eec9;
  --mint: #16866f;
  --mint-soft: #d4f0df;
  --amber: #97751a;
  --amber-soft: #f9eab7;
  --danger: #b35857;
  --danger-soft: #f5dddd;
  --info: #36728a;
  --info-soft: #d9edf3;
  --shadow-sm: 0 4px 0 #355e3315, 0 13px 29px #1b47231a;
  --shadow-md: 0 23px 54px #1b47232b;
}

html[data-palette='city'] .game-first-hero > div {
  background: linear-gradient(135deg, #082a47, #493255 55%, #dc5c7b);
}
html[data-palette='desert'] .game-first-hero > div {
  background: linear-gradient(135deg, #7d4836, #c9774d 54%, #e6bd78);
}
html[data-palette='amazon'] .game-first-hero > div {
  background: linear-gradient(135deg, #173b31, #326b42 52%, #74a653);
}

/* Convite da turma: código grande e QR Code para compartilhar como em um jogo ao vivo. */
.class-code-field {
  display: grid;
  gap: 7px;
  align-content: start;
}
.class-code-field label {
  margin: 0;
}
.class-code-field input[readonly] {
  background: var(--surface-alt);
  color: var(--brand-dark);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.class-code-field small {
  color: var(--ink-soft);
  line-height: 1.35;
}

/* Criação de turma: o código e a senha têm alturas próprias. Sem este
 * alinhamento, o campo de senha esticava até a altura do bloco do código. */
#class-form .two-cols {
  align-items: start;
}
#class-form .class-code-field {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 8px;
}
#class-form .class-code-field label {
  grid-column: 1;
}
#class-form .class-code-field [data-regenerate-class-code] {
  grid-column: 2;
  grid-row: 1;
  min-height: 46px;
  padding-inline: 13px;
  white-space: nowrap;
}
#class-form .class-code-field small {
  grid-column: 1 / -1;
}
#class-form .class-password-field {
  align-self: start;
}
#class-form .class-password-field input {
  height: 46px;
  min-height: 46px;
}

@media (max-width: 520px) {
  #class-form .class-code-field {
    grid-template-columns: 1fr;
  }
  #class-form .class-code-field [data-regenerate-class-code] {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
}

/* Control Center: densidade de informação profissional, sem sacrificar o toque no celular. */
.admin-body .app-content {
  width: min(100%, 1440px);
}
.admin-body .app-sidebar {
  border-right-color: var(--line);
  background: var(--surface);
}
.admin-body .sidebar-section {
  color: var(--brand);
  letter-spacing: 0.12em;
}
.admin-body .sidebar-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand);
}
.admin-topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  margin: -1px -1px 16px;
  padding: 14px 1px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}
.admin-hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.admin-hero::after {
  position: absolute;
  right: -64px;
  bottom: -74px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: var(--brand-soft);
  content: '';
  pointer-events: none;
}
.admin-hero > * {
  position: relative;
  z-index: 1;
}
.admin-hero h1 {
  max-width: 700px;
  color: var(--ink);
}
.admin-hero-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 16px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 750;
}
.admin-hero-status span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--mint);
}
.admin-hero-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px var(--mint-soft);
}
.admin-metric-grid .metric-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.admin-metric-grid .metric-card::before {
  display: block;
  width: 36px;
  height: 4px;
  margin-bottom: 13px;
  border-radius: 99px;
  background: var(--brand);
  content: '';
}
.admin-metric-grid .metric-card:nth-child(2)::before {
  background: var(--mint);
}
.admin-metric-grid .metric-card:nth-child(3)::before {
  background: var(--info);
}
.admin-metric-grid .metric-card:nth-child(4)::before {
  background: var(--danger);
}
.admin-body .surface-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.admin-body .record-card {
  border-color: var(--line);
  background: var(--surface-alt);
}
.admin-body .record-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 20px #17243b12;
}
.admin-body .section-head {
  gap: 14px;
}
.admin-body .filter-row {
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  width: fit-content;
}
.admin-body .filter-chip {
  min-height: 38px;
}
@media (max-width: 760px) {
  .admin-topbar {
    display: none;
  }
  .admin-hero {
    padding: 22px 18px;
    border-radius: 20px;
  }
  .admin-hero .page-actions {
    width: 100%;
  }
  .admin-hero .page-actions > * {
    flex: 1 1 0;
  }
  .admin-body .filter-row {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}
.class-qr-invite {
  display: grid;
  justify-items: center;
  gap: 13px;
  text-align: center;
}
.class-qr-invite > p,
.class-qr-invite > small {
  margin: 0;
  color: var(--ink-soft);
}
.class-qr-image {
  display: grid;
  width: min(100%, 230px);
  min-height: 160px;
  place-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
}
.class-qr-image svg {
  display: block;
  width: 100%;
  height: auto;
}
.class-join-code {
  padding: 8px 15px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 8vw, 1.85rem);
  letter-spacing: 0.12em;
}

/* Entrada do professor e painel guiado para criar e aplicar provas. */
.teacher-home-entry {
  display: grid;
  gap: 22px;
  margin: 28px 0 12px;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, var(--surface), var(--brand-soft));
  box-shadow: var(--shadow-sm);
}
.teacher-home-entry h2 {
  max-width: 650px;
  margin: 8px 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 3.3rem);
  letter-spacing: -0.06em;
  line-height: 1;
}
.teacher-home-entry p {
  max-width: 650px;
  margin: 0;
  color: var(--ink-soft);
}
.teacher-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.role-chooser {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.role-chooser legend {
  font-size: 0.86rem;
  font-weight: 800;
}
.role-chooser > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.role-chooser button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 800;
}
.role-chooser button.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.role-chooser small {
  color: var(--ink-soft);
}
.teacher-command-center {
  display: grid;
  gap: 18px;
  margin: 16px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.teacher-command-center h2 {
  margin: 5px 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  letter-spacing: -0.05em;
}
.teacher-command-center p {
  margin: 0;
  color: var(--ink-soft);
}
.teacher-journey {
  display: grid;
  gap: 10px;
}
.teacher-journey button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
}
.teacher-journey button:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.teacher-journey b {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
}
.teacher-journey span {
  display: grid;
  gap: 1px;
}
.teacher-journey small {
  color: var(--ink-soft);
}
.teacher-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.teacher-overview article {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.teacher-overview small,
.teacher-overview span {
  color: var(--ink-soft);
  font-size: 0.76rem;
}
.teacher-overview strong {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 7vw, 2.2rem);
}
.teacher-live-guide .list-stack {
  margin-top: 15px;
}
@media (min-width: 760px) {
  .teacher-home-entry {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
  .teacher-command-center {
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
    align-items: center;
  }
  .teacher-journey {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .teacher-journey button {
    height: 100%;
    align-items: flex-start;
  }
}

/*
 * Camada de acabamento das paletas.
 *
 * Alguns componentes antigos possuíam cores fixas. Estas regras finais usam
 * somente os tokens de cada cenário, para que Cidade, Deserto e Amazônia
 * cheguem da mesma forma à home, login, aluno, professor, salas e Admin.
 */
html[data-palette] body.platform-body {
  color: var(--ink);
}
html[data-palette='city'] body.platform-body {
  background:
    radial-gradient(circle at 4% -7%, #29355d 0, transparent 25rem),
    radial-gradient(circle at 96% 5%, #3a2846 0, transparent 26rem), var(--paper);
}
html[data-palette='desert'] body.platform-body {
  background:
    radial-gradient(circle at 4% -7%, #ffe2ac 0, transparent 25rem),
    radial-gradient(circle at 96% 5%, #f1c59a 0, transparent 26rem), var(--paper);
}
html[data-palette='amazon'] body.platform-body {
  background:
    radial-gradient(circle at 4% -7%, #cfe8ac 0, transparent 25rem),
    radial-gradient(circle at 96% 5%, #b8dfbd 0, transparent 26rem), var(--paper);
}

html[data-palette] .brand-mark,
html[data-palette] .button:not(.secondary):not(.ghost):not(.danger),
html[data-palette] .filter-chip.is-active,
html[data-palette] .app-bottom-nav a.is-active,
html[data-palette] .sidebar-link.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow:
    0 5px 0 var(--brand-dark),
    0 12px 22px color-mix(in srgb, var(--brand) 28%, transparent);
}
html[data-palette] .button:hover {
  box-shadow:
    0 3px 0 var(--brand-dark),
    0 16px 27px color-mix(in srgb, var(--brand) 34%, transparent);
}
html[data-palette] .button.secondary,
html[data-palette] .icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--line);
}
html[data-palette] .button.secondary:hover {
  border-color: var(--brand);
}

html[data-palette] .auth-aside,
html[data-palette] .hero-preview,
html[data-palette] .closing-cta {
  background: linear-gradient(145deg, var(--brand), var(--brand-dark) 63%, var(--ink));
  box-shadow:
    0 10px 0 var(--brand-dark),
    0 25px 42px color-mix(in srgb, var(--brand) 30%, transparent);
}
html[data-palette] .auth-aside p {
  color: color-mix(in srgb, #fff 82%, var(--brand-soft));
}
html[data-palette] .preview-status,
html[data-palette] .home-palette-picker button {
  background: color-mix(in srgb, var(--surface) 20%, transparent);
}

html[data-palette] .section.tint,
html[data-palette] .arcade-shelf,
html[data-palette] .app-content > .page-head,
html[data-palette] .teacher-home-entry {
  background: linear-gradient(135deg, var(--surface), var(--brand-soft));
}
html[data-palette] .app-content > .page-head,
html[data-palette] .metric-card,
html[data-palette] .surface-card,
html[data-palette] .app-bottom-nav {
  box-shadow:
    0 5px 0 var(--line),
    var(--shadow-sm);
}
html[data-palette] .app-sidebar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 5px 0 35px color-mix(in srgb, var(--ink) 8%, transparent);
}

html[data-palette] .feature-card,
html[data-palette] .role-card,
html[data-palette] .surface-card,
html[data-palette] .platform-card,
html[data-palette] .learning-game-card,
html[data-palette] .catalog-tools,
html[data-palette] .room-join-card,
html[data-palette] .form-surface,
html[data-palette] .game-intro,
html[data-palette] .game-stage,
html[data-palette] .play-card,
html[data-palette] .result-card,
html[data-palette] .modal,
html[data-palette] .toast,
html[data-palette] .teacher-overview article {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
html[data-palette] .record-card,
html[data-palette] .question-editor,
html[data-palette] .data-table th,
html[data-palette] .search-input input,
html[data-palette] .filter-chip,
html[data-palette] .play-options button,
html[data-palette] .result-metrics div,
html[data-palette] .tabs,
html[data-palette] .class-code-field input[readonly] {
  background: var(--surface-alt);
  color: var(--ink);
  box-shadow: none;
}
html[data-palette] .arcade-card {
  background: var(--surface);
  box-shadow: 0 4px 0 var(--line);
}
html[data-palette] .play-options button {
  box-shadow: 0 4px 0 var(--line);
}
html[data-palette] .play-options button span {
  background: var(--surface);
  color: var(--brand);
}
html[data-palette] .play-options button.is-correct {
  background: var(--mint-soft);
  box-shadow: 0 4px 0 var(--mint);
}
html[data-palette] .play-options button.is-wrong {
  background: var(--danger-soft);
  box-shadow: 0 4px 0 var(--danger);
}

html[data-palette] input,
html[data-palette] select,
html[data-palette] textarea {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
html[data-palette] input::placeholder,
html[data-palette] textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.78;
}
html[data-palette] input:focus,
html[data-palette] select:focus,
html[data-palette] textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
html[data-palette] .avatar,
html[data-palette] .feature-icon {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
html[data-palette] .badge {
  background: var(--surface-alt);
  color: var(--ink-soft);
}
html[data-palette] .badge.success {
  background: var(--mint-soft);
  color: var(--mint);
}
html[data-palette] .badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}
html[data-palette] .class-qr-image {
  border-color: var(--line);
  background: #fff;
}
html[data-palette] .modal-backdrop {
  background: color-mix(in srgb, var(--ink) 58%, transparent);
}
html[data-palette] .skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-alt) 25%,
    var(--surface) 40%,
    var(--surface-alt) 60%
  );
}

.auth-session-actions {
  margin-top: 12px;
}

/*
 * Sistema visual unificado
 *
 * Camada final para todas as páginas da plataforma. Ela substitui valores
 * legados fixos por tokens de cenário, mantendo Cidade, Deserto e Amazônia
 * coerentes entre home, jogos, professor, aluno e administração.
 */
html[data-palette] body.platform-body {
  font-size: 16px;
  line-height: 1.55;
}

html[data-palette] .platform-body h1,
html[data-palette] .platform-body h2,
html[data-palette] .platform-body h3 {
  color: var(--ink);
  font-family: var(--font-display);
  text-wrap: balance;
}

html[data-palette] .platform-body h1 {
  line-height: 1.02;
  letter-spacing: -0.052em;
}

html[data-palette] .platform-body h2 {
  line-height: 1.13;
  letter-spacing: -0.035em;
}

html[data-palette] .platform-body h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
}

html[data-palette] .page-head > div > p:not(.eyebrow),
html[data-palette] .hero-description,
html[data-palette] .teacher-home-entry p,
html[data-palette] .game-intro > p,
html[data-palette] .form-surface > p,
html[data-palette] .muted,
html[data-palette] .record-card p,
html[data-palette] .home-game-card p,
html[data-palette] .feature-card p,
html[data-palette] .role-card p {
  color: var(--ink-soft);
  line-height: 1.55;
}

html[data-palette] .app-content > .page-head {
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--brand) 15%, transparent),
      transparent 48%
    ),
    linear-gradient(135deg, var(--surface), var(--brand-soft));
}

html[data-palette] .surface-card,
html[data-palette] .feature-card,
html[data-palette] .role-card,
html[data-palette] .platform-card,
html[data-palette] .learning-game-card,
html[data-palette] .home-game-card,
html[data-palette] .record-card,
html[data-palette] .catalog-tools,
html[data-palette] .room-join-card,
html[data-palette] .form-surface,
html[data-palette] .game-intro,
html[data-palette] .game-stage,
html[data-palette] .play-card,
html[data-palette] .result-card,
html[data-palette] .question-editor {
  border-color: var(--line);
  color: var(--ink);
}

html[data-palette] .home-game-card:hover,
html[data-palette] .record-card:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 38%, var(--surface));
}

html[data-palette] .section-head h2,
html[data-palette] .home-section-head h2 {
  font-size: clamp(1.3rem, 4vw, 1.75rem);
}

.room-quick-form {
  align-content: start;
}

.room-quick-form > label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.room-quick-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: -2px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.room-quick-note span {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--mint);
  font-weight: 900;
}

.advanced-options {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.advanced-options summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 12px 15px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.advanced-options summary::-webkit-details-marker {
  display: none;
}

.advanced-options summary::after {
  margin-left: auto;
  color: var(--brand);
  content: '+';
  font-size: 1.3rem;
  line-height: 1;
}

.advanced-options[open] summary {
  border-bottom: 1px solid var(--line);
}

.advanced-options[open] summary::after {
  content: '–';
}

.advanced-options > p,
.advanced-options > .two-cols {
  margin: 0;
  padding: 0 15px 14px;
}

.advanced-options > p {
  padding-top: 13px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.advanced-options .two-cols {
  grid-template-columns: 1fr;
}

.advanced-options label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 750;
}

.room-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (min-width: 680px) {
  .advanced-options .two-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Home pública: contraste próprio. Estas regras ficam por último porque a
 * home tem botões sobre uma superfície escura e não pode herdar o botão de
 * formulário da plataforma. */
html[data-palette] .game-first-hero {
  padding: clamp(20px, 5vw, 54px) 0 26px;
}

html[data-palette] .game-first-hero > div {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 58px);
  border: 1px solid color-mix(in srgb, #fff 16%, transparent);
  border-radius: clamp(24px, 5vw, 34px);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ink) 24%, transparent);
}

html[data-palette] .game-first-hero > div::after {
  position: absolute;
  top: -110px;
  right: -95px;
  width: 290px;
  height: 290px;
  border: 1px solid #ffffff26;
  border-radius: 50%;
  box-shadow:
    0 0 0 48px #ffffff0a,
    0 0 0 98px #ffffff08;
  content: '';
  pointer-events: none;
}

html[data-palette='city'] .game-first-hero > div {
  background: linear-gradient(135deg, #112440 0%, #1e3864 100%);
}

html[data-palette='desert'] .game-first-hero > div {
  background: linear-gradient(135deg, #6d3b30 0%, #a75f42 100%);
}

html[data-palette='amazon'] .game-first-hero > div {
  background: linear-gradient(135deg, #184634 0%, #347451 100%);
}

html[data-palette] .game-first-hero h1,
html[data-palette] .game-first-hero .eyebrow,
html[data-palette] .game-first-hero p {
  position: relative;
  z-index: 1;
  color: #fff;
}

html[data-palette] .game-first-hero h1 {
  max-width: 11ch;
  margin: 10px 0 14px;
  font-size: clamp(2.45rem, 10vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

html[data-palette] .game-first-hero p {
  max-width: 52ch;
  color: #ffffffd9;
  font-size: clamp(0.98rem, 2.4vw, 1.08rem);
}

html[data-palette] .game-first-hero .hero-cta,
html[data-palette] .game-first-hero .home-palette-picker {
  position: relative;
  z-index: 1;
}

html[data-palette] .game-first-hero .button:not(.secondary):not(.ghost) {
  border: 1px solid #fff;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 4px 0 #0000002b;
}

html[data-palette] .game-first-hero .button:not(.secondary):not(.ghost):hover {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 2px 0 #0000002b;
}

html[data-palette='city'] .game-first-hero .button:not(.secondary):not(.ghost),
html[data-palette='city'] .game-first-hero .button:not(.secondary):not(.ghost):hover {
  color: #9f2849;
}

html[data-palette='desert'] .game-first-hero .button:not(.secondary):not(.ghost),
html[data-palette='desert'] .game-first-hero .button:not(.secondary):not(.ghost):hover {
  color: #74321f;
}

html[data-palette='amazon'] .game-first-hero .button:not(.secondary):not(.ghost),
html[data-palette='amazon'] .game-first-hero .button:not(.secondary):not(.ghost):hover {
  color: #1d533b;
}

html[data-palette] .game-first-hero .button.secondary {
  border: 1px solid #ffffff80;
  background: #ffffff16;
  color: #fff;
  box-shadow: none;
}

html[data-palette] .game-first-hero .button.secondary:hover {
  border-color: #fff;
  background: #ffffff24;
  color: #fff;
  box-shadow: none;
}

html[data-palette] .home-palette-picker > span {
  align-self: center;
  color: #ffffffd9;
  font-size: 0.88rem;
  font-weight: 750;
}

html[data-palette] .home-palette-picker button {
  border-color: #ffffff54;
  background: #ffffff14;
  color: #fff;
  box-shadow: none;
}

html[data-palette] .home-palette-picker button:hover,
html[data-palette] .home-palette-picker button.is-selected {
  border-color: #fff;
  background: #fff;
  color: var(--brand-dark);
}

.site-version {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: auto;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Preparação dos quizzes: uma composição própria, sem reaproveitar o card
 * de resultado ou deixar o botão solto abaixo dos campos. */
html[data-palette] .game-page {
  width: min(100% - 28px, 960px);
  padding: clamp(24px, 5vw, 52px) 0 72px;
}

html[data-palette] .game-intro,
html[data-palette] .game-stage {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-palette] .game-setup-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: clamp(22px, 4vw, 30px);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

html[data-palette] .game-setup-card .game-title-row {
  padding: clamp(22px, 5vw, 36px);
}

html[data-palette] .game-setup-card .game-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
}

html[data-palette] .game-setup-card .game-title-row h1 {
  max-width: 18ch;
  margin: 6px 0 8px;
  font-size: clamp(2rem, 5.6vw, 3.45rem);
  line-height: 1.03;
}

html[data-palette] .game-setup-card .game-title-row p:last-child {
  max-width: 70ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.5;
}

html[data-palette] .game-config-panel {
  display: grid;
  gap: 17px;
  padding: clamp(20px, 4vw, 28px);
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

html[data-palette] .game-config-copy {
  display: grid;
  gap: 3px;
}

html[data-palette] .game-config-copy b {
  color: var(--ink);
  font-size: 1.02rem;
}

html[data-palette] .game-config-copy span,
html[data-palette] .game-setup-actions small {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

html[data-palette] .game-config-panel .game-settings {
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

html[data-palette] .game-config-panel .game-settings label {
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.83rem;
}

html[data-palette] .game-config-panel .game-settings select {
  min-height: 50px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

html[data-palette] .game-config-panel .saved-note {
  margin: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
}

html[data-palette] .game-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

html[data-palette] .game-setup-actions .button {
  min-width: min(100%, 220px);
}

html[data-palette] .game-hint {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--mint) 30%, var(--line));
  background: var(--mint-soft);
  box-shadow: none;
}

html[data-palette] .game-hint b {
  color: var(--mint);
}

html[data-palette] .game-hint span {
  color: var(--ink-soft);
}

@media (min-width: 640px) {
  html[data-palette] .game-config-panel .game-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  html[data-palette] .game-page {
    width: min(100% - 20px, 960px);
    padding-top: 20px;
  }

  html[data-palette] .game-setup-card .game-title-row {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 22px;
  }

  html[data-palette] .game-hint {
    grid-template-columns: 1fr;
  }
}

/* Identidade única do PlayGroupe. Não há mais combinações de cenários ou
 * variações por página: esta paleta é aplicada em toda a plataforma. */
html[data-palette='unified'],
html:not([data-palette]) {
  --ink: #182338;
  --ink-soft: #5c6b82;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #edf2f8;
  --line: #d9e2ee;
  --brand: #3159d9;
  --brand-dark: #2445ae;
  --brand-soft: #e5ecff;
  --mint: #087f65;
  --mint-soft: #e1f5ef;
  --amber: #a86508;
  --amber-soft: #fff1d8;
  --danger: #c44155;
  --danger-soft: #fde9ec;
  --info: #256bb3;
  --info-soft: #e4f0fc;
  --shadow-sm: 0 1px 2px #17243b0c, 0 8px 22px #17243b0d;
  --shadow-md: 0 18px 48px #17243b16;
}

html[data-palette='unified'] body.platform-body,
html:not([data-palette]) body.platform-body {
  background: var(--paper);
}

html[data-palette='unified'] .game-first-hero > div,
html:not([data-palette]) .game-first-hero > div {
  background: linear-gradient(135deg, #10243f 0%, #1c3e70 100%);
}

html[data-palette='unified'] .game-first-hero .button:not(.secondary):not(.ghost),
html[data-palette='unified'] .game-first-hero .button:not(.secondary):not(.ghost):hover,
html:not([data-palette]) .game-first-hero .button:not(.secondary):not(.ghost),
html:not([data-palette]) .game-first-hero .button:not(.secondary):not(.ghost):hover {
  color: #2345ad;
}

html[data-palette='unified'] [data-theme-toggle],
html[data-palette='unified'] .home-palette-picker,
html:not([data-palette]) [data-theme-toggle],
html:not([data-palette]) .home-palette-picker {
  display: none !important;
}

@media (max-width: 640px) {
  .site-version {
    width: fit-content;
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  html[data-palette] .game-first-hero > div {
    padding: 26px 21px 23px;
  }

  html[data-palette] .game-first-hero .hero-cta {
    display: grid;
    grid-template-columns: 1fr;
  }

  html[data-palette] .game-first-hero .hero-cta .button {
    width: 100%;
  }

  html[data-palette] .home-palette-picker {
    align-items: center;
  }

  html[data-palette] .home-palette-picker > span {
    width: 100%;
  }
}

/*
 * Base estável da plataforma.
 *
 * O projeto tinha versões anteriores dos mesmos componentes declaradas em
 * pontos diferentes do arquivo. Esta é a única camada que define controles,
 * superfícies e texto depois de todas elas, impedindo que uma tela herde uma
 * cor ou sombra de outra página.
 */
html[data-palette] .platform-body {
  background-color: var(--paper);
  color: var(--ink);
}

html[data-palette] .topbar,
html[data-palette] .public-header,
html[data-palette] .app-sidebar,
html[data-palette] .site-footer {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--ink);
}

html[data-palette] .app-bottom-nav {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--ink) 16%, transparent);
}

html[data-palette] .button {
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 0 var(--brand-dark);
}

html[data-palette] .button:hover {
  background: var(--brand-dark);
  color: #fff;
  box-shadow: 0 2px 0 var(--brand-dark);
}

html[data-palette] .button:active {
  box-shadow: none;
}

html[data-palette] .button.secondary,
html[data-palette] .icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--line);
}

html[data-palette] .button.secondary:hover,
html[data-palette] .icon-button:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--line);
}

html[data-palette] .button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--brand);
  box-shadow: none;
}

html[data-palette] .button.ghost:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: none;
}

html[data-palette] .button.danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--danger) 70%, #000);
}

html[data-palette] .surface-card,
html[data-palette] .feature-card,
html[data-palette] .role-card,
html[data-palette] .platform-card,
html[data-palette] .learning-game-card,
html[data-palette] .catalog-tools,
html[data-palette] .room-join-card,
html[data-palette] .form-surface,
html[data-palette] .game-intro,
html[data-palette] .game-stage,
html[data-palette] .play-card,
html[data-palette] .result-card,
html[data-palette] .modal,
html[data-palette] .toast,
html[data-palette] .teacher-overview article {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

html[data-palette] .record-card,
html[data-palette] .question-editor,
html[data-palette] .data-table th,
html[data-palette] .tabs,
html[data-palette] .filter-chip,
html[data-palette] .result-metrics div,
html[data-palette] .class-code-field input[readonly] {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--ink);
}

html[data-palette] .home-game-card,
html[data-palette] .arcade-card {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

html[data-palette] .home-game-card .play-arrow,
html[data-palette] .app-bottom-nav a.is-active,
html[data-palette] .sidebar-link.is-active,
html[data-palette] .filter-chip.is-active,
html[data-palette] .tabs button.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

html[data-palette] .badge {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink-soft);
}

html[data-palette] .badge.success {
  border-color: color-mix(in srgb, var(--mint) 35%, var(--line));
  background: var(--mint-soft);
  color: var(--mint);
}

html[data-palette] .badge.warn {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--line));
  background: var(--amber-soft);
  color: var(--amber);
}

html[data-palette] input,
html[data-palette] select,
html[data-palette] textarea,
html[data-palette] .search-input input {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

html[data-palette] input:focus,
html[data-palette] select:focus,
html[data-palette] textarea:focus,
html[data-palette] .search-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

html[data-palette] .data-table-wrap {
  border: 1px solid var(--line);
  box-shadow: none;
}

html[data-palette] .data-table td {
  border-color: var(--line);
  color: var(--ink);
}

/* Exceções deliberadas da hero: fundo escuro pede controles claros. */
html[data-palette] .game-first-hero .button:not(.secondary):not(.ghost),
html[data-palette] .game-first-hero .button:not(.secondary):not(.ghost):hover {
  border-color: #fff;
  background: #fff;
  box-shadow: 0 4px 0 #0000002b;
}

html[data-palette] .game-first-hero .button.secondary,
html[data-palette] .game-first-hero .button.secondary:hover {
  border-color: #ffffff80;
  background: #ffffff16;
  color: #fff;
  box-shadow: none;
}

html[data-palette] .home-palette-picker button {
  border-color: #ffffff54;
  background: #ffffff14;
  color: #fff;
}

html[data-palette] .home-palette-picker button:hover,
html[data-palette] .home-palette-picker button.is-selected {
  border-color: #fff;
  background: #fff;
  color: var(--brand-dark);
}
