@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Colors */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --primary: #0a66c2;
  --primary-hover: #004182;
  --primary-light: #e0f2fe;

  --accent-orange: #ea580c;
  --accent-gold: #f59e0b;
  --accent-green: #16a34a;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --border-focus: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-secondary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Header & Navigation */
header.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0a66c2 0%, #6366f1 100%);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.dropdown-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown:focus-within .dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 280px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(4px);
}

@media (max-width: 480px) {
  .dropdown-menu {
    left: auto;
    right: -40px;
    transform: translateY(8px);
    width: 260px;
  }
  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown:focus-within .dropdown-menu {
    transform: translateY(4px);
  }
}

.dropdown-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  transition: background 0.15s ease, transform 0.15s ease;
  background: transparent !important;
}

.dropdown-item:hover {
  background: #f8fafc !important;
  transform: translateX(2px);
}

.dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dropdown-item-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.dropdown-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.dropdown-item-sub {
  font-size: 0.74rem;
  color: #64748b;
}

/* Main Container */
main.site-main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* Policy Card Container */
.policy-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: var(--shadow-md);
}

.policy-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 14px;
}

.badge-pill.queens {
  background: #fef3c7;
  color: #b45309;
}

.badge-pill.patches {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-pill.minisudoku {
  background: #fef9c3;
  color: #854d0e;
}

.badge-pill.wend {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-pill.tango {
  background: #fef3c7;
  color: #b45309;
}

.policy-header-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}

.policy-app-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.policy-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.policy-header-text .badge-pill {
  margin-bottom: 6px;
}

/* Links to other games on privacy.html */
.policy-games-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0 24px;
}

.policy-game-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.policy-game-link-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.policy-mini-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.policy-link-info {
  display: flex;
  flex-direction: column;
}

.policy-link-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.policy-link-pkg {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

h1.policy-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 8px;
}

.policy-meta {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Callout Box */
.callout-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 24px 0 32px;
  color: #166534;
  font-size: 0.95rem;
}

.callout-box strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Typography Inside Policy */
.policy-content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.policy-content p {
  margin-bottom: 16px;
  font-size: 1rem;
  color: var(--text-secondary);
}

.policy-content ul {
  margin: 0 0 20px 24px;
  color: var(--text-secondary);
}

.policy-content li {
  margin-bottom: 8px;
  font-size: 0.98rem;
}

.policy-content strong {
  color: var(--text-primary);
}

.policy-content code {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: Consolas, Monaco, monospace;
  color: var(--primary);
}

/* Landing Page Styles */
.hero-section {
  text-align: center;
  padding: 30px 10px 48px;
  max-width: 780px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Games Grid */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.game-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.game-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.game-icon.queens-icon {
  background: #fdf2e9;
  border: 1px solid #fed7aa;
}

.game-icon.sudoku-icon {
  background: #fefce8;
  border: 1px solid #fef08a;
}

.game-icon.wend-icon {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.game-meta h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.game-meta .package-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
}

.game-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
  flex: 1;
}

.game-actions {
  display: flex;
  gap: 12px;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.15s ease;
  flex: 1;
}

.btn-play:hover {
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-policy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.15s ease;
  flex: 1;
}

.btn-policy:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  text-decoration: none;
}

/* Verification Banner */
.verification-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.verification-icon {
  font-size: 2rem;
  color: var(--primary);
}

.verification-content h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.verification-content p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.code-snippet {
  background: #0f172a;
  color: #38bdf8;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  display: block;
}

/* Footer */
footer.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 32px 20px;
  margin-top: auto;
}

.footer-content {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Games Table Format Card */
.games-table-card {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
  overflow: hidden;
  margin: 28px 0 44px;
}

.games-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.games-table thead th {
  background: #f8fafc;
  padding: 14px 20px;
  font-family: var(--font-heading, inherit);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1.5px solid #e2e8f0;
}

.game-table-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
  background: #ffffff;
}

.game-table-row:last-child {
  border-bottom: none;
}

.game-table-row:hover {
  background: #f8fafc;
}

.games-table td {
  padding: 18px 20px;
  vertical-align: middle;
}

.game-meta-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.table-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.table-game-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 3px;
}

.table-game-pkg {
  font-family: monospace;
  font-size: 0.76rem;
  color: #64748b;
}

.table-game-desc {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.45;
  margin-bottom: 8px;
}

.table-features-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.feat-pill {
  font-size: 0.74rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.table-actions-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-play-table {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #0f172a;
  color: #ffffff !important;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-play-table:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-policy-table {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 13px;
  background: #ffffff;
  color: #334155 !important;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-policy-table:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a !important;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  white-space: nowrap;
}

.badge-tag.patches-tag {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-tag.queens-tag {
  background: #fef3c7;
  color: #b45309;
}

.badge-tag.sudoku-tag {
  background: #fef9c3;
  color: #854d0e;
}

.badge-tag.wend-tag {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-tag.tango-tag {
  background: #fef3c7;
  color: #b45309;
}

/* Mobile responsive fallback */
@media (max-width: 860px) {
  .games-table thead {
    display: none;
  }
  .games-table, .games-table tbody, .games-table tr.game-table-row {
    display: block;
    width: 100%;
  }
  .games-table tr.game-table-row {
    padding: 16px;
    border-bottom: 1.5px solid #e2e8f0;
  }
  .games-table td {
    display: block;
    padding: 6px 0;
    width: 100% !important;
  }
  .table-actions-group {
    justify-content: flex-start;
    padding-top: 10px;
  }
  .btn-play-table, .btn-policy-table {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.1rem;
  }
  .policy-card {
    padding: 28px 20px;
  }
  h1.policy-title {
    font-size: 1.75rem;
  }
  .verification-card {
    flex-direction: column;
  }
  .policy-header-brand {
    gap: 14px;
    align-items: flex-start;
  }
  .policy-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
}
