/* ============================================================================
   WIZARD CHESS - UI: enter screen, menu, HUD, war panel, kill feed, medals,
   subtitles, modals, game over, cinematic overlays
   ============================================================================ */

:root {
  --gold: #e2bd5a;
  --gold-dim: rgba(218, 175, 68, 0.5);
  --ink: #f3ece0;
  --panel: rgba(12, 10, 12, 0.72);
  --w: #cfe0ff;
  --b: #ff6a4a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050404;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M3 2 L12 24 L15.5 15.5 L24 12 Z' fill='%23ffb800' stroke='%23221400' stroke-width='1.8' stroke-linejoin='round'/></svg>") 3 2, auto;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* ---------- cinematic overlays ---------- */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
#check-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(200, 0, 0, 0.55) 100%);
  transition: opacity 0.6s ease;
}
#check-flash.on {
  opacity: 1;
  transition: opacity 0.05s;
}
.letterbox {
  position: fixed;
  left: 0;
  right: 0;
  height: 11vh;
  background: #000;
  z-index: 18;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.letterbox.top {
  top: 0;
  transform: translateY(-100%);
}
.letterbox.bottom {
  bottom: 0;
  transform: translateY(100%);
}
body.killcam .letterbox {
  transform: translateY(0);
}
body.killcam .hud-topbar,
body.killcam .war-panel {
  opacity: 0;
  pointer-events: none;
}

/* ---------- enter screen ---------- */
#enter-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse at center, #1a1210 0%, #000 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 1.2s ease;
}
#enter-screen.fade {
  opacity: 0;
  pointer-events: none;
}
.enter-crest {
  font-size: 84px;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(226, 189, 90, 0.6);
  animation: breathe 3s ease-in-out infinite;
}
.enter-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(36px, 7vw, 76px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-shadow: 0 4px 30px rgba(226, 189, 90, 0.4);
}
.enter-sub {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.4em;
  color: #b9a57a;
  margin-top: 6px;
  font-size: 15px;
}
.enter-prompt {
  margin-top: 56px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.25em;
  font-size: 14px;
  color: #fff;
  animation: blink 1.8s ease-in-out infinite;
}
.enter-tip {
  margin-top: 18px;
  font-size: 12px;
  color: #8a7e6a;
}
@keyframes breathe {
  50% {
    transform: scale(1.06);
    text-shadow: 0 0 70px rgba(226, 189, 90, 0.9);
  }
}
@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

/* ---------- menu ---------- */
#menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 7vw;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 70%);
  animation: fadeIn 1.2s ease;
}
.menu-card {
  width: min(520px, 92vw);
}
.menu-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(34px, 5vw, 60px);
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 4px 30px rgba(226, 189, 90, 0.35);
}
.menu-sub {
  font-family: 'Cinzel', serif;
  color: #c9b48a;
  letter-spacing: 0.3em;
  margin-bottom: 34px;
}
.menu-row {
  margin-bottom: 18px;
}
.menu-label {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #a39276;
  margin-bottom: 7px;
}
.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.seg button {
  flex: 1;
  min-width: 120px;
  padding: 11px 12px;
  background: rgba(20, 17, 15, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ddd3c2;
  border-radius: 8px;
  font: 600 13px 'Inter', sans-serif;
  cursor: inherit;
  transition: all 0.18s;
}
.seg button:hover {
  border-color: var(--gold-dim);
}
.seg button.on {
  background: rgba(184, 138, 38, 0.32);
  border-color: var(--gold);
  color: #ffe08a;
  box-shadow: 0 0 18px rgba(226, 184, 78, 0.25);
}
.menu-start {
  margin-top: 16px;
  width: 100%;
  padding: 16px;
  font: 800 18px 'Cinzel', serif;
  letter-spacing: 0.22em;
  color: #1a1004;
  background: linear-gradient(180deg, #ffe08a, #c58f22);
  border: none;
  border-radius: 10px;
  cursor: inherit;
  box-shadow: 0 10px 40px rgba(226, 160, 40, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.menu-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 50px rgba(255, 190, 60, 0.55);
}
.menu-start.small {
  width: auto;
  padding: 13px 28px;
  font-size: 15px;
}
.menu-keys {
  margin-top: 26px;
  font-size: 11.5px;
  line-height: 1.8;
  color: #8f846f;
}
.menu-keys b {
  color: #d8c08a;
}
body.in-menu .hud-topbar,
body.in-menu .war-panel {
  display: none;
}

/* ---------- site hub: nav tabs, coming-soon panels, ad slots ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 7vw;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
}
.site-logo {
  font: 900 18px 'Cinzel Decorative', 'Cinzel', serif;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-right: 28px;
  text-shadow: 0 0 18px rgba(226, 189, 90, 0.35);
}
.nav-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font: 700 13px 'Cinzel', serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b9ab90;
  cursor: inherit;
  transition: color 0.18s, border-color 0.18s;
}
.nav-tab:hover {
  color: #ffe9b0;
}
.nav-tab.on {
  color: #ffe08a;
  border-bottom-color: var(--gold);
}
.menu-title.small {
  font-size: clamp(28px, 3.6vw, 44px);
}
.soon {
  font-size: 15px;
  line-height: 1.7;
  color: #d8cdb8;
  max-width: 460px;
}
.soon-badge {
  display: inline-block;
  margin-top: 22px;
  padding: 8px 16px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  font: 700 12px 'Cinzel', serif;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}
.enter-load {
  margin: 48px auto 0;
  font: 600 13px 'Cinzel', serif;
  letter-spacing: 0.22em;
  color: #b9a57a;
}
.enter-load .bar {
  width: 280px;
  height: 3px;
  margin: 12px auto 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.enter-load .bar div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8a6420, #ffe08a);
  transition: width 0.3s;
}
/* ads: hidden unless site.js turns them on (never during a battle) */
.ad-slot {
  display: none;
}
body.ads-on .ad-slot {
  display: block;
}
body.ads-on .ad-menu {
  position: fixed;
  right: 3vw;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  min-height: 250px;
}
body.ads-on .ad-gameover {
  margin: 18px auto 0;
  width: min(728px, 90vw);
  min-height: 90px;
}

/* ---------- top bar ---------- */
.hud-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 54px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(6, 5, 5, 0.9) 0%, rgba(6, 5, 5, 0.4) 75%, transparent 100%);
  z-index: 20;
  transition: opacity 0.3s ease;
}
body.ui-hidden .hud-topbar,
body.ui-hidden .war-panel,
body.ui-hidden #killfeed {
  opacity: 0;
  pointer-events: none;
}
.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.brand-title {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(230, 193, 90, 0.4);
  margin-right: 8px;
}
.turn-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.turn-status.check {
  border-color: #ff3b30;
  background: rgba(255, 40, 30, 0.18);
  color: #ffd2cc;
  animation: pulseRed 0.9s ease-in-out infinite;
}
@keyframes pulseRed {
  50% {
    box-shadow: 0 0 18px rgba(255, 50, 30, 0.6);
  }
}
.turn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.turn-dot.white {
  background: #fff;
  box-shadow: 0 0 10px #9cc0ff;
}
.turn-dot.black {
  background: var(--b);
  box-shadow: 0 0 10px var(--b);
}
.thinking {
  color: #c9b48a;
  font-style: italic;
  font-weight: 500;
}
.thinking span {
  animation: blink 1s infinite;
}
.thinking span:nth-child(2) {
  animation-delay: 0.2s;
}
.thinking span:nth-child(3) {
  animation-delay: 0.4s;
}
.hud-btn {
  appearance: none;
  background: rgba(20, 18, 16, 0.78);
  color: #e8e2d5;
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 6px 12px;
  border-radius: 7px;
  font: 600 12.5px 'Inter', sans-serif;
  cursor: inherit;
  transition: all 0.16s ease;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.hud-btn.icon {
  padding: 6px 10px;
  font-size: 14px;
}
.hud-btn:hover:not(:disabled) {
  background: rgba(52, 43, 28, 0.9);
  border-color: var(--gold-dim);
  color: #fff;
}
.hud-btn:disabled {
  opacity: 0.35;
}
.hud-btn.active {
  background: rgba(184, 138, 38, 0.32);
  border-color: var(--gold);
  color: #ffd978;
}
.hud-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- war panel ---------- */
.war-panel {
  position: fixed;
  left: 16px;
  top: 76px;
  bottom: 90px;
  width: 230px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.3s;
}
.army,
.history {
  background: var(--panel);
  border: 1px solid rgba(218, 175, 68, 0.22);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}
.army {
  padding: 9px 11px;
}
.army-head {
  font: 700 11px 'Cinzel', serif;
  letter-spacing: 0.12em;
  color: #cdb987;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mat {
  margin-left: auto;
  color: #9fe29a;
  font-family: 'Inter';
}
.captured {
  min-height: 26px;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -2px;
  margin-top: 4px;
  word-break: break-all;
}
.army-w .captured {
  color: #f0e6d0;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}
.army-b .captured {
  color: #f2d8cf;
  text-shadow: 0 0 6px rgba(255, 70, 40, 0.5);
}
.history-head {
  font: 700 10.5px 'Cinzel', serif;
  letter-spacing: 0.2em;
  color: #8f7f5f;
  padding: 4px 4px 0;
}
.history {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 6px 4px;
  font-size: 12.5px;
  counter-reset: mv;
}
.history li {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  padding: 2px 6px;
  border-radius: 4px;
}
.history li:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}
.history .n {
  color: #7d7262;
}
.history .cap {
  color: #ff9c86;
}
.history .chk {
  color: #ffd25a;
}
.history::-webkit-scrollbar {
  width: 6px;
}
.history::-webkit-scrollbar-thumb {
  background: rgba(218, 175, 68, 0.3);
  border-radius: 3px;
}
.faction-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.faction-dot.w {
  background: #fff;
  box-shadow: 0 0 8px #9cc0ff;
}
.faction-dot.b {
  background: var(--b);
  box-shadow: 0 0 8px var(--b);
}
.faction-dot.a {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* ---------- kill feed ---------- */
#killfeed {
  position: fixed;
  right: 18px;
  top: 76px;
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
.kf {
  background: rgba(10, 8, 10, 0.78);
  border-left: 3px solid var(--gold);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  animation: kfIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  transition: opacity 0.6s, transform 0.6s;
}
.kf.w {
  border-color: #9cc0ff;
}
.kf.b {
  border-color: var(--b);
}
.kf .x {
  color: #ff5a3a;
  margin: 0 6px;
}
.kf .p {
  font-size: 16px;
}
.kf.out {
  opacity: 0;
  transform: translateX(30px);
}
@keyframes kfIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ---------- medal (first blood, check...) ---------- */
.medal {
  position: fixed;
  top: 18vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  text-align: center;
  pointer-events: none;
}
.medal.show {
  animation: medalIn 2.6s ease forwards;
}
.medal-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(30px, 5vw, 58px);
  letter-spacing: 0.1em;
  color: #ffe08a;
  text-shadow: 0 0 30px rgba(255, 170, 40, 0.8), 0 4px 0 #5a3500;
}
.medal.red .medal-title {
  color: #ffb3a3;
  text-shadow: 0 0 30px rgba(255, 40, 20, 0.9), 0 4px 0 #4a0800;
}
.medal-sub {
  font: 700 14px 'Cinzel', serif;
  letter-spacing: 0.3em;
  color: #e8dcc0;
  margin-top: 4px;
}
@keyframes medalIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(2.4);
    filter: blur(8px);
  }
  12% {
    opacity: 1;
    transform: translateX(-50%) scale(0.95);
    filter: blur(0);
  }
  18% {
    transform: translateX(-50%) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.05) translateY(-10px);
  }
}

/* ---------- subtitles ---------- */
.subtitle {
  position: fixed;
  bottom: 13vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  max-width: min(760px, 92vw);
  text-align: center;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}
body:not(.killcam) .subtitle {
  bottom: 34px;
}
.sub-speaker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 11.5px 'Cinzel', serif;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 10px;
  border-radius: 4px;
}
.subtitle.w .sub-name {
  color: var(--w);
}
.subtitle.b .sub-name {
  color: #ffab94;
}
.sub-text {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 14px;
  border-radius: 6px;
  text-shadow: 0 2px 4px #000;
}
.voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 11px;
}
.voice-wave span {
  width: 2.5px;
  height: 100%;
  background: currentColor;
  border-radius: 2px;
  animation: wavePulse 0.6s infinite ease-in-out alternate;
}
.voice-wave span:nth-child(2) {
  animation-delay: 0.15s;
}
.voice-wave span:nth-child(3) {
  animation-delay: 0.3s;
}
.voice-wave span:nth-child(4) {
  animation-delay: 0.45s;
}
@keyframes wavePulse {
  from {
    transform: scaleY(0.3);
  }
  to {
    transform: scaleY(1.1);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 26;
  pointer-events: none;
  background: rgba(10, 8, 10, 0.88);
  border: 1px solid var(--gold-dim);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  transform: translate(14px, 14px);
}
.tooltip b {
  font-family: 'Cinzel', serif;
  color: var(--gold);
}

/* ---------- modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s;
}
.modal-card {
  background: linear-gradient(180deg, #1b1714, #110e0d);
  border: 1px solid #b8913a;
  border-radius: 14px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  max-width: 94vw;
}
.modal-card.wide {
  width: 520px;
  text-align: left;
}
.modal-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 20px;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.modal-sub {
  color: #a8997c;
  font-size: 13px;
  margin-bottom: 16px;
}
.promo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.promo-btn {
  padding: 12px 14px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 10px;
  color: #fff;
  font: 700 13px 'Inter';
  cursor: inherit;
  transition: all 0.16s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.promo-btn span {
  font-size: 34px;
  color: var(--gold);
}
.promo-btn:hover {
  background: rgba(212, 175, 55, 0.32);
  transform: translateY(-3px);
}
.link-btn {
  margin-top: 14px;
  background: none;
  border: none;
  color: #a8997c;
  text-decoration: underline;
  cursor: inherit;
  font-size: 12.5px;
}
.set-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.set-grid label {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  font-size: 13px;
  color: #ddd2bd;
}
input[type='range'] {
  accent-color: #d9a83a;
  width: 100%;
}
.set-toggles {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #ddd2bd;
}
.set-toggles input {
  accent-color: #d9a83a;
  margin-right: 8px;
}
.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* ---------- game over ---------- */
.gameover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.8));
  animation: fadeIn 1.4s ease;
}
.go-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #ffe08a;
  text-shadow: 0 0 50px rgba(255, 180, 40, 0.75), 0 6px 0 #4a2c00;
  animation: medalIn2 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gameover.lose .go-title {
  color: #c9c1b8;
  text-shadow: 0 0 40px rgba(160, 20, 20, 0.8), 0 6px 0 #200;
}
.gameover.draw .go-title {
  color: #d9d2c0;
  text-shadow: 0 0 40px rgba(120, 140, 200, 0.6);
}
.go-reason {
  font: 700 16px 'Cinzel', serif;
  letter-spacing: 0.25em;
  color: #e6d9bc;
  margin-top: 8px;
}
.go-stats {
  margin-top: 18px;
  color: #b3a588;
  font-size: 13.5px;
  line-height: 1.8;
}
.go-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}
@keyframes medalIn2 {
  from {
    opacity: 0;
    transform: scale(1.8);
    filter: blur(10px);
  }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .war-panel {
    display: none;
  }
  .hud-right {
    gap: 5px;
  }
  .hud-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  #menu {
    padding-left: 0;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
  }
  .promo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .site-nav {
    padding: 14px 4vw;
  }
  .site-logo {
    white-space: nowrap;
    font-size: 15px;
    margin-right: 12px;
  }
  .nav-tab {
    white-space: nowrap;
    padding: 8px 9px;
    font-size: 11.5px;
    letter-spacing: 0.1em;
  }
}

/* ---------- opponent levels, clocks, battle report (Faz 2) ---------- */
.seg.levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.seg.levels button {
  min-width: 0;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.seg.levels button b {
  font: 700 12.5px 'Cinzel', serif;
  letter-spacing: 0.04em;
}
.seg.levels button small {
  font-size: 10.5px;
  opacity: 0.65;
}
.menu-rating {
  float: right;
  letter-spacing: 0.12em;
  color: #8f846f;
}
.menu-rating b {
  color: var(--gold);
}
.clocks {
  display: flex;
  gap: 8px;
  margin-left: 14px;
}
.clock {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(12, 10, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font: 700 17px 'Inter', monospace;
  font-variant-numeric: tabular-nums;
  color: #bdb3a0;
  min-width: 92px;
}
.clock.active {
  color: #fff3d0;
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(226, 184, 78, 0.3);
}
.clock.low.active {
  color: #ff6a4a;
  border-color: #ff4a2a;
  animation: blink 0.8s ease-in-out infinite;
}
.go-report {
  margin: 18px auto 0;
  width: min(620px, 92vw);
  text-align: left;
}
.rep-progress {
  text-align: center;
  font: 600 13px 'Cinzel', serif;
  letter-spacing: 0.2em;
  color: #c9b48a;
}
.rep-head {
  text-align: center;
  font: 800 14px 'Cinzel', serif;
  letter-spacing: 0.35em;
  color: var(--gold);
  margin-bottom: 10px;
}
.rep-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rep-col {
  background: rgba(10, 8, 9, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}
.rep-name {
  font: 700 11px 'Cinzel', serif;
  letter-spacing: 0.3em;
  color: #a39276;
}
.rep-acc {
  font: 800 34px 'Inter', sans-serif;
  color: #fff3d0;
  margin: 2px 0 8px;
}
.rep-acc small {
  font-size: 12px;
  font-weight: 600;
  color: #a39276;
  margin-left: 6px;
}
.rep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #d8cdb8;
  padding: 2px 0;
}
.rep-row b {
  margin-left: auto;
}
.rep-row i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.rep-row.best i { background: #7ee0a0; }
.rep-row.excellent i { background: #6bc4ff; }
.rep-row.good i { background: #b7c7a8; }
.rep-row.inaccuracy i { background: #f2d15b; }
.rep-row.mistake i { background: #ff9a3c; }
.rep-row.blunder i { background: #ff4a3a; }
.rep-key {
  margin-top: 12px;
  font-size: 13px;
  color: #d8cdb8;
}
.rep-key ul {
  margin: 6px 0 0 18px;
  line-height: 1.7;
}
.rep-rating {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: #d8cdb8;
}
.rep-rating .up { color: #7ee0a0; }
.rep-rating .down { color: #ff6a4a; }

/* hub layout: keep the panel clear of the top nav, one-line title */
#menu .menu-card {
  padding-top: 64px;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden; /* nothing in the panel may scroll sideways */
  container-type: inline-size; /* the title scales with the panel, not the window */
}
#menu .menu-card:not(.wide) {
  width: min(560px, 92vw);
}
#menu .menu-title {
  white-space: nowrap;
  font-size: clamp(22px, 8.6cqw, 50px);
}
.menu-rating {
  color: #c9b48a;
}
.menu-credit {
  margin-top: 10px;
  font-size: 10.5px;
  color: #6f6655;
}
.menu-credit a {
  color: #a39276;
}

/* battlefield (arena) picker */
.seg.arenas {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.seg.arenas button {
  min-width: 0;
  padding: 8px 4px;
}
.seg.arenas button b {
  font: 700 11.5px 'Cinzel', serif;
  letter-spacing: 0.02em;
}

/* partners */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0 10px;
}
.partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 10px 6px;
  background: rgba(12, 10, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.partner img {
  width: 92px;
  height: 92px;
}
.partner b {
  font: 700 11px 'Cinzel', serif;
  color: #ead7a6;
}
.partner small {
  font-size: 10.5px;
  color: #a39276;
}
.soon.small-note {
  font-size: 12px;
  color: #8f846f;
  margin-bottom: 12px;
}

/* ---------- Legendary Games (Faz 6) ---------- */
#menu .menu-card.wide {
  width: min(1080px, 88vw);
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding-right: 6px;
}
.legend-card {
  position: relative;
  background: rgba(12, 10, 12, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend-card:hover {
  border-color: var(--gold-dim);
}
.legend-card h4 {
  font: 800 16px 'Cinzel', serif;
  color: #ffe08a;
  letter-spacing: 0.03em;
}
.lc-year {
  position: absolute;
  top: 12px;
  right: 14px;
  font: 700 12px 'Cinzel', serif;
  color: #8f846f;
}
.lc-players {
  font-size: 12.5px;
  color: #e8dcc0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.lc-players i {
  color: #8f846f;
}
.lc-event {
  font-size: 11.5px;
  color: #a39276;
}
.legend-card p {
  font-size: 12.5px;
  line-height: 1.55;
  color: #cfc4ae;
  flex: 1;
}
.lc-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
body.ads-on .ad-legends {
  grid-column: 1 / -1;
  min-height: 90px;
}
body.replay #btn-undo,
body.replay #btn-hint,
body.replay #btn-draw,
body.replay #btn-resign,
body.replay #btn-new-game,
body.replay .clocks {
  display: none;
}
.replay-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 25;
  width: min(820px, 94vw);
  background: rgba(10, 8, 9, 0.86);
  border: 1px solid rgba(226, 189, 90, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
body.killcam .replay-bar {
  opacity: 0.85;
}
.rb-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.rb-title b {
  font: 800 15px 'Cinzel', serif;
  color: #ffe08a;
}
.rb-title span {
  font-size: 12px;
  color: #a39276;
}
.rb-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rb-ply {
  font: 700 13px 'Inter', monospace;
  color: #e8dcc0;
  min-width: 64px;
  text-align: center;
}
.rb-speed {
  margin-left: auto;
}
.rb-speed button {
  min-width: 44px;
  padding: 6px 8px;
}
.rb-moments {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.rb-moments button {
  background: rgba(184, 138, 38, 0.15);
  border: 1px solid rgba(226, 189, 90, 0.35);
  color: #ffe08a;
  border-radius: 999px;
  padding: 3px 10px;
  font: 600 11.5px 'Inter', sans-serif;
  cursor: inherit;
}
.rb-moments button.on {
  background: rgba(184, 138, 38, 0.5);
}
.evalbar {
  position: fixed;
  right: 16px;
  top: 90px;
  bottom: 140px;
  width: 22px;
  z-index: 24;
  background: #1a1416;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  overflow: hidden;
}
.ev-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: linear-gradient(180deg, #fff6dc, #e2c98a);
  transition: height 0.6s ease;
}
.evalbar span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  text-align: center;
  font: 800 8.5px 'Inter', sans-serif;
  letter-spacing: -0.02em;
  color: #3a2a10;
  white-space: nowrap;
}
.engine-line {
  position: fixed;
  right: 50px;
  top: 90px;
  z-index: 24;
  background: rgba(10, 8, 9, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #d8cdb8;
}
.engine-line b {
  color: #ffe08a;
}
body.replay .subtitle {
  bottom: 178px;
}
body.replay #killfeed {
  right: 50px;
}
.subtitle.comment .sub-name {
  color: #ffe08a;
}
.subtitle.comment .sub-text {
  border: 1px solid rgba(226, 189, 90, 0.45);
  background: rgba(20, 14, 6, 0.78);
  font-style: italic;
}

/* ---------- phones (Faz 9 mobile pass) ---------- */
@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden;
  }
  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    padding: 10px 8px 14px;
    z-index: 2;
  }
  .site-logo {
    width: 100%;
    margin: 0 0 4px;
    text-align: center;
    font-size: 15px;
    white-space: nowrap;
  }
  .nav-tab {
    padding: 6px 7px;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  #menu {
    align-items: flex-start;
  }
  #menu .menu-card {
    width: calc(100vw - 24px);
    padding-top: 92px;
    padding-bottom: 24px;
    box-sizing: border-box;
  }
  #menu .menu-card.wide {
    width: calc(100vw - 16px);
  }
  #menu .menu-title {
    font-size: clamp(20px, 9.4cqw, 30px);
    letter-spacing: 0.04em;
  }
  .menu-sub {
    font-size: 11.5px;
    letter-spacing: 0.14em;
    margin-bottom: 18px;
  }
  .menu-row {
    margin-bottom: 14px;
  }
  .menu-label {
    font-size: 10.5px;
    letter-spacing: 0.12em;
  }
  .seg button {
    min-width: 0;
    padding: 10px 8px;
  }
  .seg.arenas {
    grid-template-columns: repeat(3, 1fr);
  }
  .seg.arenas button b {
    font-size: 10.5px;
  }
  .seg.levels button {
    padding: 7px 2px;
  }
  .seg.levels button b {
    font-size: 9.5px;
    letter-spacing: 0;
  }
  .menu-start {
    font-size: 15px;
    letter-spacing: 0.14em;
  }
  .legend-grid {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }
  /* in-game HUD: icons only, two compact rows */
  .hud-topbar {
    padding: 6px 8px;
    gap: 6px;
    min-height: 0;
  }
  .hud-left {
    width: 100%;
    justify-content: space-between;
  }
  .brand-title {
    font-size: 12px;
    letter-spacing: 0.08em;
  }
  .turn-status {
    font-size: 11.5px;
    padding: 4px 9px;
  }
  .hud-right {
    width: 100%;
    gap: 4px;
    flex-wrap: wrap;
  }
  .hud-btn {
    padding: 5px 7px;
    font-size: 11px;
  }
  .hud-btn .lbl,
  .hud-divider {
    display: none;
  }
  .medal {
    top: 22vh;
    width: 92vw;
  }
  .medal-title {
    font-size: 30px;
    letter-spacing: 0.05em;
  }
  .medal-sub {
    font-size: 11px;
    letter-spacing: 0.14em;
  }
  .sub-text {
    font-size: 15px;
  }
  .hud-btn[data-cam] {
    padding: 5px 6px;
    font-size: 10.5px;
  }
  /* Legendary Games on a phone: one slim control strip */
  .replay-bar {
    bottom: 8px;
    width: calc(100vw - 16px);
    padding: 7px 8px;
  }
  .rb-title {
    margin-bottom: 5px;
  }
  .rb-title b {
    font-size: 13px;
  }
  .rb-title span {
    display: none;
  }
  .rb-controls {
    flex-wrap: nowrap;
    gap: 3px;
  }
  .rb-controls .hud-btn {
    padding: 5px 6px;
  }
  .rb-ply {
    min-width: 44px;
    font-size: 11px;
  }
  .rb-speed button {
    min-width: 0;
    padding: 5px 6px;
    font-size: 11px;
  }
  .rb-moments {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-top: 6px;
    padding-bottom: 2px;
  }
  .rb-moments button {
    flex: none;
  }
  body.replay .subtitle {
    bottom: 128px;
  }
  .evalbar {
    width: 10px;
    right: 4px;
    top: 120px;
    bottom: 150px;
  }
  .evalbar span {
    display: none;
  }
  .engine-line {
    right: 20px;
    left: 8px;
    top: auto;
    bottom: 124px;
    text-align: center;
    font-size: 11.5px;
  }
}

/* ---------- landscape phones: short screens get the compact HUD ---------- */
@media (max-height: 500px) {
  .hud-topbar {
    padding: 4px 8px;
    gap: 6px;
    min-height: 0;
  }
  .brand-title {
    font-size: 12px;
  }
  .turn-status {
    font-size: 11px;
    padding: 3px 8px;
  }
  .hud-btn {
    padding: 4px 7px;
    font-size: 11px;
  }
  .hud-btn .lbl,
  .hud-divider {
    display: none;
  }
  #menu .menu-card {
    padding-top: 56px;
  }
  .site-nav {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .medal {
    top: 14vh;
  }
  .medal-title {
    font-size: 28px;
  }
  .replay-bar {
    padding: 6px 10px;
  }
  .rb-title span,
  .rb-moments {
    display: none;
  }
  body.replay .subtitle {
    bottom: 84px;
  }
  .subtitle {
    bottom: 6vh;
  }
  .sub-text {
    font-size: 13.5px;
    padding: 5px 12px;
  }
}

/* ---------- Training (Faz 8) ---------- */
.tr-total {
  margin-left: 10px;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.tr-chapters {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding-right: 6px;
}
.tr-chapter {
  margin-bottom: 20px;
}
.tr-chapter h4 {
  font: 800 16px 'Cinzel', serif;
  color: #ffe08a;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tr-chapter h4 span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.tr-chapter > p {
  font-size: 12.5px;
  color: #a39276;
  margin: 4px 0 10px 36px;
}
.tr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.tr-lesson {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  background: rgba(12, 10, 12, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e8dcc0;
  cursor: inherit;
  text-align: left;
  transition: border-color 0.18s, transform 0.18s;
}
.tr-lesson:hover:not(:disabled) {
  border-color: var(--gold-dim);
  transform: translateY(-1px);
}
.tr-lesson small {
  font-size: 10.5px;
  color: #8f846f;
}
.tr-lesson b {
  font: 700 13px 'Cinzel', serif;
  letter-spacing: 0.02em;
}
.tr-lesson i {
  font-style: normal;
  font-size: 13px;
  color: #ffd25a;
  letter-spacing: 0.1em;
}
.tr-lesson.done {
  border-color: rgba(226, 189, 90, 0.4);
}
.tr-lesson.locked {
  opacity: 0.45;
}
body.ads-on .ad-training {
  min-height: 90px;
  margin-bottom: 20px;
}
body.lesson #btn-undo,
body.lesson #btn-hint,
body.lesson #btn-draw,
body.lesson #btn-resign,
body.lesson #btn-new-game,
body.lesson .clocks {
  display: none;
}
.lesson-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 25;
  width: min(760px, 94vw);
  background: rgba(10, 8, 9, 0.88);
  border: 1px solid rgba(226, 189, 90, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lb-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.lb-head span {
  font-size: 11.5px;
  color: #a39276;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lb-head b {
  font: 800 16px 'Cinzel', serif;
  color: #ffe08a;
}
#lb-text {
  font-size: 13px;
  line-height: 1.5;
  color: #d8cdb8;
  margin: 6px 0;
}
.lb-status {
  font: 600 12.5px 'Inter', sans-serif;
  color: #c9b48a;
  min-height: 18px;
}
.lb-status.good {
  color: #ffd25a;
  font-size: 14px;
}
.lb-status.bad {
  color: #ff9c86;
}
.lb-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
body.lesson .subtitle {
  bottom: 190px;
}
@media (max-width: 640px) {
  .tr-chapters {
    max-height: none;
    overflow: visible;
  }
  .tr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tr-chapter > p {
    margin-left: 0;
  }
  .lesson-bar {
    bottom: 8px;
    width: calc(100vw - 16px);
    padding: 8px 10px;
  }
  #lb-text {
    font-size: 12px;
    max-height: 54px;
    overflow-y: auto;
  }
  .lb-head b {
    font-size: 14px;
  }
  body.lesson .subtitle {
    bottom: 176px;
  }
}
@media (max-height: 500px) {
  #lb-text {
    display: none;
  }
  body.lesson .subtitle {
    bottom: 110px;
  }
}

/* ---------- Tournaments (live data from Lichess Broadcasts) ---------- */
.tn-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #a39276;
}
.tn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d8cdb8;
}
.tn-toggle input {
  accent-color: #e2bd5a;
}
.tn-src {
  margin-left: auto;
}
.tn-src a,
.tn-win a {
  color: #d8c08a;
}
.tn-body-wrap {
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  padding-right: 6px;
}
.tn-section {
  margin-bottom: 22px;
}
.tn-section h4 {
  font: 800 16px 'Cinzel', serif;
  color: #ffe08a;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.tn-section h4 small {
  font: 600 12px 'Inter', sans-serif;
  color: #8f846f;
  margin-left: 6px;
}
.tn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.tn-card {
  background: rgba(12, 10, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tn-card.live {
  border-color: rgba(255, 90, 60, 0.45);
}
.tn-img {
  height: 112px;
  background: #1a1416 center / cover no-repeat;
}
.tn-img.none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  color: rgba(226, 189, 90, 0.4);
}
.tn-body {
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.tn-body h5 {
  font: 700 14px 'Cinzel', serif;
  color: #ffe9b0;
  line-height: 1.3;
}
.tn-meta {
  font-size: 11.5px;
  color: #a39276;
}
.tn-players {
  font-size: 11.5px;
  color: #cfc4ae;
  font-style: italic;
}
.tn-timer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: #a39276;
}
.tn-timer b {
  font: 800 17px 'Cinzel', serif;
  color: #ffd25a;
  letter-spacing: 0.04em;
}
.tn-timer.live b {
  font-size: 13px;
  color: #ff9c86;
}
.tn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4a2a;
  box-shadow: 0 0 10px #ff4a2a;
  animation: pulseRed 1.2s ease-in-out infinite;
  align-self: center;
}
.tn-sub {
  font-size: 11.5px;
  color: #8f846f;
}
.tn-sub b {
  color: #d8cdb8;
}
.tn-win {
  margin-top: 4px;
  font-size: 12px;
  color: #a39276;
}
.tn-win span {
  margin-right: 6px;
}
.tn-win b {
  color: #ffd25a;
  font: 700 13.5px 'Cinzel', serif;
}
.tn-win small {
  font: 600 11px 'Inter', sans-serif;
  color: #8f846f;
}
.tn-link {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  color: #d8c08a;
  text-decoration: none;
}
.tn-link:hover {
  color: #ffe08a;
}
.tn-empty,
.tn-loading {
  font-size: 13px;
  color: #a39276;
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}
body.ads-on .ad-tournaments {
  min-height: 90px;
}
@media (max-width: 640px) {
  .site-nav {
    flex-wrap: wrap;
  }
  .nav-tab {
    padding: 6px 5px;
    font-size: 9.8px;
    letter-spacing: 0.03em;
  }
  .tn-body-wrap {
    max-height: none;
    overflow: visible;
  }
  .tn-grid {
    grid-template-columns: 1fr;
  }
  .tn-src {
    margin-left: 0;
  }
}

/* legal links in the game menu (AdSense: privacy must be one click away) */
.menu-legal {
  margin-top: 8px;
  font-size: 11px;
  color: #6f6655;
}
.menu-legal a {
  color: #a39276;
}

/* ---------- Faz 10: accounts ---------- */
input,
textarea {
  user-select: text;
}
.nav-acct {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  padding: 7px 14px;
  background: rgba(20, 17, 15, 0.7);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  color: #ffe08a;
  font: 700 12.5px 'Cinzel', serif;
  letter-spacing: 0.08em;
  cursor: inherit;
  position: relative;
  transition: border-color 0.18s, background 0.18s;
}
.nav-acct:hover {
  border-color: var(--gold);
  background: rgba(184, 138, 38, 0.22);
}
.nav-acct[hidden] {
  display: none;
}
.na-crown {
  font-size: 15px;
}
.na-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.na-dot {
  position: absolute;
  top: 3px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff8a3a;
  box-shadow: 0 0 8px #ff8a3a;
}
.acct-card {
  position: relative;
  width: 430px;
  text-align: left;
  max-height: 92vh;
  overflow-y: auto;
}
.acct-card h3 {
  padding-right: 28px;
}
.acct-x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #a8997c;
  font-size: 18px;
  cursor: inherit;
}
.acct-x:hover {
  color: #ffe08a;
}
.acct-field {
  display: block;
  margin-bottom: 12px;
}
.acct-field span {
  display: block;
  font: 600 11px 'Cinzel', serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a39276;
  margin-bottom: 5px;
}
.acct-field input,
.online-join input,
.oi-link input {
  width: 100%;
  padding: 11px 12px;
  background: rgba(8, 7, 7, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f3ece0;
  font: 500 15px 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.acct-field input:focus,
.online-join input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 184, 78, 0.18);
}
.acct-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.5;
  color: #cfc4ad;
  margin: 4px 0 10px;
}
.acct-check input {
  accent-color: #d9a83a;
  margin-top: 3px;
  flex: none;
}
.acct-card a {
  color: #ffd877;
}
.acct-msg {
  min-height: 18px;
  font-size: 13px;
  color: #ff9a7a;
  margin: 2px 0 6px;
}
.acct-submit {
  width: 100%;
  margin-top: 4px;
}
.acct-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 14px;
}
.acct-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: #d8cdb8;
  margin: 8px 0;
}
.acct-text.small {
  font-size: 12.5px;
  color: #a8997c;
}
.acct-ok {
  color: #8fe39a;
}
.acct-warn {
  color: #ffb26a;
}
.acct-banner {
  font-size: 13px;
  line-height: 1.55;
  color: #f1d9b0;
  background: rgba(255, 150, 60, 0.1);
  border: 1px solid rgba(255, 150, 60, 0.35);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.acct-banner .link-btn {
  margin: 0;
  color: #ffd877;
}
.acct-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0 8px;
}
.acct-stats div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.acct-stats b {
  display: block;
  font: 800 22px 'Cinzel', serif;
  color: #ffe08a;
}
.acct-stats small {
  font-size: 11px;
  color: #a8997c;
  line-height: 1.35;
}
.acct-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.acct-danger {
  margin-top: 18px;
  font-size: 12.5px;
  color: #a8997c;
}
.acct-danger summary {
  cursor: inherit;
}
.acct-danger form {
  margin-top: 8px;
}
.hud-btn.danger {
  border-color: rgba(255, 90, 60, 0.6);
  color: #ffb3a0;
}
.acct-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 30px);
  opacity: 0;
  z-index: 90;
  max-width: min(520px, 92vw);
  padding: 12px 20px;
  background: rgba(17, 13, 12, 0.95);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  color: #f3ece0;
  font-size: 13.5px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.acct-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.acct-toast.ok {
  border-color: rgba(120, 220, 140, 0.6);
}
.acct-toast.err {
  border-color: rgba(255, 110, 80, 0.7);
}

/* ---------- Faz 10: online battles ---------- */
.online-rated {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #ddd2bd;
  margin: 2px 0 4px;
}
.online-rated input {
  accent-color: #d9a83a;
}
.online-rated small {
  color: #8f846f;
}
.online-note {
  margin-top: 14px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #e3d7bf;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(226, 184, 78, 0.3);
  border-radius: 10px;
}
.online-note-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.online-invite {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: rgba(184, 138, 38, 0.1);
  box-shadow: 0 0 30px rgba(226, 184, 78, 0.12);
}
.oi-head {
  font: 700 13px 'Cinzel', serif;
  letter-spacing: 0.14em;
  color: #ffe08a;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.oi-link {
  display: flex;
  gap: 6px;
}
.oi-link input {
  font-size: 13px;
  min-width: 0;
}
.oi-wait {
  margin-top: 12px;
  font-size: 13px;
  color: #cfc4ad;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.oi-wait .link-btn {
  margin: 0;
}
.oi-spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(226, 184, 78, 0.25);
  border-top-color: var(--gold);
  animation: oiSpin 0.9s linear infinite;
}
@keyframes oiSpin {
  to {
    transform: rotate(360deg);
  }
}
.online-join {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.online-join input {
  font-size: 13.5px;
  padding: 9px 12px;
  min-width: 0;
}
.online-games {
  margin-top: 14px;
}
.og-head {
  font: 600 11px 'Cinzel', serif;
  letter-spacing: 0.16em;
  color: #a39276;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.og-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 4px;
  font-size: 13px;
}
.og-row.live {
  background: rgba(184, 138, 38, 0.12);
}
.og-row small {
  color: #a8997c;
  margin-left: auto;
}
.og-row em {
  color: #ffe08a;
  font-style: normal;
}
.og-row .hud-btn {
  padding: 5px 12px;
}
.og-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.og-dot.w {
  background: var(--w);
}
.og-dot.b {
  background: var(--b);
}
.online-bar {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  max-width: 94vw;
  padding: 8px 18px;
  background: var(--panel);
  border: 1px solid rgba(226, 184, 78, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  font-size: 13px;
}
body.in-menu .online-bar,
body.ui-hidden .online-bar {
  display: none;
}
.ob-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 34vw;
}
.ob-side b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ob-side small {
  color: #a8997c;
}
.ob-side.me b {
  color: #ffe08a;
}
.ob-vs {
  font: 700 10.5px 'Cinzel', serif;
  letter-spacing: 0.16em;
  color: #8f846f;
}
.ob-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffe08a;
}
.ob-note.warn {
  color: #ffb26a;
}
.ob-note .hud-btn {
  padding: 4px 10px;
}
@media (max-width: 640px) {
  .nav-acct {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
  .nav-acct .na-name {
    display: none;
  }
  .nav-acct .na-dot {
    top: 1px;
    right: 1px;
  }
  .acct-card {
    padding: 22px 18px;
  }
  .acct-stats b {
    font-size: 18px;
  }
  .online-bar {
    top: auto;
    bottom: 10px;
    border-radius: 14px;
    padding: 6px 12px;
    font-size: 12px;
  }
  .og-row small {
    display: none;
  }
}

/* ---------- menu: the panel scrolls BELOW the top nav, never under it ---------- */
#menu {
  --nav-h: 96px;
  padding-top: var(--nav-h);
  padding-bottom: 16px;
}
#menu .menu-card {
  padding-top: 18px;
  padding-bottom: 22px;
  max-height: calc(100vh - var(--nav-h) - 16px);
  max-height: calc(100dvh - var(--nav-h) - 16px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
}
#menu .site-nav {
  z-index: 3;
}
@media (max-width: 900px) {
  #menu {
    --nav-h: 76px;
  }
}
@media (max-width: 640px) {
  #menu {
    --nav-h: 84px;
  }
  #menu .menu-card {
    padding-top: 14px;
  }
}
@media (max-height: 500px) {
  #menu {
    --nav-h: 50px;
    padding-bottom: 6px;
  }
  #menu .menu-card {
    padding-top: 10px;
  }
}
