/* ============================================================
   Clube de Pontos Juvenis — visual de game com temas
   Tema ativo: atributo data-theme no <html>
   ============================================================ */

:root,
[data-theme="noite"] {
  --bg: #170f3d;
  --bg-glow: #2c1b73;
  --card: #2e1f6b;
  --card2: #3a2985;
  --deep: #241659;
  --edge: #0e0828;
  --text: #ffffff;
  --soft: #c9c2f0;
  --accent: #ffd23f;
  --ink: #1b1340;
  --a2: #35e0d2;
  --a3: #ff8fc0;
  --eyebrow: #35e0d2;
  --ok: #4ade80;
  --danger: #ff8a8a;
  --stage-a: #6a4be0;
  --stage-b: #3a2985;
  --stage-c: #241659;
  --field: #6b58c8;
  --gold: #ffd23f;
  --silver: #c9d2e8;
  --bronze: #f0a268;
}

[data-theme="dia"] {
  --bg: #dff3ff;
  --bg-glow: #ffffff;
  --card: #ffffff;
  --card2: #e3edff;
  --deep: #eef5ff;
  --edge: #1b2a5c;
  --text: #1b2a5c;
  --soft: #4a5b8c;
  --accent: #ffc62e;
  --ink: #1b2a5c;
  --a2: #4fd1e8;
  --a3: #ff9ec4;
  --eyebrow: #0a6fb0;
  --ok: #3ddc84;
  --danger: #ff8080;
  --stage-a: #8fd3ff;
  --stage-b: #bde6ff;
  --stage-c: #e5f5ff;
  --field: #8ea6e0;
  --gold: #ffc62e;
  --silver: #c9d2e8;
  --bronze: #f0a268;
}

[data-theme="floresta"] {
  --bg: #0f2a1d;
  --bg-glow: #1f5439;
  --card: #1b4630;
  --card2: #25603f;
  --deep: #153a28;
  --edge: #06150d;
  --text: #f4fff0;
  --soft: #bfe3c6;
  --accent: #ffc94a;
  --ink: #10261a;
  --a2: #7be7a5;
  --a3: #ffb27a;
  --eyebrow: #7be7a5;
  --ok: #8ceb6a;
  --danger: #ff8f7a;
  --stage-a: #4fb57a;
  --stage-b: #25603f;
  --stage-c: #153a28;
  --field: #3e8b62;
  --gold: #ffc94a;
  --silver: #c9d2e8;
  --bronze: #f0a268;
}

[data-theme="oceano"] {
  --bg: #06233f;
  --bg-glow: #0d4c7e;
  --card: #0f3a63;
  --card2: #17538a;
  --deep: #0b2d50;
  --edge: #021326;
  --text: #f0faff;
  --soft: #b5d8f0;
  --accent: #ffd166;
  --ink: #06233f;
  --a2: #3ee0ff;
  --a3: #ff9ec4;
  --eyebrow: #3ee0ff;
  --ok: #5bf0b0;
  --danger: #ff8a8a;
  --stage-a: #2e9be0;
  --stage-b: #17538a;
  --stage-c: #0b2d50;
  --field: #3f85bf;
  --gold: #ffd166;
  --silver: #c9d2e8;
  --bronze: #f0a268;
}

[data-theme="por-do-sol"] {
  --bg: #2b0f2e;
  --bg-glow: #7a2350;
  --card: #4a1b45;
  --card2: #66265a;
  --deep: #3a1537;
  --edge: #170615;
  --text: #fff4ee;
  --soft: #f2c9d8;
  --accent: #ffb43b;
  --ink: #2b0f2e;
  --a2: #ff8a5b;
  --a3: #ff7eb0;
  --eyebrow: #ff9d78;
  --ok: #7ce38b;
  --danger: #ff8a8a;
  --stage-a: #ff7a59;
  --stage-b: #8a2e6b;
  --stage-c: #3a1537;
  --field: #a5508f;
  --gold: #ffb43b;
  --silver: #c9d2e8;
  --bronze: #f0a268;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 0, var(--bg-glow), transparent 42rem),
    var(--bg);
  background-attachment: fixed;
  font-family: Nunito, system-ui, sans-serif;
  transition: background-color 240ms ease, color 240ms ease;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.check-pill:has(input:focus-visible) {
  outline: 3px solid var(--a2);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- layout ---------- */

.shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  overflow-y: auto;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 56px;
  height: 56px;
  flex: none;
  place-items: center;
  border: 3px solid var(--edge);
  border-radius: 18px;
  color: var(--ink);
  background: var(--accent);
  box-shadow: 0 5px 0 var(--edge);
  font-family: "Lilita One", cursive;
  font-size: 34px;
}

.brand p,
.eyebrow,
.mini-label {
  margin: 0;
  color: var(--eyebrow);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 2px 0 0;
  font-family: "Lilita One", cursive;
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 3px solid transparent;
  border-radius: 16px;
  color: var(--text);
  background: transparent;
  font-weight: 800;
  font-size: 1.05rem;
  text-align: left;
}

.nav-item:hover {
  background: var(--card);
}

.nav-item.is-active {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--edge);
  box-shadow: 0 4px 0 var(--edge);
}

.nav-item svg,
.btn-icon,
.primary-button svg,
.secondary-button svg,
.icon-button svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.meeting-card,
.theme-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 5px 0 var(--edge);
}

.meeting-card {
  margin-top: auto;
}

.meeting-card span {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.meeting-card strong {
  font-family: "Lilita One", cursive;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.05;
  text-transform: capitalize;
}

.meeting-card input,
select,
dialog input[type="text"],
dialog input[type="number"] {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 3px solid var(--field);
  border-radius: 14px;
  color: var(--text);
  background: var(--deep);
  font-weight: 800;
}

input[type="date"] {
  color-scheme: dark;
}

[data-theme="dia"] input[type="date"] {
  color-scheme: light;
}

dialog input[type="color"] {
  width: 100%;
  height: 46px;
  padding: 3px;
  border: 3px solid var(--field);
  border-radius: 14px;
  background: var(--deep);
}

/* ---------- temas ---------- */

.theme-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-dot {
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--edge);
  border-radius: 50%;
  background: var(--sw-bg);
  transition: transform 140ms ease;
}

.theme-dot span {
  display: block;
  width: 100%;
  height: 50%;
  margin-top: 50%;
  background: linear-gradient(90deg, var(--sw-card) 50%, var(--sw-accent) 50%);
}

.theme-dot:hover {
  transform: scale(1.1);
}

.theme-dot[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--accent);
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.theme-choice {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 3px solid var(--edge);
  border-radius: 20px;
  color: var(--text);
  background: var(--deep);
  text-align: left;
}

.theme-choice[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--accent);
}

.theme-preview {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 78px;
  padding: 10px;
  border: 3px solid var(--edge);
  border-radius: 14px;
  background: var(--sw-bg);
}

.theme-preview i {
  display: block;
  flex: 1;
  border: 2px solid var(--edge);
  border-radius: 8px 8px 0 0;
  background: var(--sw-card);
}

.theme-preview i:nth-child(1) {
  height: 55%;
}

.theme-preview i:nth-child(2) {
  height: 100%;
  background: var(--sw-accent);
}

.theme-preview i:nth-child(3) {
  height: 38%;
}

.theme-choice strong {
  font-family: "Lilita One", cursive;
  font-size: 1.15rem;
  font-weight: 400;
}

.theme-choice small {
  color: var(--soft);
  font-weight: 700;
}

/* ---------- topbar & botões ---------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h2,
.panel h3,
.dialog-heading h3 {
  margin: 0;
  font-family: "Lilita One", cursive;
  font-weight: 400;
  line-height: 1.05;
}

.topbar h2 {
  margin-top: 8px;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.primary-button,
.secondary-button,
.icon-button,
.edit-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 3px solid var(--edge);
  border-radius: 16px;
  color: var(--ink);
  background: var(--accent);
  box-shadow: 0 5px 0 var(--edge);
  font-family: "Lilita One", cursive;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.edit-button:hover,
.danger-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--edge);
}

.primary-button:active,
.secondary-button:active,
.icon-button:active,
.edit-button:active,
.danger-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--edge);
}

.secondary-button,
.icon-button {
  color: var(--text);
  background: var(--card2);
}

.icon-button {
  width: 48px;
  padding: 0;
}

.file-button input {
  display: none;
}

.edit-button,
.danger-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 1rem;
  box-shadow: 0 4px 0 var(--edge);
}

.edit-button {
  background: var(--a2);
}

.danger-button {
  background: var(--danger);
}

/* ---------- views & painéis ---------- */

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi,
.panel {
  border: 3px solid var(--edge);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 6px 0 var(--edge);
}

.kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.kpi-icon {
  display: grid;
  width: 56px;
  height: 56px;
  flex: none;
  place-items: center;
  border: 3px solid var(--edge);
  border-radius: 18px;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--edge);
}

.kpi-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi:nth-child(1) .kpi-icon {
  background: var(--a2);
}

.kpi:nth-child(2) .kpi-icon {
  background: var(--accent);
}

.kpi:nth-child(3) .kpi-icon {
  background: #ff9a4d;
}

.kpi:nth-child(4) .kpi-icon {
  background: var(--a3);
}

.kpi span {
  display: block;
  color: var(--soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.kpi strong {
  display: block;
  font-family: "Lilita One", cursive;
  font-size: 2.7rem;
  font-weight: 400;
  line-height: 1;
}

.dashboard-grid,
.settings-grid,
.avatar-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 24px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 22px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading > div {
  display: grid;
  gap: 6px;
}

.panel h3 {
  font-size: 1.75rem;
}

.score-pill,
.month-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 3px solid var(--edge);
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent);
  font-size: 0.95rem;
  font-weight: 900;
  white-space: nowrap;
}

.month-tag {
  background: var(--a2);
}

.empty {
  padding: 22px;
  border: 3px dashed var(--field);
  border-radius: 18px;
  color: var(--soft);
  font-weight: 800;
  text-align: center;
}

/* ---------- avatar ---------- */

.avatar {
  --av: 200px;
  position: relative;
  width: var(--av);
  aspect-ratio: 5 / 6;
  flex: none;
}

.avatar-art,
.avatar-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-svg {
  overflow: visible;
}

.avatar-level-badge {
  display: none;
  position: absolute;
  top: 8px;
  right: -6px;
  z-index: 3;
  min-width: 62px;
  height: 32px;
  place-items: center;
  border: 3px solid var(--edge);
  border-radius: 999px;
  color: var(--ink);
  background: var(--a2);
  font-family: "Lilita One", cursive;
  font-size: 0.95rem;
}

.avatar-stage .avatar-level-badge {
  display: grid;
}

.avatar-level-4 .avatar-level-badge {
  background: var(--accent);
}

.avatar-level-5 .avatar-level-badge {
  background: var(--a3);
}

.avatar-stage {
  position: relative;
  display: flex;
  min-height: 320px;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 34px;
  overflow: hidden;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: radial-gradient(circle at 50% 62%, var(--stage-a) 0, var(--stage-b) 48%, var(--stage-c) 100%);
}

.avatar-stage::before {
  content: "";
  position: absolute;
  bottom: 16px;
  left: 50%;
  width: min(270px, 72%);
  height: 42px;
  border: 3px solid var(--edge);
  border-radius: 50%;
  background: var(--deep);
  transform: translateX(-50%);
}

.avatar-stage .avatar {
  --av: 240px;
  z-index: 1;
}

.avatar-stage.large {
  min-height: 390px;
  margin: 14px 0;
}

.avatar-stage.large .avatar {
  --av: 290px;
}

@media (prefers-reduced-motion: no-preference) {
  .avatar-stage .avatar-art {
    animation: idle 3s ease-in-out infinite;
    transform-origin: 50% 100%;
  }

  @keyframes idle {
    0%,
    100% {
      transform: translateY(0) scale(1, 1);
    }
    50% {
      transform: translateY(-5px) scale(1.01, 0.995);
    }
  }
}

/* ---------- pódio ---------- */

.podium {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 4px 4px 0;
}

.podium-col {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.podium-col .avatar {
  --av: 116px;
}

.podium-col.is-first .avatar {
  --av: 138px;
}

.podium-name {
  max-width: 100%;
  overflow: hidden;
  font-family: "Lilita One", cursive;
  font-size: 1.3rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-block {
  display: flex;
  width: 100%;
  margin-top: 6px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--edge);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  color: #1b1340;
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.35);
}

.podium-block strong {
  font-family: "Lilita One", cursive;
  font-size: 2.6rem;
  font-weight: 400;
  line-height: 1;
}

.podium-block span {
  font-size: 0.95rem;
  font-weight: 900;
}

.place-1 {
  background: var(--gold);
}

.place-2 {
  background: var(--silver);
}

.place-3 {
  background: var(--bronze);
}

/* ---------- ranking ---------- */

.mini-ranking,
.ranking-list,
.score-list,
.student-list,
.criteria-list {
  display: grid;
  gap: 12px;
}

.rank-row,
.score-row,
.student-row,
.criterion-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: var(--deep);
}

.rank-place {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 3px solid var(--edge);
  border-radius: 50%;
  color: #fff;
  background: var(--card2);
  font-family: "Lilita One", cursive;
  font-size: 1.35rem;
}

.rank-place.p1,
.rank-place.p2,
.rank-place.p3 {
  color: #1b1340;
}

.rank-place.p1 {
  background: var(--gold);
}

.rank-place.p2 {
  background: var(--silver);
}

.rank-place.p3 {
  background: var(--bronze);
}

.rank-avatar .avatar,
.row-avatar .avatar {
  --av: 52px;
}

.rank-body {
  min-width: 140px;
  flex: 1 1 160px;
}

.rank-name,
.student-name,
.criterion-name {
  font-size: 1.1rem;
  font-weight: 900;
}

.student-meta,
.item-meta,
.wallet {
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.progress,
.xp-track {
  height: 16px;
  margin-top: 8px;
  overflow: hidden;
  border: 3px solid var(--edge);
  border-radius: 999px;
  background: var(--bg);
}

.progress span,
.xp-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18);
  transition: width 360ms ease;
}

/* ---------- pontuar ---------- */

.score-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  align-items: start;
}

.score-row {
  flex-direction: column;
  align-items: stretch;
  padding: 16px;
  background: var(--card);
}

.score-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.score-head .avatar {
  --av: 64px;
}

.score-head > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.score-head .student-name {
  font-family: "Lilita One", cursive;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
}

.today-badge {
  padding: 8px 14px;
  border: 3px solid var(--edge);
  border-radius: 16px;
  color: var(--soft);
  background: var(--deep);
  font-family: "Lilita One", cursive;
  font-size: 1.5rem;
  line-height: 1;
  white-space: nowrap;
}

.today-badge.has-points {
  color: var(--ink);
  background: var(--ok);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px 0 10px;
  border: 3px solid var(--field);
  border-radius: 16px;
  background: var(--deep);
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease;
}

.check-pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.check-box {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border: 3px solid var(--field);
  border-radius: 50%;
  background: var(--bg);
}

.check-box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.check-xp {
  font-family: "Lilita One", cursive;
  font-size: 1.1rem;
}

.check-pill:has(input:checked) {
  border-color: var(--edge);
  color: var(--ink);
  background: var(--ok);
  box-shadow: 0 4px 0 var(--edge);
}

.check-pill:has(input:checked) .check-box {
  border-color: var(--edge);
  background: #fff;
}

.check-pill:has(input:checked) .check-box svg {
  opacity: 1;
}

.check-pill:active {
  transform: translateY(2px);
}

/* ---------- lojinha ---------- */

.student-pick {
  margin-bottom: 4px;
}

.avatar-profile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.profile-stat {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 3px solid var(--edge);
  border-radius: 16px;
  background: var(--deep);
}

.profile-stat span,
.next-level,
.achievement small {
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.profile-stat strong {
  font-family: "Lilita One", cursive;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
}

.xp-track {
  grid-column: 1 / -1;
  height: 22px;
  margin: 0;
}

.next-level {
  grid-column: 1 / -1;
}

.achievement-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.achievement {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 3px solid var(--edge);
  border-radius: 16px;
  background: var(--deep);
}

.achievement > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 3px solid var(--edge);
  border-radius: 50%;
  color: var(--soft);
  background: var(--bg);
  font-weight: 900;
}

.achievement.is-unlocked {
  background: color-mix(in srgb, var(--ok) 30%, var(--deep));
}

.achievement.is-unlocked > span {
  color: var(--ink);
  background: var(--ok);
}

.achievement strong,
.achievement small {
  display: block;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.shop-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: var(--deep);
}

.shop-icon {
  position: relative;
  display: grid;
  height: 150px;
  place-items: center;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 56%, var(--stage-a) 0, var(--stage-b) 80%);
}

.shop-icon .avatar {
  --av: 108px;
}

.shop-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 10px;
  border: 3px solid var(--edge);
  border-radius: 999px;
  color: var(--ink);
  background: var(--a3);
  font-size: 0.75rem;
  font-weight: 900;
}

.shop-tag.is-owned {
  background: var(--a2);
}

.shop-tag.is-worn {
  background: var(--ok);
}

.shop-price {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: "Lilita One", cursive;
  font-size: 1.3rem;
}

.shop-price svg {
  width: 24px;
  height: 24px;
}

.shop-card button {
  min-height: 44px;
  border: 3px solid var(--edge);
  border-radius: 14px;
  color: var(--ink);
  background: var(--accent);
  box-shadow: 0 4px 0 var(--edge);
  font-family: "Lilita One", cursive;
  font-size: 1.1rem;
}

.shop-card button.is-worn {
  color: var(--text);
  background: var(--card2);
}

.shop-card button.is-owned {
  background: var(--a2);
}

.shop-card button:disabled {
  color: var(--soft);
  background: var(--bg);
  box-shadow: none;
}

/* ---------- diálogos ---------- */

dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 0;
  border: 3px solid var(--edge);
  border-radius: 28px;
  color: var(--text);
  background: var(--card);
  box-shadow: 0 8px 0 var(--edge);
}

#studentDialog {
  width: min(1040px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(8, 4, 24, 0.7);
}

.dialog-card {
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 40px);
  padding: 24px;
  overflow-y: auto;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-heading h3 {
  font-size: 2rem;
}

.dialog-card label {
  display: grid;
  gap: 10px;
  color: var(--eyebrow);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.skin-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skin-choice {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 78px;
  padding: 8px 6px;
  border: 3px solid var(--edge);
  border-radius: 16px;
  color: var(--text);
  background: var(--deep);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.skin-choice span {
  display: block;
  width: 34px;
  height: 34px;
  border: 3px solid var(--edge);
  border-radius: 50%;
}

.skin-choice.is-selected,
.avatar-choice.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--accent);
}

.avatar-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.avatar-choice {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 10px 14px;
  border: 3px solid var(--edge);
  border-radius: 20px;
  color: var(--text);
  background: var(--deep);
  text-align: center;
  letter-spacing: 0;
  text-transform: none;
}

.avatar-choice .avatar {
  --av: 120px;
}

.avatar-choice strong {
  font-size: 0.95rem;
  line-height: 1.15;
}

.avatar-choice small {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.avatar-choice-dot {
  width: 14px;
  height: 14px;
  border: 3px solid var(--edge);
  border-radius: 50%;
}

/* ---------- responsivo ---------- */

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px 16px 0;
    overflow: visible;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 58px;
    padding: 6px 2px;
    font-size: 0.72rem;
    text-align: center;
  }

  .meeting-card {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 16px;
  }

  .podium-col .avatar {
    --av: 82px;
  }

  .podium-col.is-first .avatar {
    --av: 100px;
  }

  .avatar-stage .avatar {
    --av: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- modos (admin / juvenil) ---------- */

[data-role="player"] [data-admin-only] {
  display: none !important;
}

.mode-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 5px 0 var(--edge);
}

.mode-card strong {
  font-family: "Lilita One", cursive;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
}

.mode-card .secondary-button {
  min-height: 42px;
  font-size: 1rem;
}

[data-role="admin"] .mode-card strong {
  color: var(--accent);
}

.hint {
  margin: 12px 0 0;
  color: var(--soft);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.field-label {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--eyebrow);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#settingsView input[type="number"],
#settingsView input[type="password"],
#pinDialog input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 3px solid var(--field);
  border-radius: 14px;
  color: var(--text);
  background: var(--deep);
  font-weight: 800;
}

.dialog-error {
  margin: 0;
  color: var(--danger);
  font-weight: 900;
}

#scoreView .panel + .panel {
  margin-top: 24px;
}

/* ---------- quiz ---------- */

.quiz-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 12px;
}

.quiz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: var(--deep);
}

.quiz-row .avatar {
  --av: 56px;
}

.quiz-name {
  flex: 1 1 110px;
  min-width: 0;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-btn {
  width: 44px;
  height: 44px;
  border: 3px solid var(--edge);
  border-radius: 14px;
  color: var(--ink);
  background: var(--a2);
  box-shadow: 0 4px 0 var(--edge);
  font-family: "Lilita One", cursive;
  font-size: 1.6rem;
  line-height: 1;
}

.step-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--edge);
}

.stepper input {
  width: 64px;
  min-height: 44px;
  padding: 0 4px;
  border: 3px solid var(--field);
  border-radius: 14px;
  color: var(--text);
  background: var(--bg);
  font-family: "Lilita One", cursive;
  font-size: 1.4rem;
  text-align: center;
}

/* ---------- minha pontuação ---------- */

.history-list {
  display: grid;
  gap: 10px;
}

.history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 16px;
  border: 3px solid var(--edge);
  border-radius: 18px;
  background: var(--deep);
}

.history-date {
  min-width: 90px;
  font-family: "Lilita One", cursive;
  font-size: 1.2rem;
  text-transform: capitalize;
}

.history-detail {
  flex: 1 1 160px;
  min-width: 0;
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

.history-detail b {
  color: var(--text);
}

@media (max-width: 980px) {
  .nav {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
}

/* ---------- aviso de sincronização ---------- */

.sync-status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 16px;
  border: 3px solid var(--edge);
  border-radius: 16px;
  color: var(--ink);
  background: var(--danger);
  box-shadow: 0 5px 0 var(--edge);
  font-weight: 900;
}

.sync-status.is-info {
  background: var(--a2);
}

/* ---------- entrada por código ---------- */

[data-role="guest"] .shell,
:root:not([data-role="guest"]) .login-screen {
  display: none;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(440px, 100%);
  padding: 28px;
  border: 3px solid var(--edge);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 8px 0 var(--edge);
}

.login-card h2 {
  margin: 4px 0 0;
  font-family: "Lilita One", cursive;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1;
}

.login-card .hint {
  margin: 0;
}

.login-card .field-label {
  margin: 0;
}

.code-input {
  width: 100%;
  min-height: 64px;
  padding: 0 12px;
  border: 3px solid var(--field);
  border-radius: 16px;
  color: var(--text);
  background: var(--deep);
  font-family: "Lilita One", cursive;
  font-size: 2rem;
  letter-spacing: 0.4em;
  text-align: center;
}

.link-button {
  min-height: 44px;
  border: 0;
  color: var(--soft);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
}

.student-code {
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.student-code b {
  padding: 2px 8px;
  border: 2px solid var(--edge);
  border-radius: 8px;
  color: var(--ink);
  background: var(--accent);
  font-family: "Lilita One", cursive;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}
