/* CSS Variables - Dark Teal Theme */
:root {
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-secondary: #f97066;
  --accent-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-hover: #475569;
  --success: #10b981;
  --error: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-accent: 0 4px 14px -3px rgba(20, 184, 166, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s;
}

.logo-link:hover {
  transform: scale(1.05);
}

.age-badge-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid #dc2626;
  color: #dc2626;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  opacity: 0.85;
}

.logo-svg {
  filter: drop-shadow(0 2px 4px rgba(13, 148, 136, 0.2));
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-desktop {
  display: flex;
}

.nav-mobile {
  display: none;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}

.mobile-menu-btn:hover {
  color: var(--accent);
}

.lang-switch-group {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.lang-switch {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: background 0.2s, color 0.2s;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lang-switch.active {
  background: var(--accent);
  color: #fff;
}

.mobile-controls {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

/* Language Switcher */
.language-switcher {
  display: flex;
  gap: 0.25rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.lang-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: var(--text-muted);
}

.lang-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  color: white;
}

/* Footer */
.footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.footer-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.footer-text a {
  color: var(--accent);
  transition: color 0.2s;
}

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

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-nav a:hover,
.footer-cookie-btn:hover {
  color: var(--text);
}

.footer-cookie-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-compliance {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.age-badge-footer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
}

/* Home Page */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  position: relative;
}

.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 700px;
}

.hero-section h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero-section p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.age-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.85rem !important;
  color: var(--text-muted);
  opacity: 0.85;
}

.age-badge-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.home::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      ellipse at 15% 25%,
      rgba(13, 148, 136, 0.12) 0%,
      transparent 40%
    ),
    radial-gradient(
      ellipse at 85% 75%,
      rgba(20, 184, 166, 0.08) 0%,
      transparent 40%
    );
  pointer-events: none;
  z-index: -1;
}

/* Floating game elements */
.home::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.04;
  background-image:
    /* Ships - scattered */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 20'%3E%3Cpath d='M5 15 L15 15 L20 10 L55 10 L55 15 L5 15 M25 8 L30 3 L35 8' fill='%2314b8a6' /%3E%3C/svg%3E"),
    /* Connect Four pieces */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='12' fill='%23ef4444' /%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='12' fill='%23fbbf24' /%3E%3C/svg%3E"),
    /* Reversi pieces */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='12' fill='%23ffffff' /%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='12' fill='%23374151' /%3E%3C/svg%3E"),
    /* Grid pattern */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M0 13h40 M0 27h40 M13 0v40 M27 0v40' stroke='%2314b8a6' stroke-width='1' fill='none' /%3E%3C/svg%3E"),
    /* Target/crosshair */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='10' stroke='%2314b8a6' stroke-width='2' fill='none' /%3E%3Cpath d='M15 2v6 M15 22v6 M2 15h6 M22 15h6' stroke='%2314b8a6' stroke-width='2' /%3E%3C/svg%3E");
  background-size:
    80px 26px,
    40px 40px,
    35px 35px,
    38px 38px,
    36px 36px,
    60px 60px,
    45px 45px;
  background-position:
    5% 15%,
    92% 20%,
    15% 85%,
    78% 45%,
    25% 55%,
    50% 90%,
    88% 80%;
  background-repeat: no-repeat;
  animation: floatElements 30s ease-in-out infinite;
}

@keyframes floatElements {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(0.5deg);
  }
  50% {
    transform: translateY(-4px) rotate(-0.3deg);
  }
  75% {
    transform: translateY(-10px) rotate(0.3deg);
  }
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  width: 100%;
  max-width: 1000px;
}

.game-tile {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.game-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    var(--accent) 50%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
}

.game-tile:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(20, 184, 166, 0.2);
  border-color: transparent;
}

.game-tile:hover::before {
  opacity: 1;
}

.game-preview {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #134e4a 0%, #164e63 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
}

.game-preview::after {
  content: "▶";
  position: absolute;
  width: 60px;
  height: 60px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.4);
  padding-left: 4px;
}

.game-tile:hover .game-preview::after {
  opacity: 1;
  transform: scale(1);
}

.game-tile .game-info {
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(to top, var(--bg-card) 0%, transparent 100%);
}

.game-tile .game-info h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s;
}

.game-tile:hover .game-info h2 {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Game Page */
.game-page {
  max-width: 800px;
  margin: 0 auto;
}

.game-header {
  text-align: center;
  margin-bottom: 2rem;
}

.game-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.game-header p {
  color: var(--text-muted);
}

.game-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

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

.control-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.control-group select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.control-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
}

.btn-primary:hover {
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Game Status */
.game-status {
  text-align: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.game-status.winner {
  background: var(--accent-gradient);
  border: none;
  color: white;
}

/* Score Board */
.score-board {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 1.5rem 0;
}

.score-item {
  text-align: center;
}

.score-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.score-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.score-value.player {
  color: var(--accent);
}

.score-value.ai {
  color: var(--accent-secondary);
}

.score-item {
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* Game Info Box */
.game-info {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}

.game-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.game-info ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.game-info li {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Connect Four */
.connect-four-container {
  display: flex;
  justify-content: center;
}

.connect-four-board {
  display: flex;
  gap: 8px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  padding: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.connect-four-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.connect-four-cell {
  width: 50px;
  height: 50px;
  background: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.connect-four-piece {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: transform 0.3s;
}

.connect-four-piece.player {
  background: linear-gradient(135deg, #f97066 0%, #ef4444 100%);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.connect-four-piece.ai {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.connect-four-piece.preview-player {
  background: rgba(249, 112, 102, 0.4);
}

.connect-four-cell.winning .connect-four-piece {
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

/* Reversi */
.reversi-container {
  display: flex;
  justify-content: center;
}

.reversi-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  background: #134e4a;
  padding: 8px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.reversi-cell {
  width: 45px;
  height: 45px;
  background: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.reversi-cell.valid-move {
  background: #14b8a6;
}

.reversi-cell.last-move {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.reversi-piece {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: transform 0.3s;
}

.reversi-piece.black {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  box-shadow:
    inset 0 -3px 0 rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

.reversi-piece.white {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.reversi-hint {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.reversi-score {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 1.5rem;
}

.reversi-score-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.reversi-score-item .reversi-piece {
  width: 28px;
  height: 28px;
}

/* Battleship */
.battleship-placement {
  text-align: center;
}

.placement-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.battleship-single-board {
  display: flex;
  justify-content: center;
}

.battleship-game-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.battleship-player-side,
.battleship-enemy-side {
  text-align: center;
}

.battleship-player-side h3,
.battleship-enemy-side h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.battleship-board-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.battleship-board {
  display: grid;
  grid-template-columns: 30px repeat(10, 32px);
  gap: 2px;
  background: var(--bg-elevated);
  padding: 8px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.battleship-corner {
  width: 30px;
  height: 30px;
}

.battleship-header {
  width: 32px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.battleship-row {
  display: contents;
}

.battleship-row .battleship-header {
  width: 30px;
  height: 32px;
}

.battleship-cell {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #164e63 0%, #0e7490 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.battleship-cell.ship {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.battleship-cell.hit {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.battleship-cell.hit::after {
  content: "×";
  font-size: 1.25rem;
  font-weight: bold;
  color: white;
}

.battleship-cell.miss {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.battleship-cell.miss::after {
  content: "•";
  font-size: 1.5rem;
  color: var(--text-muted);
}

.battleship-cell.clickable {
  cursor: pointer;
}

.battleship-cell.clickable:hover {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  transform: scale(1.1);
}

.battleship-cell.hover-valid {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.battleship-cell.hover-invalid {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.battleship-ships {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.battleship-ships h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.battleship-ship-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.battleship-ship-item:last-child {
  border-bottom: none;
}

.battleship-ship-item .ship-name {
  font-weight: 500;
}

.battleship-ship-item .ship-status {
  color: var(--accent);
  font-size: 0.8rem;
}

.battleship-ship-item.sunk {
  opacity: 0.5;
}

.battleship-ship-item.sunk .ship-name {
  text-decoration: line-through;
}

.battleship-ship-item.sunk .ship-status {
  color: var(--error);
}

/* Cookie Consent */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.cookie-content {
  flex: 1;
}

.cookie-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.cookie-links {
  display: flex;
  gap: 1.5rem;
}

.cookie-links a {
  color: var(--accent);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.cookie-links a:hover {
  color: var(--accent-hover);
}

.cookie-actions {
  display: flex;
  gap: 1rem;
}

/* Legal Pages */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.legal-page .last-updated {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.legal-page section {
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent);
}

.legal-page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.legal-page p {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.legal-page ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-page li {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.cookie-table th,
.cookie-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cookie-table th {
  color: var(--text);
  font-weight: 600;
}

.cookie-table td {
  color: var(--text-muted);
}

/* Game Preview Animations */
.preview-connect-four {
  display: flex;
  flex-direction: column;
  gap: 5px;
  transform: scale(1.1);
}

.preview-connect-four .preview-row {
  display: flex;
  gap: 5px;
}

.preview-connect-four .preview-cell {
  width: 22px;
  height: 22px;
  background: #0f172a;
  border-radius: 50%;
  transition: all 0.4s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preview-connect-four .preview-cell.red {
  background: linear-gradient(135deg, #f97066 0%, #ef4444 100%);
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(239, 68, 68, 0.4);
}

.preview-connect-four .preview-cell.yellow {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(251, 191, 36, 0.4);
}

.preview-reversi {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  padding: 6px;
  border-radius: 6px;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.preview-reversi .preview-row {
  display: contents;
}

.preview-reversi .preview-cell {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-reversi .preview-piece {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: all 0.4s ease;
}

.preview-reversi .preview-piece.black {
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preview-reversi .preview-piece.white {
  background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.preview-battleship {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  padding: 8px;
  border-radius: 8px;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preview-battleship .preview-row {
  display: contents;
}

.preview-battleship .preview-cell {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #164e63 0%, #0e7490 100%);
  border-radius: 4px;
  transition: all 0.4s ease;
}

.preview-battleship .preview-cell.ship {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.preview-battleship .preview-cell.hit {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.preview-battleship .preview-cell.miss {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .game-preview::after {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: row;
    gap: 1rem;
  }

  .nav-desktop {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-controls {
    display: flex;
  }

  .nav-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.95);
  }

  .nav-mobile .nav-link {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-mobile .nav-link:last-of-type {
    border-bottom: none;
  }

  .nav {
    gap: 1rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
  }

  .home {
    min-height: auto;
    padding: 2rem 0;
  }

  .game-tile {
    border-radius: 16px;
  }

  .game-preview::after {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-nav {
    align-items: center;
  }

  .cookie-consent {
    flex-direction: column;
    text-align: center;
  }

  .cookie-links {
    justify-content: center;
  }

  .connect-four-cell {
    width: 40px;
    height: 40px;
  }

  .connect-four-piece {
    width: 34px;
    height: 34px;
  }

  .reversi-cell {
    width: 36px;
    height: 36px;
  }

  .reversi-piece {
    width: 28px;
    height: 28px;
  }

  .battleship-game-area {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .battleship-board {
    grid-template-columns: 24px repeat(10, 26px);
  }

  .battleship-cell {
    width: 26px;
    height: 26px;
  }

  .battleship-header {
    width: 26px;
    height: 24px;
    font-size: 0.65rem;
  }

  .battleship-row .battleship-header {
    width: 24px;
    height: 26px;
  }

  .score-board {
    gap: 1.5rem;
  }

  .game-controls {
    flex-direction: column;
  }

  .main-content {
    padding: 1rem;
  }

  .game-header h1 {
    font-size: 1.75rem;
  }

  .legal-page h1 {
    font-size: 1.75rem;
  }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
  .main-content {
    padding: 0.75rem;
  }

  .header-content {
    padding: 0.75rem 1rem;
  }

  .app-name {
    font-size: 1rem;
  }

  .age-badge-header {
    display: none;
  }

  .games-grid {
    gap: 1rem;
  }

  .game-tile .game-info {
    padding: 1rem;
  }

  .game-tile .game-info h2 {
    font-size: 1.1rem;
  }

  .connect-four-board {
    padding: 8px;
    gap: 4px;
  }

  .connect-four-cell {
    width: 32px;
    height: 32px;
  }

  .connect-four-piece {
    width: 26px;
    height: 26px;
  }

  .reversi-cell {
    width: 30px;
    height: 30px;
  }

  .reversi-piece {
    width: 24px;
    height: 24px;
  }

  .reversi-hint {
    width: 8px;
    height: 8px;
  }

  .battleship-board {
    grid-template-columns: 20px repeat(10, 22px);
    padding: 4px;
    gap: 1px;
  }

  .battleship-cell {
    width: 22px;
    height: 22px;
  }

  .battleship-header {
    width: 22px;
    height: 20px;
    font-size: 0.55rem;
  }

  .battleship-row .battleship-header {
    width: 20px;
    height: 22px;
  }

  .battleship-cell.hit::after {
    font-size: 1rem;
  }

  .battleship-cell.miss::after {
    font-size: 1.1rem;
  }

  .score-board {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .score-item {
    padding: 0.75rem 1rem;
  }

  .score-value {
    font-size: 1.5rem;
  }

  .game-status {
    font-size: 0.95rem;
    padding: 0.75rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .cookie-consent {
    padding: 1rem;
    gap: 1rem;
  }

  .cookie-content p {
    font-size: 0.8rem;
  }

  .cookie-links {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .cookie-links a {
    font-size: 0.75rem;
  }

  .cookie-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-actions .btn {
    width: 100%;
  }

  .footer {
    padding: 2rem 1rem;
  }

  .footer-title {
    font-size: 1.25rem;
  }

  .footer-subtitle {
    font-size: 0.9rem;
  }

  .footer-text {
    font-size: 0.8rem;
  }

  .game-header h1 {
    font-size: 1.5rem;
  }

  .legal-page h1 {
    font-size: 1.5rem;
  }

  .legal-page h2 {
    font-size: 1.1rem;
  }

  .placement-controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .reversi-score {
    gap: 1.5rem;
  }

  .reversi-score-item {
    font-size: 1.25rem;
  }
}

/* ============================================================
   CASINO PAGE
   ============================================================ */

.casino-page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 3rem;
}

/* --- Hero --- */
.casino-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.casino-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #14b8a6;
  margin-bottom: 0.75rem;
}

.casino-hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #14b8a6;
  animation: liveDot 1.6s ease-in-out infinite;
}

@keyframes liveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.casino-hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
  line-height: 1.15;
}

.casino-hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.casino-trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.casino-trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.25);
  color: #5eead4;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

/* --- Card list --- */
.casino-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- Individual card --- */
.casino-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px 120px 1fr auto;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.3s cubic-bezier(0.4,0,0.2,1),
              border-color 0.3s;
  animation: cardFadeUp 0.4s ease both;
  overflow: hidden;
}

.casino-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--c-border) 0%, transparent 60%);
  opacity: 0.04;
  pointer-events: none;
  transition: opacity 0.3s;
}

.casino-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 40px var(--c-glow), 0 2px 8px rgba(0,0,0,0.4);
  border-color: var(--c-border);
}

.casino-card:hover::before { opacity: 0.08; }

.casino-card:nth-child(1) { animation-delay: 0.05s; }
.casino-card:nth-child(2) { animation-delay: 0.12s; }
.casino-card:nth-child(3) { animation-delay: 0.19s; }
.casino-card:nth-child(4) { animation-delay: 0.26s; }

@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Rank --- */
.casino-rank-col { display: flex; justify-content: center; }

.casino-rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  gap: 2px;
  flex-shrink: 0;
}

.casino-rank-crown {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.rank-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(245,158,11,0.5);
  animation: rankPulse 2.5s ease-in-out infinite;
}

@keyframes rankPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(245,158,11,0.5); }
  50%       { box-shadow: 0 4px 28px rgba(245,158,11,0.85); }
}

.rank-silver {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(148,163,184,0.3);
}

.rank-bronze {
  background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(249,115,22,0.3);
}

.rank-default {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* --- Logo --- */
.casino-logo-col { display: flex; justify-content: center; }

.casino-logo-wrap {
  width: 110px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  transition: background 0.2s;
}

.casino-card:hover .casino-logo-wrap {
  background: rgba(255,255,255,0.1);
}

.casino-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: brightness(1.05);
}

/* --- Info --- */
.casino-info-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.casino-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.casino-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.casino-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.casino-stars {
  font-size: 0.9rem;
  color: #f59e0b;
  letter-spacing: 0.05em;
  line-height: 1;
}

.casino-bonus-main {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.casino-bonus-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.casino-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.casino-feature-chip {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

/* --- CTA --- */
.casino-cta-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.casino-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--c-from) 0%, var(--c-to) 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 4px 18px var(--c-glow);
  animation: btnShimmer 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.casino-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  animation: btnGleam 3s ease-in-out infinite;
}

@keyframes btnGleam {
  0%   { left: -100%; }
  40%  { left: 160%; }
  100% { left: 160%; }
}

.casino-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 28px var(--c-glow);
  filter: brightness(1.1);
}

.casino-disclaimer {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* --- Footer note --- */
.casino-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.75;
  text-align: center;
}

.casino-footer-note a {
  color: var(--accent);
  text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .casino-card {
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.75rem;
    padding: 1rem;
  }

  .casino-logo-col {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
  }

  .casino-rank-col {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
  }

  .casino-info-col {
    grid-column: 2;
    grid-row: 2;
  }

  .casino-cta-col {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }

  .casino-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
  }

  .casino-logo-wrap {
    width: 90px;
    height: 44px;
  }

  .casino-rank-badge {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .casino-bonus-main { font-size: 1rem; }
}

@media (max-width: 480px) {
  .casino-hero-title { font-size: 1.6rem; }
  .casino-trust-bar  { gap: 0.35rem; }
  .casino-trust-chip { font-size: 0.68rem; padding: 0.3rem 0.6rem; }
  .casino-features   { display: none; }
}
