@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Share+Tech+Mono&family=Rajdhani:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 140, 255, 0.25) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(123, 140, 255, 0.25);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(123, 140, 255, 0.4);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

html {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  background: #0a0a1a;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e0e0e0;
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ─── Game hidden class ─── */
.game-hidden {
  display: none !important;
}

/* ─── Menu screen ─── */
#menu-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--cp-bg);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Scanline sweep */
#menu-screen::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cp-purple), transparent);
  opacity: 0;
  animation: cpScanline 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

/* Ghost glyph */
#menu-screen::after {
  content: '\265B';
  position: absolute;
  font-size: clamp(300px, 50vw, 580px);
  opacity: 0.025;
  color: var(--cp-purple);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 1;
}

#menu-screen.menu-fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#menu-bg {
  position: absolute;
  inset: -15%;
  z-index: 0;
}

.menu-bg-layer {
  position: absolute;
  inset: 0;
  transition: transform 0.18s linear;
  will-change: transform;
}

.menu-bg-layer-1 {
  background-image:
    linear-gradient(rgba(123, 140, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 140, 255, 0.09) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 1;
}

.menu-bg-layer-2 {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(123, 140, 255, 0.12) 0%, transparent 70%);
  opacity: 1;
}

.menu-bg-layer-3 {
  background: radial-gradient(ellipse 60% 40% at 80% 100%, rgba(192, 132, 252, 0.1) 0%, transparent 70%);
  opacity: 1;
}

#menu-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 48px 40px;
  max-width: 860px;
  width: 90%;
}

@keyframes titleGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes titleFloat {
  0%, 100% { transform: perspective(600px) rotateX(8deg) rotateY(-4deg) translateY(0); }
  50%      { transform: perspective(600px) rotateX(4deg) rotateY(4deg) translateY(-6px); }
}

.content-inner .landing-title sup {
  font-size: 0.45em;
  vertical-align: super;
  line-height: 0;
  letter-spacing: -1px;
  background: linear-gradient(270deg, var(--cp-purple), var(--cp-violet), var(--cp-pink), var(--cp-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleGradient 6s ease infinite;
}

#menu-title sup {
  font-size: 0.45em;
  vertical-align: super;
  line-height: 0;
  letter-spacing: -1px;
  background: linear-gradient(270deg, var(--cp-purple), var(--cp-violet), var(--cp-pink), var(--cp-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleGradient 6s ease infinite;
}

#menu-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(52px, 9vw, 110px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 0.88;
  background: linear-gradient(270deg, var(--cp-purple), var(--cp-violet), var(--cp-pink), var(--cp-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGradient 6s ease infinite;
  filter: drop-shadow(0 0 32px var(--cp-glow-purple));
  user-select: none;
}

#menu-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--cp-purple);
  opacity: 0.8;
  margin-top: 4px;
}

#menu-cubes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 44px;
  width: min(100%, 840px);
  min-height: 230px;
  perspective: 1400px;
  transform-style: preserve-3d;
  transition: min-height 0.25s ease, opacity 0.25s ease;
}

#menu-cubes.is-expanded {
  pointer-events: none;
  display: none;
}

.cube-wrapper {
  --cube-size: 152px;
  --cube-footprint: 188px;
  --cube-depth: calc(var(--cube-size) / 2);
  --face-bg: rgba(102, 85, 187, 0.08);
  --edge-color: rgba(136, 119, 221, 0.35);
  width: var(--cube-footprint);
  height: var(--cube-footprint);
  border: 0;
  padding: 0;
  margin: 0;
  appearance: none;
  background: none;
  color: #e9ebff;
  cursor: pointer;
  perspective: 900px;
  transform-style: preserve-3d;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  transition: transform 0.34s ease, opacity 0.28s ease, filter 0.28s ease;
}

.cube-wrapper.mode-bot {
  --face-bg: rgba(74, 102, 182, 0.11);
  --edge-color: rgba(110, 136, 204, 0.44);
}

.cube-wrapper.mode-online {
  --face-bg: rgba(66, 90, 170, 0.11);
  --edge-color: rgba(102, 136, 204, 0.44);
}

.cube-wrapper:nth-child(1) .cube {
  animation-delay: -0.2s;
}

.cube-wrapper:nth-child(2) .cube {
  animation-delay: -2s;
}

.cube-wrapper:nth-child(3) .cube {
  animation-delay: -3.2s;
}

.cube-wrapper:hover:not(.is-hidden):not(.is-centered) {
  transform: translateY(-6px);
  filter: drop-shadow(0 18px 32px rgba(110, 130, 255, 0.25));
}

.cube-wrapper.is-hidden {
  opacity: 0;
  transform: scale(0.58) translateY(20px);
  pointer-events: none;
}

.cube-wrapper.is-centered {
  transform: translateY(-8px) scale(1.04);
  z-index: 10;
  pointer-events: auto;
}

.cube-wrapper.is-selected .cube-face {
  box-shadow: 0 0 18px rgba(221, 204, 34, 0.25);
  border-color: rgba(221, 204, 34, 0.55);
}

.cube-wrapper.is-activating {
  transform: scale(0.96);
}

.cube {
  width: var(--cube-size);
  height: var(--cube-size);
  position: relative;
  transform-style: preserve-3d;
  animation: cubeDrift 8.4s ease-in-out infinite;
}

@keyframes cubeDrift {
  0%, 100% {
    transform: rotateX(-26deg) rotateY(34deg) rotateZ(0deg) translateY(0);
  }
  50% {
    transform: rotateX(-20deg) rotateY(46deg) rotateZ(-2deg) translateY(-7px);
  }
}

.cube-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--face-bg);
  border: 1px dashed var(--edge-color);
  box-shadow: inset 0 0 18px rgba(120, 130, 220, 0.13);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-shadow: 0 2px 12px rgba(10, 10, 35, 0.8);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cube-wrapper:hover .cube-face.front,
.cube-wrapper:focus-visible .cube-face.front {
  background: color-mix(in srgb, var(--face-bg) 65%, rgba(255, 255, 255, 0.2));
  border-color: color-mix(in srgb, var(--edge-color) 72%, rgba(255, 255, 255, 0.46));
  box-shadow: inset 0 0 30px rgba(165, 176, 255, 0.22);
}

.cube-wrapper:focus-visible {
  outline: 2px solid rgba(221, 229, 255, 0.62);
  outline-offset: 10px;
}

.cube-face.front  { transform: translateZ(var(--cube-depth)); }
.cube-face.back   { transform: rotateY(180deg) translateZ(var(--cube-depth)); }
.cube-face.right  { transform: rotateY(90deg) translateZ(var(--cube-depth)); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(var(--cube-depth)); }
.cube-face.top    { transform: rotateX(90deg) translateZ(var(--cube-depth)); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(var(--cube-depth)); }

.cube-title {
  font-size: 20px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.9px;
}

.cube-desc {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(235, 239, 255, 0.66);
}

#menu-submenu {
  min-height: 260px;
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
  isolation: isolate;
}

#menu-submenu.is-active {
  display: flex;
}

#menu-game-mode-control {
  width: min(100%, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  margin-bottom: 10px;
  position: relative;
  z-index: 20;
}

#menu-game-mode-control::after {
  content: '';
  position: absolute;
  right: calc(50% - 72px);
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(225, 234, 255, 0.9);
  border-bottom: 2px solid rgba(225, 234, 255, 0.9);
  transform: translateY(-62%) rotate(45deg);
  pointer-events: none;
  opacity: 0.88;
}

#menu-game-mode-control label {
  font-size: 11px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: rgba(214, 223, 255, 0.9);
}

#menu-game-mode-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid rgba(155, 174, 255, 0.45);
  background:
    linear-gradient(180deg, rgba(62, 77, 146, 0.55) 0%, rgba(33, 44, 93, 0.62) 100%);
  color: rgba(234, 240, 255, 0.96);
  border-radius: 10px;
  padding: 7px 34px 7px 11px;
  min-width: 140px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(10, 12, 28, 0.35), 0 0 0 1px rgba(188, 202, 255, 0.12) inset;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#menu-game-mode-select option {
  background: #1a214d;
  color: rgba(234, 240, 255, 0.98);
}

#menu-game-mode-select option:hover,
#menu-game-mode-select option:checked {
  background: #303f82;
  color: #f2f6ff;
}

#menu-game-mode-select:hover {
  border-color: rgba(176, 193, 255, 0.64);
  transform: translateY(-1px);
}

#menu-game-mode-select:focus-visible {
  outline: none;
  border-color: rgba(198, 212, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(158, 186, 255, 0.35), 0 10px 24px rgba(10, 12, 28, 0.35);
}

#menu-back-btn {
  border: 1px solid rgba(180, 190, 255, 0.4);
  background: rgba(30, 35, 70, 0.5);
  color: rgba(226, 232, 255, 0.9);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -6px, 0);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  position: relative;
  z-index: 30;
  order: 2;
  margin-top: 24px;
}

#menu-back-btn:hover {
  background: rgba(60, 70, 130, 0.62);
}

#menu-back-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

#menu-subcubes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  justify-items: center;
  align-items: start;
  column-gap: 18px;
  row-gap: 12px;
  width: min(100%, 560px);
  transform-style: preserve-3d;
  position: relative;
  z-index: 5;
  margin-top: 2px;
  padding-bottom: 10px;
  order: 1;
}

.subcube-wrapper {
  --cube-size: 132px;
  --cube-footprint: 160px;
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  transition: transform 0.32s ease, opacity 0.32s ease;
}

.subcube-wrapper.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.subcube-wrapper .cube {
  animation: subCubeDrift 7.2s ease-in-out infinite;
}

.subcube-wrapper:hover:not(.is-hidden):not(.is-centered) {
  transform: translateY(0) scale(1);
}

@keyframes subCubeDrift {
  0%, 100% {
    transform: rotateX(-20deg) rotateY(26deg) rotateZ(0deg) translateY(0);
  }
  50% {
    transform: rotateX(-16deg) rotateY(30deg) rotateZ(-1deg) translateY(-3px);
  }
}

.subcube-wrapper.tone-soft {
  --face-bg: rgba(115, 100, 200, 0.13);
  --edge-color: rgba(158, 142, 232, 0.46);
}

.subcube-wrapper.tone-mid {
  --face-bg: rgba(82, 104, 195, 0.13);
  --edge-color: rgba(122, 149, 223, 0.45);
}

.subcube-wrapper.tone-hard {
  --face-bg: rgba(66, 86, 165, 0.14);
  --edge-color: rgba(98, 126, 204, 0.45);
}

.subcube-wrapper.tone-white {
  --face-bg: rgba(134, 126, 222, 0.13);
  --edge-color: rgba(168, 159, 243, 0.48);
}

.subcube-wrapper.tone-black {
  --face-bg: rgba(58, 78, 150, 0.14);
  --edge-color: rgba(95, 120, 198, 0.46);
}

/* ─── Online lobby ─── */
#online-lobby {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--cp-bg);
}

#online-lobby::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cp-purple), transparent);
  opacity: 0;
  animation: cpScanline 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

#lobby-bg {
  position: absolute;
  inset: -15%;
  z-index: 0;
}

.lobby-bg-layer {
  position: absolute;
  inset: 0;
}

.lobby-bg-layer-1 {
  background-image:
    linear-gradient(rgba(123, 140, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 140, 255, 0.09) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 1;
}

.lobby-bg-layer-2 {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(123, 140, 255, 0.12) 0%, transparent 70%);
  opacity: 1;
}

.lobby-bg-layer-3 {
  background: radial-gradient(ellipse 60% 40% at 80% 100%, rgba(192, 132, 252, 0.1) 0%, transparent 70%);
  opacity: 1;
}

#lobby-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 40px 36px;
  max-width: 520px;
  width: 92%;
  background: rgba(14, 14, 38, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px dashed rgba(136, 119, 221, 0.35);
  border-radius: 16px;
  box-shadow:
    inset 0 0 40px rgba(100, 115, 220, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(90, 100, 200, 0.08);
}

#lobby-heading, .lobby-view-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
  background: linear-gradient(270deg, #7b8cff, #c084fc, #60a5fa, #7b8cff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGradient 6s ease infinite;
  filter: drop-shadow(0 2px 8px rgba(123, 140, 255, 0.3));
}

@keyframes lobbyPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Browse view layout ─── */
#lobby-browse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

/* ─── Room table ─── */
#room-table-wrap {
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(116, 136, 204, 0.5) rgba(16, 20, 42, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(136, 119, 221, 0.22);
  background: rgba(10, 10, 28, 0.5);
  box-shadow: inset 0 0 18px rgba(100, 110, 200, 0.06);
}

#room-table-wrap::-webkit-scrollbar { width: 7px; }
#room-table-wrap::-webkit-scrollbar-track { background: rgba(16, 20, 42, 0.5); border-radius: 4px; }
#room-table-wrap::-webkit-scrollbar-thumb { background: rgba(116, 136, 204, 0.5); border-radius: 4px; }

#room-table {
  width: 100%;
  border-collapse: collapse;
}

#room-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(180, 195, 255, 0.55);
  padding: 11px 16px;
  background: rgba(24, 26, 60, 0.8);
  border-bottom: 1px solid rgba(136, 119, 221, 0.18);
  position: sticky;
  top: 0;
  z-index: 1;
}

#room-table thead th:last-child {
  text-align: right;
  width: 80px;
}

#room-table tbody tr {
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

#room-table tbody tr:hover {
  background: rgba(100, 115, 220, 0.14);
  box-shadow: inset 0 0 24px rgba(120, 140, 255, 0.06);
}

#room-table tbody tr:active {
  background: rgba(100, 115, 220, 0.24);
}

#room-table tbody td {
  padding: 13px 16px;
  font-size: 14px;
  color: #dde3ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

#room-table tbody td:first-child {
  font-weight: 600;
}

#room-table tbody td:last-child {
  text-align: right;
}

#room-table tbody td .table-join-tag {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #34d399;
  transition: all 0.16s ease;
}

#room-table tbody tr:hover .table-join-tag {
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.15);
}

#room-table-empty {
  text-align: center;
  color: rgba(200, 210, 255, 0.3);
  font-size: 14px;
  line-height: 1.7;
  padding: 40px 20px;
  font-style: italic;
}

/* ─── Lobby action row ─── */
#lobby-action-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

#lobby-create-btn,
#lobby-quick-btn {
  flex: 1;
  padding: 14px 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

#lobby-create-btn {
  background: rgba(102, 85, 187, 0.2);
  border: 1px dashed rgba(136, 119, 221, 0.45);
  color: #c8bfff;
  box-shadow: inset 0 0 16px rgba(136, 119, 221, 0.08);
}

#lobby-create-btn:hover {
  background: rgba(102, 85, 187, 0.35);
  border-color: rgba(168, 152, 243, 0.65);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 20px rgba(136, 119, 221, 0.12),
    0 8px 24px rgba(102, 85, 187, 0.25);
}

#lobby-quick-btn {
  background: rgba(66, 90, 170, 0.18);
  border: 1px dashed rgba(102, 136, 204, 0.4);
  color: #a8c4ff;
  box-shadow: inset 0 0 16px rgba(102, 136, 204, 0.06);
}

#lobby-quick-btn:hover {
  background: rgba(66, 90, 170, 0.32);
  border-color: rgba(130, 160, 230, 0.6);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 20px rgba(102, 136, 204, 0.1),
    0 8px 24px rgba(66, 90, 170, 0.2);
}

/* ─── Lobby shared buttons ─── */
.lobby-primary-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(102, 85, 187, 0.22);
  border: 1px dashed rgba(136, 119, 221, 0.5);
  color: #c8bfff;
  box-shadow: inset 0 0 18px rgba(136, 119, 221, 0.08);
  transition: all 0.2s ease;
}

.lobby-primary-btn:hover {
  background: rgba(102, 85, 187, 0.38);
  border-color: rgba(168, 152, 243, 0.7);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 20px rgba(136, 119, 221, 0.12),
    0 8px 24px rgba(102, 85, 187, 0.25);
}

.lobby-secondary-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 190, 255, 0.2);
  border-radius: 999px;
  color: rgba(226, 232, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px 24px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lobby-secondary-btn:hover {
  background: rgba(60, 70, 130, 0.4);
  border-color: rgba(200, 210, 255, 0.4);
  color: rgba(240, 244, 255, 0.95);
}

/* ─── Create game form ─── */
#lobby-create, #lobby-quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.create-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.create-field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(180, 195, 255, 0.55);
}

.create-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 12px 36px 12px 16px;
  border: 1px solid rgba(136, 119, 221, 0.3);
  border-radius: 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a898ee'/%3E%3C/svg%3E") no-repeat right 14px center,
    rgba(14, 14, 38, 0.6);
  color: rgba(230, 240, 255, 0.95);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 12px rgba(100, 100, 200, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.create-field select:hover {
  border-color: rgba(168, 152, 243, 0.5);
}

.create-field select:focus {
  outline: none;
  border-color: rgba(168, 152, 243, 0.65);
  box-shadow: 0 0 0 2px rgba(136, 119, 221, 0.18), inset 0 0 12px rgba(100, 100, 200, 0.05);
}

.create-field select option {
  background: #14143a;
  color: rgba(234, 240, 255, 0.98);
}

#create-color-buttons,
#create-vis-buttons {
  display: flex;
  gap: 10px;
}

.create-toggle-btn {
  flex: 1;
  padding: 12px 0;
  border: 1px solid rgba(136, 119, 221, 0.2);
  border-radius: 10px;
  background: rgba(14, 14, 38, 0.5);
  color: rgba(200, 210, 255, 0.5);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: inset 0 0 10px rgba(100, 100, 200, 0.04);
}

.create-toggle-btn:hover:not(.selected) {
  background: rgba(102, 85, 187, 0.12);
  border-color: rgba(136, 119, 221, 0.35);
  color: rgba(220, 228, 255, 0.75);
}

.create-toggle-btn.selected {
  background: rgba(102, 85, 187, 0.22);
  border-color: rgba(168, 152, 243, 0.55);
  color: #d4cbff;
  box-shadow:
    inset 0 0 16px rgba(136, 119, 221, 0.1),
    0 0 14px rgba(136, 119, 221, 0.12);
}

/* ─── Waiting view ─── */
#lobby-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

#lobby-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: center;
  color: #e0e4ff;
}

#lobby-link-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

#lobby-link {
  flex: 1;
  background: rgba(10, 10, 28, 0.6);
  border: 1px solid rgba(136, 119, 221, 0.25);
  border-radius: 10px;
  color: #c0c0e0;
  font-size: 13px;
  padding: 11px 14px;
  outline: none;
  font-family: 'Segoe UI Mono', 'Consolas', monospace;
  box-shadow: inset 0 0 10px rgba(100, 100, 200, 0.05);
}

#lobby-copy-btn {
  background: rgba(102, 85, 187, 0.25);
  border: 1px solid rgba(136, 119, 221, 0.4);
  border-radius: 10px;
  color: #d0cbff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 22px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

#lobby-copy-btn:hover {
  background: rgba(102, 85, 187, 0.4);
  border-color: rgba(168, 152, 243, 0.6);
  box-shadow: 0 0 12px rgba(136, 119, 221, 0.15);
}

#lobby-status {
  font-size: 13px;
  color: rgba(200, 210, 255, 0.4);
  text-align: center;
}

/* ─── Invite code display ─── */
.invite-code-display {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  font-family: 'Segoe UI Mono', 'Consolas', monospace;
  color: #d4cbff;
  text-align: center;
  padding: 14px 24px;
  background: rgba(10, 10, 28, 0.5);
  border: 1px dashed rgba(136, 119, 221, 0.4);
  border-radius: 12px;
  user-select: all;
  box-shadow: inset 0 0 20px rgba(136, 119, 221, 0.06);
}

/* ─── Invite code section ─── */
#room-code-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(136, 119, 221, 0.12);
  width: 100%;
}

.room-code-label {
  font-size: 11px;
  color: rgba(200, 210, 255, 0.35);
  letter-spacing: 0.4px;
}

#room-code-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 260px;
}

#room-code-input {
  flex: 1;
  background: rgba(10, 10, 28, 0.6);
  border: 1px solid rgba(136, 119, 221, 0.25);
  border-radius: 10px;
  color: #d4cbff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  padding: 9px 12px;
  outline: none;
  font-family: 'Segoe UI Mono', 'Consolas', monospace;
  box-shadow: inset 0 0 10px rgba(100, 100, 200, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#room-code-input::placeholder {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: none;
  color: rgba(200, 210, 255, 0.3);
}

#room-code-input:focus {
  border-color: rgba(168, 152, 243, 0.55);
  box-shadow: 0 0 0 2px rgba(136, 119, 221, 0.15), inset 0 0 10px rgba(100, 100, 200, 0.05);
}

#room-code-join-btn {
  padding: 9px 20px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.16s ease;
}

#room-code-join-btn:hover {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.12);
}

/* ─── Canvas ─── */
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game-frame {
  position: fixed;
  inset: 10px;
  z-index: 9;
  pointer-events: none;
  border: 1px solid rgba(141, 156, 255, 0.24);
  border-radius: 12px;
  box-shadow:
    inset 0 0 22px rgba(96, 112, 210, 0.09),
    0 0 18px rgba(32, 44, 100, 0.22);
}

#game-home-btn {
  pointer-events: auto;
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  border: 1px solid rgba(170, 184, 255, 0.34);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(9, 12, 32, 0.78);
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
}

#game-home-btn::before {
  content: '♛';
  font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', serif;
  font-size: 20px;
  line-height: 1;
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: filter 0.3s ease, transform 0.3s ease;
}

#game-home-btn sup {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: translateY(-0.2em);
  transition: filter 0.3s ease;
}

#game-home-btn:hover {
  border-color: rgba(203, 215, 255, 0.58);
  background-color: rgba(14, 20, 46, 0.92);
}

#game-home-btn:active {
  transform: scale(0.97);
}

#game-home-btn:focus-visible {
  outline: 2px solid rgba(220, 228, 255, 0.62);
  outline-offset: 2px;
}

/* ─── UI overlay ─── */
#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
}

#top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#turn-indicator {
  background: rgba(10, 10, 30, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 28px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

#game-status {
  font-size: 14px;
  color: #ffcc44;
  text-shadow: 0 0 8px rgba(255, 204, 68, 0.4);
  min-height: 20px;
}

#captured-pieces {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  width: 100%;
}

.captured-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.captured-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.42);
  text-align: right;
  user-select: none;
}

.captured-row {
  background: rgba(10, 10, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 12px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  letter-spacing: 1px;
  font-size: 17px;
  width: 100%;
}

/* ─── Side panel ─── */
#side-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 200px;
  background: rgba(14, 14, 38, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(136, 119, 221, 0.3);
  padding: 24px 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

#side-panel::before {
  content: '';
  position: absolute;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(123, 140, 255, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 20%, transparent 80%);
  animation: sidePanelGridDrift 40s linear infinite;
}

#side-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(ellipse 140% 35% at 50% -10%, rgba(123, 140, 255, 0.1) 0%, transparent 65%),
    radial-gradient(ellipse 120% 30% at 50% 110%, rgba(192, 132, 252, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, rgba(123, 140, 255, 0.02) 0%, transparent 30%, transparent 70%, rgba(192, 132, 252, 0.015) 100%);
}

@keyframes sidePanelGridDrift {
  from { transform: translate(0, 0); }
  to   { transform: translate(-24px, 24px); }
}

#move-panel {
  position: absolute;
  top: 64px;
  left: 12px;
  z-index: 10;
  width: 190px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  pointer-events: auto;
  background: rgba(10, 10, 30, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: transform 0.2s ease;
}

#side-panel.is-collapsed {
  transform: translateX(100%);
  pointer-events: none;
}

#move-panel.is-collapsed {
  transform: translateX(calc(-100% - 12px));
  pointer-events: none;
}

.panel-toggle-btn {
  position: absolute;
  z-index: 12;
  width: 20px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 30, 0.78);
  color: #e6ebff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.panel-toggle-btn:hover {
  background: rgba(36, 50, 96, 0.88);
  border-color: rgba(170, 200, 255, 0.5);
}

.panel-toggle-btn:focus-visible {
  outline: 2px solid rgba(221, 231, 255, 0.65);
  outline-offset: 2px;
}

.panel-toggle-btn-left {
  top: 64px;
  left: 202px;
  border-left: none;
  border-radius: 0 8px 8px 0;
  transition: left 0.2s ease, background 0.16s ease, border-color 0.16s ease;
}

.panel-toggle-btn-left.is-panel-collapsed {
  left: 0;
}

.panel-toggle-btn-right {
  top: 12px;
  right: 200px;
  border-right: none;
  border-radius: 8px 0 0 8px;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.16s ease, border-color 0.16s ease;
}

.panel-toggle-btn-right.is-panel-collapsed {
  right: 0;
}

#move-panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
}

#move-panel-empty {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.48);
}

#move-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(116, 136, 204, 0.62) rgba(16, 20, 42, 0.62);
}

#move-options::-webkit-scrollbar {
  width: 9px;
}

#move-options::-webkit-scrollbar-track {
  background: rgba(16, 20, 42, 0.62);
  border-radius: 999px;
}

#move-options::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(132, 152, 218, 0.78), rgba(88, 108, 180, 0.78));
  border: 2px solid rgba(16, 20, 42, 0.78);
  border-radius: 999px;
}

#move-options::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(152, 174, 232, 0.86), rgba(104, 126, 198, 0.86));
}

.move-option-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(40, 60, 100, 0.4);
  color: #e6ebff;
  padding: 7px 8px;
  text-align: left;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.move-option-btn:hover,
.move-option-btn:focus-visible,
.move-option-btn.is-hovered {
  background: rgba(90, 120, 190, 0.52);
  border-color: rgba(170, 200, 255, 0.68);
  box-shadow: 0 0 0 1px rgba(170, 200, 255, 0.5), 0 0 14px rgba(90, 130, 220, 0.35);
  transform: translateX(2px);
  outline: none;
}

.move-option-btn.is-capture {
  background: rgba(130, 50, 35, 0.42);
  border-color: rgba(255, 135, 95, 0.42);
}

.move-option-btn.is-capture:hover,
.move-option-btn.is-capture:focus-visible,
.move-option-btn.is-capture.is-hovered {
  background: rgba(180, 72, 50, 0.58);
  border-color: rgba(255, 170, 130, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 170, 130, 0.55), 0 0 14px rgba(220, 90, 60, 0.35);
}

#new-game-btn, #undo-btn {
  background: rgba(102, 85, 187, 0.22);
  border: 1px dashed rgba(136, 119, 221, 0.5);
  color: #c8bfff;
  border-radius: 8px;
  padding: 12px 0;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(136, 119, 221, 0.08);
  transition: all 0.2s ease;
  width: 100%;
}

#new-game-btn:hover, #undo-btn:hover:not(:disabled) {
  background: rgba(102, 85, 187, 0.38);
  border-color: rgba(168, 152, 243, 0.7);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 20px rgba(136, 119, 221, 0.12),
    0 4px 16px rgba(102, 85, 187, 0.25);
}

#undo-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: rgba(60, 60, 80, 0.2);
  border-color: rgba(100, 100, 120, 0.3);
  color: #888;
  box-shadow: none;
}

#my-threats-control {
  background: rgba(78, 52, 18, 0.4);
  color: #ffe9d0;
  border: 1px solid rgba(255, 176, 80, 0.3);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}

#my-threats-control:hover {
  background: rgba(106, 70, 24, 0.86);
  border-color: rgba(255, 196, 120, 0.5);
}

#my-threats-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid rgba(255, 176, 80, 0.72);
  background: rgba(64, 42, 12, 0.95);
  display: grid;
  place-content: center;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

#my-threats-checkbox:hover {
  border-color: rgba(255, 205, 140, 0.9);
  box-shadow: 0 0 0 1px rgba(220, 150, 50, 0.3);
}

#my-threats-checkbox:checked {
  background: rgba(200, 130, 40, 0.95);
  border-color: rgba(255, 215, 150, 0.95);
}

#my-threats-checkbox::after {
  content: '';
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 0.12s ease;
  clip-path: polygon(14% 54%, 0 68%, 39% 100%, 100% 20%, 84% 6%, 39% 70%);
  background: #1a0e04;
}

#my-threats-checkbox:checked::after {
  transform: scale(1);
}

#my-threats-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 176, 80, 0.35);
}

#show-protected-control {
  background: rgba(24, 62, 118, 0.4);
  color: #d8ecff;
  border: 1px solid rgba(102, 180, 255, 0.36);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}

#show-protected-control:hover {
  background: rgba(34, 82, 156, 0.86);
  border-color: rgba(146, 206, 255, 0.58);
}

#show-protected-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid rgba(116, 194, 255, 0.84);
  background: rgba(18, 44, 82, 0.95);
  display: grid;
  place-content: center;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

#show-protected-checkbox:hover {
  border-color: rgba(190, 228, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(86, 168, 230, 0.34);
}

#show-protected-checkbox:checked {
  background: rgba(66, 164, 244, 0.95);
  border-color: rgba(202, 236, 255, 0.96);
}

#show-protected-checkbox::after {
  content: '';
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 0.12s ease;
  clip-path: polygon(14% 54%, 0 68%, 39% 100%, 100% 20%, 84% 6%, 39% 70%);
  background: #05263f;
}

#show-protected-checkbox:checked::after {
  transform: scale(1);
}

#show-protected-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(104, 182, 255, 0.4);
}

#ai-thinking-fx-control {
  background: rgba(84, 72, 10, 0.4);
  color: #fff6be;
  border: 1px solid rgba(255, 220, 90, 0.34);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}

#ai-thinking-fx-control:hover {
  background: rgba(112, 96, 12, 0.86);
  border-color: rgba(255, 228, 134, 0.58);
}

#ai-thinking-fx-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid rgba(255, 220, 90, 0.8);
  background: rgba(60, 50, 8, 0.95);
  display: grid;
  place-content: center;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

#ai-thinking-fx-checkbox:hover {
  border-color: rgba(255, 236, 160, 0.96);
  box-shadow: 0 0 0 1px rgba(240, 210, 80, 0.3);
}

#ai-thinking-fx-checkbox:checked {
  background: rgba(222, 188, 46, 0.96);
  border-color: rgba(255, 241, 178, 0.96);
}

#ai-thinking-fx-checkbox::after {
  content: '';
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 0.12s ease;
  clip-path: polygon(14% 54%, 0 68%, 39% 100%, 100% 20%, 84% 6%, 39% 70%);
  background: #2a2206;
}

#ai-thinking-fx-checkbox:checked::after {
  transform: scale(1);
}

#ai-thinking-fx-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 220, 90, 0.36);
}


/* ─── Side panel sliders ─── */
.panel-slider-control {
  background: rgba(10, 10, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-slider-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
}

.panel-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.panel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7b8cff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.15s;
}

.panel-slider::-webkit-slider-thumb:hover {
  background: #9aa6ff;
}

.panel-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7b8cff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

#controls-help {
  background: rgba(10, 10, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-item {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.4;
}

/* ─── Promotion modal ─── */
#promo-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#promo-modal.modal-hidden {
  display: none;
}

#promo-modal-inner {
  background: rgba(16, 16, 40, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

#promo-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#promo-options {
  display: flex;
  gap: 10px;
}

.promo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px 18px;
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-width: 80px;
}

.promo-btn:hover {
  background: rgba(100, 120, 200, 0.35);
  border-color: rgba(140, 160, 255, 0.5);
}

.promo-icon {
  font-size: 36px;
  line-height: 1;
}

/* ─── Confirmation modal ─── */
#confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#confirm-modal.modal-hidden {
  display: none;
}

#confirm-modal-inner {
  position: relative;
  width: min(92vw, 360px);
  background: rgba(16, 16, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.62);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#confirm-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding-right: 28px;
}

#confirm-message {
  font-size: 14px;
  color: rgba(232, 236, 255, 0.82);
  line-height: 1.4;
}

#confirm-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 0;
}

#confirm-actions button {
  min-width: 84px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f2f4ff;
  font-size: 14px;
  padding: 7px 12px;
  cursor: pointer;
}

#confirm-ok-btn {
  background: rgba(76, 98, 202, 0.72);
  border-color: rgba(164, 184, 255, 0.45);
}

#confirm-ok-btn:hover {
  background: rgba(98, 122, 232, 0.86);
}

#confirm-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(240, 244, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#confirm-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ─── Mobile move confirmation ─── */
#mobile-move-confirm {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(10, 10, 30, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(141, 156, 255, 0.28);
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#mobile-move-confirm.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

#mobile-move-confirm-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #e0e4ff;
  white-space: nowrap;
}

#mobile-move-confirm-actions {
  display: flex;
  gap: 10px;
}

#mobile-confirm-yes,
#mobile-confirm-no {
  min-width: 72px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

#mobile-confirm-yes {
  background: rgba(52, 211, 153, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #34d399;
}

#mobile-confirm-yes:hover,
#mobile-confirm-yes:active {
  background: rgba(52, 211, 153, 0.38);
  border-color: rgba(52, 211, 153, 0.75);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.2);
  transform: translateY(-1px);
}

#mobile-confirm-no {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
}

#mobile-confirm-no:hover,
#mobile-confirm-no:active {
  background: rgba(239, 68, 68, 0.32);
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.18);
  transform: translateY(-1px);
}

/* ─── Tooltip ─── */
#piece-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 1000;
  background: rgba(10, 10, 30, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #e0e4ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  text-transform: capitalize;
  display: none;
}

#piece-tooltip.is-visible {
  display: block;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  #game-frame {
    inset: 6px;
    border-radius: 10px;
  }

  #game-home-btn {
    top: 8px;
    left: 8px;
    padding: 5px 10px;
  }

  #side-panel {
    top: 0;
    bottom: 0;
    right: 0;
    width: 160px;
    padding: 16px 12px;
  }

  #move-panel {
    top: 58px;
    left: 8px;
    width: 155px;
    max-height: calc(100vh - 130px);
    padding: 8px;
  }

  #side-panel.is-collapsed {
    transform: translateX(100%);
  }

  #move-panel.is-collapsed {
    transform: translateX(calc(-100% - 8px));
  }

  .panel-toggle-btn {
    width: 18px;
    height: 30px;
    font-size: 11px;
  }

  .panel-toggle-btn-left {
    top: 58px;
    left: 163px;
  }

  .panel-toggle-btn-right {
    top: 12px;
    right: 160px;
  }

  .captured-row {
    min-height: 28px;
    font-size: 15px;
  }

  .captured-label {
    font-size: 8px;
  }

  .move-option-btn {
    font-size: 11px;
    padding: 6px 7px;
  }

  #turn-indicator {
    font-size: 15px;
    padding: 6px 18px;
  }

  #controls-help {
    display: none;
  }

  #menu-inner {
    padding: 32px 16px;
    gap: 20px;
  }

  #menu-subtitle {
    letter-spacing: 4px;
  }

  #menu-cubes {
    flex-direction: column;
    gap: 24px;
    min-height: 390px;
  }

  .cube-wrapper {
    --cube-size: 112px;
    --cube-footprint: 136px;
  }

  #menu-submenu {
    min-height: 270px;
    width: min(100%, 360px);
  }

  #menu-game-mode-control {
    width: min(100%, 320px);
    gap: 8px;
    margin-bottom: 8px;
  }

  #menu-game-mode-control::after {
    right: calc(50% - 66px);
    width: 7px;
    height: 7px;
  }

  #menu-game-mode-control label {
    font-size: 10px;
  }

  #menu-game-mode-select {
    min-width: 128px;
    font-size: 11px;
    padding: 6px 30px 6px 10px;
  }

  .subcube-wrapper {
    --cube-size: 98px;
    --cube-footprint: 118px;
  }

  #menu-subcubes {
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    width: min(100%, 320px);
    column-gap: 8px;
    row-gap: 8px;
  }
}


/* ══════════════════════════════════════════════════════
   CONTENT PAGE REDESIGN — cyber/grid aesthetic
   Requires: Google Fonts @import at top of file
   Do NOT modify game CSS above this line
   ══════════════════════════════════════════════════════ */

/* ─── CSS custom properties ─── */
:root {
  --cp-bg:          #0a0a1a;
  --cp-bg2:         #0d0d22;
  --cp-purple:      #7b8cff;
  --cp-violet:      #c084fc;
  --cp-pink:        #f472b6;
  --cp-blue:        #60a5fa;
  --cp-green:       #34d399;
  --cp-text:        #e9ebff;
  --cp-muted:       rgba(233, 235, 255, 0.45);
  --cp-edge:        rgba(123, 140, 255, 0.22);
  --cp-glow-purple: rgba(123, 140, 255, 0.4);
  --cp-glow-violet: rgba(192, 132, 252, 0.4);
  --cp-grid-color:  rgba(123, 140, 255, 0.07);
}

/* ─── Shared navigation ─── */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 32px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 10, 26, 0.94);
  border-bottom: 1px solid var(--cp-edge);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.site-nav-logo {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  font-size: 0;
  line-height: 1;
  color: var(--cp-purple);
  text-decoration: none;
}

.site-nav-logo::before {
  content: '♛';
  font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', serif;
  font-size: 20px;
  line-height: 1;
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 10px var(--cp-glow-purple);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.site-nav-logo sup {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: translateY(-0.2em);
  transition: filter 0.3s ease;
}

/* Nav logo hover → expand into "chess³ᵈ" */
.nav-logo-text {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 20px;
  background: linear-gradient(270deg, var(--cp-purple), var(--cp-violet), var(--cp-pink), var(--cp-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGradient 6s ease infinite;
  transition: max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease 0.05s;
}

.site-nav-logo:hover .nav-logo-text,
#game-home-btn:hover .nav-logo-text {
  max-width: 80px;
  opacity: 1;
}

.site-nav-logo:hover::before,
#game-home-btn:hover::before {
  filter: drop-shadow(0 0 12px var(--cp-glow-purple));
  animation: logoQueenPulse 0.5s ease forwards;
}

@keyframes logoQueenPulse {
  0%   { transform: scale(1) rotate(0deg); }
  20%  { transform: scale(1.25) rotate(-12deg); }
  45%  { transform: scale(1.05) rotate(6deg); }
  70%  { transform: scale(1.15) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.site-nav-logo:hover sup,
#game-home-btn:hover sup {
  background: linear-gradient(270deg, var(--cp-purple), var(--cp-violet), var(--cp-pink), var(--cp-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGradient 6s ease infinite;
  filter: drop-shadow(0 0 6px var(--cp-glow-purple));
}

.site-nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.site-nav-links a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--cp-muted);
  text-decoration: none;
  text-transform: uppercase;
  padding: 8px 14px;
  transition: color 0.2s, background 0.2s;
}

.site-nav-links a:hover,
.site-nav-links a.site-nav-active {
  color: var(--cp-purple);
  background: rgba(123, 140, 255, 0.08);
}

/* "Play Online" CTA link in nav */
.site-nav-links a[href="/play-chess-online/"] {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--cp-bg);
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: filter 0.2s;
}

.site-nav-links a[href="/play-chess-online/"]:hover {
  filter: brightness(1.15);
  color: var(--cp-bg);
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
}

#site-nav-toggle {
  display: none;
  background: rgba(123, 140, 255, 0.1);
  border: 1px solid var(--cp-edge);
  border-radius: 4px;
  color: var(--cp-text);
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

/* Hide nav/footer/seo during gameplay */
body.game-active #site-nav,
body.game-active #seo-content,
body.game-active #site-footer {
  display: none;
}

/* ─── SEO content block (game page only) ─── */
#seo-content {
  padding: 64px 20px 48px;
  position: relative;
  z-index: 1;
}

#seo-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at top center, #141433 0%, #0a0a1a 72%);
  z-index: -1;
}

.seo-content-inner {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(13, 13, 34, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--cp-edge);
  padding: 40px 48px;
}

#seo-content h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--cp-text);
  letter-spacing: 1px;
  border-left: 3px solid var(--cp-purple);
  padding-left: 12px;
}

#seo-content h2:first-child {
  margin-top: 0;
}

#seo-content p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--cp-muted);
}

#seo-content p a {
  color: var(--cp-purple);
  text-decoration: none;
  border-bottom: 1px solid var(--cp-edge);
  transition: color 0.2s, border-color 0.2s;
}

#seo-content p a:hover {
  color: var(--cp-violet);
  border-color: var(--cp-violet);
}

/* Game page .seo-links — scoped separately */
#seo-content .seo-links {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--cp-edge);
}

#seo-content .seo-links h3 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--cp-purple);
}

#seo-content .seo-links ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

#seo-content .seo-links li {
  margin-bottom: 0;
}

#seo-content .seo-links a {
  display: block;
  padding: 12px 16px;
  background: rgba(123, 140, 255, 0.06);
  border: 1px solid var(--cp-edge);
  color: var(--cp-muted);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

#seo-content .seo-links a:hover {
  background: rgba(123, 140, 255, 0.12);
  border-color: var(--cp-purple);
  color: var(--cp-text);
}

/* ─── Site footer (shared) ─── */
#site-footer {
  padding: 28px 48px;
  background: rgba(10, 10, 26, 0.7);
  border-top: 1px solid var(--cp-edge);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner {
  display: contents;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 4px;
  align-items: center;
}

.footer-links a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cp-muted);
  text-decoration: none;
  padding: 4px 8px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--cp-purple);
}

.footer-copy {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(233, 235, 255, 0.2);
}

/* ─── CTA button (content pages) ─── */
.content-cta {
  margin: 48px 0;
  text-align: center;
}

.cta-btn {
  display: inline-block;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cp-bg);
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  padding: 14px 48px;
  text-decoration: none;
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  box-shadow: 0 0 30px var(--cp-glow-purple);
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--cp-glow-purple);
}

/* ─── Responsive nav collapse (≤768px) ─── */
@media (max-width: 768px) {
  #site-nav {
    padding: 0 20px;
  }

  #site-nav-toggle {
    display: block;
  }

  .site-nav-links {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 16px;
    background: rgba(10, 10, 26, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--cp-edge);
    display: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 300;
  }

  .site-nav-links a {
    width: 100%;
    text-align: center;
    padding: 14px;
  }

  /* Reset angled clip-path in mobile nav */
  .site-nav-links a[href="/play-chess-online/"] {
    clip-path: none;
    border-radius: 4px;
  }

  .site-nav-links.is-open {
    display: flex;
  }
}

/* ─── Content page layout ─── */
body.content-page-layout {
  /* IMPORTANT: overrides global body { overflow: hidden } required by game */
  overflow: visible;
  height: auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cp-bg);
  color: var(--cp-text);
}

/* Grid lines background — parallax layer (shallow depth) */
body.content-page-layout::before {
  content: '';
  position: fixed;
  inset: -5%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--cp-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--cp-grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: translate3d(var(--px1, 0px), var(--py1, 0px), 0);
  transition: transform 0.18s linear;
  will-change: transform;
}

/* Radial glow overlays — parallax layer (deeper depth) */
body.content-page-layout::after {
  content: '';
  position: fixed;
  inset: -5%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(123, 140, 255, 0.09) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(192, 132, 252, 0.07) 0%, transparent 70%);
  transform: translate3d(var(--px2, 0px), var(--py2, 0px), 0);
  transition: transform 0.18s linear;
  will-change: transform;
}

body.content-page-layout #site-nav {
  position: sticky;
  flex-shrink: 0;
}

body.content-page-layout #site-footer {
  margin-top: auto;
}

body.content-page-layout main.content-page {
  flex: 1;
  padding: 24px 20px 64px;
  position: relative;
  z-index: 1;
}

/* Scanline animation on landing page only — decorative, graceful degradation on :has() unsupported */
body.content-page-layout:has(.landing-hero-inner) main.content-page::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cp-purple), transparent);
  opacity: 0;
  animation: cpScanline 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes cpScanline {
  0%   { top: 0%;   opacity: 0;   }
  5%   { opacity: 0.25; }
  95%  { opacity: 0.25; }
  100% { top: 100%; opacity: 0;   }
}

/* ─── Content inner (glassmorphic card) ─── */
.content-inner {
  max-width: 860px;
  margin: 0 auto;
  background: rgba(13, 13, 34, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--cp-edge);
  padding: 60px 56px;
}

/* Landing page: transparent, full-width — keeps div.content-inner in DOM for SEO rule compliance */
.landing-hero-inner {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  padding: 0;
  max-width: 1100px;
}

/* ─── Typography (content pages) ─── */
.content-inner h1 sup {
  font-size: 0.45em;
  vertical-align: baseline;
  position: relative;
  top: -0.5em;
  line-height: 0;
}

.content-inner h1 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 24px;
  background: linear-gradient(270deg, var(--cp-purple), var(--cp-violet), var(--cp-pink), var(--cp-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGradient 6s ease infinite;
  filter: drop-shadow(0 2px 16px var(--cp-glow-purple));
}

.content-inner h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--cp-text);
  letter-spacing: 1px;
  border-left: 3px solid var(--cp-purple);
  padding-left: 12px;
}

.content-inner h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--cp-purple);
}

.content-inner p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--cp-muted);
}

.content-inner strong {
  color: var(--cp-text);
  font-weight: 600;
}

.content-inner p a,
.content-inner li a {
  color: var(--cp-purple);
  text-decoration: none;
  border-bottom: 1px solid var(--cp-edge);
  transition: color 0.2s, border-color 0.2s;
}

.content-inner p a:hover,
.content-inner li a:hover {
  color: var(--cp-violet);
  border-color: var(--cp-violet);
}

/* ─── SEO links (content pages — scoped to .content-inner) ─── */
.content-inner .seo-links {
  margin-top: 48px;
  border-left: 2px solid var(--cp-edge);
  padding-left: 24px;
}

.content-inner .seo-links h3 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--cp-purple);
  margin-bottom: 16px;
}

.content-inner .seo-links h3::before {
  content: '// ';
  opacity: 0.6;
}

.content-inner .seo-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-inner .seo-links li {
  margin-bottom: 0;
}

.content-inner .seo-links a {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--cp-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.content-inner .seo-links a:hover {
  color: var(--cp-purple);
  text-decoration: underline;
}

/* ─── Landing page hero ─── */
.landing-hero {
  min-height: min(100vh, 800px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 40px 40px;
  position: relative;
  overflow: hidden;
}

.landing-hero-glyph {
  position: absolute;
  font-size: min(75vw, 580px);
  opacity: 0.045;
  color: var(--cp-purple);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 0;
}

.landing-eyebrow {
  position: relative;
  z-index: 1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--cp-purple);
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-eyebrow::before,
.landing-eyebrow::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--cp-purple);
  opacity: 0.5;
}

.content-inner .landing-title {
  position: relative;
  z-index: 1;
  font-family: 'Orbitron', monospace;
  font-size: clamp(80px, 14vw, 180px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
  margin-bottom: 16px;
  white-space: nowrap;
  background: linear-gradient(270deg, var(--cp-purple), var(--cp-violet), var(--cp-pink), var(--cp-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGradient 6s ease infinite;
  filter: drop-shadow(0 0 32px var(--cp-glow-purple));
}

.landing-subtitle {
  position: relative;
  z-index: 1;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--cp-muted);
  margin-top: 20px;
  margin-bottom: 44px;
  max-width: 480px;
}

.landing-cta-group {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-btn-primary {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cp-bg);
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  padding: 16px 52px;
  text-decoration: none;
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  box-shadow: 0 0 40px var(--cp-glow-purple), 0 0 80px rgba(123, 140, 255, 0.15);
  transition: filter 0.2s, transform 0.2s;
  display: inline-block;
}

.landing-btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.landing-btn-secondary {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cp-purple);
  text-decoration: none;
  border: 1px solid var(--cp-edge);
  padding: 15px 32px;
  background: rgba(123, 140, 255, 0.04);
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: background 0.2s, border-color 0.2s;
  display: inline-block;
}

.landing-btn-secondary:hover {
  background: rgba(123, 140, 255, 0.1);
  border-color: var(--cp-purple);
}

.landing-btn-discord {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #7289da;
  text-decoration: none;
  border: 1px solid rgba(114, 137, 218, 0.3);
  padding: 15px 32px;
  background: rgba(114, 137, 218, 0.04);
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.landing-btn-discord:hover {
  background: rgba(114, 137, 218, 0.15);
  border-color: #7289da;
  color: #fff;
}

.landing-badges {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 24px;
  margin-top: 44px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--cp-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.landing-badge::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--cp-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--cp-green);
  flex-shrink: 0;
}

/* ─── Mode grid (landing page) ─── */
.mode-section-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 6px;
  color: var(--cp-purple);
  text-transform: uppercase;
  margin-bottom: 32px;
  opacity: 0.7;
  text-align: center;
}

.mode-section-label::before {
  content: '// ';
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin-bottom: 80px;
}

.mode-card {
  background: var(--cp-bg2);
  padding: 40px 32px;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  transition: background 0.25s;
}

.mode-card:hover {
  background: rgba(123, 140, 255, 0.06);
}

.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cp-purple), var(--cp-violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.mode-card:hover::before {
  transform: scaleX(1);
}

.mode-card-glyph {
  font-size: 36px;
  margin-bottom: 20px;
  opacity: 0.5;
  display: block;
}

.mode-card-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--cp-purple);
  opacity: 0.5;
  margin-bottom: 10px;
  display: block;
}

.mode-card-title {
  font-family: 'Orbitron', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cp-text);
  margin-bottom: 12px;
}

.mode-card-desc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--cp-muted);
  line-height: 1.6;
}

.mode-card-arrow {
  position: absolute;
  bottom: 28px;
  right: 28px;
  font-size: 18px;
  color: var(--cp-purple);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}

.mode-card:hover .mode-card-arrow {
  opacity: 1;
  transform: translate(4px, -4px);
}

/* ─── SEO text block below mode grid (landing page) ─── */
.landing-seo-block {
  padding: 0 20px 60px;
}

.landing-seo-block h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 14px;
  color: var(--cp-text);
  letter-spacing: 1px;
  border-left: 3px solid var(--cp-purple);
  padding-left: 12px;
}

.landing-seo-block p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--cp-muted);
}

.landing-seo-block strong {
  color: var(--cp-text);
  font-weight: 600;
}

/* ─── Responsive (≤768px) ─── */
@media (max-width: 768px) {
  body.content-page-layout main.content-page {
    padding: 16px 16px 40px;
  }

  .content-inner {
    padding: 40px 28px;
  }

  .landing-hero {
    padding: 16px 24px 32px;
    min-height: auto;
  }

  .mode-grid {
    grid-template-columns: 1fr 1fr;
  }

  #site-footer {
    padding: 24px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ─── Responsive (≤480px) ─── */
@media (max-width: 480px) {
  .content-inner {
    padding: 28px 20px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .landing-badges {
    gap: 14px;
  }

  .landing-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .landing-btn-primary,
  .landing-btn-secondary,
  .landing-btn-discord {
    width: 100%;
    text-align: center;
    clip-path: none;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════
   CONTENT PAGE — DIFFERENTIATED LAYOUTS
   Each page gets a unique hero, card system, and accent
   ══════════════════════════════════════════════════════ */

/* ─── Page hero banners ─── */
.page-hero {
  position: relative;
  padding: 80px 40px 48px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--cp-edge);
  margin-bottom: 48px;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero-glyph {
  position: absolute;
  font-size: clamp(180px, 30vw, 340px);
  opacity: 0.035;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 0;
}

.page-hero h1 {
  position: relative;
  z-index: 1;
}

.page-hero-subtitle {
  position: relative;
  z-index: 1;
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--cp-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.page-hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.page-hero-stat {
  text-align: center;
}

.page-hero-stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.page-hero-stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cp-muted);
}

/* Hero color themes */
.page-hero--bot::before {
  background: radial-gradient(ellipse 70% 80% at 50% 20%, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
}

.page-hero--bot .page-hero-stat-value { color: #60a5fa; }
.page-hero--bot .page-hero-glyph { color: #60a5fa; }

.page-hero--rules::before {
  background: radial-gradient(ellipse 70% 80% at 50% 20%, rgba(52, 211, 153, 0.07) 0%, transparent 70%);
}

.page-hero--rules .page-hero-stat-value { color: #34d399; }
.page-hero--rules .page-hero-glyph { color: #34d399; }

.page-hero--openings::before {
  background: radial-gradient(ellipse 70% 80% at 50% 20%, rgba(192, 132, 252, 0.08) 0%, transparent 70%);
}

.page-hero--openings .page-hero-stat-value { color: var(--cp-violet); }
.page-hero--openings .page-hero-glyph { color: var(--cp-violet); }

.page-hero--tactics::before {
  background: radial-gradient(ellipse 70% 80% at 50% 20%, rgba(244, 114, 182, 0.07) 0%, transparent 70%);
}

.page-hero--tactics .page-hero-stat-value { color: #f472b6; }
.page-hero--tactics .page-hero-glyph { color: #f472b6; }

/* Content body below hero — no glassmorphic card */
.content-inner--has-hero {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  padding: 0 20px 60px;
  max-width: 900px;
}

/* ─── Difficulty cards (vs computer page) ─── */
.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
}

.difficulty-card {
  background: var(--cp-bg2);
  padding: 32px 24px;
  position: relative;
  transition: background 0.25s;
}

.difficulty-card:hover {
  background: rgba(123, 140, 255, 0.04);
}

.difficulty-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.difficulty-card--easy::before { background: linear-gradient(90deg, #34d399, #6ee7b7); }
.difficulty-card--medium::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.difficulty-card--hard::before { background: linear-gradient(90deg, #f87171, #ef4444); }

.difficulty-card-level {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.difficulty-card--easy .difficulty-card-level { color: #34d399; }
.difficulty-card--medium .difficulty-card-level { color: #fbbf24; }
.difficulty-card--hard .difficulty-card-level { color: #f87171; }

.difficulty-card-title {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--cp-text);
  margin-bottom: 14px;
}

.difficulty-card-desc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--cp-muted);
}

/* ─── Piece reference cards (chess rules page) ─── */
.piece-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
}

.piece-card {
  background: var(--cp-bg2);
  padding: 28px 24px;
  position: relative;
  transition: background 0.25s;
}

.piece-card:hover {
  background: rgba(52, 211, 153, 0.04);
}

.piece-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.piece-card-icon {
  font-size: 36px;
  line-height: 1;
  opacity: 0.7;
  flex-shrink: 0;
}

.piece-card-meta {
  flex: 1;
}

.piece-card-name {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cp-text);
}

.piece-card-directions {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #34d399;
  text-transform: uppercase;
}

.piece-card-desc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--cp-muted);
}

/* ─── Strategy cards (openings page) ─── */
.strategy-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
}

.strategy-card {
  background: var(--cp-bg2);
  padding: 32px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  transition: background 0.25s;
  position: relative;
}

.strategy-card:hover {
  background: rgba(192, 132, 252, 0.04);
}

.strategy-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cp-violet), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.strategy-card:hover::before {
  opacity: 1;
}

.strategy-card-num {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  color: var(--cp-violet);
  opacity: 0.35;
  line-height: 1;
  padding-top: 4px;
}

.strategy-card-body h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--cp-text);
  letter-spacing: 1px;
  margin-bottom: 10px;
  border-left: none;
  padding-left: 0;
}

.strategy-card-body p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--cp-muted);
}

.strategy-card-body strong {
  color: var(--cp-text);
  font-weight: 600;
}

/* ─── Tactic pattern cards (puzzles page) ─── */
.tactic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
}

.tactic-card {
  background: var(--cp-bg2);
  padding: 28px 24px;
  position: relative;
  transition: background 0.25s;
}

.tactic-card:hover {
  background: rgba(244, 114, 182, 0.04);
}

.tactic-card-icon {
  font-size: 24px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.6;
}

.tactic-card-title {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cp-text);
  margin-bottom: 10px;
}

.tactic-card-desc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--cp-muted);
}

/* ─── Exercise list (puzzles page) ─── */
.exercise-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
}

.exercise-item {
  background: var(--cp-bg2);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
  transition: background 0.25s;
}

.exercise-item:hover {
  background: rgba(244, 114, 182, 0.04);
}

.exercise-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #f472b6;
  padding-top: 3px;
}

.exercise-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--cp-muted);
}

.exercise-text strong {
  color: var(--cp-text);
  font-weight: 600;
}

/* ─── Section text blocks (used between card sections) ─── */
.section-text {
  margin: 40px 0;
  max-width: 700px;
}

.section-text h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--cp-text);
  letter-spacing: 1px;
  border-left: 3px solid var(--cp-purple);
  padding-left: 12px;
  margin-bottom: 16px;
}

.section-text p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--cp-muted);
  margin-bottom: 16px;
}

.section-text p:last-child { margin-bottom: 0; }

.section-text strong {
  color: var(--cp-text);
  font-weight: 600;
}

.section-text a {
  color: var(--cp-purple);
  text-decoration: none;
  border-bottom: 1px solid var(--cp-edge);
  transition: color 0.2s, border-color 0.2s;
}

.section-text a:hover {
  color: var(--cp-violet);
  border-color: var(--cp-violet);
}

/* ─── SEO links in new layouts ─── */
.content-inner--has-hero .seo-links {
  margin-top: 48px;
  border-left: 2px solid var(--cp-edge);
  padding-left: 24px;
}

.content-inner--has-hero .seo-links h3 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--cp-purple);
  margin-bottom: 16px;
}

.content-inner--has-hero .seo-links h3::before {
  content: '// ';
  opacity: 0.6;
}

.content-inner--has-hero .seo-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-inner--has-hero .seo-links a {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--cp-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.content-inner--has-hero .seo-links a:hover {
  color: var(--cp-purple);
  text-decoration: underline;
}

.content-inner--has-hero .content-cta {
  margin: 48px 0;
  text-align: center;
}

/* ─── How-to-play hero (amber accent) ─── */
.page-hero--guide::before {
  background: radial-gradient(ellipse 70% 80% at 50% 20%, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
}

.page-hero--guide .page-hero-stat-value { color: #fbbf24; }
.page-hero--guide .page-hero-glyph { color: #fbbf24; }

/* ─── Step cards (how-to-play page) ─── */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
  counter-reset: step-counter;
}

.step-card {
  background: var(--cp-bg2);
  padding: 32px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  transition: background 0.25s;
  position: relative;
  counter-increment: step-counter;
}

.step-card:hover {
  background: rgba(251, 191, 36, 0.04);
}

.step-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #fbbf24, transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.step-card:hover::before {
  opacity: 1;
}

.step-card-num {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  color: #fbbf24;
  opacity: 0.35;
  line-height: 1;
  padding-top: 4px;
}

.step-card-body h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--cp-text);
  letter-spacing: 1px;
  margin-bottom: 10px;
  border-left: none;
  padding-left: 0;
}

.step-card-body p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--cp-muted);
}

.step-card-body strong {
  color: var(--cp-text);
  font-weight: 600;
}

/* ─── Control cards (how-to-play page) ─── */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
}

.control-card {
  background: var(--cp-bg2);
  padding: 24px 20px;
  transition: background 0.25s;
}

.control-card:hover {
  background: rgba(251, 191, 36, 0.04);
}

.control-card-action {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 8px;
  display: block;
}

.control-card-input {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--cp-text);
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.15);
  padding: 4px 10px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 10px;
}

.control-card-desc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--cp-muted);
}

/* ─── Tip list (how-to-play page) ─── */
.tip-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--cp-edge);
  border: 1px solid var(--cp-edge);
  margin: 40px 0;
}

.tip-item {
  background: var(--cp-bg2);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
  transition: background 0.25s;
}

.tip-item:hover {
  background: rgba(251, 191, 36, 0.04);
}

.tip-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  padding-top: 3px;
}

.tip-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--cp-muted);
}

.tip-text strong {
  color: var(--cp-text);
  font-weight: 600;
}

/* ─── Responsive: new layout components ─── */
@media (max-width: 768px) {
  .page-hero { padding: 60px 24px 36px; }
  .page-hero-stats { gap: 20px; }
  .page-hero-stat-value { font-size: 22px; }
  .difficulty-grid { grid-template-columns: 1fr; }
  .piece-grid { grid-template-columns: 1fr; }
  .tactic-grid { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: 1fr; }
  .strategy-card {
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 24px 20px;
  }
  .strategy-card-num { font-size: 22px; }
  .step-card {
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 24px 20px;
  }
  .step-card-num { font-size: 22px; }
  .exercise-item,
  .tip-item {
    grid-template-columns: 24px 1fr;
    gap: 12px;
    padding: 16px 20px;
  }
}
