/* ============================================
   canasta.se - Modern Clean Design
   ============================================ */

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

:root {
  --navy: #0d1a2d;
  --navy-light: #1a2744;
  --gold: #d4a843;
  --gold-hover: #c49a35;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-dark: #eef1f6;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e4ea;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 6px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --max-width: 1100px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--navy); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Header --- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.logo span { color: var(--gold); }

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

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

.lang-switch {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 4px;
}

.lang-switch a {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.lang-switch a.active {
  background: var(--gold);
  color: var(--navy);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, #0a1220 0%, #162040 50%, #1a2744 100%);
  color: #fff;
  padding: 80px 0 100px;
  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 30% 50%, rgba(212,168,67,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  position: relative;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 0 auto 36px;
  position: relative;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}
.btn-primary:hover {
  background: var(--gold-hover);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,168,67,0.3);
}

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
  transform: translateY(-1px);
}

.btn-shop {
  background: var(--gold);
  color: var(--navy);
}
.btn-shop:hover {
  background: var(--gold-hover);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212,168,67,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: #fff;
}

/* --- Sections --- */
section {
  padding: 80px 0;
}

section:nth-child(even):not(.hero):not(.cta-section) {
  background: var(--bg-alt);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 16px;
}

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

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.about-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.about-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.about-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* --- Rules --- */
.rules-content {
  max-width: 800px;
  margin: 0 auto;
}

.rule-block {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.rule-block h3 {
  color: var(--navy);
  font-size: 1.2rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rule-number {
  background: var(--gold);
  color: var(--navy);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.rule-block p, .rule-block ul {
  color: var(--text-light);
  font-size: 0.95rem;
}

.rule-block ul {
  padding-left: 20px;
  margin-top: 8px;
}

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

/* --- Points table --- */
.points-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.9rem;
}

.points-table th {
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
}

.points-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.points-table tr:nth-child(even) td {
  background: var(--bg-alt);
}

/* --- Products --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.product-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.product-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.product-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin: 0 auto 16px;
  border-radius: 8px;
}

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

.product-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex-grow: 1;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.product-price small {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* --- Strategy --- */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.strategy-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--card-shadow);
}

.strategy-card h3 {
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.strategy-level {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.level-beginner { background: #e8f5e9; color: #2e7d32; }
.level-advanced { background: #fff3e0; color: #e65100; }

/* --- Tutorial Section --- */
.tutorial-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.tutorial-container {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.tutorial-progress {
  display: flex;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}

.tutorial-step-indicator {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.tutorial-step-indicator.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  background: var(--bg);
}

.tutorial-step-indicator.completed {
  color: #2e7d32;
}

.tutorial-content {
  padding: 40px;
  min-height: 300px;
}

.tutorial-content h3 {
  color: var(--navy);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.tutorial-content p {
  color: var(--text-light);
  margin-bottom: 16px;
}

.tutorial-hand {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 24px 0;
}

.tutorial-nav {
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
}

/* --- Card visuals (used in tutorial & game) --- */
.card {
  width: 60px;
  height: 84px;
  border-radius: 6px;
  background: #fff;
  border: 2px solid var(--border);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  position: relative;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 2;
}

.card.selected {
  transform: translateY(-12px);
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(212,168,67,0.3);
}

.card .card-rank { font-size: 1.1rem; }
.card .card-suit { font-size: 1.3rem; line-height: 1; }

.card.red { color: #c62828; }
.card.black { color: #212121; }
.card.wild {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fff8e1, #fff);
}

.card-back {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-color: var(--navy);
  color: rgba(255,255,255,0.3);
  font-size: 1.5rem;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  text-align: center;
  padding: 80px 0;
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.cta-section p {
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

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

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

.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

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

.game-page { background: #1a3a1a; min-height: 100vh; color: #fff; }

.game-header {
  background: rgba(0,0,0,0.3);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.game-scores {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
}

.game-scores .score-label { color: rgba(255,255,255,0.6); }
.game-scores .score-value { font-weight: 700; color: var(--gold); }

.game-area {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Opponent hand */
.opponent-hand {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 20px;
  min-height: 84px;
}

.opponent-hand .card {
  width: 44px;
  height: 62px;
}

/* Table area */
.table-area {
  display: flex;
  justify-content: center;
  gap: 40px;
  align-items: center;
  padding: 30px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  margin-bottom: 20px;
  min-height: 140px;
}

.draw-pile, .discard-pile {
  text-align: center;
}

.pile-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
}

.draw-pile .card, .discard-pile .card {
  width: 70px;
  height: 98px;
  font-size: 1rem;
}

.draw-pile .card {
  cursor: pointer;
}

.draw-pile .card:hover {
  transform: translateY(-4px);
}

/* Melds area */
.melds-area {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.meld-group {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  gap: 4px;
}

.meld-group .card {
  width: 44px;
  height: 62px;
  font-size: 0.7rem;
  cursor: default;
}

.meld-group .card:hover {
  transform: none;
  box-shadow: none;
}

.melds-section {
  margin-bottom: 20px;
}

.melds-section h3 {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

/* Player hand */
.player-hand {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 16px 0;
  min-height: 100px;
}

/* Game actions */
.game-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.game-actions .btn {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.game-actions .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Game messages */
.game-message {
  text-align: center;
  padding: 12px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  min-height: 44px;
}

.game-message.highlight {
  color: var(--gold);
  font-weight: 600;
}

/* Game over overlay */
.game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.game-overlay-content {
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  max-width: 400px;
}

.game-overlay-content h2 {
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 12px;
}

.game-overlay-content p {
  margin-bottom: 24px;
  color: var(--text-light);
}

.hidden { display: none !important; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .hero { padding: 60px 0 80px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }

  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .products-grid { grid-template-columns: 1fr; gap: 20px; }
  .strategy-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 20px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  }

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

  .tutorial-content { padding: 24px; }
  .tutorial-nav { padding: 16px 24px; }
  .tutorial-step-indicator { font-size: 0.7rem; padding: 8px 4px; }

  section { padding: 60px 0; }
  .section-title { font-size: 1.6rem; }

  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* Game responsive */
  .opponent-hand .card { width: 32px; height: 45px; }
  .card { width: 48px; height: 67px; font-size: 0.7rem; }
  .card .card-rank { font-size: 0.9rem; }
  .card .card-suit { font-size: 1rem; }
  .table-area { gap: 20px; padding: 16px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .products-grid .btn { width: auto; }
  .rule-block { padding: 20px; }
  .card { width: 40px; height: 56px; }
  .card .card-rank { font-size: 0.8rem; }
  .card .card-suit { font-size: 0.9rem; }
}
