/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #0a0e1a;
  --navy-light: #111833;
  --navy-mid: #1a2240;
  --violet: #8b5cf6;
  --violet-glow: #a78bfa;
  --cyan: #06d6a0;
  --cyan-glow: #34d399;
  --cyan-dim: #0d9488;
  --gold: #f59e0b;
  --red: #ef4444;
  --green: #22c55e;
  --white: #f8fafc;
  --gray: #94a3b8;
  --glass-bg: rgba(17, 24, 51, 0.7);
  --glass-border: rgba(139, 92, 246, 0.3);
  --glow-violet: 0 0 20px rgba(139, 92, 246, 0.4);
  --glow-cyan: 0 0 20px rgba(6, 214, 160, 0.4);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--cyan-glow);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== UTILITIES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--violet-glow), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 1.1rem;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-violet);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--cyan-dim));
  color: var(--white);
  box-shadow: var(--glow-violet);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border: 2px solid var(--cyan);
  box-shadow: var(--glow-cyan);
}

.btn-outline:hover {
  background: var(--cyan);
  color: var(--navy);
  transform: translateY(-2px);
}

.btn-game {
  padding: 16px 40px;
  font-size: 1.2rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-higher {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: var(--white);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.btn-higher:hover {
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.7);
  transform: translateY(-3px);
}

.btn-lower {
  background: linear-gradient(135deg, var(--red), #dc2626);
  color: var(--white);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-lower:hover {
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.7);
  transform: translateY(-3px);
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo span {
  background: linear-gradient(135deg, var(--violet-glow), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a {
  color: var(--gray);
  font-weight: 500;
  transition: color var(--transition);
}

.nav a:hover {
  color: var(--cyan);
}

.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== HERO ===== */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
  animation: rotate-bg 30s linear infinite;
}

@keyframes rotate-bg {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--white), var(--violet-glow), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto 36px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== GAME SECTION ===== */
.game-section {
  padding: 80px 0;
}

.game-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
}

.stat-box {
  text-align: center;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--cyan);
}

.stat-value.best {
  color: var(--gold);
}

/* Game Table */
.game-table {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
  min-height: 260px;
}

.card {
  width: 160px;
  height: 224px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  position: relative;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.card-front {
  background: linear-gradient(145deg, var(--navy-mid), var(--navy-light));
  border: 2px solid var(--glass-border);
  box-shadow: var(--glow-violet);
}

.card-back {
  background: linear-gradient(145deg, var(--violet), #6d28d9);
  border: 2px solid var(--violet-glow);
  box-shadow: var(--glow-violet);
}

.card-back::after {
  content: '?';
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.3);
}

.card-red {
  color: var(--red);
}

.card-black {
  color: var(--white);
}

.card-suit {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-size: 1.5rem;
  opacity: 0.7;
}

.card-suit-top {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 1rem;
  opacity: 0.7;
}

.vs-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray);
  opacity: 0.5;
}

/* Game Controls */
.game-controls {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.game-message {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  min-height: 30px;
  margin-bottom: 20px;
}

.game-message.win {
  color: var(--green);
}

.game-message.lose {
  color: var(--red);
}

/* Game History */
.game-history {
  margin-top: 32px;
}

.game-history h3 {
  font-size: 1.1rem;
  color: var(--gray);
  margin-bottom: 12px;
  text-align: center;
}

.history-cards {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.history-card {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--navy-mid);
  border: 1px solid var(--glass-border);
}

.game-log {
  margin-top: 24px;
  max-height: 200px;
  overflow-y: auto;
  padding: 16px;
  background: var(--navy-mid);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}

.log-entry {
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--gray);
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.win {
  color: var(--green);
}

.log-entry.loss {
  color: var(--red);
}

/* Card flip animation */
.card-flip {
  animation: flipCard 0.6s ease;
}

@keyframes flipCard {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

/* ===== RULES SECTION ===== */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.rule-card {
  text-align: center;
  padding: 32px 24px;
}

.rule-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.rule-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--white);
}

.rule-card p {
  color: var(--gray);
  font-size: 0.95rem;
}

/* ===== ABOUT SECTION ===== */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--white);
}

.about-text p {
  color: var(--gray);
  margin-bottom: 16px;
}

.about-features {
  list-style: none;
}

.about-features li {
  padding: 8px 0;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 12px;
}

.about-features li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}

.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-graphic {
  width: 100%;
  max-width: 300px;
  height: 300px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.about-graphic::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: conic-gradient(from 0deg, transparent, var(--violet), transparent, var(--cyan), transparent);
  animation: rotate-bg 8s linear infinite;
  opacity: 0.2;
}

.about-graphic-text {
  position: relative;
  z-index: 1;
  font-size: 4rem;
  text-align: center;
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--transition);
}

.faq-question:hover {
  color: var(--cyan);
}

.faq-icon {
  font-size: 1.2rem;
  transition: transform var(--transition);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 24px 20px;
}

.faq-answer p {
  color: var(--gray);
  font-size: 0.95rem;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-light);
  border-top: 1px solid var(--glass-border);
  padding: 60px 0 30px;
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--gray);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--cyan);
}

.responsible-gaming-block {
  background: var(--navy-mid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 40px;
  text-align: center;
}

.responsible-gaming-block h4 {
  color: var(--gold);
  margin-bottom: 12px;
}

.responsible-gaming-block p {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.responsible-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.responsible-links a {
  color: var(--cyan);
  font-size: 0.85rem;
}

.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: 24px;
  text-align: center;
}

.footer-disclaimer {
  color: var(--gray);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.footer-age-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ===== PAGE CONTENT (for sub-pages) ===== */
.page-content {
  padding: 120px 0 80px;
  min-height: 70vh;
}

.page-content h1 {
  font-size: 2.5rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--violet-glow), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-content h2 {
  font-size: 1.5rem;
  color: var(--white);
  margin: 32px 0 12px;
}

.page-content p, .page-content li {
  color: var(--gray);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.page-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.98);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--glass-border);
  }

  .nav.active {
    display: flex;
  }

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

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .game-table {
    flex-direction: column;
    gap: 20px;
  }

  .card {
    width: 130px;
    height: 182px;
    font-size: 2.5rem;
  }

  .game-controls {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .btn-game {
    width: 100%;
    max-width: 240px;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .game-stats {
    gap: 24px;
  }

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

  .footer-top {
    grid-template-columns: 1fr;
  }

  .vs-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .card {
    width: 110px;
    height: 154px;
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--navy);
}

::-webkit-scrollbar-thumb {
  background: var(--violet);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--violet-glow);
}
