/* ==========================================================================
   PuzPets — Cozy Puzzle Games & Wandering Companions
   styles.css (Production Vanilla CSS)
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Nunito", "Quicksand", sans-serif;
  
  /* Rich Forest Meadow Background Palette */
  --bg-forest-deep: #16301a;
  --bg-forest-mid: #214325;
  --bg-forest-glade: #2e5a33;
  --bg-meadow-light: #44774a;
  
  /* High-Contrast Crisp Parchment Surface */
  --bg-surface: #ffffff;
  --bg-surface-warm: #fbf9f5;
  --bg-subtle: #f3ede2;
  --bg-subtle-hover: #e9e0d1;
  --border-color: #dcd0bf;
  --border-strong: #c2b39d;
  --border-forest: rgba(85, 140, 92, 0.35);
  
  --text-main: #24201b;
  --text-muted: #6b6051;
  --text-light: #948674;
  --text-on-dark: #fbfbf9;

  /* Woodland Earthy & Cozy Accents */
  --coral: #e07a5f;
  --coral-dark: #cc6449;
  --sage: #5f8d67;
  --sage-dark: #466c4c;
  --honey: #e8a838;
  --honey-dark: #cf9023;
  --amber: #f2994a;
  --lavender: #8e83b8;
  --cream: #fdfbf7;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 5px rgba(20, 35, 20, 0.08);
  --shadow-md: 0 8px 20px rgba(15, 30, 15, 0.12);
  --shadow-lg: 0 16px 36px rgba(10, 25, 10, 0.18);
  --shadow-inner: inset 0 2px 4px rgba(20, 35, 20, 0.06);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-forest-mid);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(225, 245, 190, 0.12) 0%, transparent 65%),
    linear-gradient(180deg, #17321c 0%, #204524 350px, #264e2b 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Grassy Meadow Blade & Soft Clover Texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px),
    radial-gradient(rgba(100, 190, 115, 0.12) 1px, transparent 1px);
  background-size: 40px 40px, 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.6;
  z-index: 0;
}

/* App Root Layout */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.main-header {
  background-color: rgba(22, 45, 25, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-forest);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 25;
  box-shadow: 0 4px 16px rgba(10, 25, 12, 0.25);
}

.header-content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-logo {
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.brand-area:hover .brand-logo {
  transform: rotate(-6deg) scale(1.06);
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  color: #fcfbf7;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background-color: rgba(232, 168, 56, 0.25);
  color: #f7d27e;
  border: 1px solid rgba(232, 168, 56, 0.4);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.brand-text p {
  font-size: 12px;
  color: #bfd4c2;
}

/* Header Quick Nav Tabs */
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 820px) {
  .header-nav {
    display: none;
  }
}

.nav-link-btn {
  background: transparent;
  color: #d1e2d4;
  border: 1px solid transparent;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-link-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.treat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fdf6ec;
  border: 1px solid #ebd7bf;
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.treat-pill:hover {
  transform: scale(1.04);
}

.treat-icon {
  font-size: 16px;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-header:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-strong);
}

.btn-primary-cozy {
  background: var(--coral);
  color: #fff;
  border: 1px solid var(--coral-dark);
}

.btn-primary-cozy:hover {
  background: var(--coral-dark);
  color: #fff;
}

/* ==========================================================================
   Main Portal Layout (Content + Right Sidebar)
   ========================================================================== */
.portal-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 28px;
  flex: 1;
  width: 100%;
}

.main-stage {
  flex: 1;
  min-width: 0;
}

.sidebar-container {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 1024px) {
  .portal-layout {
    flex-direction: column;
    padding: 16px;
    gap: 20px;
  }
  .sidebar-container {
    width: 100%;
  }
}

/* ==========================================================================
   Right Sidebar
   ========================================================================== */
.sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Pet Companion Selector List in Sidebar */
.pet-collection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-collection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.pet-collection-item.active {
  background: #fdf7ee;
  border-color: #e5cdb2;
  box-shadow: 0 0 0 2px rgba(224, 122, 95, 0.2);
}

.pet-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pet-item-avatar {
  font-size: 24px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.pet-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.pet-item-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.pet-unlock-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform var(--transition-fast);
}

.pet-unlock-btn:hover {
  transform: scale(1.05);
}

.btn-ad-unlock {
  background: #fef4e8;
  color: var(--coral-dark);
  border-color: #f7c99e;
}

.btn-equipped {
  background: #edf5ee;
  color: var(--sage-dark);
  border-color: #bcd9c0;
}

.btn-equip {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* Sidebar Quick Treats Bonus */
.free-treats-banner {
  background: linear-gradient(135deg, #fdf4e7 0%, #fae8d4 100%);
  border: 1px solid #ebd1b2;
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.free-treats-btn {
  background: var(--coral);
  color: #fff;
  border: 1px solid var(--coral-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(224, 122, 95, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--transition-fast);
}

.free-treats-btn:hover {
  transform: scale(1.04);
}

/* ==========================================================================
   Central Hub Game Grid
   ========================================================================== */
.hub-view {
  display: block;
}

.hub-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hub-hero-text h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.hub-hero-text p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 580px;
}

.hub-hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 680px) {
  .game-grid {
    grid-template-columns: 1fr;
  }
}

.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.game-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-sm);
}

.icon-sudoku { background: #eef3f8; border: 1px solid #d2e1f0; }
.icon-2048 { background: #fdf5ea; border: 1px solid #fae3be; }
.icon-tictactoe { background: #fbf0f4; border: 1px solid #f6d8e2; }
.icon-memory { background: #edf5ee; border: 1px solid #c9e3cc; }
.icon-pawsweeper { background: #fdf0ec; border: 1px solid #f5cfc4; }
.icon-petslide { background: #f2eef9; border: 1px solid #ddd2f0; }

.game-card-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.tag-sudoku { background: #e2ecf5; color: #436d93; }
.tag-2048 { background: #fef0db; color: #b37012; }
.tag-tictactoe { background: #fae4ed; color: #a44d71; }
.tag-memory { background: #e1f0e3; color: #437a4c; }
.tag-pawsweeper { background: #fae2db; color: #b84f32; }
.tag-petslide { background: #eae4f5; color: #6a499f; }

.game-card-body h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.game-card-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 20px;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.game-stats {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-play-card {
  font-size: 12px;
  font-weight: 700;
  color: var(--coral-dark);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Active Game Container & Header Bar
   ========================================================================== */
.game-view-container {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.game-view-container.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

.game-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-back-hub:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-strong);
}

.active-game-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.game-score-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
}

.badge-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.badge-val {
  font-size: 15px;
  color: var(--text-main);
}

/* ==========================================================================
   Game 1: Sudoku
   ========================================================================== */
.sudoku-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 520px;
  margin: 0 auto;
}

.sudoku-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  flex-wrap: wrap;
}

.difficulty-select {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  background: #332c25;
  border: 3px solid #332c25;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  user-select: none;
}

.sudoku-cell {
  background: #ffffff;
  border: 0.5px solid #dfd5c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

/* 3x3 Subgrid Borders */
.sudoku-cell:nth-child(3n) {
  border-right: 2px solid #332c25;
}
.sudoku-cell:nth-child(9n) {
  border-right: none;
}
.sudoku-cell:nth-child(n + 19):nth-child(-n + 27),
.sudoku-cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom: 2px solid #332c25;
}

.sudoku-cell.fixed {
  background: #f7f3ed;
  color: #27211b;
  font-weight: 800;
}

.sudoku-cell.selected {
  background: #fef0db !important;
  box-shadow: inset 0 0 0 2px var(--honey);
}

.sudoku-cell.highlighted {
  background: #faf4ea;
}

.sudoku-cell.same-number {
  background: #f5e8d5;
}

.sudoku-cell.error {
  background: #fde8e8 !important;
  color: #c53030 !important;
  animation: shake 0.3s ease-in-out;
}

.sudoku-cell.hinted {
  background: #e6f6ea !important;
  color: #22543d !important;
  animation: popIn 0.3s ease-out;
}

.sudoku-keypad {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 450px;
  justify-content: center;
  flex-wrap: wrap;
}

.keypad-btn {
  flex: 1;
  min-width: 38px;
  height: 44px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.keypad-btn:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.keypad-btn.btn-erase {
  font-size: 14px;
  color: var(--coral-dark);
}

.btn-sudoku-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef4e8;
  border: 1px solid #f9caa7;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sudoku-hint:hover {
  background: #fee7d1;
  transform: scale(1.02);
}

/* ==========================================================================
   Game 2: 2048
   ========================================================================== */
.g2048-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 440px;
  margin: 0 auto;
  user-select: none;
}

.g2048-top-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.g2048-board-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #b6a798;
  border-radius: var(--radius-lg);
  padding: 12px;
  position: relative;
  box-shadow: var(--shadow-md);
  touch-action: none;
}

.g2048-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  height: 100%;
}

.g2048-empty-cell {
  background: rgba(238, 228, 218, 0.35);
  border-radius: var(--radius-md);
}

.g2048-tile-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  pointer-events: none;
}

.g2048-tile {
  position: absolute;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  transition: transform 0.12s ease-in-out;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  animation: tileAppear 0.18s ease-out;
}

.tile-2 { background: #eee4da; color: #776e65; font-size: 32px; }
.tile-4 { background: #ede0c8; color: #776e65; font-size: 32px; }
.tile-8 { background: #f2b179; color: #f9f6f2; font-size: 30px; }
.tile-16 { background: #f59563; color: #f9f6f2; font-size: 28px; }
.tile-32 { background: #f67c5f; color: #f9f6f2; font-size: 28px; }
.tile-64 { background: #e95938; color: #f9f6f2; font-size: 28px; }
.tile-128 { background: #edcf72; color: #f9f6f2; font-size: 26px; box-shadow: 0 0 10px rgba(237, 207, 114, 0.4); }
.tile-256 { background: #edcc61; color: #f9f6f2; font-size: 26px; box-shadow: 0 0 14px rgba(237, 204, 97, 0.5); }
.tile-512 { background: #edc850; color: #f9f6f2; font-size: 26px; box-shadow: 0 0 18px rgba(237, 200, 80, 0.6); }
.tile-1024 { background: #b885c4; color: #f9f6f2; font-size: 22px; }
.tile-2048 { background: #81a88b; color: #ffffff; font-size: 22px; box-shadow: 0 0 24px rgba(129, 168, 139, 0.8); }

.g2048-dpad {
  display: grid;
  grid-template-areas:
    ". up ."
    "left down right";
  gap: 8px;
  margin-top: 10px;
}

.dpad-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  width: 52px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.dpad-btn:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-strong);
}

.dpad-up { grid-area: up; }
.dpad-left { grid-area: left; }
.dpad-down { grid-area: down; }
.dpad-right { grid-area: right; }

.g2048-undo-hook {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Game 3: Tic-Tac-Toe (Pet Edition)
   ========================================================================== */
.ttt-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 420px;
  margin: 0 auto;
}

.ttt-status-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ttt-pet-bubble {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  background: var(--border-color);
  padding: 10px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.ttt-cell {
  background: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.ttt-cell:hover:empty {
  background: #fef7ee;
}

.ttt-cell.winning {
  background: #edf6ef;
  transform: scale(0.96);
  animation: pulseGreen 1s infinite alternate;
}

.ttt-mode-picker {
  display: flex;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.ttt-mode-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ttt-mode-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Game 4: Memory Match
   ========================================================================== */
.memory-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  aspect-ratio: 1 / 1;
  perspective: 1000px;
}

.memory-card {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.memory-card.flipped,
.memory-card.matched {
  transform: rotateY(180deg);
}

.memory-card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  user-select: none;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.card-back {
  background: linear-gradient(135deg, #f4eee2 0%, #ecd9c3 100%);
  color: var(--coral);
  font-size: 26px;
  font-weight: 800;
  border-color: #dfceb7;
}

.card-back::after {
  content: "🐾";
  font-size: 24px;
  opacity: 0.75;
}

.card-front {
  background: #ffffff;
  font-size: 36px;
  transform: rotateY(180deg);
}

.memory-card.matched .card-front {
  background: #f0f7f2;
  border-color: #b7d6bf;
  animation: popIn 0.3s ease-out;
}

/* ==========================================================================
   Pet Overlay System (Floating/Wandering Pixel Companions with Walking Gait)
   ========================================================================== */
#pet-overlay-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.wandering-pet {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: top 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95), left 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95);
  filter: drop-shadow(0 6px 10px rgba(10, 25, 10, 0.22));
}

.wandering-pet:hover .pet-avatar-frame {
  transform: translateY(-4px) scale(1.1);
}

.pet-avatar-frame {
  position: relative;
  font-size: 38px;
  line-height: 1;
  transform-origin: bottom center;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: petIdleBreathe 2.8s ease-in-out infinite;
}

/* Authentic quadruped walking gait */
.wandering-pet.walking .pet-avatar-frame {
  animation: petStepWalk 0.38s ease-in-out infinite alternate !important;
}

.wandering-pet.facing-left .pet-avatar-frame {
  transform: scaleX(-1);
}

.wandering-pet.facing-left.walking .pet-avatar-frame {
  animation: petStepWalkFlipped 0.38s ease-in-out infinite alternate !important;
}

.pet-shadow {
  width: 32px;
  height: 8px;
  background: rgba(15, 30, 15, 0.28);
  border-radius: 50%;
  margin-top: -2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.wandering-pet.walking .pet-shadow {
  animation: petShadowSquash 0.38s ease-in-out infinite alternate;
}

/* Realistic Ground Step Dust / Leaf Puffs */
.step-puff-particle {
  position: absolute;
  font-size: 13px;
  pointer-events: none;
  z-index: 49;
  animation: stepPuffFloat 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes stepPuffFloat {
  0% {
    transform: translateY(0) scale(0.6) rotate(0deg);
    opacity: 0.85;
  }
  100% {
    transform: translateY(-16px) scale(1.1) rotate(25deg);
    opacity: 0;
  }
}

@keyframes petStepWalk {
  0% {
    transform: translateY(0) rotate(0deg) scale(1.06, 0.94);
  }
  25% {
    transform: translateY(-9px) rotate(4.5deg) scale(0.96, 1.05);
  }
  50% {
    transform: translateY(0) rotate(0deg) scale(1.05, 0.95);
  }
  75% {
    transform: translateY(-9px) rotate(-4.5deg) scale(0.96, 1.05);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1.06, 0.94);
  }
}

@keyframes petStepWalkFlipped {
  0% {
    transform: scaleX(-1) translateY(0) rotate(0deg) scale(1.06, 0.94);
  }
  25% {
    transform: scaleX(-1) translateY(-9px) rotate(-4.5deg) scale(0.96, 1.05);
  }
  50% {
    transform: scaleX(-1) translateY(0) rotate(0deg) scale(1.05, 0.95);
  }
  75% {
    transform: scaleX(-1) translateY(-9px) rotate(4.5deg) scale(0.96, 1.05);
  }
  100% {
    transform: scaleX(-1) translateY(0) rotate(0deg) scale(1.06, 0.94);
  }
}

@keyframes petShadowSquash {
  0%, 50%, 100% {
    transform: scale(1.15, 1);
    opacity: 0.32;
  }
  25%, 75% {
    transform: scale(0.72, 0.6);
    opacity: 0.12;
  }
}

@keyframes petIdleBreathe {
  0%, 100% {
    transform: translateY(0) scale(1, 1);
  }
  50% {
    transform: translateY(-2px) scale(1.02, 0.98);
  }
}

.pet-speech-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  animation: popIn 0.2s ease-out;
}

.pet-speech-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border-width: 4px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.pet-sleep-zzz {
  position: absolute;
  top: -14px;
  right: -6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--lavender);
  animation: floatZzz 1.5s infinite;
  pointer-events: none;
}

/* Click Particle Effect */
.heart-particle {
  position: absolute;
  font-size: 20px;
  pointer-events: none;
  animation: heartBurst 0.8s ease-out forwards;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #332c25;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  animation: toastPop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes petWaddle {
  0% { transform: rotate(-5deg) translateY(0); }
  100% { transform: rotate(5deg) translateY(-4px); }
}

@keyframes floatSmall {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@keyframes floatZzz {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translate(12px, -18px) scale(1.1); opacity: 0; }
}

@keyframes heartBurst {
  0% { transform: scale(0.5) translateY(0); opacity: 1; }
  100% { transform: scale(1.4) translateY(-32px); opacity: 0; }
}

@keyframes tileAppear {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 rgba(100, 180, 120, 0); }
  100% { box-shadow: 0 0 16px rgba(100, 180, 120, 0.4); }
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes toastPop {
  0% { transform: translateY(20px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ==========================================================================
   Top Animal Sanctuary & Companion Selector Ribbon
   ========================================================================== */
.top-pet-bar {
  background: #fdfaf6;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  position: sticky;
  top: 61px;
  z-index: 19;
  box-shadow: 0 2px 8px rgba(50, 40, 30, 0.03);
}

.top-pet-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-pet-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.top-pet-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.top-pet-label {
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.top-pet-lead {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  color: var(--coral-dark);
  font-size: 12px;
}

.top-pet-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.top-pet-categories {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pet-cat-btn {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.pet-cat-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.pet-cat-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral-dark);
}

/* Horizontal Roster Ribbon */
.top-pet-roster-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.top-pet-roster-scroll::-webkit-scrollbar {
  height: 5px;
}

.top-pet-roster-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.top-pet-card,
.pet-roster-chip {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(10, 25, 12, 0.06);
  user-select: none;
}

.top-pet-card:hover,
.pet-roster-chip:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 6px 14px rgba(10, 25, 12, 0.1);
}

.top-pet-card.active,
.pet-roster-chip.active {
  border-color: var(--coral);
  background: #fdf7f3;
  box-shadow: 0 0 0 2px rgba(224, 122, 95, 0.25);
}

.top-pet-card.locked,
.pet-roster-chip.locked {
  background: #faf6f0;
  opacity: 0.95;
}

.top-pet-card-avatar,
.pet-roster-avatar {
  font-size: 28px;
  line-height: 1;
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.pet-roster-meta,
.top-pet-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pet-roster-name,
.top-pet-card-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pet-roster-species {
  font-size: 11px;
  color: var(--text-muted);
}

.pet-tier-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.pet-tier-tag.cozy {
  background: #fef0db;
  color: #a36512;
  border: 1px solid #f6d8ae;
}

.pet-tier-tag.woodland {
  background: #e4f2e7;
  color: #386b40;
  border: 1px solid #c0dfc5;
}

.pet-tier-tag.exotic {
  background: #fae4dd;
  color: #b5492b;
  border: 1px solid #f4c2b4;
}

.pet-tier-tag.mythic {
  background: #ede9f7;
  color: #5d489b;
  border: 1px solid #d4ccee;
}

.pet-roster-action {
  margin-left: 2px;
}

.pet-roster-status-active {
  font-size: 11px;
  font-weight: 800;
  color: var(--coral-dark);
  background: #faeee9;
  border: 1px solid #f6c8ba;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.pet-roster-btn-equip {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.pet-roster-btn-equip:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.pet-roster-btn-ad {
  font-size: 11px;
  font-weight: 800;
  color: #a36512;
  background: #fef5ea;
  border: 1px solid #fae1bb;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform var(--transition-fast);
}

.pet-roster-btn-ad:hover {
  transform: scale(1.05);
  background: #fdecd5;
}

.action-active {
  background: #fdeee8;
  color: var(--coral-dark);
  border-color: #f7c99e;
}

.action-equip {
  background: #fff;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.action-ad-unlock {
  background: #fdf5ea;
  color: #b37012;
  border-color: #fae3be;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ==========================================================================
   Interactive Pet Meadow Playpen (Hub Feature)
   ========================================================================== */
.meadow-playpen-card {
  background: linear-gradient(180deg, #f5fbf6 0%, #eaf4eb 100%);
  border: 1px solid #cce3cf;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.meadow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.meadow-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meadow-title h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.meadow-title p {
  font-size: 12px;
  color: var(--text-muted);
}

.meadow-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meadow-btn {
  background: #ffffff;
  border: 1px solid #c2dec5;
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.meadow-btn:hover {
  background: #eef6ef;
  border-color: var(--sage);
  transform: translateY(-1px);
}

.meadow-yard {
  background: #d8edd9;
  border: 2px dashed #b5dbb8;
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 95px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.meadow-grass-decor {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 14px;
  opacity: 0.55;
  pointer-events: none;
}

.meadow-pets-container {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

.meadow-pet-sprite {
  font-size: 32px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
  animation: petWaddle 1.6s ease-in-out infinite alternate;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.meadow-pet-sprite:hover {
  transform: scale(1.15) rotate(5deg);
}

.meadow-speech-bubble {
  background: #fff;
  border: 1px solid #bcd9c0;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sage-dark);
  box-shadow: var(--shadow-sm);
  max-width: 320px;
  z-index: 1;
  animation: popIn 0.3s ease;
}

/* ==========================================================================
   Daily Companion Quests Card
   ========================================================================== */
.hub-quests-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.quests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .quests-grid {
    grid-template-columns: 1fr;
  }
}

.quest-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.quest-details {
  flex: 1;
  min-width: 0;
}

.quest-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.quest-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.quest-bar-wrap {
  background: #e2d9cd;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quest-bar-fill {
  background: var(--sage);
  height: 100%;
  transition: width 0.4s ease;
}

.quest-claim-btn {
  background: #e5dacb;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  cursor: not-allowed;
  white-space: nowrap;
}

.quest-claim-btn.ready {
  background: var(--coral);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(224, 122, 95, 0.3);
  animation: pulseGreen 1.5s infinite alternate;
}

/* ==========================================================================
   GAME 5: Paw Sweeper (Minesweeper) Styles
   ========================================================================== */
.sweeper-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}

.sweeper-board {
  display: grid;
  grid-template-columns: repeat(8, 44px);
  grid-template-rows: repeat(8, 44px);
  gap: 4px;
  background: #b5cca8;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 3px solid #89a878;
  box-shadow: var(--shadow-md);
  user-select: none;
}

@media (max-width: 480px) {
  .sweeper-board {
    grid-template-columns: repeat(8, 36px);
    grid-template-rows: repeat(8, 36px);
    gap: 3px;
    padding: 8px;
  }
}

.sweeper-cell {
  width: 100%;
  height: 100%;
  background: #84af6e;
  border: 2px solid #a3ce8d;
  border-right-color: #638c4e;
  border-bottom-color: #638c4e;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.1s ease;
}

.sweeper-cell:hover {
  background: #90be79;
}

.sweeper-cell.revealed {
  background: #e9dec9;
  border: 1px solid #d2c5ae;
  cursor: default;
}

.sweeper-cell.mine {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  animation: shake 0.3s ease;
}

.sweeper-cell.revealed-safe {
  background: #e0f2e3;
  border: 1px solid #bce2c2;
}

.sweeper-cell[data-num="1"] { color: #2e6db4; }
.sweeper-cell[data-num="2"] { color: #3b884d; }
.sweeper-cell[data-num="3"] { color: #c44f33; }
.sweeper-cell[data-num="4"] { color: #4e388c; }
.sweeper-cell[data-num="5"] { color: #9c411c; }
.sweeper-cell[data-num="6"] { color: #207a82; }

.sweeper-face-btn {
  font-size: 22px;
  background: #fff;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.sweeper-face-btn:hover {
  transform: scale(1.1);
}

.btn-toggle-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-toggle-flag.flag-mode {
  background: #fdf2e9;
  border-color: #f7c99e;
  color: var(--coral-dark);
}

.btn-ad-perk {
  background: #fef4e8;
  color: var(--coral-dark);
  border: 1px solid #f7c99e;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--transition-fast);
}

.btn-ad-perk:hover {
  transform: scale(1.04);
  background: #fde8d0;
}

/* ==========================================================================
   GAME 6: Pet Slide (15-Puzzle) Styles
   ========================================================================== */
.petslide-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}

.petslide-board-container {
  background: #e9dec9;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 4px solid #c7b69c;
  box-shadow: var(--shadow-md);
}

.petslide-board {
  display: grid;
  gap: 8px;
  user-select: none;
}

.petslide-board.grid-4x4 {
  grid-template-columns: repeat(4, 75px);
  grid-template-rows: repeat(4, 75px);
}

.petslide-board.grid-3x3 {
  grid-template-columns: repeat(3, 90px);
  grid-template-rows: repeat(3, 90px);
}

@media (max-width: 480px) {
  .petslide-board.grid-4x4 {
    grid-template-columns: repeat(4, 58px);
    grid-template-rows: repeat(4, 58px);
    gap: 6px;
  }
  .petslide-board.grid-3x3 {
    grid-template-columns: repeat(3, 76px);
    grid-template-rows: repeat(3, 76px);
    gap: 6px;
  }
}

.petslide-tile {
  background: #fff;
  border: 1px solid #dbcdba;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 0 #cbbea8, 0 5px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  position: relative;
}

.petslide-tile:hover {
  background: #fbf7f0;
  transform: translateY(-2px);
}

.petslide-tile:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #cbbea8;
}

.petslide-tile.empty {
  background: transparent;
  border: 2px dashed #cbbea8;
  box-shadow: none;
  cursor: default;
}

.petslide-tile-num {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.petslide-tile-avatar {
  font-size: 28px;
  line-height: 1;
}

.petslide-helper-bar {
  text-align: center;
  max-width: 440px;
}

/* Treat spending pulse on pill */
.treat-pill.pulse-spend {
  animation: shake 0.3s ease;
  background: #fbeee8;
}

.treat-deduct-float {
  position: absolute;
  color: var(--coral-dark);
  font-weight: 900;
  font-size: 14px;
  pointer-events: none;
  animation: heartBurst 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  z-index: 9999;
}

/* ==========================================================================
   Informational & Legal Pages (About, Privacy, Terms, Contact)
   ========================================================================== */
.info-page-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 30px;
}

.info-page-body {
  margin-top: 10px;
  color: var(--text-main);
  line-height: 1.65;
}

.info-hero-banner {
  background: linear-gradient(135deg, #f0f7f1 0%, #e5f0e7 100%);
  border: 1px solid #cbe0ce;
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.info-hero-icon {
  font-size: 42px;
  flex-shrink: 0;
}

.info-hero-banner h3 {
  font-size: 18px;
  font-weight: 800;
  color: #214325;
  margin-bottom: 6px;
}

.info-hero-banner p {
  font-size: 13.5px;
  color: #3b5a3f;
  margin: 0;
}

.info-section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .info-section-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  background: var(--bg-surface-warm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.info-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.info-card p {
  font-size: 13px;
  color: var(--text-muted);
}

.info-feature-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-main);
}

.info-feature-list li strong {
  color: var(--sage-dark);
}

.info-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.info-pill {
  font-size: 11px;
  font-weight: 700;
  background: #eaf3eb;
  color: var(--sage-dark);
  border: 1px solid #c9decb;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.info-link {
  color: var(--coral-dark);
  text-decoration: underline;
  font-weight: 700;
}

/* Legal Documents Formatting */
.legal-text-wrap {
  max-width: 860px;
  font-size: 13.5px;
  color: var(--text-main);
}

.legal-text-wrap h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin: 22px 0 8px 0;
}

.legal-text-wrap p {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.legal-text-wrap ul {
  margin: 8px 0 16px 20px;
  color: var(--text-muted);
}

.legal-text-wrap li {
  margin-bottom: 6px;
}

.contact-highlight-box {
  background: #fdf5ea;
  border: 1px solid #f6d9af;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-main);
}

.contact-highlight-box a {
  color: var(--coral-dark);
  font-weight: 700;
}

/* Interactive Contact Desk */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
}

@media (max-width: 860px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-info-card {
  background: var(--bg-surface-warm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-info-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.contact-channel-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.channel-icon {
  font-size: 22px;
  line-height: 1;
}

.channel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.channel-link {
  font-size: 14px;
  font-weight: 800;
  color: var(--coral-dark);
  text-decoration: underline;
}

.channel-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.quick-copy-box {
  background: #ffffff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.btn-copy-email {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-email:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-strong);
}

.contact-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.contact-form-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.form-group label .req {
  color: var(--coral);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(95, 141, 103, 0.18);
}

.btn-submit-contact {
  background: var(--sage-dark);
  color: #ffffff;
  border: 1px solid #36553b;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  margin-top: 6px;
}

.btn-submit-contact:hover {
  background: #315136;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.contact-success-card {
  background: #eef7f0;
  border: 1px solid #bddfc4;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: #214325;
  animation: popIn 0.3s ease-out;
}

/* ==========================================================================
   Comprehensive Portal Footer
   ========================================================================== */
.portal-footer {
  background-color: rgba(18, 38, 20, 0.97);
  border-top: 1px solid var(--border-forest);
  color: #e5ece6;
  margin-top: 40px;
  padding: 44px 24px 24px 24px;
  position: relative;
  z-index: 10;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 960px) {
  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 580px) {
  .footer-top-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-logo {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
}

.footer-mission {
  font-size: 12.5px;
  color: #bfd1c3;
  line-height: 1.55;
  margin-bottom: 6px;
}

.footer-contact-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.footer-email-link {
  color: #f7d27e;
  font-weight: 800;
  text-decoration: underline;
  font-size: 13px;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-heading {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #ffffff;
  margin-bottom: 4px;
}

.footer-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: #bfd1c3;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition-fast);
}

.footer-link-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-legal-notice {
  font-size: 12px;
  color: #aebfb2;
  line-height: 1.5;
}

.footer-compliance-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.compliance-tag {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #d8ebd9;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.footer-bottom-bar {
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: #8fa693;
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-bottom-right a {
  color: #f7d27e;
  text-decoration: underline;
}


/* ==========================================================================
   2026 Upgrade: Typography, SEO Links, Streak Pill, Game Enhancements & Adsterra
   ========================================================================== */
h1, h2, h3, h4, .active-game-title, .brand-text h1, .hub-hero-text h2 {
  font-family: var(--font-heading);
}

a.brand-area,
a.nav-link-btn,
a.btn-back-hub,
a.btn-play-card,
a.footer-link-btn,
a.game-card-title-link {
  text-decoration: none;
}

a.game-card-title-link {
  color: inherit;
}

a.game-card-title-link:hover {
  color: var(--coral-dark);
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #78350f;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.pill-unit {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 700;
}

@media (max-width: 960px) {
  .header-content {
    flex-wrap: wrap;
  }
  .header-nav {
    display: flex;
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Meadow Playpen Actors & Toy Animations */
.meadow-pet-actor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  animation: petWaddle 1.8s ease-in-out infinite alternate;
  transition: transform var(--transition-fast);
}

.meadow-pet-actor:hover {
  transform: translateY(-4px) scale(1.1);
}

.meadow-pet-avatar {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
}

.meadow-pet-nametag {
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.92);
  color: var(--sage-dark);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  border: 1px solid #c2dec5;
}

.meadow-toy-ball,
.crumb-particle {
  position: absolute;
  font-size: 22px;
  pointer-events: none;
  z-index: 5;
  animation: popIn 0.3s ease-out, floatSmall 0.6s ease-in-out infinite alternate;
}

/* Quests enhancements */
.quests-reset-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--sage-dark);
  background: #eaf3ec;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.quest-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.quest-progress-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--sage-dark);
}

.quest-claim-btn.claimed {
  background: #e3efe5;
  color: var(--sage-dark);
  border: 1px solid #bdd8c1;
  cursor: default;
}

/* Sudoku Notes Mode */
.btn-header.notes-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 800;
}

.sudoku-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 2px;
  pointer-events: none;
}

.sudoku-note-num {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 2048 Tile Companion Badges */
.g2048-tile {
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
}

.tile-pet-emoji {
  font-size: 15px;
  line-height: 1;
}

.tile-num-text {
  font-weight: 800;
}

/* Memory 5x4 Grid Mode */
.memory-board.grid-5x4 {
  grid-template-columns: repeat(5, 1fr);
  aspect-ratio: 5 / 4;
}

/* Paw Sweeper fixes & 10x10 Woodland Grid */
.sweeper-board.grid-10x10 {
  grid-template-columns: repeat(10, 38px);
  grid-template-rows: repeat(10, 38px);
}

@media (max-width: 480px) {
  .sweeper-board.grid-10x10 {
    grid-template-columns: repeat(10, 30px);
    grid-template-rows: repeat(10, 30px);
  }
}

.sweeper-cell.c-1 { color: #2e6db4; }
.sweeper-cell.c-2 { color: #2f7d40; }
.sweeper-cell.c-3 { color: #c44f33; }
.sweeper-cell.c-4 { color: #4e388c; }
.sweeper-cell.c-5 { color: #9c411c; }
.sweeper-cell.c-6 { color: #207a82; }
.sweeper-cell.c-7 { color: #1f2937; }
.sweeper-cell.c-8 { color: #6b7280; }

.sweeper-cell.bee {
  background: #fde8e8;
  border-color: #f8b4b4;
  animation: shake 0.3s ease;
}

.sweeper-cell.flagged {
  background: #fef5ea;
}

/* Pet Slide class unification */
.slide-tile-icon {
  font-size: 28px;
  line-height: 1;
}

.slide-tile-num {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.petslide-tile.smart-hint-glow {
  box-shadow: 0 0 0 3px var(--honey), 0 4px 12px rgba(232, 168, 56, 0.45);
  background: #fef9ec;
}

/* Helper caption & SEO Guide / Game Articles */
.game-helper-caption {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

.seo-guide-card,
.game-seo-article {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}

.seo-guide-card h3,
.game-seo-article h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.seo-guide-card p,
.game-seo-article p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.seo-guide-card a,
.game-seo-article a,
.info-feature-list a {
  color: var(--sage-dark);
  font-weight: 700;
  text-decoration: underline;
}

.seo-faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 680px) {
  .seo-faq-grid {
    grid-template-columns: 1fr;
  }
}

.seo-faq-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.seo-faq-item h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-main);
}

.seo-faq-item p {
  font-size: 12.5px;
  margin: 0;
}

/* Sidebar Milestones Mini Grid */
.stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-mini-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-mini-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--sage-dark);
}

.stat-mini-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Adsterra Placement Containers */
.adsterra-sidebar-card,
.adsterra-horizontal-card {
  background: var(--bg-surface-warm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.adsterra-horizontal-card {
  margin-top: 24px;
}

.adsterra-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.adsterra-slot-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0;
}

.adsterra-status-pill {
  font-size: 10px;
  font-weight: 700;
  color: var(--sage-dark);
  background: #eaf3ec;
  border: 1px solid #cce0cf;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.adsterra-box-300x250 {
  min-height: 250px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.adsterra-horizontal-slot {
  min-height: 90px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.adsterra-partner-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  color: var(--text-muted);
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.adsterra-partner-fallback strong {
  color: var(--text-main);
  font-size: 13px;
}

.adsterra-partner-fallback span {
  font-size: 11.5px;
}

.adsterra-consent-card {
  cursor: default;
}

.btn-inline-consent {
  margin-top: 6px;
  background: var(--sage-dark);
  color: #ffffff;
  border: 1px solid #35543a;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-inline-consent:hover {
  background: #2f4b33;
}

/* ==========================================================================
   November 2026 Audit Upgrades:
   - Brand Title & Route H1 Typography
   - Concise Game Rules Brief
   - Compact Top Companion Ribbon & Collapsible Sidebar Nursery
   - Sanctuary Boost & Puzzle Complete Modals
   - Ad Consent Bar & Privacy Controls
   - Keyboard Focus Ring & Calm Mode (Reduced Motion)
   ========================================================================== */
.brand-text .brand-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: #fcfbf7;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-hero-text h1,
.hub-hero-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.btn-calm-toggle[aria-pressed="true"] {
  background: #e6f4ea;
  border-color: var(--sage);
  color: var(--sage-dark);
  font-weight: 800;
}

/* Concise Original Rules & Controls Banner above each board */
.game-rules-brief {
  background: #f5faf6;
  border: 1px solid #cce0cf;
  border-left: 4px solid var(--sage);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.5;
}

.game-rules-brief strong {
  color: var(--sage-dark);
}

/* Compact Top Companion Bar when playing a game or toggled */
.btn-roster-collapse {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-roster-collapse:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.top-pet-bar.compact-mode {
  padding: 8px 18px;
}

.top-pet-bar.compact-mode .top-pet-bar-header {
  margin-bottom: 0;
}

.top-pet-bar.compact-mode #top-pet-roster,
.top-pet-bar.compact-mode .top-pet-roster-scroll,
.top-pet-bar.compact-mode .top-pet-categories,
.top-pet-bar.compact-mode .top-pet-roster,
.top-pet-bar.compact-mode .pet-category-tabs {
  display: none !important;
}

/* Collapsible Sidebar Nursery & Telemetry Line */
.sidebar-nursery-details summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.sidebar-nursery-details summary::-webkit-details-marker {
  display: none;
}

.sidebar-nursery-summary {
  margin-bottom: 0;
}

.sidebar-nursery-details[open] .sidebar-nursery-summary {
  margin-bottom: 12px;
}

.telemetry-summary-line {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}

/* Mobile clutter reduction & above-the-fold board optimization on narrow viewports */
@media (max-width: 768px) {
  .main-header {
    padding: 8px 12px;
    position: relative;
  }
  .header-content {
    gap: 8px;
  }
  .brand-logo {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .brand-text .brand-title,
  .brand-text h1 {
    font-size: 16px;
  }
  .brand-text p,
  .brand-tag,
  .pill-unit {
    display: none;
  }
  .header-actions {
    gap: 6px;
  }
  .streak-pill,
  .treat-pill {
    padding: 4px 8px;
    font-size: 11.5px;
  }
  .btn-header {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .top-pet-bar {
    position: relative;
    top: auto;
    padding: 6px 12px;
  }
  body.in-game-view .header-nav {
    display: none;
  }
  body.in-game-view #pet-overlay-container {
    display: none;
  }
  body.in-game-view .top-pet-bar {
    padding: 5px 12px;
  }
  body.in-game-view .top-pet-bar.compact-mode .top-pet-label,
  body.in-game-view .top-pet-bar.compact-mode .top-pet-count {
    display: none;
  }
  body.in-game-view .top-pet-bar-header {
    flex-wrap: nowrap;
    gap: 6px;
  }
  body.in-game-view .top-pet-sub {
    display: none;
  }
  body.in-game-view .portal-layout {
    padding: 8px;
    gap: 12px;
  }
  body.in-game-view .game-view-container {
    padding: 12px;
  }
  body.in-game-view .game-top-nav {
    padding-bottom: 10px;
    margin-bottom: 10px;
    gap: 8px;
  }
  body.in-game-view .active-game-title {
    font-size: 17px;
  }
  body.in-game-view .game-rules-brief {
    padding: 6px 10px;
    margin-bottom: 10px;
    font-size: 11.5px;
    line-height: 1.35;
  }
  body.in-game-view .sudoku-wrapper,
  body.in-game-view .g2048-wrapper,
  body.in-game-view .petslide-wrapper {
    gap: 10px;
  }
}

/* Accessible Keyboard Focus Outlines */
.sudoku-cell:focus-visible,
.ttt-cell:focus-visible,
.memory-card:focus-visible,
.sweeper-cell:focus-visible,
.petslide-tile:focus-visible,
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

/* Sanctuary Boost & Puzzle Complete Modals */
.sanctuary-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 17, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sanctuary-modal-backdrop[hidden] {
  display: none !important;
}

.sanctuary-modal-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  padding: 22px 24px;
  color: var(--text-main);
  animation: popIn 0.2s ease-out;
}

.sanctuary-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sanctuary-modal-header h3 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
}

.sanctuary-modal-close {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.sanctuary-modal-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.sanctuary-boost-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.boost-option-card {
  background: var(--bg-surface-warm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.boost-option-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e4f2e7;
  color: #2c5e34;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.boost-option-badge.sponsor {
  background: #fef3c7;
  color: #92400e;
}

.boost-option-card h4 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
}

.boost-option-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.boost-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.sanctuary-modal-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.complete-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.complete-stat-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.complete-stat-pill span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

.complete-stat-pill strong {
  font-size: 16px;
  color: var(--sage-dark);
  font-weight: 800;
}

.supporter-cosmetic-box {
  background: #f5faf6;
  border: 1px solid #cce0cf;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

/* Ad Consent & Privacy Banner */
.ad-consent-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 880px;
  background: rgba(20, 40, 23, 0.97);
  color: #f3f7f4;
  border: 1px solid rgba(165, 214, 172, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  z-index: 1100;
}

.ad-consent-banner[hidden] {
  display: none !important;
}

.ad-consent-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ad-consent-text {
  flex: 1;
  min-width: 240px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #d7e6d9;
}

.ad-consent-text strong {
  color: #ffffff;
  display: block;
  margin-bottom: 2px;
  font-size: 13.5px;
}

.ad-consent-text a {
  color: #f7d27e;
  text-decoration: underline;
}

.ad-consent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Calm Mode & Reduced Motion Accessibility */
body.calm-mode .wandering-pet,
body.calm-mode .meadow-pet-actor,
body.calm-mode .quest-claim-btn.ready {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  --font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Baloo 2", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   PHASE 1–4 SEO, CONTENT HUB, GUIDES, I18N, SHARE & EMBED STYLES
   ========================================================================== */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.breadcrumb-nav a {
  color: var(--sage-dark);
  font-weight: 700;
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  opacity: 0.6;
}

/* Pet of the Day Spotlight Card */
.pet-of-the-day-card {
  background: linear-gradient(135deg, #f3faf4 0%, #fff9eb 100%);
  border: 2px solid #cbe0ce;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.potd-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 240px;
}

.potd-emoji {
  font-size: 46px;
  background: #ffffff;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #dfeee1;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.potd-kicker {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--coral-dark);
  margin-bottom: 2px;
}

.potd-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.potd-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.potd-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Deep Game SEO Article & FAQ Accordion */
.game-seo-article {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  line-height: 1.7;
  color: var(--text-main);
}

.game-seo-article h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  color: #1f4224;
  margin: 22px 0 10px 0;
}

.game-seo-article h2:first-child {
  margin-top: 0;
}

.game-seo-article h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  color: #26512c;
  margin: 18px 0 8px 0;
}

.game-seo-article p,
.game-seo-article li {
  font-size: 14.5px;
  color: var(--text-main);
}

.game-seo-article ul,
.game-seo-article ol {
  padding-left: 22px;
  margin: 10px 0 16px 0;
}

.game-seo-article li {
  margin-bottom: 6px;
}

.game-intro-lead {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  line-height: 1.55;
}

.sudoku-variant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px 0;
}

.sudoku-variant-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: #f0f7f1;
  color: #214325;
  border: 1px solid #c6dec9;
  text-decoration: none;
}

.sudoku-variant-pill.active,
.sudoku-variant-pill:hover {
  background: #214325;
  color: #ffffff;
  border-color: #214325;
}

.daily-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 8px;
  margin: 14px 0 20px 0;
}

.daily-archive-link {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.daily-archive-link:hover,
.daily-archive-link.active {
  border-color: var(--sage-primary);
  background: #eef7f0;
  transform: translateY(-1px);
}

.faq-accordion-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.faq-details-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 10px;
}

.faq-details-item summary {
  font-weight: 800;
  font-size: 14.5px;
  color: #1f4224;
  cursor: pointer;
}

.faq-details-item p {
  margin: 8px 0 0 0;
  font-size: 13.8px;
  color: var(--text-muted);
  line-height: 1.6;
}

.related-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.related-card-link {
  display: block;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.related-card-link:hover {
  transform: translateY(-2px);
  border-color: var(--sage-primary);
  background: #f2f9f3;
}

.related-card-link strong {
  display: block;
  font-size: 14px;
  color: #1f4224;
  margin-bottom: 4px;
}

.related-card-link span {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Strategy Guides Hub & Guide Articles */
.ascii-diagram {
  background: #1a2f1d;
  color: #d9f5de;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid #355e3b;
}

.guide-tip-box {
  background: #f3faf4;
  border-left: 4px solid var(--sage-primary);
  padding: 14px 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 16px 0;
  font-size: 13.8px;
}

.guide-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* Share Score & Embed Code Boxes */
.complete-share-box {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.embed-code-textarea {
  width: 100%;
  min-height: 92px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: #1c2e1f;
  color: #e3f9e7;
  margin: 8px 0 10px 0;
}

.lang-switcher-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #e6f2e8;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.lang-pill:hover,
.lang-pill.active {
  background: #e7b84b;
  color: #19331d;
  border-color: #e7b84b;
}

/* Chromeless ?embed=1 Mode for External Iframes */
body.embed-mode .main-header,
body.embed-mode .top-pet-bar,
body.embed-mode .sidebar-container,
body.embed-mode .portal-footer,
body.embed-mode .breadcrumb-nav,
body.embed-mode .game-seo-article,
body.embed-mode .adsterra-horizontal-card,
body.embed-mode #pet-overlay-container {
  display: none !important;
}

body.embed-mode .portal-layout {
  grid-template-columns: 1fr !important;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px;
}
