/**
 * Neón Šach — FEZO City kid-friendly neon styling.
 * Scoped under .fezo-chess to avoid theme bleed.
 */
.fezo-chess {
  --nc-cyan: #00FFCC;
  --nc-purple: #8A2BE2;
  --nc-magenta: #FF2BD6;
  --nc-gold: #ffaa00;
  --nc-light: #2a2740;
  --nc-dark: #15141f;
  --nc-ink: #f3f4f6;
  --nc-muted: #a0a0b8;
  width: 100%;
  color: var(--nc-ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}
.fezo-chess * { box-sizing: border-box; }

.nchess {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(12px, 3vh, 28px) 14px 40px;
  gap: 14px;
}

/* ── Menu ────────────────────────────────────────────────────────────── */
.nchess__menu { text-align: center; max-width: 640px; margin: clamp(10px, 6vh, 60px) auto 0; }
.nchess__title {
  font-family: 'Audiowide', 'JetBrains Mono', monospace;
  font-size: clamp(28px, 6vw, 46px);
  margin: 0 0 6px;
  color: var(--nc-cyan);
  text-shadow: 0 0 18px rgba(0, 255, 204, .55);
}
.nchess__sub { color: var(--nc-muted); margin: 0 0 26px; font-size: 14px; }
.nchess__modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.nchess__mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 14px;
  min-height: 120px;
  justify-content: center;
  background: linear-gradient(160deg, #15151f, #0d0d18);
  border: 2px solid rgba(138, 43, 226, .4);
  border-radius: 18px;
  color: var(--nc-ink);
  cursor: pointer;
  transition: transform .14s cubic-bezier(.34, 1.56, .64, 1), border-color .14s, box-shadow .14s;
}
.nchess__mode:hover { transform: translateY(-3px) scale(1.03); border-color: var(--nc-cyan); box-shadow: 0 0 22px rgba(0, 255, 204, .4); }
.nchess__mode:active { transform: scale(.97); }
.nchess__mode-emo { font-size: 2rem; }
.nchess__mode b { font-size: 1.05rem; }
.nchess__mode small { color: var(--nc-muted); font-size: .8rem; }
.nchess__mode[data-diff="hard"] { border-color: rgba(255, 43, 214, .5); }
.nchess__mode[data-diff="hard"]:hover { border-color: var(--nc-magenta); box-shadow: 0 0 22px rgba(255, 43, 214, .5); }

/* ── Game ────────────────────────────────────────────────────────────── */
.nchess__game { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nchess__topbar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nchess__turn { flex: 1; text-align: center; font-size: 14px; font-weight: 700; }
.nchess__turn b { color: var(--nc-cyan); }
.nchess__dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.nchess__dot.is-w { background: #eef6ff; box-shadow: 0 0 8px rgba(0, 255, 204, .7); }
.nchess__dot.is-b { background: var(--nc-magenta); box-shadow: 0 0 8px rgba(255, 43, 214, .7); }

.nchess__captured { width: 100%; max-width: 560px; min-height: 26px; display: flex; flex-wrap: wrap; gap: 1px; padding: 0 4px; }
.nchess__pc--mini { font-size: 20px; line-height: 1; opacity: .85; }

.nchess__boardwrap { width: 100%; display: flex; justify-content: center; }
.nchess__board {
  width: min(94vw, 68vh, 560px);
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border: 3px solid rgba(0, 255, 204, .5);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 32px rgba(0, 255, 204, .22), 0 8px 40px rgba(0, 0, 0, .6);
  font-size: calc(min(94vw, 68vh, 560px) / 11);
  background: var(--nc-dark);
}
.nchess__sq {
  position: relative;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  line-height: 1;
  transition: background .1s;
}
.nchess__sq.is-light { background: var(--nc-light); }
.nchess__sq.is-dark { background: var(--nc-dark); }
.nchess__sq.is-last { background: rgba(255, 170, 0, .22); }
.nchess__sq.is-sel { box-shadow: inset 0 0 0 3px var(--nc-cyan); background: rgba(0, 255, 204, .14); }
.nchess__sq.is-check { background: radial-gradient(circle, rgba(255, 0, 85, .55), rgba(255, 0, 85, .12)); box-shadow: inset 0 0 0 2px #ff0055; }
.nchess__sq.is-dest::after {
  content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%;
  background: rgba(0, 255, 204, .55); box-shadow: 0 0 10px rgba(0, 255, 204, .6); pointer-events: none;
}
.nchess__sq.is-dest.is-cap::after {
  width: 86%; height: 86%; background: transparent; border-radius: 12%;
  box-shadow: inset 0 0 0 4px rgba(0, 255, 204, .75), 0 0 12px rgba(0, 255, 204, .5);
}
.nchess__pc {
  pointer-events: none;
  line-height: 1;
}
.nchess__pc[data-color="w"] { color: #eef6ff; text-shadow: 0 0 6px rgba(0, 255, 204, .85), 0 1px 2px rgba(0, 0, 0, .6); }
.nchess__pc[data-color="b"] { color: #ff7ad9; text-shadow: 0 0 7px rgba(255, 43, 214, .9), 0 1px 2px rgba(0, 0, 0, .6); }

.nchess__actions { margin-top: 4px; display: flex; gap: 10px; }

.nchess__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 9px 18px;
  background: #0d0d18; color: var(--nc-ink);
  border: 2px solid rgba(138, 43, 226, .5);
  border-radius: 12px;
  font: 800 .95rem 'JetBrains Mono', monospace; letter-spacing: .03em;
  text-decoration: none; cursor: pointer;
  transition: transform .12s, box-shadow .14s, background .14s, border-color .14s;
}
.nchess__btn:hover { border-color: var(--nc-purple); box-shadow: 0 0 16px rgba(138, 43, 226, .5); }
.nchess__btn:active { transform: scale(.96); }
.nchess__btn--ghost { min-height: 40px; padding: 7px 12px; border-color: rgba(255, 255, 255, .12); font-size: .85rem; }
.nchess__btn--primary { background: linear-gradient(135deg, var(--nc-cyan), #00c9a0); color: #06121b; border-color: var(--nc-cyan); }
.nchess__btn--primary:hover { box-shadow: 0 0 22px rgba(0, 255, 204, .7); }

/* ── Promo + Over modals ─────────────────────────────────────────────── */
.nchess__promo, .nchess__over {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 4, 9, .82); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); padding: 16px;
}
.nchess__promo[hidden], .nchess__over[hidden] { display: none; }
.nchess__promo-panel, .nchess__over-panel {
  background: #0a0a14; border: 1.5px solid rgba(138, 43, 226, .5); border-radius: 16px;
  padding: 22px 26px; text-align: center; box-shadow: 0 0 40px rgba(138, 43, 226, .3); max-width: 380px;
}
.nchess__promo-panel p { margin: 0 0 12px; color: var(--nc-muted); }
.nchess__promo-row { display: flex; gap: 10px; }
.nchess__promo-pick {
  width: 60px; height: 60px; font-size: 38px; line-height: 1;
  background: #15151f; border: 2px solid rgba(0, 255, 204, .4); border-radius: 12px; cursor: pointer;
}
.nchess__promo-pick:hover { border-color: var(--nc-cyan); box-shadow: 0 0 14px rgba(0, 255, 204, .5); }
.nchess__promo-pick[data-color="w"] { color: #eef6ff; }
.nchess__promo-pick[data-color="b"] { color: #ff7ad9; }

.nchess__over-panel h2 { margin: 0 0 8px; font-family: 'Audiowide', monospace; font-size: 1.6rem; color: var(--nc-cyan); text-shadow: 0 0 12px rgba(0, 255, 204, .5); }
.nchess__over-panel p { margin: 0 0 8px; color: var(--nc-muted); font-size: 14px; }
.nchess__score { font-size: 1.4rem; margin: 12px 0; color: var(--nc-gold); }
.nchess__score b { font-size: 1.8rem; }
.nchess__hint { font-size: 12px !important; color: var(--nc-cyan) !important; opacity: .85; }
.nchess__over-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

@media (max-width: 420px) {
  .nchess__modes { grid-template-columns: 1fr 1fr; }
  .nchess__turn { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .nchess__mode, .nchess__btn { transition: none; }
}
