:root {
  --bg: #15161a;
  --panel: #1d1f25;
  --text: #ece8df;
  --muted: #8d8f99;
  --accent: #e9c46a;
  --check: #ff6b5b;
  --clock-on-bg: #f4f1e8;
  --clock-on-fg: #15161a;
  --green: #81b64c;
  --green-dark: #5d8c35;
  --surface: #23252c;
  --surface-2: #2c2f37;
  /* Espaço mínimo reservado aos painéis — o tabuleiro fica com o resto. */
  --panel-h: 52px;
  --panel-w: 120px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* "hidden" sempre esconde, mesmo em elementos com display próprio (labels, botões…). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* O tabuleiro pega o máximo possível; os painéis dividem a sobra.
   --board-ratio (largura/altura do tabuleiro na tela) é calculado pelo app. */
#board-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: min(calc(100vw / var(--board-ratio, 1.1)), calc(100vh - 2 * var(--panel-h)));
  height: min(calc(100vw / var(--board-ratio, 1.1)), calc(100dvh - 2 * var(--panel-h)));
  min-width: 0;
  min-height: 0;
}

#board-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- Painéis dos jogadores ---------- */
.panel {
  flex: 1 1 var(--panel-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 14px;
  background: var(--panel);
  transition: background .25s;
}
.panel.flip { transform: rotate(180deg); }
.panel.active { background: #2a2c33; }

.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.piece-icon { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #8d8f99; }
.panel[data-color="w"] .piece-icon { background: #f1e6d0; }
.panel[data-color="b"] .piece-icon { background: #111; }
.name {
  font-size: clamp(16px, 2.4vmin, 24px);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status { color: var(--check); font-weight: 700; font-size: clamp(16px, 2.2vmin, 24px); }

.clock {
  font-variant-numeric: tabular-nums;
  font-size: clamp(22px, 3.8vmin, 38px);
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 10px;
  background: #0f1013;
  color: var(--muted);
  min-width: 4.2em;
  text-align: center;
  transition: background .25s, color .25s;
}
.panel.active .clock { background: var(--clock-on-bg); color: var(--clock-on-fg); }
.panel.active .clock.low { background: var(--check); color: #fff; }
.clock.off { visibility: hidden; }

/* Paisagem: painéis viram colunas laterais */
@media (orientation: landscape) {
  body { flex-direction: row; }
  #board-wrap {
    height: 100%;
    width: min(calc(100vh * var(--board-ratio, 1.1)), calc(100vw - 2 * var(--panel-w)));
    width: min(calc(100dvh * var(--board-ratio, 1.1)), calc(100vw - 2 * var(--panel-w)));
  }
  .panel {
    flex: 1 1 var(--panel-w);
    flex-direction: column;
    justify-content: center;
    padding: 12px 8px;
  }
  .clock { min-width: 0; width: 100%; max-width: 4.2em; }
  .menu-btn { margin: 0; }
  .who { flex-direction: column; text-align: center; max-width: 100%; }
  .name { max-width: 100%; }
}

/* ---------- Botão de menu ---------- */
.menu-btn {
  flex: 0 0 auto;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #33363f;
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 11, 14, .72);
  backdrop-filter: blur(4px);
}
.overlay[hidden] { display: none; }
#setup { background: var(--bg); }

.card {
  width: min(460px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.card.flip { transform: rotate(180deg); }
.card h1 { margin: 0 0 6px; font-size: 32px; }
.card h2 { margin: 0; font-size: 26px; }
.card p { margin: 0; color: var(--muted); }

label { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 14px; color: var(--muted); flex: 1; }
.row { display: flex; gap: 12px; }

input, select {
  font: inherit;
  font-size: 18px;
  color: var(--text);
  background: #0f1013;
  border: 1px solid #33363f;
  border-radius: 10px;
  padding: 12px;
}

fieldset { border: 1px solid #33363f; border-radius: 10px; padding: 8px 12px 12px; text-align: left; }
legend { color: var(--muted); font-size: 14px; padding: 0 6px; }
label.radio { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 16px; padding: 6px 0; }
label.radio input { width: 20px; height: 20px; }

button {
  font: inherit;
  font-size: 18px;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  background: #2c2f37;
  color: var(--text);
  cursor: pointer;
}
button:active { transform: scale(.98); }
/* Botão principal verde "de tabuleiro", com sombra embaixo (estilo chess.com). */
button.primary { background: var(--green); color: #fff; font-weight: 800; box-shadow: 0 4px 0 var(--green-dark); }
button.primary:active { box-shadow: 0 1px 0 var(--green-dark); transform: translateY(3px); }
button.secondary { background: transparent; border: 1px solid #3a3d46; }
button.danger { color: var(--check); }

.menu button { width: 100%; }

/* Seletor 3D / 2D */
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; flex-direction: row; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #33363f;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}
.seg input:checked + span { border-color: var(--accent); background: #353843; }
.seg span { font-size: 16px; }
#bot-options { margin-top: 12px; }
#bot-options[hidden], #label-black[hidden] { display: none; }

/* ---------- Tela inicial: casca de app ---------- */
[data-icon] { display: inline-block; flex: 0 0 auto; }
[data-icon] svg { width: 100%; height: 100%; display: block; }

#setup {
  display: block; padding: 0; background: var(--bg); backdrop-filter: none;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.shell { min-height: 100%; display: grid; grid-template-columns: 230px minmax(0, 1fr); }

.sidenav {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 10px;
  background: #1a1b20; border-right: 1px solid #262830; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; padding: 4px 10px 18px; cursor: pointer; border-radius: 10px; }
.brand:hover { opacity: .85; }
.logo { width: 38px; height: 38px; background: center / contain no-repeat; }
.sidenav button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: transparent; font-size: 17px; text-align: left; color: #d8d5cf;
}
.sidenav button:hover { background: #26282f; }
.sidenav button.on { background: #2c2f37; color: #fff; }
.sidenav button [data-icon] { width: 30px; height: 30px; }
.side-bottom { margin-top: auto; }
.sidenav .support { color: #ffb3b5; }

.home-main {
  width: 100%; max-width: 1000px; margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 48px) 40px;
  display: flex; flex-direction: column; gap: 20px;
}
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.mobile-only { display: none; }
.whoami {
  flex-direction: row; align-items: center; gap: 8px; flex: 0 1 280px;
  padding: 4px 8px 4px 4px; border-radius: 999px; background: var(--surface); color: var(--text);
}
.whoami input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 4px; font-size: 16px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #1b1b1b; font-weight: 800; font-size: 17px;
}

#setup [data-panel][hidden] { display: none; }

/* Conta Google */
.top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.google-slot { min-height: 40px; display: flex; align-items: center; }
.cloud-badge { font-size: 16px; padding-right: 4px; }
.whoami input { border: 0 !important; outline: none; }
.whoami input[readonly] { cursor: pointer; pointer-events: none; font-weight: 700; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.account-card { padding: 18px; border-radius: 16px; background: var(--surface); }
.account-out { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.account-out h3, .account-in h3 { margin: 0 0 4px; font-size: 18px; color: var(--text); text-transform: none; letter-spacing: 0; }
.account-out p, .account-in p { margin: 0; color: var(--muted); line-height: 1.4; }
.account-in { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.account-photo { width: 56px; height: 56px; border-radius: 50%; background: #15161a; }
.account-info { flex: 1; min-width: 180px; }
.account-sync { margin-top: 4px !important; font-size: 13px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-in p { margin: 0 0 10px; }

/* Minha conta */
#account-page-in { display: flex; flex-direction: column; gap: 14px; }
#account-page-in[hidden] { display: none; }
.big-emoji { font-size: 44px; width: 54px; text-align: center; }
.profile-head { display: flex; align-items: center; gap: 18px; padding: 8px 0; }
.profile-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: var(--surface); box-shadow: 0 0 0 3px var(--green); }
.profile-head h2 { margin: 0; font-size: 28px; }
.profile-head p { margin: 2px 0 0; color: var(--muted); }
.profile-badge { display: inline-flex !important; align-items: center; gap: 6px; margin-top: 8px !important;
  padding: 3px 10px; border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--text) !important; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.account-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--text); text-transform: none; letter-spacing: 0; }
.account-card p { color: var(--muted); line-height: 1.45; margin: 0 0 12px; }
.account-card a { color: var(--accent); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.mini-stats div { padding: 10px; border-radius: 10px; background: #15161a; }
.mini-stats b { display: block; font-size: 20px; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.muted-line { font-size: 13px; }
.danger-zone { border: 1px solid #5a2a2a; background: #2a1d1f; }
.danger-btn { background: #c0392b; color: #fff; font-weight: 700; }
.avatar.mini { width: 30px; height: 30px; font-size: 14px; }
.whoami.clickable { cursor: pointer; }
.whoami.clickable:hover { background: var(--surface-2); }
section[data-panel], #setup-form { display: flex; flex-direction: column; gap: 16px; }
.panel-title { display: flex; align-items: center; gap: 14px; }
.panel-title [data-icon] { width: 54px; height: 54px; }
.panel-title h2 { margin: 0; font-size: 28px; }
.panel-title p { margin: 2px 0 0; color: var(--muted); }

button.big { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 19px; padding: 16px 24px; border-radius: 14px; }
button.big [data-icon] { width: 30px; height: 30px; }
button i[data-icon] { width: 26px; height: 26px; vertical-align: middle; margin-right: 8px; }

/* Início */
.hero { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 32px; align-items: center; }
.mini-board {
  width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr);
  border-radius: 12px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.mini-board div { background: center / 86% no-repeat; }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 4.4vw, 50px); line-height: 1.08; }
.hero h1 span { color: var(--green); }
.hero p { margin: 0 0 22px; font-size: 17px; line-height: 1.5; color: #c9c6bf; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; }

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feature {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 20px; border-radius: 18px; background: var(--surface);
}
.feature.wide { grid-column: 1 / -1; }
.feature > [data-icon] { width: 54px; height: 54px; }
.feature h2 { margin: 0; font-size: 21px; }
.feature p { margin: 0; flex: 1; color: var(--muted); line-height: 1.4; }
.feature button { margin-top: 6px; }
.feature-head { display: flex; align-items: center; gap: 14px; }
.feature-head [data-icon] { width: 58px; height: 58px; }
.feature-head p { margin-top: 4px; }

/* Personagens do computador */
.bot-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0; }
.bot-face {
  width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
  font-size: 36px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .22);
}
.bot-card { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.bot-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 10px; }
.bot-pick button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px;
  border: 2px solid transparent; background: #15161a; font-size: 14px; font-weight: 700;
}
.bot-pick button.on { border-color: var(--green); background: #1f2b17; }
.bot-pick small { color: var(--muted); font-size: 11px; font-weight: 400; text-align: center; line-height: 1.2; }
.bot-pick .bot-face { width: 52px; height: 52px; font-size: 30px; border-radius: 14px; }

.seg.opp span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.seg.opp i[data-icon] { width: 36px; height: 36px; margin: 0; }
.seg.opp small { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.2; }
/* Visual 2D/3D: subtítulo e selo "sugerido" */
.seg span small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.tag-sug {
  font-style: normal; font-size: 11px; font-weight: 800; vertical-align: middle;
  padding: 1px 7px; border-radius: 999px; background: var(--green); color: #fff;
}
.seg input:checked + span { border-color: var(--green); background: #1f2b17; }
.continue-list { display: flex; flex-wrap: wrap; gap: 10px; }
.continue-list button { flex: 1 1 240px; font-size: 17px; }
.continue-list:not(:has(button:not([hidden]))) { display: none; }

.info-box, #stats { display: flex; flex-direction: column; gap: 6px; text-align: left; }
#stats h3 { margin-top: 10px; }
.stat {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface);
}
.stat span { color: var(--muted); }
.stat.link { cursor: pointer; }

/* Assistir (Twitch) */
.watch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.live {
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: var(--surface); color: var(--text); text-decoration: none; transition: transform .15s;
}
.live:hover { transform: translateY(-2px); }
.live-thumb { position: relative; aspect-ratio: 16 / 9; background: #0e0e10 center / cover no-repeat; }
.live-badge {
  position: absolute; top: 8px; left: 8px; padding: 1px 6px; border-radius: 4px;
  background: #eb0400; color: #fff; font-size: 12px; font-weight: 800;
}
.live-viewers {
  position: absolute; bottom: 8px; left: 8px; padding: 1px 6px; border-radius: 4px;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px;
}
.live-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-body b { display: flex; align-items: center; gap: 6px; }
.live-body small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-lang { font-size: 11px; padding: 0 5px; border-radius: 4px; background: #2f3239; color: #cfcfcf; font-weight: 700; }
.live-lang.pt { background: #1f6e3a; color: #fff; }
.watch-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button-link {
  display: inline-flex; align-items: center; padding: 14px 18px; border-radius: 12px;
  background: #9146ff; color: #fff; font-weight: 700; text-decoration: none;
}
.watch-note { margin: 0; font-size: 12px; color: var(--muted); }
.watch-empty { padding: 20px; border-radius: 14px; background: var(--surface); color: var(--muted); line-height: 1.5; }

/* Aulas */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lesson {
  display: flex; align-items: center; gap: 14px; padding: 14px; text-align: left;
  border-radius: 16px; background: var(--surface); position: relative;
}
.lesson.first { grid-column: 1 / -1; background: linear-gradient(135deg, #2b3a1f, var(--surface)); border: 2px solid var(--green); }
.lesson.first::after {
  content: 'Comece aqui'; position: absolute; top: -10px; right: 14px; padding: 2px 10px;
  border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 800;
}
.lesson.done { opacity: .8; }
.lesson-icon {
  width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center;
  font-size: 28px; border-radius: 12px; background: #15161a;
}
.lesson-icon [data-icon] { width: 36px; height: 36px; }
.lesson-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lesson-body b { font-size: 17px; }
.lesson-body small { color: var(--muted); font-size: 13px; }
.bar { height: 6px; border-radius: 3px; background: #15161a; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green); }

/* Celular e tablet em pé: barra de navegação embaixo, como num app */
@media (max-width: 899px), (orientation: portrait) and (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid #262830;
  }
  .sidenav .brand, .side-bottom { display: none; }
  .sidenav button { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; text-align: center; }
  .sidenav button [data-icon] { width: 28px; height: 28px; }
  .home-main { padding-bottom: 100px; }
  .mobile-only { display: flex; }
  .topbar { justify-content: space-between; }
  .topbar .brand { padding: 0; font-size: 20px; }
  .whoami { flex: 0 1 220px; }
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; gap: 22px; }
  .mini-board { max-width: 320px; margin: 0 auto; }
  .hero-buttons { justify-content: center; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Sorteio ---------- */
.draw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.draw-side {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border-radius: 12px; background: #15161a; transition: transform .1s, box-shadow .3s;
}
.draw-side b { font-size: 20px; }
.draw-side small { color: var(--muted); font-size: 12px; }
.draw-side .piece-icon { width: 34px; height: 34px; }
.draw-side.spin { transform: scale(.94); }
.draw-side.winner { box-shadow: 0 0 0 3px var(--accent); }
.piece-icon.w { background: #f1e6d0; }
.piece-icon.b { background: #111; }

/* ---------- Avisos ---------- */
#sheet .card { text-align: center; }
#sheet-text { font-size: 17px; color: var(--text); line-height: 1.4; }
.sheet-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sheet-buttons button { flex: 1 1 160px; }
#result-extra { color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--panel-h) + 24px); transform: translateX(-50%);
  z-index: 30; max-width: 90vw; padding: 10px 18px; border-radius: 999px;
  background: rgba(20, 21, 26, .92); color: #fff; font-size: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  pointer-events: none;
}
#toast[hidden] { display: none; }
#btn-hint + #btn-menu { margin-left: 0; }

/* ---------- Rodapé: créditos e doação ---------- */
.credits {
  margin-top: 12px; padding: 20px; border-radius: 18px; background: var(--surface);
  display: flex; flex-direction: column; gap: 14px; font-size: 14px; color: var(--muted);
}
.credits p { margin: 0; line-height: 1.45; }
.credits h3 { margin: 0 0 4px; font-size: 18px; color: var(--text); text-transform: none; letter-spacing: 0; }
.credits a { color: var(--accent); text-decoration: none; }
.credits a:hover { text-decoration: underline; }
.donate { display: flex; align-items: flex-start; gap: 14px; }
.donate [data-icon] { width: 44px; height: 44px; }
.made-by { text-align: center; font-size: 13px; }
.pix {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px; background: #15161a; border: 1px dashed #4a4d57;
}
.pix span { font-size: 16px; font-weight: 700; color: var(--text); }
.pix small { color: var(--muted); }

/* ---------- Online ---------- */
#online-options[hidden] { display: none; }
#online-options { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.hint-text { margin: 0; font-size: 14px; color: var(--muted); text-align: left; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; }
.room-code {
  font-size: 48px; font-weight: 800; letter-spacing: .25em; padding: 10px;
  border-radius: 14px; background: #15161a; color: var(--accent);
}
.waiting-dots { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Revisão da partida ---------- */
body.reviewing { --panel-h: 124px; --panel-w: 240px; }
body:not(.reviewing) .review-info,
body:not(.reviewing) .review-bar { display: none; }
body.reviewing .panel > :not(.review-info):not(.review-bar) { display: none; }
body.reviewing .panel { justify-content: center; }
.review-info { width: 100%; text-align: center; font-size: clamp(15px, 2.2vmin, 20px); line-height: 1.35; }
.review-info .tag { font-weight: 700; }
.review-bar { width: 100%; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.review-moves {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.review-moves::-webkit-scrollbar { display: none; }
.review-moves .no { color: var(--muted); font-size: 13px; align-self: center; padding-left: 4px; }
.review-moves button {
  flex: 0 0 auto; padding: 6px 9px; font-size: 15px; border-radius: 8px;
  background: #15161a; border: 2px solid transparent;
}
.review-moves button.on { border-color: var(--accent); background: #353843; }
.review-controls { display: flex; gap: 6px; }
.review-controls button { flex: 1; padding: 10px 4px; font-size: 18px; }
.review-controls .rv-analyze, .review-controls .rv-exit { flex: 1.6; font-size: 15px; }
/* Professor falando */
.coach { display: flex; align-items: flex-start; gap: 10px; text-align: left; max-width: 640px; margin: 0 auto; }
.coach-face { font-size: 34px; line-height: 1; }
.bubble {
  position: relative; flex: 1; background: #f4f1e8; color: #1b1b1b;
  border-radius: 14px; padding: 8px 12px; font-size: clamp(14px, 2vmin, 17px);
}
.bubble::before {
  content: ''; position: absolute; left: -8px; top: 12px;
  border: 8px solid transparent; border-right-color: #f4f1e8; border-left: 0;
}
.bubble small { color: #555; }
.bubble .tag { font-weight: 800; white-space: nowrap; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 4px; font-size: 13px; }
.q-icon {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 3px; margin: 0 2px 0 4px;
  border-radius: 9px; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle;
}
body.reviewing { --panel-h: 136px; }
@media (orientation: landscape) {
  .coach { flex-direction: column; align-items: center; }
  .bubble::before { display: none; }
  .summary { grid-template-columns: 1fr; }
}

/* Barra de avaliação */
#eval-bar {
  position: absolute; left: 4px; top: 6%; bottom: 6%; width: 14px; z-index: 2;
  border-radius: 4px; overflow: hidden; background: #3a3a3a; box-shadow: 0 0 0 1px rgba(0,0,0,.4);
  display: flex; flex-direction: column; justify-content: flex-end;
}
#eval-bar[hidden] { display: none; }
#eval-bar .fill { background: #f4f1e8; transition: height .4s ease; }
#eval-bar.flip { justify-content: flex-start; }
#eval-bar .val {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 9px; font-weight: 800; text-align: center; color: #888; writing-mode: vertical-rl;
}

/* Classificação dos lances */
.q-best { color: #5ad1ff; }
.q-good { color: #7ccf7c; }
.q-inacc { color: #f4d35e; }
.q-mistake { color: #f29e4c; }
.q-blunder { color: #ff5c5c; }
@media (orientation: landscape) {
  .review-bar { height: 100%; justify-content: center; }
  .review-moves { flex-wrap: wrap; overflow: auto; max-height: 60vh; }
  .review-controls { flex-wrap: wrap; }
  .review-controls button { flex: 1 1 40%; }
}

/* ---------- Temas ---------- */
.overlay.sheet { align-items: flex-end; background: rgba(10, 11, 14, .25); backdrop-filter: none; z-index: 20; }
.card.wide { width: min(760px, 100%); max-height: 62vh; text-align: left; }
.card h3 { margin: 4px 0 0; font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 15px;
  text-align: left;
  border: 2px solid transparent;
}
.chip.on { border-color: var(--accent); background: #353843; }
.swatch {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 4px solid;
  background-size: 50% 50%;
}
.swatch.round { border-radius: 50%; border: 1px solid #555; }
.preview { width: 38px; height: 38px; flex: 0 0 auto; }

.promo-row { display: flex; gap: 10px; justify-content: center; }
.promo-row button { font-size: 52px; width: 84px; height: 84px; padding: 0; line-height: 1; }
