/* Skip artifact shell — fixed styles served beside every artifact.
   Tokens, utilities and components (basecoat 1.0 markup, no CDN); artifacts
   override --accent for their own identity. */
:root {
  color-scheme: light dark;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --accent-text: color-mix(in srgb, var(--accent) 72%, #000);
  --bg: #f8f9fb;
  --surface: #ffffff;
  --text: #14171f;
  --text-muted: #5b6472;
  --border: rgba(20, 23, 31, 0.10);
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 23, 31, 0.08);
  --space: 16px;
  --success: #0a7a35;
  --danger: #c0262d;
  --warning: #8a5300;
}
/* Theme resolution. Without data-theme the viewer's system preference decides,
   as it always did. With it, the artifact's own choice wins in BOTH directions:
   a page that hardcodes one palette must not be handed the opposite set of
   tokens by the machine it happens to be opened on. The dark values appear
   twice because a media query cannot be folded into a selector list.
   The attribute sits inside :where() so these blocks keep the specificity of a
   bare :root — the page's own <style> is linked after this file and must go on
   overriding any token it wants, exactly as it could before. */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --accent-text: color-mix(in srgb, var(--accent) 78%, #fff);
    --bg: #101318;
    --surface: #181c23;
    --text: #eef1f6;
    --text-muted: #9aa4b2;
    --border: rgba(238, 241, 246, 0.12);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
  }
}
:root:where([data-theme="dark"]) {
  color-scheme: dark;
  --accent-text: color-mix(in srgb, var(--accent) 78%, #fff);
  --bg: #101318;
  --surface: #181c23;
  --text: #eef1f6;
  --text-muted: #9aa4b2;
  --border: rgba(238, 241, 246, 0.12);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
}
:root:where([data-theme="light"]) { color-scheme: light; }
/* Pages generated before the shell had its own components still link the
   basecoat CDN, which reads its own tokens and switches theme only on a
   .dark class. Bridged to the shell's, whatever of it those pages use takes
   the page's accent and follows the declared theme. Its --accent token is a
   hover tint, renamed in its theme as --color-accent; the shell's --accent is
   the brand colour, so the tint is derived from it here. */
:root {
  --background: var(--bg);
  --foreground: var(--text);
  --card: var(--surface);
  --card-foreground: var(--text);
  --popover: var(--surface);
  --popover-foreground: var(--text);
  --primary: var(--accent);
  --primary-foreground: var(--accent-contrast);
  --secondary: color-mix(in srgb, var(--text) 7%, var(--surface));
  --secondary-foreground: var(--text);
  --muted: color-mix(in srgb, var(--text) 5%, var(--surface));
  --muted-foreground: var(--text-muted);
  --color-accent: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --color-accent-foreground: var(--text);
  --destructive: var(--danger);
  --input: var(--border);
  --ring: var(--accent);
}
* { box-sizing: border-box; }
/* The reset the pages were written against: they all linked basecoat, which
   ships Tailwind's. Its components now live here, so the reset does too. */
*, ::before, ::after, ::backdrop { margin: 0; padding: 0; border: 0 solid; }
/* Preflight's rule too: without it a component class that sets display
   (.alert, .card, .btn…) beats the hidden attribute and shows the element. */
[hidden]:where(:not([hidden="until-found"])) { display: none !important; }
.hidden { display: none !important; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
ol, ul, menu { list-style: none; }
svg, video, canvas, iframe { display: block; vertical-align: middle; }
button, input, select, textarea { color: inherit; background-color: transparent; border-radius: 0; }
table { border-collapse: collapse; }
hr { height: 0; color: inherit; border-top-width: 1px; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }

.shell-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.shell-section { padding: calc(var(--space) * 2) 0; }
.shell-grid { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shell-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: var(--space); }
.shell-footer { padding: 24px 0 40px; color: var(--text-muted); font-size: 13px; }

.shell-hero { padding: calc(var(--space) * 3) 0 calc(var(--space) * 2); }
.shell-hero h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.15; margin: 0 0 10px; text-wrap: balance; }
.shell-hero p { color: var(--text-muted); max-width: 60ch; margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space);
}

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .kpi-value { font-size: clamp(22px, 2.3vw, 28px); font-weight: 650; line-height: 1.1; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi .kpi-label { font-size: 13px; color: var(--text-muted); }
.kpi .kpi-delta { font-size: 12.5px; font-weight: 600; }
.kpi .kpi-delta.up { color: var(--success); }
.kpi .kpi-delta.down { color: var(--danger); }

table.shell-table { border-collapse: collapse; width: 100%; font-size: 14px; }
table.shell-table th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
table.shell-table th, table.shell-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--border); }
table.shell-table td.num, table.shell-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.shell-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }

.chart-box { width: 100%; min-height: 220px; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chart-legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.muted { color: var(--text-muted); }
.accent { color: var(--accent-text); }
.shell-badge, .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text);
}
/* A pill keeps its content width inside flex and grid columns, which would
   otherwise stretch it across the card; a centred parent still centres it. */
.shell-badge, .eyebrow, .badge { width: fit-content; max-width: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .shell-fade { animation: shell-fade 400ms ease both; }
  @keyframes shell-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Layout and type utilities: what the pages kept spelling in style="".
   Spacing and type sizes follow Tailwind's scale; there is no Tailwind. */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: var(--space); }
.between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.cols-2, .cols-3, .cols-4, .cols-5 { display: grid; gap: var(--space); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .cols-2, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) { .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-6 { padding: 24px; }
.text-xs { font-size: 12px; } .text-sm { font-size: 14px; } .text-base { font-size: 16px; }
.text-lg { font-size: 18px; } .text-xl { font-size: 20px; line-height: 1.35; }
.text-2xl { font-size: 24px; line-height: 1.25; } .text-3xl { font-size: 30px; line-height: 1.2; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-right { text-align: right; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.w-full { width: 100%; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }

/* Components, with basecoat 1.0 markup (variants and sizes are data
   attributes) and the shell tokens, so a page needs neither component CSS
   nor a CSS framework. An older page that also links basecoat gets these
   rules after it, over the same properties. */
button, input, select, textarea { font: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: calc(var(--radius) - 2px);
  background: var(--accent); color: var(--accent-contrast);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn[data-variant="secondary"] { background: color-mix(in srgb, var(--text) 8%, var(--surface)); color: var(--text); }
.btn[data-variant="secondary"]:hover { background: color-mix(in srgb, var(--text) 14%, var(--surface)); }
.btn[data-variant="outline"] { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn[data-variant="ghost"] { background: transparent; color: var(--text); }
.btn[data-variant="outline"]:hover, .btn[data-variant="ghost"]:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.btn[data-variant="destructive"] { background: var(--danger); color: var(--bg); }
.btn[data-variant="destructive"]:hover { background: color-mix(in srgb, var(--danger) 86%, var(--text)); }
.btn[data-variant="link"] { height: auto; padding: 0; background: none; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.btn[data-size="sm"] { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[data-size="lg"] { height: 42px; padding: 0 20px; font-size: 15px; }
.btn[data-size="icon"] { width: 36px; padding: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border: 1px solid transparent; border-radius: 999px; background: var(--accent); color: var(--accent-contrast);
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge[data-variant="secondary"] { background: color-mix(in srgb, var(--text) 8%, var(--surface)); color: var(--text); }
.badge[data-variant="outline"] { background: transparent; color: var(--text); border-color: var(--border); }
.badge[data-variant="destructive"] { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }

.alert {
  display: grid; gap: 4px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 14px;
}
.alert h2, .alert h3 { margin: 0; font-size: 14px; font-weight: 600; }
.alert p, .alert section { margin: 0; color: var(--text-muted); }
.alert[data-variant="destructive"] { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); color: var(--danger); }

.card {
  display: flex; flex-direction: column; gap: 16px; padding: 20px 0;
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.card > header, .card > section, .card > footer { padding: 0 20px; }
.card > header { display: grid; gap: 4px; }
.card > header h2, .card > header h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.card > header p { margin: 0; color: var(--text-muted); font-size: 14px; }
.card > footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.input {
  width: 100%; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
  background: var(--surface); color: var(--text); font-size: 14px;
}
textarea.input { min-height: 84px; resize: vertical; }
.input::placeholder { color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field [role="alert"] { color: var(--danger); font-size: 13px; }

dialog.dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0;
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog.dialog > div { display: grid; gap: 16px; padding: 24px; }
dialog.dialog header { display: grid; gap: 4px; }
dialog.dialog header h2 { margin: 0; font-size: 18px; font-weight: 600; }
dialog.dialog header p { margin: 0; color: var(--text-muted); font-size: 14px; }
dialog.dialog footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.tabs { display: grid; gap: 12px; }
.tabs > [role="tablist"] {
  display: inline-flex; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; overflow-x: auto;
  border-radius: var(--radius); background: color-mix(in srgb, var(--text) 6%, var(--surface));
}
.tabs [role="tab"] {
  padding: 6px 12px; border: 0; border-radius: calc(var(--radius) - 4px); background: transparent;
  color: var(--text-muted); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs [role="tabpanel"][hidden] { display: none; }

.accordion > details { border-bottom: 1px solid var(--border); }
.accordion > details > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; font-weight: 500; list-style: none; cursor: pointer;
}
.accordion > details > summary::-webkit-details-marker { display: none; }
.accordion > details > summary::after { content: "+"; color: var(--text-muted); font-size: 18px; line-height: 1; }
.accordion > details[open] > summary::after { content: "\2212"; }
.accordion > details > :not(summary) { margin: 0 0 14px; color: var(--text-muted); }

.toaster {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column-reverse; gap: 8px;
  width: min(360px, calc(100vw - 32px)); pointer-events: none;
}
.toaster .toast { pointer-events: auto; transition: opacity 200ms ease, transform 200ms ease; }
.toaster .toast[aria-hidden="true"] { opacity: 0; transform: translateY(8px); }
.toaster .toast-content {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); font-size: 13px;
}
.toaster .toast-content h2 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.toaster .toast-content p { margin: 0; color: var(--text-muted); }

/* skipUI building blocks. */
.skip-table-search { max-width: 320px; margin-bottom: 12px; }
.skip-table-wrap { overflow-x: auto; }
table.shell-table th[data-sort] { cursor: pointer; user-select: none; }
table.shell-table th[aria-sort="ascending"]::after { content: " \25B2"; font-size: 9px; }
table.shell-table th[aria-sort="descending"]::after { content: " \25BC"; font-size: 9px; }
table.shell-table td.skip-table-empty { color: var(--text-muted); text-align: center; padding: 24px 0; }
.skip-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.toaster .toast[data-type="success"] .toast-content { border-left: 3px solid var(--success); }
.toaster .toast[data-type="error"] .toast-content { border-left: 3px solid var(--danger); }

dialog.dialog, dialog.custom-dialog {
  margin: auto !important;
  inset: 0;
}
dialog.custom-dialog:not([open]), dialog.dialog:not([open]) {
  display: none !important;
}
dialog.custom-dialog[open] {
  display: block !important;
}




/* === RESPONSIVIDADE FLUIDA V12 === */
.avatar-neutro-svg {
  background: #e2e8f0;
  object-fit: cover;
}
@media (max-width: 1100px) {
  .shell-grid.cols-4, .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .shell-grid.cols-3, .cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 768px) {
  .shell-grid.cols-4, .shell-grid.cols-3, .shell-grid.cols-2,
  .cols-4, .cols-3, .cols-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .row.between {
    flex-wrap: wrap;
    gap: 10px;
  }
  .content-area, .main-content {
    padding: 14px 12px 84px 12px !important;
  }
  dialog.dialog, dialog.custom-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 16px !important;
  }
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* === TEMA DUOLINGO GAMIFICADO V16 === */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

:root {
  --duo-green: #58cc02;
  --duo-green-dark: #46a302;
  --duo-blue: #1cb0f6;
  --duo-blue-dark: #1899d6;
  --duo-gold: #ffc800;
  --duo-gold-dark: #e5b400;
  --duo-red: #ff4b4b;
  --duo-red-dark: #ea2b2b;
  --duo-purple: #ce82ff;
  --duo-purple-dark: #a55eea;
}

body, button, input, select, textarea {
  font-family: 'Nunito', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
}

/* Botões Táteis 3D Estilo Duolingo */
.btn {
  border-radius: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0.3px;
  border-bottom: 4px solid rgba(0, 0, 0, 0.22) !important;
  transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.15s ease !important;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(2px) !important;
  border-bottom-width: 2px !important;
}

/* Cards Interativos Arredondados com Borda Tátil */
.card-interactive, .panel {
  border-radius: 20px !important;
  border: 2px solid var(--border) !important;
  border-bottom-width: 5px !important;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
}

/* Barra de Progresso Estilo Duolingo com Brilho Interno */
.level-bar {
  height: 14px !important;
  border-radius: 999px !important;
  background: #e2e8f0 !important;
  overflow: hidden;
  position: relative;
}
.level-bar-fill {
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #58cc02, #61e002) !important;
  position: relative;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.level-bar-fill::after {
  content: '';
  position: absolute;
  top: 3px; left: 8px; right: 8px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

/* Questões Bem Dimensionadas e Opções Táteis 3D */
.duo-question-shell {
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}
.question-option {
  border-radius: 16px !important;
  border: 2px solid var(--border) !important;
  border-bottom-width: 5px !important;
  padding: 14px 18px !important;
  background: var(--surface) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease !important;
}
.question-option:hover {
  border-color: #1cb0f6 !important;
  background: rgba(28, 176, 246, 0.05) !important;
}
.question-option:active {
  transform: translateY(2px);
  border-bottom-width: 3px !important;
}
.question-option.selected {
  border-color: #1cb0f6 !important;
  border-bottom-color: #1899d6 !important;
  background: rgba(28, 176, 246, 0.12) !important;
  color: #0284c7 !important;
}
.option-badge {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
  border: 2px solid var(--border) !important;
  border-bottom-width: 3px !important;
  font-weight: 900 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.question-option.selected .option-badge {
  background: #1cb0f6 !important;
  color: #fff !important;
  border-color: #1899d6 !important;
}

/* Mapa de Trilhas em Caminho Serpentina Estilo Duolingo */
.duo-path-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px;
  gap: 26px;
  position: relative;
}
.duo-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.2s ease;
}
.duo-node-circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 0 rgba(0,0,0,0.22), 0 12px 24px rgba(0,0,0,0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
.duo-node-circle:active:not(.locked) {
  transform: translateY(5px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.22);
}
.duo-node-circle.concluida {
  background: linear-gradient(180deg, #ffc800 0%, #f59e0b 100%);
  box-shadow: 0 8px 0 #b45309;
}
.duo-node-circle.atual {
  background: linear-gradient(180deg, #58cc02 0%, #46a302 100%);
  box-shadow: 0 8px 0 #367c02, 0 0 0 8px rgba(88, 204, 2, 0.22);
  animation: duoPulseNode 1.8s infinite;
}
.duo-node-circle.chefao {
  width: 96px;
  height: 96px;
  background: linear-gradient(180deg, #ce82ff 0%, #9333ea 100%);
  box-shadow: 0 8px 0 #6b21a8;
}
.duo-node-circle.locked {
  background: #cbd5e1;
  color: #64748b;
  box-shadow: 0 8px 0 #94a3b8;
  cursor: not-allowed;
}
.duo-start-bubble {
  position: absolute;
  top: -38px;
  background: #ffffff;
  color: #58cc02;
  border: 2px solid #e2e8f0;
  border-bottom-width: 4px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  animation: duoBounceBubble 1.2s ease-in-out infinite;
}
@keyframes duoPulseNode {
  0%, 100% { box-shadow: 0 8px 0 #367c02, 0 0 0 6px rgba(88, 204, 2, 0.2); }
  50% { box-shadow: 0 8px 0 #367c02, 0 0 0 14px rgba(88, 204, 2, 0.08); }
}
@keyframes duoBounceBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Grade das 10 Patentes de Nível (Insígnias Gerais) */
.patente-badge-card {
  border-radius: 18px;
  padding: 14px 12px;
  text-align: center;
  border: 2px solid var(--border);
  border-bottom-width: 5px;
  background: var(--surface);
  transition: transform 0.18s ease;
}
.patente-badge-card. conquistada {
  border-color: #ffc800;
  border-bottom-color: #d97706;
  background: linear-gradient(180deg, rgba(255,200,0,0.08) 0%, var(--surface) 100%);
}
.patente-badge-card.atual-rank {
  border-color: #58cc02;
  border-bottom-color: #46a302;
  box-shadow: 0 0 0 4px rgba(88,204,2,0.18);
  transform: scale(1.03);
}
.patente-badge-card.bloqueada {
  opacity: 0.48;
  filter: grayscale(0.8);
}

/* === FIX ICONES E TORNEIOS V18 === */
.nav-item svg, .sidebar-nav svg, .nav-link svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}
.nav-item, .nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  overflow: hidden !important;
}
.escape-door-box {
  border-radius: 18px;
  padding: 16px;
  border: 2px solid var(--border);
  border-bottom-width: 5px;
  text-align: center;
  background: var(--bg);
}
.escape-door-box.unlocked {
  border-color: #58cc02;
  background: rgba(88, 204, 2, 0.1);
}
.escape-door-box.active-room {
  border-color: #ffc800;
  background: rgba(255, 200, 0, 0.12);
  transform: scale(1.03);
}
.poker-chip-btn {
  border-radius: 999px !important;
  padding: 10px 18px !important;
  font-weight: 900 !important;
  border: 3px dashed rgba(255,255,255,0.5) !important;
  box-shadow: 0 5px 0 rgba(0,0,0,0.25) !important;
  cursor: pointer;
}
.bracket-match-card {
  border-radius: 14px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--surface);
  font-size: 0.8rem;
}
.bracket-match-card.venceu {
  border-color: #58cc02;
  background: rgba(88, 204, 2, 0.08);
}

/* === MENU PADRAO V20 === */
/* Unifica os itens de menu do Professor (.nav-item) com o mesmo design limpo do Perfil do Aluno (.nav-link) */
.sidebar-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 10px !important;
}
.sidebar-nav .nav-item,
.sidebar-nav .nav-link,
.sidebar .nav-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 42px !important;
  max-height: 44px !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-bottom-width: 1px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all 0.15s ease !important;
  margin: 0 !important;
}
.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-link:hover,
.sidebar .nav-item:hover {
  background: var(--bg) !important;
  color: var(--text) !important;
  transform: translateX(2px) !important;
}
.sidebar-nav .nav-item.active,
.sidebar-nav .nav-link.active,
.sidebar .nav-item.active {
  background: rgba(79, 70, 229, 0.1) !important;
  color: var(--accent) !important;
  border-color: rgba(79, 70, 229, 0.25) !important;
  font-weight: 800 !important;
}
.sidebar-nav .nav-item svg,
.sidebar-nav .nav-link svg,
.sidebar .nav-item svg {
  width: 19px !important;
  height: 19px !important;
  min-width: 19px !important;
  max-width: 19px !important;
  max-height: 19px !important;
  flex-shrink: 0 !important;
  stroke-width: 2.1px !important;
}
.sidebar-nav .nav-item span,
.sidebar-nav .nav-link span,
.sidebar .nav-item span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

/* Torre do Conhecimento Visual (Andares Escaláveis) */
.tower-floors-stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
  border-radius: 18px;
  border: 2px solid #4338ca;
}
.tower-floor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}
.tower-floor-row.conquistado {
  background: rgba(88, 204, 2, 0.2);
  border-color: #58cc02;
  color: #86efac;
}
.tower-floor-row.andar-atual {
  background: linear-gradient(90deg, #ce82ff 0%, #7c3aed 100%);
  border-color: #ffc800;
  color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 0 16px rgba(206, 130, 255, 0.45);
}

/* === TORRE CASTELO E SELETOR VISUAL V22 === */
.castle-tower-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at 50% 15%, #312e81 0%, #0f172a 80%);
  border-radius: 22px;
  padding: 20px 14px 16px 14px;
  border: 3px solid #4338ca;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55);
}
.castle-battlements {
  display: flex;
  justify-content: space-between;
  width: 88%;
  max-width: 230px;
  margin-bottom: -2px;
  z-index: 2;
}
.castle-merlon {
  width: 26px;
  height: 18px;
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  border: 2px solid #94a3b8;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}
.castle-body-Shaft {
  width: 88%;
  max-width: 230px;
  background: repeating-linear-gradient(
    0deg,
    #334155 0px,
    #334155 24px,
    #1e293b 25px,
    #1e293b 28px
  );
  border-left: 5px solid #64748b;
  border-right: 5px solid #64748b;
  border-top: 4px solid #94a3b8;
  display: flex;
  flex-direction: column-reverse;
  position: relative;
  border-radius: 4px;
}
.castle-floor-stage {
  height: 54px;
  border-top: 3px solid #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  position: relative;
  transition: background 0.35s ease;
}
.castle-floor-stage.floor-done {
  background: rgba(88, 204, 2, 0.25);
  border-top-color: #58cc02;
}
.castle-floor-stage.floor-current {
  background: linear-gradient(90deg, rgba(206, 130, 255, 0.38), rgba(255, 200, 0, 0.35));
  border-top-color: #ffc800;
  box-shadow: inset 0 0 18px rgba(255, 200, 0, 0.45);
}
.castle-window {
  width: 20px;
  height: 28px;
  border-radius: 12px 12px 2px 2px;
  background: #0f172a;
  border: 2px solid #64748b;
  transition: all 0.3s ease;
}
.castle-floor-stage.floor-done .castle-window {
  background: #58cc02;
  border-color: #bbf7d0;
  box-shadow: 0 0 10px #58cc02;
}
.castle-floor-stage.floor-current .castle-window {
  background: #ffc800;
  border-color: #fef08a;
  box-shadow: 0 0 14px #ffc800;
}
.castle-climber-avatar {
  font-size: 1.55rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
  animation: climberBounce 0.9s ease-in-out infinite;
}
@keyframes climberBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.1); }
}
.castle-base-foundation {
  width: 96%;
  max-width: 250px;
  height: 18px;
  background: #475569;
  border: 2px solid #94a3b8;
  border-radius: 4px;
}

/* Construtor Visual de Questões (Substituto do Ctrl+Clique) */
.q-builder-box {
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.q-builder-tabs {
  display: flex;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
.q-builder-tab {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
}
.q-builder-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--surface);
}
.q-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.12s ease;
}
.q-check-item:hover {
  border-color: #1cb0f6;
}
.q-check-item.marcado {
  border-color: #58cc02;
  background: rgba(88, 204, 2, 0.1);
}

/* === ACESSIBILIDADE E TOPBAR PLAYER V25 === */
@import url('https://fonts.cdnfonts.com/css/opendyslexic');

/* Remove o antigo player flutuante de canto para não atrapalhar a tela */
#player-musical-etec-v24 {
  display: none !important;
}

/* Player Musical Elegante Integrado na Barra Superior (Topbar) */
.topbar-music-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  transition: all 0.2s ease;
}
.topbar-music-pill.playing {
  border-color: #58cc02;
  background: rgba(88, 204, 2, 0.1);
}
.topbar-music-pill select {
  background: transparent;
  border: none;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}
.topbar-music-btn {
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  background: #58cc02;
  transition: transform 0.1s ease;
}
.topbar-music-btn.on {
  background: #1cb0f6;
}
.topbar-a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff !important;
  border: none;
  border-bottom: 3px solid #1d4ed8;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

/* Barra de Transcrição e Leitura por Voz dentro do Simulado */
.sim-voice-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(28, 176, 246, 0.1) 0%, rgba(206, 130, 255, 0.1) 100%);
  border: 2px solid rgba(28, 176, 246, 0.35);
  margin-bottom: 12px;
}
.voice-transcript-box {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px dashed var(--accent);
  font-size: 0.82rem;
  line-height: 1.6;
  display: none;
}
.voice-transcript-box.active {
  display: block;
}
.word-spoken-highlight {
  background: #ffc800;
  color: #0f172a;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 900;
}

/* Modos Globais de Acessibilidade */
html.a11y-dyslexic,
html.a11y-dyslexic body,
html.a11y-dyslexic button,
html.a11y-dyslexic input,
html.a11y-dyslexic select,
html.a11y-dyslexic textarea,
html.a11y-dyslexic p,
html.a11y-dyslexic h1,
html.a11y-dyslexic h2,
html.a11y-dyslexic h3 {
  font-family: 'OpenDyslexic', 'Comic Sans MS', Verdana, sans-serif !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.12em !important;
  line-height: 1.85 !important;
}

html.a11y-high-contrast {
  --bg: #000000 !important;
  --surface: #0a0a0a !important;
  --text: #ffffff !important;
  --text-muted: #ffff00 !important;
  --border: #ffffff !important;
  --accent: #00ffff !important;
}
html.a11y-high-contrast body {
  background: #000000 !important;
  color: #ffffff !important;
}
html.a11y-high-contrast .card-interactive,
html.a11y-high-contrast .panel,
html.a11y-high-contrast .question-option {
  background: #050505 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
}

/* Régua de Foco de Leitura (TDAH / Baixa Visão) */
#a11y-reading-ruler {
  position: fixed;
  left: 0;
  width: 100vw;
  height: 38px;
  background: rgba(255, 200, 0, 0.22);
  border-top: 2px solid #ffc800;
  border-bottom: 2px solid #ffc800;
  pointer-events: none;
  z-index: 99998;
  display: none;
}
html.a11y-ruler-on #a11y-reading-ruler {
  display: block;
}

/* === RESPONSIVIDADE MOBILE E DESPOLUICAO V30 === */

/* 1. Redimensionamento Fluido de Ícones e Elementos (Evita ícones gigantes no celular) */
.game-icon-circle {
  width: 38px !important;
  height: 38px !important;
  font-size: 1.2rem !important;
  border-radius: 10px !important;
}
.duo-node-circle {
  width: 64px !important;
  height: 64px !important;
  font-size: 1.5rem !important;
}
.duo-node-circle.chefao {
  width: 74px !important;
  height: 74px !important;
}
.patente-badge-card div[style*="font-size"] {
  font-size: 1.65rem !important;
}
.student-hero-v14, .arena-hero-banner {
  padding: 18px 20px !important;
  border-radius: 16px !important;
}
.card-interactive, .panel {
  border-radius: 14px !important;
  border-bottom-width: 3px !important;
  padding: 14px !important;
}
.btn {
  border-radius: 10px !important;
  border-bottom-width: 3px !important;
  height: 36px !important;
  font-size: 0.84rem !important;
}

/* 2. Barra de Navegação Inferior Nativa para Celulares e Tablets Compactos (Bottom Nav) */
#mobile-bottom-nav-v30 {
  display: none;
}

@media (max-width: 992px) {
  .shell-grid.cols-4, .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .shell-grid.cols-3, .cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

@media (max-width: 768px) {
  /* Reserva espaço inferior para a Bottom Nav no celular */
  body {
    padding-bottom: 74px !important;
  }
  main, #main-content {
    padding: 10px 10px 80px 10px !important;
  }
  /* Topbar limpa e compacta no celular */
  header.topbar, .topbar {
    padding: 6px 10px !important;
    gap: 6px !important;
    min-height: 50px !important;
  }
  #top-name, #user-turma-badge, #etec-topbar-sound-style, #etec-topbar-sound-vol {
    display: none !important;
  }
  #etec-topbar-sound-pill {
    padding: 2px 6px !important;
  }
  #etec-topbar-sound-btn, #etec-topbar-a11y-btn {
    padding: 4px 8px !important;
    font-size: 10.5px !important;
  }
  /* Tipografia proporcional no celular */
  h1, .text-2xl { font-size: 1.18rem !important; line-height: 1.25 !important; }
  h2, .text-xl  { font-size: 1.05rem !important; line-height: 1.25 !important; }
  h3, .text-lg  { font-size: 0.94rem !important; }
  .student-hero-v14, .arena-hero-banner {
    padding: 14px !important;
    border-radius: 14px !important;
  }
  /* KPIs do Hero em 2x2 compacto no celular */
  .student-hero-v14 .shell-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }
  .student-hero-v14 .panel {
    padding: 8px 10px !important;
  }
  .student-hero-v14 .text-2xl {
    font-size: 1.05rem !important;
  }
  /* Grades principais em 1 coluna limpa no celular */
  .shell-grid.cols-3, .shell-grid.cols-2, .cols-3, .cols-2 {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  /* Comp-selector de matérias em 2 colunas compactas no celular */
  #comp-selector-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  #comp-selector-multi .comp-card-multi div[style*="font-size"] {
    font-size: 1.25rem !important;
  }
  /* Barra de Navegação Inferior Fixa Estilo App Mobile */
  #mobile-bottom-nav-v30 {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: var(--surface);
    border-top: 2px solid var(--border);
    z-index: 9995;
    align-items: center;
    justify-content: space-around;
    padding: 4px 6px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  }
  .mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
  }
  .mob-nav-item .mob-ico {
    font-size: 1.15rem;
    line-height: 1;
  }
  .mob-nav-item.active {
    color: var(--accent);
    background: rgba(79, 70, 229, 0.1);
  }
  /* Sidebar lateral recolhida como gaveta (drawer) no celular */
  .sidebar {
    position: fixed !important;
    top: 0;
    bottom: 62px;
    left: 0;
    width: 265px !important;
    z-index: 9998 !important;
    transform: translateX(-105%);
    transition: transform 0.22s ease !important;
    box-shadow: 8px 0 28px rgba(0,0,0,0.35);
  }
  .sidebar.open, .sidebar.aberta, .sidebar.mobile-open {
    transform: translateX(0) !important;
  }
  #mobile-drawer-backdrop-v30 {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9997;
    display: none;
  }
  #mobile-drawer-backdrop-v30.show {
    display: block;
  }
}

/* === UX SAMSUNG A55 E BOTTOM SHEET V31 === */

/* 1. Blindagem Global contra Estouro Horizontal (Overflow-X) em Qualquer Dispositivo */
html, body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}
.app-shell, .main-area, main, #main-content, .card-interactive, .panel, .row, .stack {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
p, h1, h2, h3, h4, span, div, label {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* 2. Cards de Modalidade do Simulado (Substitui os botões longos que vazavam da tela) */
.sim-modo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.sim-modo-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  width: 100%;
  white-space: normal !important;
  transition: all 0.15s ease;
}
.sim-modo-card.selected {
  border-color: #58cc02 !important;
  border-bottom-color: #46a302 !important;
  background: rgba(88, 204, 2, 0.09) !important;
}
.sim-modo-card .modo-ico {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.sim-modo-card .modo-tit {
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.25;
}
.sim-modo-card .modo-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* Grade de Quantidade de Questões (Botões Pílula Compactos) */
.sim-qtd-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.sim-qtd-pill {
  height: 38px !important;
  padding: 0 6px !important;
  border-radius: 12px !important;
  border: 2px solid var(--border) !important;
  border-bottom-width: 3px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sim-qtd-pill.selected {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
}

/* 3. Menu Gaveta Inferior (Bottom Sheet) para o botão "☰ Mais" no Celular */
#mobile-more-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: none;
}
#mobile-more-sheet-backdrop.open {
  display: block;
}
#mobile-more-sheet-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 62px;
  background: var(--surface);
  border-top: 2px solid var(--border);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px 20px 16px;
  z-index: 9999;
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.35);
  transform: translateY(115%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 75vh;
  overflow-y: auto;
}
#mobile-more-sheet-panel.open {
  transform: translateY(0);
}
.sheet-handle-bar {
  width: 44px;
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  margin: 0 auto 12px auto;
}
.sheet-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.sheet-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  position: relative;
}
.sheet-menu-card.active {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
}
.sheet-menu-card .sh-ico {
  font-size: 1.45rem;
  line-height: 1;
}

/* 4. Regras Específicas para Smartphones (ex: Samsung A55 = 412px) */
@media (max-width: 768px) {
  /* Qualquer botão dentro do conteúdo principal pode quebrar linha se for longo */
  #main-content .btn {
    white-space: normal !important;
    height: auto !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    line-height: 1.25 !important;
    text-align: center;
  }
  .badge {
    white-space: normal !important;
    text-align: left;
    line-height: 1.25 !important;
  }
  .sim-modo-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .sim-qtd-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  #comp-selector-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  #comp-selector-multi .comp-card-multi {
    padding: 10px 8px !important;
  }
  #comp-selector-multi .comp-card-multi .font-bold {
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
  }
  /* Topbar enxuta para caber perfeitamente em 384px-412px */
  header.topbar, .topbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    padding: 6px 8px !important;
    gap: 4px !important;
  }
  .topbar .badge, .topbar .stat-badge {
    font-size: 10.5px !important;
    padding: 3px 6px !important;
    white-space: nowrap !important;
  }
  #top-streak {
    display: none !important;
  }
}

/* === CARROSSEL HORIZONTAL ARENA E TORNEIOS V32 === */

/* Container de Rolagem Horizontal Suave (Swipe Lateral estilo Netflix / Play Store) */
.horizontal-carousel-wrap {
  position: relative;
  width: 100%;
}
.horizontal-scroll-rail {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 14px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 6px 4px 16px 4px !important;
  margin: 0 !important;
}
.horizontal-scroll-rail::-webkit-scrollbar {
  height: 7px;
}
.horizontal-scroll-rail::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
}
.horizontal-scroll-rail::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

/* Cada card dentro do carrossel tem largura fixa confortável e trava no centro/início ao deslizar */
.horizontal-scroll-rail > * {
  flex: 0 0 300px !important;
  width: 300px !important;
  max-width: 82vw !important;
  scroll-snap-align: start;
}

/* Carrossel compacto para as 100 Insígnias de Nível */
.horizontal-scroll-rail.rail-compact > * {
  flex: 0 0 190px !important;
  width: 190px !important;
  max-width: 68vw !important;
}

/* Barra de navegação do carrossel (Setas ◀ ▶ + Indicador de deslize) */
.carousel-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.carousel-arrows-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.carousel-arrow-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 999px !important;
  border: 2px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-weight: 900 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 !important;
}
.carousel-arrow-btn:active {
  transform: scale(0.94);
}
.swipe-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .horizontal-scroll-rail > * {
    flex: 0 0 272px !important;
    width: 272px !important;
    max-width: 80vw !important;
  }
  .horizontal-scroll-rail.rail-compact > * {
    flex: 0 0 165px !important;
    width: 165px !important;
    max-width: 62vw !important;
  }
}

/* === CHIPS MATERIAS E ANIMACAO MOEDAS V33 === */

/* Empacotador Compacto de Matérias do Simulado (Com Rolagem Suave se houver muitas matérias) */
.comp-chips-wrapper {
  max-height: 225px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
}
.comp-chip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 2px solid var(--border);
  border-bottom-width: 3px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.14s ease;
  position: relative;
  user-select: none;
}
.comp-chip-item:hover {
  border-color: #1cb0f6;
  transform: translateY(-1px);
}
.comp-chip-item.selected {
  border-color: #58cc02 !important;
  border-bottom-color: #367c02 !important;
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.18), rgba(88, 204, 2, 0.08)) !important;
  box-shadow: 0 0 0 2px rgba(88, 204, 2, 0.28);
}
.comp-chip-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: transparent;
  background: var(--bg);
  flex-shrink: 0;
}
.comp-chip-item.selected .comp-chip-check {
  background: #58cc02;
  border-color: #46a302;
  color: #ffffff;
}
.comp-chip-info {
  min-width: 0;
  flex: 1;
}
.comp-chip-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comp-chip-item.selected .comp-chip-title {
  color: #367c02;
}
[data-theme="dark"] .comp-chip-item.selected .comp-chip-title {
  color: #86efac;
}
.comp-chip-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Trilha de 7 Dias de Login Consecutivo */
.streak-7d-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}
.streak-day-box {
  padding: 8px 4px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
}
.streak-day-box.done {
  border-color: #58cc02;
  background: rgba(88, 204, 2, 0.14);
  color: #46a302;
}
.streak-day-box.today {
  border-color: #ffc800;
  background: linear-gradient(180deg, rgba(255, 200, 0, 0.28), rgba(255, 200, 0, 0.1));
  transform: scale(1.06);
  box-shadow: 0 0 14px rgba(255, 200, 0, 0.4);
}
.streak-day-box.day7 {
  border-color: #ce82ff;
}

/* Animação Flutuante de Moedas Ganhas ou Debitadas */
.coin-float-anim {
  position: fixed;
  z-index: 999999;
  font-weight: 900;
  font-size: 1.35rem;
  pointer-events: none;
  animation: coinFloatUp 1.6s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  text-shadow: 0 4px 12px rgba(0,0,0,0.45);
}
@keyframes coinFloatUp {
  0%   { opacity: 0; transform: translateY(20px) scale(0.7); }
  20%  { opacity: 1; transform: translateY(0px) scale(1.12); }
  80%  { opacity: 1; transform: translateY(-45px) scale(1); }
  100% { opacity: 0; transform: translateY(-75px) scale(0.9); }
}
@media (max-width: 600px) {
  .comp-chips-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 210px;
  }
  .streak-7d-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
