:root { 
  --solitaire-green: #124a20;
  --solitaire-green-dark: #0e3d1a;
  --solitaire-light: #3ca558;
  --solitaire-gold: #ffd700;
}

/* ==========================================
   BASE STYLES
   ========================================== */

@font-face {
    font-family: 'lt_saeadabold';
    src: url('/css/fonts/ltsaeada-bold-webfont.woff2') format('woff2'),
        url('/css/fonts/ltsaeada-bold-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html {
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}

body {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  line-height: 1.6;
}

/* ==========================================
   GAME AREA (augments inline critical CSS)
   ========================================== */

#mainHolder {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

#notSupportHolder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  color: white;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.6;
  font-family: 'lt_saeadabold', sans-serif;
  z-index: 100;
}

canvas#gameCanvas {
  -webkit-user-select: none;
  -moz-user-select: none;
       user-select: none;
  touch-action: manipulation;
}

/* ==========================================
   GAME LOADING INDICATOR
   ========================================== */

#game-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

#game-loading p {
  color: #fff;
  font-size: 1rem;
  margin: 0;
}

.game-loaded #game-loading {
  display: none !important;
}

/* ==========================================
   GAME INTRO SECTION (Above the game - SEO critical)
   ========================================== */

.game-intro {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1rem 0.5rem;
  text-align: center;
}

.game-intro h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
}

.game-intro p {
  font-size: 0.95rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .game-intro {
    padding: 1.5rem 2rem 1rem;
  }
  .game-intro h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
  }
  .game-intro p {
    font-size: 1.1rem;
  }
}

/* ==========================================
   SEO CONTENT SECTION (Below the game)
   ========================================== */

#seo-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
  background-color: #ffffff;
  color: #1a1a1a;
}

.seo-article {
  max-width: 900px;
  margin: 0 auto;
}

.content-section,
.seo-section {
  margin-bottom: 2.5rem;
}

.content-section h2,
.seo-section h2 {
  font-size: 1.5rem;
  color: #124a20;
  margin: 0 0 1rem;
  font-weight: 700;
}

.content-section h3,
.seo-section h3 {
  font-size: 1.2rem;
  color: #1a1a1a;
  margin: 1.5rem 0 0.75rem;
  font-weight: 600;
}

.content-section p,
.seo-section p {
  color: #333;
  line-height: 1.7;
  margin: 0 0 1rem;
}

.content-section ul,
.seo-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.content-section li,
.seo-section li {
  color: #333;
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.content-section li::before,
.seo-section li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #124a20;
}

.content-section li strong,
.seo-section li strong {
  color: #1a1a1a;
}

.variation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.variation-card {
  display: block;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.variation-card:hover {
  background: #f0f0f0;
  border-color: #124a20;
}

.variation-card h3 {
  color: #1a1a1a;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.variation-card p {
  color: #555;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.difficulty-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  font-weight: 500;
  vertical-align: middle;
}

/* Guide article */
.guide-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0 0 1rem;
  line-height: 1.2;
}
@media (min-width: 769px) {
  .guide-title { font-size: 2.5rem; }
}
.guide-article table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}
.guide-article th,
.guide-article td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.guide-article th {
  background: #124a20;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.guide-article tr:last-child td { border-bottom: none; }
.guide-article tbody tr:nth-child(odd) { background: #fff; }
.guide-article tbody tr:nth-child(even) { background: #f7faf8; }
.guide-article tbody tr:hover { background: #eef5f0; }
@media (max-width: 600px) {
  .guide-article table { font-size: 0.85rem; }
  .guide-article th,
  .guide-article td { padding: 0.5rem 0.6rem; }
}
.guide-article h2 { margin-top: 2rem; }
.guide-article h3 { margin-top: 1.5rem; color: #124a20; }
.guide-article ul { padding-left: 1.5rem; margin: 1rem 0; }
.guide-article li { margin-bottom: 0.5rem; line-height: 1.6; color: #333; }
.guide-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.difficulty-easy { background: #dcfce7; color: #166534; }
.difficulty-medium { background: #fef3c7; color: #92400e; }
.difficulty-hard { background: #fee2e2; color: #991b1b; }

/* How to Play */
.how-to-steps {
  padding-left: 1.5rem;
  margin: 1rem 0;
  counter-reset: step-counter;
  list-style: none;
}
.how-to-steps li {
  position: relative;
  padding: 0.5rem 0 0.5rem 2.2rem;
  color: #333;
  line-height: 1.6;
  counter-increment: step-counter;
}
.how-to-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1.6rem;
  height: 1.6rem;
  background: #124a20;
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.variant-diff-block {
  background: #f0fdf4;
  border-left: 4px solid #124a20;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  border-radius: 0 8px 8px 0;
}
.variant-diff-block h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #124a20;
}
.variant-diff-block p {
  margin: 0;
  color: #1a1a1a;
  line-height: 1.6;
}

@media (min-width: 768px) {
  #seo-content {
    padding: 3rem 2rem;
  }
  .content-section h2,
  .seo-section h2 {
    font-size: 1.75rem;
  }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

*:focus-visible {
  outline: 2px solid var(--solitaire-gold);
  outline-offset: 2px;
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */

.site-header {
  background: #0e3d1a;
  position: relative;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
}

.header-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.header-logo-dot {
  color: #ffd700;
}

/* --- Mobile menu button --- */

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  padding: 0.4rem;
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

/* --- Desktop nav --- */

.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.header-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.header-nav-link.is-active {
  color: #fff;
  font-weight: 600;
}

/* --- Desktop dropdown --- */

.games-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: 14rem;
  max-height: 28rem;
  overflow-y: auto;
  background: #0e3d1a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  overscroll-behavior: contain;
}

.dropdown-menu.is-open {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.12s;
}

.dropdown-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* --- Drawer backdrop --- */

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}

.drawer-backdrop.is-visible {
  display: block;
  opacity: 1;
}

/* --- Mobile drawer --- */

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 360px);
  background: linear-gradient(180deg, #112e1a 0%, #0a2412 100%);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: rgba(0,0,0,0.12);
}

.drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.drawer-close:hover,
.drawer-close:active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem 1rem 2rem;
}

.drawer-category {
  margin-bottom: 1.25rem;
}

.drawer-category:last-child {
  margin-bottom: 0;
}

.drawer-category-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 0.25rem 0.5rem;
  margin: 0;
}

.drawer-game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.drawer-game-link {
  display: block;
  padding: 0.55rem 0.65rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.12s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}

.drawer-game-link:hover,
.drawer-game-link:active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.08);
  color: #fff;
}

.drawer-game-link.is-active {
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
  font-weight: 600;
  border-color: rgba(255, 215, 0, 0.25);
}

/* --- Responsive --- */

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none !important;
  }
  
  .mobile-drawer,
  .drawer-backdrop {
    display: none !important;
  }
  
  .desktop-nav {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0.5rem 1rem;
  }
  .header-logo {
    font-size: 1.25rem;
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

[data-js-hidden] {
  display: none;
}

.js-loaded [data-js-hidden] {
  display: block;
}

/* ==========================================
   EXPLORE GAMES GRID (More Solitaire Games)
   ========================================== */

.explore-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.explore-grid li {
  padding: 0;
}

.explore-grid li::before {
  display: none;
}

.explore-grid a {
  display: block;
  padding: 0.7rem 1rem;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #124a20;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.explore-grid a:hover {
  background: #e8f5e9;
  border-color: #124a20;
  box-shadow: 0 2px 8px rgba(18, 74, 32, 0.1);
}

/* ==========================================
   FOOTER
   ========================================== */

.site-footer {
  background: #111827;
  color: rgba(255, 255, 255, 0.8);
  padding: 2.5rem 1rem 1.5rem;
  margin-top: auto;
}

.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-legal {
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.footer-legal a:hover {
  color: #fff;
}

.footer-sep {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.3);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* ─── Win Overlay ─────────────────────────────────── */
#win-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#win-overlay.win-visible {
  opacity: 1;
}
.win-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.win-modal {
  position: relative;
  background: linear-gradient(145deg, #1a5c2a, #0e3d1a);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.15);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.win-visible .win-modal {
  transform: scale(1);
}
.win-trophy {
  font-size: 3.5rem;
  margin-bottom: 0.25rem;
  animation: winBounce 0.6s ease;
}
@keyframes winBounce {
  0% { transform: scale(0) rotate(-15deg); }
  50% { transform: scale(1.2) rotate(5deg); }
  70% { transform: scale(0.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}
.win-title {
  color: #ffd700;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.win-stats-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.win-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}
.win-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.2rem;
}
.win-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}
.win-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.win-btn {
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.win-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.win-btn:active {
  transform: translateY(0);
}
.win-btn-primary {
  background: #ffd700;
  color: #0e3d1a;
}
.win-btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
