/* ===== Google Minesweeper Theme — Full Override ===== */

body.gm-theme {
  --grass-light: #aad751;
  --grass-dark: #a2d149;
  --revealed-light: #e5c29f;
  --revealed-dark: #d7b899;
  --header-bg: #4a752c;
  --header-dark: #3d6324;
  --flag-red: #f44336;
  --num-blue: #1976d2;
  --num-green: #388e3c;
  --num-red: #d32f2f;
  --num-purple: #7b1fa2;
  --num-maroon: #880e4f;
  --num-teal: #00897b;
  --num-black: #212121;
  --num-gray: #757575;
  --mine-bg: #e53935;
  --page-bg: #f0f4e8;
  --text-dark: #2e3d1a;
  --text-muted: #5a6e3f;
  --card-bg: #ffffff;
  --section-bg: #e8eeda;
  --primary: #4caf50;
  --primary-light: #66bb6a;
  --primary-dark: #388e3c;
  --accent: #e53935;
  --bg: #f0f4e8;
  --text: #2e3d1a;
  --text-light: #5a6e3f;
  --white: #ffffff;
  --font: 'Nunito', 'Quicksand', sans-serif;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --border-light: rgba(74,117,44,0.08);
  --border-input: rgba(74,117,44,0.15);
}

body.gm-theme[data-theme="dark"] {
  --page-bg: #1a2e1a;
  --text-dark: #c8e6c9;
  --text-muted: #81c784;
  --card-bg: #2e4a2e;
  --section-bg: #253d25;
  --header-bg: #2d4a1a;
  --header-dark: #1f3312;
  --grass-light: #5a8a3a;
  --grass-dark: #4f7d32;
  --revealed-light: #4a3d2a;
  --revealed-dark: #3f3424;
  --bg: #1a2e1a;
  --text: #c8e6c9;
  --text-light: #81c784;
  --white: #2e4a2e;
  --border-light: rgba(200,230,200,0.08);
  --border-input: rgba(200,230,200,0.15);
}

/* Header */
body.gm-theme .site-header {
  background: linear-gradient(135deg, var(--header-bg), #5a8a35);
  backdrop-filter: none;
  border-bottom: none;
  box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}
body.gm-theme[data-theme="dark"] .site-header {
  background: linear-gradient(135deg, #1f3312, #2d4a1a);
}
body.gm-theme .logo { color: #fff; }
body.gm-theme .logo-icon {
  background: var(--grass-light);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
body.gm-theme nav a { color: rgba(255,255,255,0.85); }
body.gm-theme nav a:hover { color: #fff; background: rgba(255,255,255,0.15); }
body.gm-theme nav a.active { color: #fff; background: rgba(255,255,255,0.2); font-weight: 700; }
body.gm-theme .mobile-menu-btn { color: #fff; }
body.gm-theme .theme-toggle { color: #fff; border-color: rgba(255,255,255,0.25); }
body.gm-theme .theme-toggle:hover { border-color: rgba(255,255,255,0.5); }
body.gm-theme .lang-btn { color: #fff; border-color: rgba(255,255,255,0.25); }
body.gm-theme .lang-btn:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Language dropdown — needs dark bg since nav a is white */
body.gm-theme .lang-dropdown { background: var(--header-dark); border: 1px solid rgba(255,255,255,0.15); }
body.gm-theme .lang-dropdown a { color: rgba(255,255,255,0.75); }
body.gm-theme .lang-dropdown a:hover { background: rgba(255,255,255,0.1); color: #fff; }
body.gm-theme .lang-dropdown a.active { color: #fff; font-weight: 700; }

/* Hero */
body.gm-theme .hero h1 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: var(--header-bg);
  color: var(--header-bg);
}
body.gm-theme .hero h1 .accent { color: var(--flag-red); -webkit-text-fill-color: var(--flag-red); }
body.gm-theme[data-theme="dark"] .hero h1 { -webkit-text-fill-color: #81c784; color: #81c784; }
body.gm-theme[data-theme="dark"] .hero h1 .accent { -webkit-text-fill-color: #ef5350; color: #ef5350; }
body.gm-theme .hero p { color: var(--text-muted); font-family: 'Quicksand', 'Nunito', sans-serif; }

body.gm-theme .badge {
  background: var(--section-bg);
  color: var(--text-dark);
  border: 1px solid rgba(74,117,44,0.15);
}
body.gm-theme .badge .icon { stroke: var(--header-bg); }

/* Game container */
.gm-game-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px;
}
.gm-game-container {
  background: var(--header-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25), 0 2px 10px rgba(0,0,0,0.1);
  user-select: none;
  max-width: 100%;
  transition: width 0.2s ease;
}
body.gm-theme[data-theme="dark"] .gm-game-container {
  background: var(--header-dark);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* Top bar */
.game-top-bar {
  background: var(--header-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
body.gm-theme[data-theme="dark"] .game-top-bar { background: #162a0e; }

.difficulty-select {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.difficulty-select:hover { background-color: rgba(255,255,255,0.25); }
.difficulty-select option { background: var(--header-dark); color: #fff; }

.game-counters { display: flex; align-items: center; gap: 14px; }
.gm-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
}
.gm-counter .icon { font-size: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }

.top-buttons { display: flex; gap: 6px; }
.top-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.top-btn:hover { background: rgba(255,255,255,0.25); }

/* Board */
.gm-board {
  display: grid;
  padding: 4px;
  gap: 0;
  background: var(--header-bg);
}
body.gm-theme[data-theme="dark"] .gm-board { background: var(--header-dark); }

body.gm-theme .board-wrapper {
  position: relative;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  overflow: visible;
  max-width: none;
}

/* Cells */
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  transition: transform 0.08s;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  padding: 0;
  margin: 0;
}
.cell:active:not(.revealed):not(.flagged) { transform: scale(0.92); }

.cell.grass-light { background: var(--grass-light); }
.cell.grass-dark { background: var(--grass-dark); }
.cell.grass-light:hover { background: #b8dd66; }
.cell.grass-dark:hover { background: #afd95c; }
body.gm-theme[data-theme="dark"] .cell.grass-light:hover { background: #6a9a48; }
body.gm-theme[data-theme="dark"] .cell.grass-dark:hover { background: #5f8d3e; }

.cell.revealed { cursor: default; }
.cell.revealed.rev-light { background: var(--revealed-light); }
.cell.revealed.rev-dark { background: var(--revealed-dark); }

.cell.num-1 { color: var(--num-blue); }
.cell.num-2 { color: var(--num-green); }
.cell.num-3 { color: var(--num-red); }
.cell.num-4 { color: var(--num-purple); }
.cell.num-5 { color: var(--num-maroon); }
.cell.num-6 { color: var(--num-teal); }
.cell.num-7 { color: var(--num-black); }
.cell.num-8 { color: var(--num-gray); }
body.gm-theme[data-theme="dark"] .cell.num-1 { color: #64b5f6; }
body.gm-theme[data-theme="dark"] .cell.num-2 { color: #81c784; }
body.gm-theme[data-theme="dark"] .cell.num-3 { color: #ef5350; }
body.gm-theme[data-theme="dark"] .cell.num-4 { color: #ce93d8; }
body.gm-theme[data-theme="dark"] .cell.num-7 { color: #bbb; }

.cell.flagged::after { content: '🚩'; font-size: 18px; }
.cell.mine-exploded { background: var(--mine-bg) !important; }
.cell.mine-show::after { content: '💣'; font-size: 18px; }

/* Overlay */
.game-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 0 0 12px 12px;
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.game-overlay.show { opacity: 1; pointer-events: all; }
.overlay-emoji { font-size: 64px; margin-bottom: 12px; animation: gm-bounceIn 0.5s cubic-bezier(0.68,-0.55,0.265,1.55); }
.overlay-text {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  margin-bottom: 6px;
}
.overlay-sub { color: rgba(255,255,255,0.8); font-size: 15px; font-weight: 600; margin-bottom: 20px; }
.overlay-btn {
  background: var(--grass-light);
  color: var(--header-dark);
  border: none;
  padding: 12px 32px;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}
.overlay-btn:hover { background: #b8e05c; transform: translateY(-2px); }
@keyframes gm-bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Content cards */
.gm-content-section { max-width: 900px; margin: 40px auto; padding: 0 24px; }
.content-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(74,117,44,0.1);
}
body.gm-theme[data-theme="dark"] .content-card { box-shadow: 0 2px 12px rgba(0,0,0,0.2); border-color: rgba(200,230,200,0.08); }

.content-card h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--header-bg);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
body.gm-theme[data-theme="dark"] .content-card h2 { color: #81c784; }
.content-card h2 .icon { font-size: 28px; }
.content-card h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--header-bg);
  margin: 20px 0 10px;
}
body.gm-theme[data-theme="dark"] .content-card h3 { color: #a5d6a7; }
.content-card p { font-size: 15.5px; line-height: 1.75; color: var(--text-muted); margin-bottom: 12px; }
.content-card ul { list-style: none; padding: 0; }
.content-card ul li { padding: 8px 0 8px 28px; position: relative; font-size: 15px; line-height: 1.6; color: var(--text-muted); }
.content-card ul li::before { content: '🌿'; position: absolute; left: 0; top: 8px; }

/* Features grid */
.gm-features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
.gm-feature-item { background: var(--section-bg); border-radius: 12px; padding: 20px; text-align: center; transition: transform 0.2s; }
.gm-feature-item:hover { transform: translateY(-3px); }
.gm-feature-icon { font-size: 36px; margin-bottom: 10px; }
.gm-feature-item h3 { font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 700; color: var(--header-bg); margin: 0 0 6px; }
body.gm-theme[data-theme="dark"] .gm-feature-item h3 { color: #a5d6a7; }
.gm-feature-item p { font-size: 13.5px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* Diff table */
.diff-table { width: 100%; border-collapse: collapse; margin-top: 16px; border-radius: 10px; overflow: hidden; }
.diff-table th { background: var(--header-bg); color: #fff; padding: 12px 16px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14px; text-align: left; }
.diff-table td { padding: 12px 16px; font-size: 14px; color: var(--text-dark); border-bottom: 1px solid rgba(74,117,44,0.1); }
.diff-table tr:nth-child(even) td { background: var(--section-bg); }
body.gm-theme[data-theme="dark"] .diff-table th { background: #1f3312; }

/* Tips grid */
.tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.tip-card { background: var(--section-bg); border-radius: 10px; padding: 16px; border-left: 4px solid var(--grass-light); }
.tip-card h4 { font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700; color: var(--header-bg); margin-bottom: 6px; }
body.gm-theme[data-theme="dark"] .tip-card h4 { color: #a5d6a7; }
.tip-card p { font-size: 13.5px; line-height: 1.6; color: var(--text-muted); margin: 0; }

/* FAQ */
.gm-faq-item { border-bottom: 1px solid rgba(74,117,44,0.12); padding: 18px 0; }
.gm-faq-item:last-child { border-bottom: none; }
.gm-faq-q {
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  padding: 0;
}
.gm-faq-q::before { content: '▸'; color: var(--header-bg); transition: transform 0.2s; font-size: 14px; flex-shrink: 0; }
.gm-faq-q.open::before { transform: rotate(90deg); }
.gm-faq-a { font-size: 15px; line-height: 1.7; color: var(--text-muted); margin-top: 10px; padding-left: 22px; display: none; }
.gm-faq-a.show { display: block; }

/* Footer override */
body.gm-theme .site-footer { background: var(--header-dark); }
body.gm-theme[data-theme="dark"] .site-footer { background: #0d1f0d; }
body.gm-theme #cookie-banner { background: var(--header-dark) !important; }

/* Mobile */
@media (max-width: 768px) {
  body.gm-theme .nav-links.open { background: var(--header-bg); }
  body.gm-theme .nav-links.open a { color: rgba(255,255,255,0.8); }
  body.gm-theme .nav-links.open a:hover { color: #fff; background: rgba(255,255,255,0.1); }
  body.gm-theme .nav-links.open a.active { color: #fff; background: rgba(255,255,255,0.2); }
  body.gm-theme .lang-dropdown a:hover { background: rgba(255,255,255,0.1); color: #fff; }
  body.gm-theme .lang-dropdown a.active { color: #fff; }
  .game-top-bar { padding: 8px 10px; gap: 8px; }
  .gm-counter { font-size: 18px; }
  .difficulty-select { font-size: 13px; padding: 5px 10px; }
  .content-card { padding: 24px 18px; }
  .content-card h2 { font-size: 22px; }
  .tips-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .gm-features-grid { grid-template-columns: 1fr; }
  .cell.flagged::after, .cell.mine-show::after { font-size: 14px; }
}
