/* ==========================================================================
   Chess Movers - Master Production Stylesheet
   Themes: Modern Dark, Light Green, Light Blue, Classic Wood
   Responsive Split-Screen, SVG Move Arrows, Piece Palette, Mobile Drawer
   ========================================================================== */


:root {
  --bg-canvas: #0c1222;
  --bg-surface: #141e33;
  --bg-surface-elevated: #1e2c47;
  --bg-surface-subtle: #19263e;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #22c55e;
  --accent-primary-hover: #16a34a;
  --accent-cta: #3b82f6;
  --accent-cta-hover: #2563eb;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --eval-white: #f8fafc;
  --eval-black: #1e293b;
  --board-light: #f0d9b5;
  --board-dark: #b58863;
  --arrow-stroke: rgba(34, 197, 94, 0.85);
  --arrow-head: rgba(34, 197, 94, 0.95);
  --square-highlight: rgba(163, 230, 53, 0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}


/* --- Theme: Light Green (Chess.com Classic Style) --- */
body.theme-green {
  --bg-canvas: #0e1a14;
  --bg-surface: #15271e;
  --bg-surface-elevated: #1e382b;
  --bg-surface-subtle: #193025;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.2);
  --accent-primary: #22c55e;
  --accent-cta: #10b981;
  --accent-cta-hover: #059669;
  --board-light: #ebecd0;
  --board-dark: #739552;
  --arrow-stroke: rgba(74, 222, 128, 0.9);
  --arrow-head: rgba(74, 222, 128, 1);
  --square-highlight: rgba(187, 247, 208, 0.55);
}


/* --- Theme: Light Blue (Oceanic Sky Style) --- */
body.theme-blue {
  --bg-canvas: #0b1526;
  --bg-surface: #112038;
  --bg-surface-elevated: #192d4f;
  --bg-surface-subtle: #142643;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.2);
  --accent-primary: #38bdf8;
  --accent-cta: #0284c7;
  --accent-cta-hover: #0369a1;
  --board-light: #dbe3eb;
  --board-dark: #4a75a0;
  --arrow-stroke: rgba(56, 189, 248, 0.85);
  --arrow-head: rgba(56, 189, 248, 0.95);
  --square-highlight: rgba(186, 230, 253, 0.55);
}


/* --- Theme: Classic Wood --- */
body.theme-wood {
  --bg-canvas: #17120e;
  --bg-surface: #241c16;
  --bg-surface-elevated: #332720;
  --bg-surface-subtle: #2b211a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --accent-primary: #eab308;
  --accent-cta: #d97706;
  --accent-cta-hover: #b45309;
  --board-light: #f0d9b5;
  --board-dark: #b58863;
  --arrow-stroke: rgba(250, 204, 21, 0.85);
  --arrow-head: rgba(250, 204, 21, 0.95);
  --square-highlight: rgba(254, 240, 138, 0.5);
}


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}


/* Apply Board Themes to Chessboard.js DOM */
body.theme-green #chessboard .white-1e1d7 {
  background-color: var(--board-light) !important;
  color: var(--board-dark) !important;
}
body.theme-green #chessboard .black-3c85d {
  background-color: var(--board-dark) !important;
  color: var(--board-light) !important;
}
body.theme-blue #chessboard .white-1e1d7 {
  background-color: var(--board-light) !important;
  color: var(--board-dark) !important;
}
body.theme-blue #chessboard .black-3c85d {
  background-color: var(--board-dark) !important;
  color: var(--board-light) !important;
}
body.theme-wood #chessboard .white-1e1d7 {
  background-color: var(--board-light) !important;
  color: var(--board-dark) !important;
}
body.theme-wood #chessboard .black-3c85d {
  background-color: var(--board-dark) !important;
  color: var(--board-light) !important;
}


/* ==========================================================================
   Header & Top Bar Contract (3-Zone Navigation)
   ========================================================================== */
.app-header {
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(14, 22, 38, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1.5rem;
}


.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}


.brand-wordmark {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}


.brand-icon {
  font-size: 1.35rem;
  color: var(--accent-primary);
  display: inline-block;
  transform: translateY(-1px);
}


.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}


.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
  white-space: nowrap;
  padding: 0.35rem 0.25rem;
  position: relative;
}


.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}


.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-primary);
  border-radius: 2px;
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


/* Theme Selector Pill */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
}


.theme-picker-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}


.theme-select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}


.theme-select option {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

/* Language Selector Dropdown (Matching Floating Dark Card Specification) */
.lang-picker {
  position: relative;
  display: inline-block;
}

.lang-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.lang-dropdown-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-primary);
}

.lang-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.current-lang-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.lang-dropdown-btn[aria-expanded="true"] .lang-arrow {
  transform: rotate(180deg);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 9999;
  min-width: 195px;
  max-height: 380px;
  overflow-y: auto;
  background-color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  flex-direction: column;
  gap: 2px;
}

.lang-menu.open {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-option:hover {
  background-color: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.lang-option.active {
  background-color: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  font-weight: 700;
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-name {
  flex: 1;
}

.lang-tick {
  font-size: 0.8rem;
  color: #38bdf8;
  opacity: 0;
}

.lang-option.active .lang-tick {
  opacity: 1;
}

/* Mobile drawer lang picker */
.mobile-lang-drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.5rem;
}

.mobile-lang-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mobile-lang-select {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-family: inherit;
  font-size: 0.85rem;
}


/* Mobile Hamburger Toggle */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}


/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem 1.5rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 199;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  overscroll-behavior: contain;
}


.mobile-nav-drawer.open {
  display: flex;
}


.mobile-nav-drawer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}


.mobile-nav-drawer a.active {
  color: var(--accent-primary);
  font-weight: 700;
}


/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  font-family: inherit;
}


.btn:focus-visible {
  outline: 2px solid var(--accent-cta);
  outline-offset: 2px;
}


.btn-primary {
  background-color: var(--accent-primary);
  color: #042f1a;
}


.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  color: #042f1a;
}


.btn-cta {
  background-color: var(--accent-cta);
  color: #ffffff;
}


.btn-cta:hover {
  background-color: var(--accent-cta-hover);
}


.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}


.btn-secondary:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--border-hover);
}


.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
}


/* ==========================================================================
   Main App Split-Screen Layout
   ========================================================================== */
.main-layout {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-sizing: border-box;
}


.hero-banner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.2rem 0 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.hero-banner-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.hero-text-block {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.hero-lang-picker-slot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
  padding-top: 0.35rem;
}

.hero-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-wrap: balance;
  margin: 0;
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 820px;
  line-height: 1.4;
  margin: 0;
}


.app-grid,
.screenshot-studio-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* ==========================================================================
   Left Column: Piece Palette, Chessboard, Eval Bar, Move Arrow
   ========================================================================== */
.board-column {
  flex: 1 1 480px;
  max-width: 500px;
  width: 100%;
  min-width: 320px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
}


/* Piece Palette Toolbars (Black & White blocks - Expanded Across Full Board Edge) */
.piece-palette-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #202b38;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  width: 100%;
  box-sizing: border-box;
}

.palette-bar-black {
  border-color: rgba(148, 163, 184, 0.25);
}

.palette-bar-white {
  border-color: rgba(56, 189, 248, 0.25);
}

body.theme-green .piece-palette-bar {
  background-color: #1a2e22;
  border-color: rgba(74, 222, 128, 0.18);
}

body.theme-blue .piece-palette-bar {
  background-color: #17263c;
  border-color: rgba(56, 189, 248, 0.18);
}

body.theme-wood .piece-palette-bar {
  background-color: #2b1f16;
  border-color: rgba(217, 119, 6, 0.22);
}

.palette-side-tag {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.palette-side-tag.tag-black {
  background: rgba(15, 23, 42, 0.95);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.palette-side-tag.tag-white {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.18);
  font-weight: 800;
}

.palette-btn-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.palette-btn {
  flex: 1 1 auto;
  min-width: 34px;
  max-width: 60px;
  height: 42px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  user-select: none;
}

.palette-btn img.palette-piece-img {
  width: 34px;
  height: 34px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  transition: transform 0.14s ease;
}

.palette-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.palette-btn:hover img.palette-piece-img {
  transform: scale(1.12);
}

.palette-btn.active {
  background-color: rgba(56, 189, 248, 0.25) !important;
  color: #ffffff !important;
  border: 1.5px solid #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45) !important;
  transform: scale(1.05);
}

.palette-btn.btn-delete {
  flex: 0 0 42px;
  width: 42px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-size: 1.2rem;
  font-weight: 600;
  margin-left: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.palette-btn.btn-delete:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.04);
}

.palette-btn.btn-delete.active {
  background-color: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5) !important;
  transform: scale(1.05);
}

/* Cursor indicator when a palette piece is active for placement */
#chessboard.palette-placing-mode,
#chessboard.palette-placing-mode * {
  cursor: crosshair !important;
}

/* Improved Chess Master Difficulty Select Section */
.difficulty-select-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.difficulty-select {
  flex: 1 1 auto;
  min-width: 200px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.difficulty-select:hover,
.difficulty-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  outline: none;
}

/* Heading Desktop / Mobile display switch */
.mobile-heading-text {
  display: none;
}

.desktop-heading-text {
  display: inline;
}

.board-container-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}


/* Vertical Evaluation Bar */
.eval-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  flex-shrink: 0;
  background-color: var(--eval-black);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}


.eval-bar-white {
  width: 100%;
  background-color: var(--eval-white);
  height: 50%;
  margin-top: auto;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.15);
}


.eval-score-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  transition: all 0.3s ease;
}


.eval-score-badge.badge-white {
  bottom: 8px;
  color: #0f172a;
  background-color: rgba(255, 255, 255, 0.95);
}


.eval-score-badge.badge-black {
  top: 8px;
  color: #f8fafc;
  background-color: rgba(15, 23, 42, 0.95);
}


/* Chessboard Box: Stable 1:1 Aspect Ratio on All Screens */
.chessboard-box {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  margin: 0 auto;
  box-sizing: border-box;
}


#chessboard,
#screenshotBoard {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 280px;
  aspect-ratio: 1 / 1 !important;
  touch-action: none !important;
  user-select: none;
  box-sizing: border-box !important;
  position: relative;
}


#chessboard *,
#screenshotBoard * {
  touch-action: none !important;
}

#chessboard .chessboard-63f37,
#screenshotBoard .chessboard-63f37 {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

#chessboard .board-b72b1,
#screenshotBoard .board-b72b1 {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  border: 2px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 4px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#chessboard .row-5277c,
#screenshotBoard .row-5277c {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  flex: 1 1 0 !important;
  height: 12.5% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  clear: none !important;
  box-sizing: border-box !important;
}

#chessboard .square-55d63,
#screenshotBoard .square-55d63 {
  flex: 1 1 0 !important;
  width: 12.5% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1 !important;
  float: none !important;
  position: relative !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

#chessboard .clearfix-7da63,
#screenshotBoard .clearfix-7da63 {
  display: none !important;
  height: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
}

#chessboard .square-55d63 img.piece-417db,
#screenshotBoard .square-55d63 img.piece-417db {
  width: 92% !important;
  height: 92% !important;
  max-width: 92% !important;
  max-height: 92% !important;
  object-fit: contain !important;
  pointer-events: auto !important;
}

/* Smooth and fast piece transitions */
#chessboard .piece-417db {
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
  will-change: transform;
}


/* SVG Move Arrow Overlay (Matching Reference Image Exactly: Simple Dim Translucent Green) */
.board-arrow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  z-index: 25;
}


.board-arrow-overlay,
.board-arrow-overlay * {
  pointer-events: none !important;
}


/* SVG Move Arrow Overlay (Matching Reference Image 2: Mid-level Dim Translucent Green) */
.move-arrow-path,
.move-arrow-path.preview-arrow,
.move-arrow-path.capture-arrow {
  fill: rgba(135, 192, 60, 0.55) !important;
  stroke: none !important;
  filter: none !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease;
}

.move-arrow-path.side-arrow,
.move-arrow-path.capture-arrow.side-arrow {
  fill: rgba(135, 192, 60, 0.28) !important;
  stroke: none !important;
  filter: none !important;
  pointer-events: none !important;
}

/* Source & Target Square Highlighting: Dim Light-Green Fill */
.highlight-source {
  background-color: rgba(135, 192, 60, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(105, 160, 45, 0.30) !important;
}

.highlight-target {
  background-color: rgba(135, 192, 60, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(105, 160, 45, 0.30) !important;
}

/* Opponent Piece Being Captured / Killed: Only that place/block is light red with circle */
.highlight-capture-target {
  background-color: rgba(239, 68, 68, 0.36) !important;
  box-shadow: inset 0 0 0 1.5px rgba(239, 68, 68, 0.55) !important;
}

/* Captured Pieces Display Along Board Corner Lines */
.captured-pieces-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  min-height: 26px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.4);
}

.captured-player-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.82rem;
  color: #f1f5f9;
}

.captured-pieces-list {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.captured-piece-glyph {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

.captured-white-glyph {
  color: #f8fafc;
}

.captured-black-glyph {
  color: #94a3b8;
}

.captured-piece-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: -2px;
  margin-right: 2px;
}

.material-advantage-pill {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.4rem;
}

.highlight-check {
  background-color: rgba(239, 68, 68, 0.65) !important;
  box-shadow: inset 0 0 6px 3px rgba(239, 68, 68, 0.85) !important;
}

/* Legal Move Dots (Matching Reference Image 2: Round Filled Circle showing where piece can actually possibly move) */
.chess-move-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 27%;
  height: 27%;
  background-color: rgba(46, 110, 60, 0.70);
  border-radius: 50%;
  pointer-events: none !important;
  z-index: 20;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.chess-capture-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  height: 82%;
  border: 3.5px solid rgba(225, 75, 75, 0.70);
  background-color: rgba(225, 75, 75, 0.20);
  border-radius: 50%;
  pointer-events: none !important;
  z-index: 20;
}

/* Hide coordinates on board when toggle is unchecked */
body.hide-coordinates #chessboard .notation-322f9,
body.hide-coordinates #chessboard [class*="notation"] {
  display: none !important;
}


/* Glowing Hint Button for Critical/Special Tactical Situations */
.btn-hint-glow {
  border-color: #f59e0b !important;
  color: #fbbf24 !important;
  background-color: rgba(245, 158, 11, 0.15) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6) !important;
  animation: hintPulse 1.8s infinite ease-in-out;
}


@keyframes hintPulse {
  0%, 100% {
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.85);
    transform: scale(1.05);
  }
}


/* Ad Placement Slot */
.ad-slot {
  width: 100%;
  border: 1px dashed var(--border-subtle);
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 85px;
  text-align: center;
}


.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}


.ad-mock-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}


.ad-mock-badge {
  font-size: 0.72rem;
  color: var(--accent-cta);
  font-weight: 600;
}


.ad-mock-body {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ==========================================================================
   Right Column: Position Analysis Card (Reference Image Layout)
   ========================================================================== */
.controls-column {
  flex: 1 1 420px;
  min-width: 320px;
  max-width: 550px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}


.analysis-card {
  width: 100%;
  box-sizing: border-box;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}


.card-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}


.card-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}


.card-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
}


.social-btn.btn-fb {
  background-color: #1877f2;
  border-color: #1877f2;
  color: #ffffff;
}


.social-btn.btn-x {
  background-color: #0f172a;
  border-color: var(--border-subtle);
  color: #ffffff;
}


.icon-btn {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}


.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}


/* Engine Live Status Banner (Reference Image Look) */
.engine-status-pill-banner {
  background-color: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
}


.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}


.live-dot.paused {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}


.status-pill-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  flex: 1;
}


.status-pill-text strong {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}


.status-sub-info {
  font-size: 0.775rem;
  color: var(--text-muted);
}


/* Action Controls Row 1 (Stop, Back, Move) */
.controls-primary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 0.65rem;
}


.btn-move-primary {
  background-color: var(--accent-cta);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}


.btn-move-primary:hover {
  background-color: var(--accent-cta-hover);
}


/* Side to Move Segmented Control (Reference Image) */
.card-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}


.section-row-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}


.side-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.side-toggle-btn {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}


.side-toggle-btn.active {
  background-color: var(--accent-cta);
  color: #ffffff;
  border-color: var(--accent-cta);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}


/* Castling Rights Chips (Reference Image) */
.castling-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.castling-option-btn {
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.castling-option-btn:hover .section-row-label {
  color: var(--accent-cta);
}

.castling-toggle-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.castling-toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.castling-chips {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.castling-chips.hidden {
  display: none;
}

.castling-chip {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.castling-chip.active {
  background-color: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
}

.castling-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-feedback-link {
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.header-feedback-link:hover {
  color: var(--accent-cta);
}


/* Reset / Kings Only / Rotate Row (Reference Image) */
.board-ops-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}


/* Current FEN Box (Reference Image) */
.fen-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}


.fen-box-header {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
}


.fen-box-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}


.fen-inline-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.4rem;
}


.fen-text-display {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--accent-cta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-color: var(--bg-surface);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}


/* Move History Strip */
.history-strip {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}


.history-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.history-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}


.history-moves-list {
  max-height: 100px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  line-height: 1.5;
}


.move-entry {
  color: var(--text-secondary);
}


.move-entry .san-move {
  color: var(--text-primary);
  font-weight: 600;
}


/* ==========================================================================
   Auto Play Page (Human vs Stockfish Bot)
   ========================================================================== */
.autoplay-layout {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-sizing: border-box;
}


.bot-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 1rem;
}


.bot-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}


.bot-avatar {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  background-color: var(--bg-surface-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}


.bot-name {
  font-weight: 800;
  font-size: 1.05rem;
}


.bot-rating {
  font-size: 0.775rem;
  color: var(--accent-primary);
  font-weight: 700;
}


.bot-thinking-bubble {
  font-size: 0.8rem;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
}


/* ==========================================================================
   FIDE Calculator Page
   ========================================================================== */
.fide-calculator-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}


.fide-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}


.fide-tabs-bar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: fit-content;
  max-width: 100%;
}

.fide-tab-btn {
  padding: 0.5rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fide-tab-btn:hover {
  color: var(--text-primary);
}

.fide-tab-btn.active {
  background: var(--accent-cta);
  color: #0b1320;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.calc-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.calc-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.calc-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.calc-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 13px;
  padding-right: 2.2rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calc-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.20);
}

.calc-input optgroup {
  background-color: #0b1322;
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.35rem 0.2rem;
}

.calc-input option {
  background-color: #172030;
  color: #f1f5f9;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.6rem;
}

.rating-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.01em;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #38bdf8;
  white-space: nowrap;
}

.rating-input-composite {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rating-input-composite:hover,
.rating-input-composite:focus-within {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.rating-input-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.rating-num-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.55rem 0.7rem;
  color: #ffffff;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rating-num-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.rating-adjust-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.rating-adjust-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.fide-result-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.result-pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.result-pill-btn:hover {
  border-color: var(--accent-cta);
  color: var(--text-primary);
}

.result-pill-btn.active.pill-win {
  background: rgba(34, 197, 94, 0.18);
  border-color: #22c55e;
  color: #4ade80;
}

.result-pill-btn.active.pill-draw {
  background: rgba(234, 179, 8, 0.18);
  border-color: #eab308;
  color: #facc15;
}

.result-pill-btn.active.pill-loss {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  color: #f87171;
}

.fide-results-box {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  text-align: center;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.result-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.result-val {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

.result-val.delta-positive {
  color: #4ade80;
}

.result-val.delta-negative {
  color: #f87171;
}

.result-val.delta-neutral {
  color: #94a3b8;
}

.prob-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.prob-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.3s ease;
}

.fide-summary-banner {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.fide-summary-banner strong {
  color: var(--text-primary);
}

.tpr-round-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 44px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
  .tpr-round-row {
    grid-template-columns: 70px 1fr 1fr 40px;
    gap: 0.4rem;
  }
  .fide-summary-banner {
    flex-direction: column;
    align-items: stretch;
  }
}


/* ==========================================================================
   Pieces Guide Page
   ========================================================================== */
.pieces-guide-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}


.piece-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}


.piece-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}


.piece-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}


.piece-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}


.piece-glyph {
  font-size: 3rem;
  line-height: 1;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}


.piece-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}


.piece-name {
  font-size: 1.4rem;
  font-weight: 800;
}


.piece-value {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 700;
}


.piece-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}


.piece-strategy-box {
  background-color: var(--bg-surface-elevated);
  border-left: 3px solid var(--accent-cta);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}


/* ==========================================================================
   Screenshot Scanner Page
   ========================================================================== */
.screenshot-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}


.dropzone-box {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}


.dropzone-box:hover,
.dropzone-box.dragover {
  border-color: var(--accent-cta);
  background-color: var(--bg-surface-elevated);
}


.dropzone-icon {
  font-size: 3rem;
  color: var(--accent-cta);
}


.preview-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}


.screenshot-preview-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.screenshot-preview-box img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  object-fit: contain;
}

.screenshot-studio-grid {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 860px) {
  .screenshot-studio-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: rgba(14, 22, 38, 0.98);
  margin-top: auto;
  padding: 2.5rem 1.5rem;
}


.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}


.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}


.footer-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}


.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
}


.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
}


.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}


.footer-nav a:hover {
  color: var(--text-primary);
}


.footer-copyright {
  font-size: 0.775rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   Header Action Buttons & Settings Modal Contract (Matching Reference Image 1)
   ========================================================================== */
.header-settings-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-settings-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background-color: var(--bg-surface-subtle);
  transform: rotate(25deg);
}

/* Settings Modal Dialog (Exact Layout & Visual Aesthetics from Reference Image 1) */
.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 9, 18, 0.82);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.settings-modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.settings-modal-card {
  background: #141b27;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.settings-modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.settings-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.settings-modal-close:hover {
  color: #f8fafc;
}

.settings-modal-body {
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Settings Row with Label & Subtext (Matching Reference Image 1) */
.settings-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-option-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-option-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 240px;
}

.settings-group-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  margin-top: 0.5rem;
  margin-bottom: 0.15rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

.settings-rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.settings-option-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.settings-option-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.35;
  margin-top: 2px;
}

/* Segmented Pill Group (Matching Reference Image 1) */
.segmented-group {
  display: inline-flex;
  align-items: center;
  background-color: #172030;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.segmented-pill {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.segmented-pill:hover {
  color: #f1f5f9;
}

.segmented-pill.active {
  background-color: #0f1c2e;
  border-color: #1d4ed8;
  color: #60a5fa;
  font-weight: 700;
}

.segmented-pill-sub {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 1px;
}

.segmented-pill.active .segmented-pill-sub {
  color: #93c5fd;
}

/* iOS-style Toggle Switch (Matching Reference Image 1) */
.switch-control {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 25px;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s;
  border-radius: 25px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 19px;
  width: 19px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

.switch-control input:checked + .switch-slider {
  background-color: #38bdf8;
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(21px);
}

/* Piece Theme Grid in Settings */
.piece-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 0.5rem;
}

.piece-theme-card {
  background: #1a2233;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.55rem 0.45rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.piece-theme-card:hover {
  border-color: #38bdf8;
}

.piece-theme-card.active {
  border-color: #38bdf8;
  background-color: #1e3a5f;
}

.piece-theme-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 32px;
}

.piece-theme-preview img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.piece-theme-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* Settings Modal Footer (Matching Reference Image 1: Cancel & Save) */
.settings-modal-footer {
  padding: 1.1rem 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: rgba(14, 21, 33, 0.85);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.btn-modal-cancel {
  background-color: #242e42;
  color: #cbd5e1;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-modal-cancel:hover {
  background-color: #2d3a54;
  color: #f8fafc;
}

.btn-modal-save {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.6rem 1.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-modal-save:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Feedback & Generic Modal Backdrops */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-backdrop.open,
.modal-backdrop[style*="display: flex"] {
  display: flex !important;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-dialog {
  background: #141b27;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  z-index: 10000;
}

.modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(14, 21, 33, 0.85);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1;
}

.modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.modal-body {
  padding: 1.35rem;
  overflow-y: auto;
  box-sizing: border-box;
  color: #cbd5e1;
}



/* ==========================================================================
   Responsive Viewport Architecture (Laptop/PC Viewport Ergonomics & Mobile Perfection)
   ========================================================================== */

/* ==========================================================================
   Responsive Viewport Architecture
   - Desktop & Laptop Screens (>= 1025px): Board fills column flush, no side gaps
   - Tablet Screens (641px - 1024px): "Mini-laptop", full top navigation bar,
     settings icon, theme options visible, zero piece clipping
   - Mobile Phone Screens (<= 640px): Pixel-perfect, streamlined, zero cutoff
   ========================================================================== */

/* ==========================================================================
   5 STRICT RESPONSIVE LAYOUT RULES
   ========================================================================== */

/* ==========================================================================
   5 STRICT RESPONSIVE LAYOUT RULES
   ========================================================================== */

/* RULE 1: MASTER TWO-COLUMN GRID SYSTEM (For PC, Laptops & Landscape Tablets > 900px) */
@media (min-width: 901px) {
  .app-grid,
  .screenshot-studio-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Left column: Chessboard section sits comfortably on the left side */
  .board-column {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 500px !important;
    min-width: 380px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* Right column: Position Analysis control board sits perfectly on the right side parallel */
  .controls-column {
    flex: 1 1 420px !important;
    max-width: 550px !important;
    min-width: 360px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .board-container-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    gap: 0.65rem;
    box-sizing: border-box;
  }

  .eval-bar-wrapper {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    flex-shrink: 0;
  }

  .chessboard-box {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
  }
}

/* RULE 2: MOBILE & PORTRAIT TABLET AUTO-STACKING (<= 900px) */
@media (max-width: 900px) {
  .app-grid,
  .screenshot-studio-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Board section sits proudly on top */
  .board-column {
    width: 100% !important;
    max-width: 500px !important;
    flex: none !important;
    margin: 0 auto !important;
    padding: 0.75rem 0.85rem !important;
    box-sizing: border-box !important;
  }

  /* Position Analysis controls slide smoothly underneath it */
  .controls-column {
    width: 100% !important;
    max-width: 500px !important;
    flex: none !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  .board-container-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    gap: 0.5rem;
    box-sizing: border-box;
  }

  .eval-bar-wrapper {
    width: 26px;
    min-width: 26px;
    max-width: 26px;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .chessboard-box {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
  }

  .controls-primary-row {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    box-sizing: border-box;
  }

  .btn-move-primary {
    grid-column: 1 / -1;
  }
}

/* Tablet Screens (841px - 1080px) Header & Navigation */
@media (min-width: 841px) and (max-width: 1080px) {
  .app-header {
    padding: 0.45rem 1rem;
  }

  .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
  }

  .brand-wordmark {
    font-size: 1.05rem;
    flex-shrink: 0;
  }

  .nav-links {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: nowrap;
  }

  .nav-links a {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.25rem;
    white-space: nowrap;
  }

  .header-actions {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .mobile-menu-btn {
    display: none !important;
  }
}

/* Mobile Screens (<= 840px): Clean Mobile Hamburger Drawer to prevent any disappearing header links */
@media (max-width: 840px) {
  .nav-links {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block !important;
  }
}

/* 3. Mobile Phone Screens (<= 640px): Fluid Expansion & Protective Padding Shield */
@media (max-width: 640px) {
  .main-layout,
  .autoplay-layout,
  .fide-calculator-container,
  .pieces-guide-container,
  .screenshot-container {
    padding: 0.75rem 0.85rem;
    gap: 0.85rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-banner {
    padding: 0.2rem 0;
    gap: 0.15rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-kicker {
    display: none;
  }

  .hero-title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .hero-desc {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .hero-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .hero-lang-picker-slot {
    padding-top: 0;
    align-self: flex-start;
  }

  .lang-menu {
    left: 0;
    right: auto;
    max-width: calc(100vw - 2rem);
  }

  .nav-links {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  .mobile-heading-text {
    display: inline !important;
  }

  .desktop-heading-text {
    display: none !important;
  }

  .app-grid,
  .screenshot-studio-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.85rem !important;
    box-sizing: border-box !important;
  }

  .board-column,
  .controls-column,
  .analysis-card {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .board-container-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .eval-bar-wrapper {
    width: 22px;
    min-width: 22px;
    max-width: 22px;
    border-radius: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .eval-score-badge {
    font-size: 0.58rem;
    padding: 1px 2px;
  }

  .chessboard-box {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
  }

  #chessboard,
  #screenshotBoard {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
  }

  .piece-palette-bar {
    padding: 0.25rem 0.45rem;
    gap: 0.25rem;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .palette-side-tag {
    font-size: 0.65rem;
    padding: 0.12rem 0.35rem;
    flex-shrink: 0;
  }

  .palette-btn-group {
    gap: 0.2rem;
    flex-shrink: 0;
  }

  .palette-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 1.2rem;
    box-sizing: border-box;
  }

  .palette-btn img.palette-piece-img {
    width: 22px;
    height: 22px;
  }

  .palette-btn.btn-delete {
    font-size: 0.95rem;
    padding-left: 0.25rem;
    margin-left: 0.1rem;
  }

  .captured-pieces-strip {
    min-height: 24px;
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }

  .bot-profile-card {
    padding: 0.45rem 0.65rem;
    width: 100%;
    box-sizing: border-box;
  }

  .card-top-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-section-row,
  .castling-row {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
  }

  .board-ops-row {
    grid-template-columns: 1fr;
    width: 100%;
    box-sizing: border-box;
  }

  .controls-primary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    box-sizing: border-box;
  }

  .controls-primary-row button,
  .controls-primary-row a {
    width: 100%;
    box-sizing: border-box;
  }

  .btn-move-primary {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
  }

  .theme-picker {
    display: none;
  }

  /* Rule 5: Input fields, buttons, forms adapt cleanly to 100% */
  .custom-select,
  .calc-input,
  .fen-display-input,
  .text-field,
  input[type="text"],
  input[type="number"],
  select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 420px) {
  .palette-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .palette-btn img.palette-piece-img {
    width: 19px;
    height: 19px;
  }

  .palette-side-tag {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
  }

  .palette-btn-group {
    gap: 0.15rem;
  }
}

/* ==========================================================================
   About Us - Blog-Style Article Layout (Centered Page, Left-Aligned Headings)
   ========================================================================== */
.about-page-main,
.about-blog-main,
.legal-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 3rem 1.25rem 5rem;
  box-sizing: border-box;
  flex: 1;
}

.about-page-container,
.about-blog-container,
.legal-container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  box-sizing: border-box;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb-trail a {
  color: var(--accent-cta);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb-trail a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.breadcrumb-current {
  color: var(--text-secondary);
}

/* Centered Header for Blog-Style About Us */
.about-blog-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  margin-bottom: 1.15rem;
}

.about-badge-icon {
  font-size: 0.95rem;
}

.about-blog-title {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.15;
  text-align: center;
}

.about-blog-tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 1.25rem;
  line-height: 1.45;
  text-align: center;
}

.about-blog-lead {
  font-size: 1.08rem;
  color: #e2e8f0;
  line-height: 1.85;
  text-align: left;
  margin-top: 0.5rem;
}

/* Blog Article Flow */
.about-blog-article {
  width: 100%;
  text-align: left;
}

.about-blog-heading {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: left;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.about-blog-text {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  text-align: left;
}

.about-blog-text.about-sub-paragraph {
  margin-top: 0.75rem;
}

.about-blog-list {
  padding-left: 1.5rem;
  margin: 0.75rem 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.about-blog-list li {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.75;
}

.about-blog-list li strong {
  color: #f8fafc;
}

/* End Contact Us Link - Simple Inline Note with Blue Underline & Emoji */
.about-blog-contact {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 1.05rem;
  color: #e2e8f0;
  line-height: 1.75;
  text-align: left;
}

.about-contact-underline-link,
.about-blog-contact a,
.about-blog-text a.about-contact-underline-link,
a.about-contact-underline-link {
  color: #38bdf8 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-decoration-color: #38bdf8 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 4px !important;
  display: inline !important;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.about-contact-underline-link:hover,
.about-blog-contact a:hover,
.about-blog-text a.about-contact-underline-link:hover,
a.about-contact-underline-link:hover {
  color: #93c5fd !important;
  text-decoration-color: #93c5fd !important;
}

/* Responsive Breakpoints for Tablet & Mobile */
@media (max-width: 768px) {
  .about-page-main,
  .about-blog-main,
  .legal-main {
    padding: 2rem 1rem 3.5rem;
  }

  .about-blog-title {
    font-size: 2.25rem;
  }

  .about-blog-tagline {
    font-size: 1.15rem;
  }

  .about-blog-lead {
    font-size: 1.02rem;
  }

  .about-blog-heading {
    font-size: 1.35rem;
    margin-top: 2.25rem;
  }

  .about-blog-text {
    font-size: 1rem;
    line-height: 1.75;
  }
}

@media (max-width: 480px) {
  .about-page-main,
  .about-blog-main,
  .legal-main {
    padding: 1.5rem 0.85rem 3rem;
  }

  .about-blog-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .about-blog-title {
    font-size: 1.95rem;
  }

  .about-blog-tagline {
    font-size: 1.05rem;
  }

  .about-blog-lead {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .about-blog-heading {
    font-size: 1.25rem;
    margin-top: 1.85rem;
    margin-bottom: 0.75rem;
  }

  .about-blog-text {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .about-blog-contact {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   Contact Us Page - Responsive Form Matching Screenshot
   ========================================================================== */
.contact-page-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 3rem 1.25rem 5rem;
  box-sizing: border-box;
  flex: 1;
}

.contact-page-container {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  box-sizing: border-box;
}

.contact-header-block {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
}

.contact-page-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
  margin-bottom: 0.75rem;
  text-align: center;
}

.contact-page-subtitle {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.6;
  text-align: left;
  margin: 0 auto 1.5rem auto;
  max-width: 840px;
}

.contact-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 2.5rem 2.5rem;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  width: 100%;
}

.contact-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
}

.contact-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}

.contact-input,
.contact-textarea {
  width: 100%;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.contact-input {
  height: 48px;
}

.contact-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

.contact-input:focus,
.contact-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #1e293b;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.contact-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.contact-btn-submit {
  background-color: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}

.contact-btn-submit:hover:not(:disabled) {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.contact-btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.contact-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Alert Notification Styles */
.contact-alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  box-sizing: border-box;
}

.contact-alert-success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #4ade80;
}

.contact-alert-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.alert-icon {
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .contact-page-main {
    padding: 2rem 1rem 3.5rem;
  }

  .contact-card {
    padding: 1.75rem 1.5rem;
  }

  .contact-page-title {
    font-size: 2rem;
  }

  .contact-textarea {
    min-height: 150px;
  }
}

@media (max-width: 480px) {
  .contact-page-main {
    padding: 1.25rem 0.75rem 2.5rem;
  }

  .contact-card {
    padding: 1.25rem 1rem;
    border-radius: 10px;
  }

  .contact-page-title {
    font-size: 1.75rem;
  }

  .contact-page-subtitle {
    font-size: 0.92rem;
    margin-bottom: 1.15rem;
  }

  .contact-input {
    height: 44px;
    font-size: 0.95rem;
  }

  .contact-textarea {
    min-height: 140px;
    font-size: 0.95rem;
  }

  .contact-btn-submit {
    width: 100%;
    padding: 0.75rem 1.5rem;
  }
}

/* ==========================================================================
   Home Page Feature Sections, Guides, FAQ Accordion & Related Tools (4 Reference Images)
   ========================================================================== */
.home-feature-sections {
  width: 100%;
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  box-sizing: border-box;
}

.home-section-title,
.guide-inner-title,
#featuresHeading,
#howToUseHeading,
#dedicatedToolsHeading,
#faqHeading,
#relatedToolsHeading {
  text-align: center !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
}

.home-section-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 1.35rem;
  line-height: 1.25;
}

/* 1. Chess Move Calculator & Analysis Features (Image 1) */
.features-section-block {
  width: 100%;
}

.feature-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.feature-info-card {
  background: rgba(18, 28, 46, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
}

.feature-info-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.feature-card-heading {
  font-size: 1.18rem;
  font-weight: 700;
  color: #38bdf8;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.feature-card-paragraph {
  font-size: 0.92rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

/* 2. Understand Your Chess Position & How to Use (Image 2) */
.guide-content-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}

.guide-lead-text {
  font-size: 1.02rem;
  color: #cbd5e1;
  line-height: 1.68;
  margin: 0 auto 1rem auto;
  max-width: 980px;
  text-align: center;
}

.guide-inner-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem 1.85rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.guide-inner-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 1rem 0;
  text-align: center;
  width: 100%;
}

.guide-bullets-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guide-bullets-list li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.94rem;
  color: #94a3b8;
  line-height: 1.55;
}

.guide-bullets-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: #38bdf8;
  font-size: 1.2rem;
  line-height: 1.2;
}

.guide-bullets-list li strong {
  color: #f1f5f9;
}

.how-to-steps-container {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1rem;
}

.step-item-row {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.step-num-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.16);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-details-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.step-title-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.step-desc-text {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

/* 3. Dedicated Tools & FAQ Accordion (Image 3) */
.tools-and-faq-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.single-answer-callout {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  padding: 1rem 1.35rem;
  font-size: 0.94rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.single-answer-callout a {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.single-answer-callout a:hover {
  color: #7dd3fc;
}

.dedicated-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.dedicated-tool-card {
  background: rgba(18, 28, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.45rem 1.6rem;
  display: flex;
  gap: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.dedicated-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  background-color: rgba(22, 34, 56, 0.95);
}

.tool-card-icon-badge {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tool-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.tool-card-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

/* Frequently Asked Questions (Image 3) */
.faq-accordion-container {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  overflow: hidden;
}

.faq-accordion-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.faq-accordion-item:last-child {
  border-bottom: none;
}

.faq-question-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.5rem;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.faq-question-button * {
  pointer-events: none;
}

.faq-question-button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #38bdf8;
}

.faq-toggle-chevron {
  font-size: 0.85rem;
  color: #64748b;
  transition: transform 0.25s ease, color 0.15s ease;
  flex-shrink: 0;
}

.faq-accordion-item.open .faq-toggle-chevron {
  transform: rotate(180deg);
  color: #38bdf8;
}

.faq-answer-collapse {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
}

.faq-accordion-item.open .faq-answer-collapse {
  max-height: 800px !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  padding: 0.35rem 1.5rem 1.35rem 1.5rem !important;
}

.faq-answer-collapse p {
  font-size: 0.925rem;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0;
}

/* 4. Related Tools (Image 4) */
.related-tools-section-block {
  width: 100%;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.related-tool-card-box {
  background: rgba(18, 28, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.related-tool-card-box:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.related-tool-top {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.related-tool-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.related-tool-title-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.related-tool-desc-text {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

.related-tool-cta-link {
  color: #f59e0b;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.15s ease, color 0.15s ease;
}

.related-tool-cta-link:hover {
  color: #fbbf24;
  gap: 0.5rem;
}

/* Floating Feedback Pill (Image 4) */
.floating-feedback-pill {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.floating-feedback-pill:hover {
  transform: translateY(-2px);
  background-color: #334155;
  border-color: #38bdf8;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.25);
  color: #ffffff;
}

.floating-feedback-pill.widget-open {
  background-color: #334155 !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6) !important;
}

/* ==========================================================================
   Competitor-Style Feedback Popup Widget (Compact, Non-Cutting, Sleek)
   ========================================================================== */
.feedback-popup-widget {
  position: fixed;
  bottom: 60px;
  right: 18px;
  top: auto;
  z-index: 10000;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 75px);
  max-height: calc(100dvh - 75px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  background-color: #111827;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0.85rem;
  box-sizing: border-box;
  animation: fbSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: none !important;
  flex-direction: column;
  gap: 0.45rem;
}

.feedback-popup-widget.open {
  display: flex !important;
}

@keyframes fbSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fb-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fb-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fb-pawn-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #e2e8f0;
  flex-shrink: 0;
}

.fb-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.fb-subtitle {
  margin: 1px 0 0;
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.2;
}

.fb-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.fb-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.fb-widget-form {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.fb-form-group {
  display: flex;
  flex-direction: column;
}

.fb-field-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.fb-stars-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.fb-star-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 1.25rem;
  color: #475569;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease, transform 0.1s ease;
}

.fb-star-btn:hover {
  transform: scale(1.15);
}

.fb-star-btn.active {
  color: #f59e0b;
}

.fb-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.fb-tag-pill {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fb-tag-pill:hover {
  background: #334155;
  color: #f1f5f9;
}

.fb-tag-pill.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.fb-textarea-wrap {
  position: relative;
}

.fb-textarea {
  background: #1a2234;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f8fafc;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  height: 46px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fb-textarea:focus {
  border-color: #b58855;
  box-shadow: 0 0 0 2px rgba(181, 136, 85, 0.25);
}

.fb-char-counter {
  text-align: right;
  font-size: 0.65rem;
  color: #64748b;
  margin-top: 2px;
}

.fb-input {
  background: #1a2234;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f8fafc;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fb-input:focus {
  border-color: #b58855;
  box-shadow: 0 0 0 2px rgba(181, 136, 85, 0.25);
}

.fb-submit-btn {
  background: #b58855;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease, transform 0.1s ease;
}

.fb-submit-btn:hover {
  background: #a37542;
}

.fb-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.fb-success-banner {
  padding: 0.4rem 0.6rem;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 6px;
  color: #86efac;
  font-size: 0.76rem;
  text-align: center;
  font-weight: 600;
}

.fb-links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.1rem;
}

.fb-google-link,
.fb-fullpage-link {
  font-size: 0.7rem;
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.fb-google-link:hover,
.fb-fullpage-link:hover {
  color: #93c5fd;
}

/* Specific styling for laptop screens (<= 800px screen height or 125%-150% scaling) */
@media (max-height: 800px) {
  .feedback-popup-widget {
    bottom: 54px;
    max-height: calc(100dvh - 65px);
    padding: 0.6rem 0.75rem;
    gap: 0.35rem;
  }
  .fb-pawn-badge {
    width: 24px;
    height: 24px;
    font-size: 0.95rem;
  }
  .fb-subtitle {
    display: none;
  }
  .fb-textarea {
    min-height: 38px;
    height: 38px;
  }
  .fb-input {
    height: 28px;
  }
}

/* Small mobile devices */
@media (max-width: 640px) {
  .feedback-popup-widget {
    bottom: 56px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: 340px;
    margin: 0 0 0 auto;
    max-height: calc(100dvh - 65px);
    padding: 0.65rem 0.75rem;
    gap: 0.35rem;
  }
}

@media (max-height: 580px) {
  .feedback-popup-widget {
    bottom: 45px;
    max-height: calc(100dvh - 52px);
    padding: 0.5rem 0.65rem;
    gap: 0.25rem;
  }
  .fb-textarea {
    min-height: 32px;
    height: 32px;
  }
  .fb-input {
    height: 26px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .home-feature-sections {
    padding: 0 1.25rem;
    gap: 2.75rem;
  }
  .feature-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dedicated-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-section-title {
    font-size: 1.65rem;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .home-feature-sections {
    padding: 0 0.65rem;
    gap: 2.25rem;
    margin: 1.25rem auto 2.5rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .home-section-title {
    font-size: 1.32rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    text-align: center;
    padding: 0 0.25rem;
  }

  .guide-lead-text {
    font-size: 0.92rem;
    text-align: center;
    padding: 0 0.25rem;
    margin-bottom: 1rem;
  }

  .feature-cards-grid,
  .dedicated-tools-grid,
  .related-tools-grid {
    grid-template-columns: 1fr;
    gap: 0.95rem;
    width: 100%;
  }

  .feature-info-card {
    padding: 1.15rem 1.25rem;
    border-radius: 12px;
  }

  .feature-card-heading {
    font-size: 1.08rem;
  }

  .feature-card-paragraph {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .step-item-row {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .step-num-badge {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .step-title-text {
    font-size: 0.98rem;
  }

  .step-desc-text {
    font-size: 0.86rem;
  }

  .guide-inner-card {
    padding: 1.15rem 1.15rem;
  }

  .guide-inner-title {
    font-size: 1.12rem;
    text-align: center;
  }

  .guide-bullets-list li {
    font-size: 0.88rem;
    padding-left: 1.15rem;
  }

  .faq-accordion-container {
    border-radius: 10px;
  }

  .faq-question-button {
    padding: 0.95rem 1.15rem;
    font-size: 0.95rem;
    gap: 0.75rem;
  }

  .faq-answer-collapse {
    padding: 0 1.15rem;
  }

  .faq-accordion-item.open .faq-answer-collapse {
    padding: 0 1.15rem 1.1rem 1.15rem;
  }

  .faq-answer-collapse p {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .related-tool-card-box {
    padding: 1.2rem 1.25rem;
  }

  .floating-feedback-pill {
    bottom: 14px;
    right: 14px;
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  .home-feature-sections {
    padding: 0 0.35rem;
  }
  .feature-info-card,
  .step-item-row,
  .guide-inner-card,
  .related-tool-card-box {
    padding: 0.95rem 0.95rem;
  }
}



