/* ============================
   WestCoastCheckers.com
   West Coast / LA Theme
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Righteous&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --sunset-orange: #FF6B35;
  --golden-yellow: #FFB347;
  --ocean-blue: #1B6CA8;
  --sky-blue: #87CEEB;
  --sandy-tan: #F4E4BC;
  --warm-white: #FFF8F0;
  --driftwood: #8B7355;
  --palm-green: #2E8B57;
  --coral-pink: #FF6F61;
  --deep-navy: #0D2137;

  --board-light: #F5DEB3;
  --board-dark: #1B6CA8;
  --board-dark-hover: #2180c4;
  --piece-light: #FFD699;
  --piece-light-stroke: #E8A030;
  --piece-dark: #1A3A5C;
  --piece-dark-stroke: #0D2137;
  --highlight-move: rgba(255, 183, 71, 0.5);
  --highlight-capture: rgba(255, 71, 71, 0.5);
  --highlight-last: rgba(46, 139, 87, 0.35);

  --font-display: 'Righteous', cursive;
  --font-body: 'Inter', sans-serif;

  --shadow-warm: 0 4px 20px rgba(255, 107, 53, 0.15);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--deep-navy);
  background: linear-gradient(180deg, #FFF0E0 0%, #FFE4CC 30%, #E0F0FF 70%, #C5E3F6 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === PALM TREE BG DECORATION === */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='400' viewBox='0 0 200 400'%3E%3Cg opacity='0.04'%3E%3Cpath d='M100 400 L100 180' stroke='%232E8B57' stroke-width='8' fill='none'/%3E%3Cellipse cx='100' cy='160' rx='80' ry='30' fill='%232E8B57' transform='rotate(-30 100 160)'/%3E%3Cellipse cx='100' cy='160' rx='80' ry='30' fill='%232E8B57' transform='rotate(30 100 160)'/%3E%3Cellipse cx='100' cy='150' rx='70' ry='25' fill='%232E8B57' transform='rotate(-60 100 150)'/%3E%3Cellipse cx='100' cy='150' rx='70' ry='25' fill='%232E8B57' transform='rotate(60 100 150)'/%3E%3C/g%3E%3C/svg%3E") left bottom no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='400' viewBox='0 0 200 400'%3E%3Cg opacity='0.04'%3E%3Cpath d='M100 400 L100 180' stroke='%232E8B57' stroke-width='8' fill='none'/%3E%3Cellipse cx='100' cy='160' rx='80' ry='30' fill='%232E8B57' transform='rotate(-30 100 160)'/%3E%3Cellipse cx='100' cy='160' rx='80' ry='30' fill='%232E8B57' transform='rotate(30 100 160)'/%3E%3Cellipse cx='100' cy='150' rx='70' ry='25' fill='%232E8B57' transform='rotate(-60 100 150)'/%3E%3Cellipse cx='100' cy='150' rx='70' ry='25' fill='%232E8B57' transform='rotate(60 100 150)'/%3E%3C/g%3E%3C/svg%3E") right bottom no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* === NAV === */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 107, 53, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--sunset-orange);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .logo-icon {
  font-size: 1.8rem;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--deep-navy);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

/* === HERO (Landing) === */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--sunset-orange), var(--golden-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--driftwood);
  margin-bottom: 48px;
  font-weight: 400;
}

.hero .sun {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--golden-yellow), var(--sunset-orange));
  border-radius: 50%;
  margin: 0 auto 40px;
  box-shadow: 0 0 60px rgba(255, 179, 71, 0.4), 0 0 120px rgba(255, 107, 53, 0.15);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(255, 179, 71, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 80px rgba(255, 179, 71, 0.6); }
}

/* === GAME MODE CARDS === */
.game-modes {
  display: flex;
  gap: 32px;
  justify-content: center;
  padding: 0 24px 80px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.mode-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 340px;
  text-align: center;
  box-shadow: var(--shadow-warm);
  border: 1px solid rgba(255, 107, 53, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.mode-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 32px rgba(255, 107, 53, 0.2);
}

.mode-card .board-preview {
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
  display: grid;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.mode-card .board-preview.board-8 { grid-template-columns: repeat(8, 1fr); }
.mode-card .board-preview.board-10 { grid-template-columns: repeat(10, 1fr); }

.board-preview .sq {
  aspect-ratio: 1;
}

.board-preview .sq-light { background: var(--board-light); }
.board-preview .sq-dark { background: var(--board-dark); }

.mode-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--deep-navy);
  margin-bottom: 8px;
}

.mode-card .subtitle {
  color: var(--driftwood);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sunset-orange), var(--golden-yellow));
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.45);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--ocean-blue), var(--sky-blue));
  color: white;
  box-shadow: 0 4px 16px rgba(27, 108, 168, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 6px 24px rgba(27, 108, 168, 0.45);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
}

.btn-accent:hover {
  box-shadow: 0 6px 24px rgba(231, 76, 60, 0.45);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--driftwood);
  border: 2px solid var(--driftwood);
}

.btn-outline:hover {
  background: var(--driftwood);
  color: white;
}

.btn-disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
}

/* === COMING SOON BANNER === */
.coming-soon {
  text-align: center;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

.coming-soon p {
  font-size: 1.1rem;
  color: var(--driftwood);
}

.coming-soon .btn {
  margin-top: 16px;
}

/* === FOOTER === */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--driftwood);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* ============================
   GAME PAGE
   ============================ */

.game-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
}

/* === SETUP SCREEN === */
.setup-screen {
  max-width: 500px;
  margin: 40px auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow-warm);
  text-align: center;
}

.setup-screen h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--deep-navy);
  margin-bottom: 24px;
}

.setup-group {
  margin-bottom: 24px;
  text-align: left;
}

.setup-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--deep-navy);
}

.setup-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.setup-options button {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid #ddd;
  background: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--deep-navy);
}

.setup-options button:hover {
  border-color: var(--sunset-orange);
}

.setup-options button.selected {
  border-color: var(--sunset-orange);
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.08), rgba(255, 179, 71, 0.08));
  color: var(--sunset-orange);
  font-weight: 700;
}

.start-game-btn {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
}

/* === GAME LAYOUT === */
.game-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

/* === PLAYER INFO === */
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s;
}

.player-bar.active-turn {
  box-shadow: 0 0 0 2px var(--sunset-orange), var(--shadow-soft);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-piece-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid;
}

.player-piece-icon.dark-piece {
  background: var(--piece-dark);
  border-color: var(--piece-dark-stroke);
}

.player-piece-icon.light-piece {
  background: var(--piece-light);
  border-color: var(--piece-light-stroke);
}

.player-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.captured-count {
  font-size: 0.85rem;
  color: var(--driftwood);
}

/* === BOARD === */
.board-wrapper {
  position: relative;
  flex-shrink: 0;
}

.board {
  display: grid;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 4px solid var(--driftwood);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.board.board-8 {
  grid-template-columns: repeat(8, 1fr);
  width: min(85vw, 520px);
  height: min(85vw, 520px);
}

.board.board-10 {
  grid-template-columns: repeat(10, 1fr);
  width: min(85vw, 520px);
  height: min(85vw, 520px);
}

.square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.15s;
}

.square.light { background: var(--board-light); }
.square.dark { background: var(--board-dark); }
.square.dark:hover { background: var(--board-dark-hover); }
.square.highlight-move { background: var(--highlight-move) !important; cursor: pointer; }
.square.highlight-capture { background: var(--highlight-capture) !important; cursor: pointer; }
.square.highlight-last { box-shadow: inset 0 0 0 3px rgba(46, 139, 87, 0.5); }
.square.highlight-selected { box-shadow: inset 0 0 0 3px var(--golden-yellow); }

/* === PIECES === */
.piece {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  position: absolute;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.piece:hover {
  transform: scale(1.08);
}

.piece.dark-piece {
  background: radial-gradient(circle at 35% 35%, #2A5A8C, var(--piece-dark));
  border: 2px solid var(--piece-dark-stroke);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.piece.light-piece {
  background: radial-gradient(circle at 35% 35%, #FFE8B8, var(--piece-light));
  border: 2px solid var(--piece-light-stroke);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.piece.king::after {
  content: '♛';
  font-size: 1.4em;
  position: absolute;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

.piece.light-piece.king::after {
  color: rgba(139, 69, 19, 0.85);
}

.piece.moving {
  transition: left 0.3s ease, top 0.3s ease;
  z-index: 10;
}

.piece.captured {
  animation: fadeCapture 0.35s ease forwards;
}

@keyframes fadeCapture {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.3); opacity: 0; }
}

/* === SIDE PANEL === */
.side-panel {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.panel-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--deep-navy);
  margin-bottom: 10px;
}

.move-list {
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--driftwood);
}

.move-list .move-number {
  font-weight: 700;
  color: var(--deep-navy);
  margin-right: 4px;
}

.game-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.game-controls .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.85rem;
  min-width: 100px;
}

/* === STATUS / MESSAGES === */
.game-status {
  text-align: center;
  padding: 12px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--sunset-orange);
  min-height: 40px;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.modal p {
  color: var(--driftwood);
  margin-bottom: 24px;
}

.modal .btn {
  margin: 6px;
}

/* ============================
   RULES PAGE
   ============================ */
.rules-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

.rules-container h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--deep-navy);
  margin-bottom: 8px;
}

.rules-container .rules-intro {
  color: var(--driftwood);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.rule-section {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.rule-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--sunset-orange);
  margin-bottom: 16px;
}

.rule-section h3 {
  font-size: 1.1rem;
  color: var(--deep-navy);
  margin: 16px 0 8px;
}

.rule-section p,
.rule-section li {
  line-height: 1.7;
  color: #444;
}

.rule-section ul {
  padding-left: 24px;
  margin: 8px 0;
}

.rule-section li {
  margin-bottom: 6px;
}

.rules-diff-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.rules-diff-table th,
.rules-diff-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 0.92rem;
}

.rules-diff-table th {
  background: rgba(255, 107, 53, 0.06);
  font-weight: 600;
  color: var(--deep-navy);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .hero .sun { width: 80px; height: 80px; }
  .game-modes { flex-direction: column; align-items: center; }
  .mode-card { width: 100%; max-width: 340px; }

  .game-layout { flex-direction: column; align-items: center; }
  .side-panel { width: 100%; max-width: 520px; }

  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.85rem; }

  .board.board-8,
  .board.board-10 {
    width: min(92vw, 520px);
    height: min(92vw, 520px);
  }

  .rules-container { padding: 24px 16px 60px; }
  .rule-section { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .hero { padding: 50px 16px 40px; }
  .nav { padding: 12px 16px; }
  .nav-logo { font-size: 1.2rem; }
}
