:root {
  --bg: #f7fce0;
  --panel: rgba(255, 255, 255, 0.9);
  --text: #0b1a0e;
  --muted: #4e5a32;
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --secondary: #ffca3a;
  --accent: #ff595e;
  --border: #132a13;
  --radius: 20px;
  --shadow: 0 10px 0 var(--border);
  --font-main: 'Outfit', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Paytone+One&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(rgba(45, 106, 79, 0.05) 2px, transparent 2px);
  background-size: 30px 30px;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 84px 20px 40px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── Compact Header ── */
header.top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: var(--primary-dark);
  border-bottom: 4px solid var(--border);
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.logo {
  font-family: 'Paytone One', sans-serif;
  font-size: 26px;
  color: var(--secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 2px 2px 0 var(--border);
}

.header-games {
  display: flex;
  gap: 10px;
  margin-left: 20px;
  margin-right: auto;
}

.h-game {
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--secondary);
  font-weight: 800;
  color: var(--border);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 3px 3px 0 var(--border);
}

.nav-links {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-right: 20px;
}

.nav-links a { color: #fff; transition: 0.2s; }
.nav-links a:hover { color: var(--secondary); transform: scale(1.1); }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 15px;
  border: 3px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--border);
  position: relative;
}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-main);
  font-size: 15px;
  width: 140px;
  font-weight: 600;
}

/* ── Beautiful Search Dropdown ── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  max-height: 450px;
  background: #fff;
  border: 4px solid var(--border);
  border-radius: 20px;
  box-shadow: 10px 10px 0 var(--border);
  overflow-y: auto;
  z-index: 1001;
  display: none;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.search-dropdown::-webkit-scrollbar { width: 8px; }
.search-dropdown::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

.search-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  text-decoration: none;
  color: var(--text);
  border-radius: 12px;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.search-item:hover {
  background: var(--bg);
  border-color: var(--border);
  transform: translateX(5px);
}

.search-item img {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border: 2px solid var(--border);
  object-fit: cover;
}

.search-item span {
  font-weight: 800;
  font-size: 14px;
}

/* ── Player Section ── */
.player-section {
  background: #fff;
  padding: 12px;
  border: 4px solid var(--border);
  border-radius: 24px;
  box-shadow: 10px 10px 0 var(--border);
  margin-bottom: 30px;
}

.player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 16px;
}

.play-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
}

.placeholder-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(25px) brightness(0.6);
  transform: scale(1.1);
}

.placeholder-img {
  position: relative;
  z-index: 1;
  width: auto;
  height: 85%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  border: 4px solid rgba(255, 255, 255, 0.2);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: var(--secondary);
  color: var(--border);
  border: 4px solid var(--border);
  padding: 15px 40px;
  font-family: 'Paytone One', sans-serif;
  font-size: 32px;
  cursor: pointer;
  border-radius: 50px;
  box-shadow: 0 8px 0 var(--border);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-button:hover { transform: translate(-50%, -55%) scale(1.05); box-shadow: 0 12px 0 var(--border); }
.play-button:active { transform: translate(-50%, -45%) scale(0.95); box-shadow: 0 4px 0 var(--border); }

.game-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5px 5px;
}

.game-title {
  font-family: 'Paytone One', sans-serif;
  font-size: 28px;
  color: var(--primary-dark);
}

.actions { display: flex; gap: 12px; }

.btn {
  padding: 8px 18px;
  font-weight: 800;
  border: 3px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
  box-shadow: 4px 4px 0 var(--border);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--border); }
.btn-green { background: #2d6a4f; color: #fff; }
.btn-fav { background: var(--accent); color: #fff; }
.btn-share { background: #3b82f6; color: #fff; }

/* ── Content Area ── */
.content-area {
  margin-top: 20px;
  background: #fff;
  padding: 30px;
  border: 4px solid var(--border);
  border-radius: 24px;
  box-shadow: 10px 10px 0 var(--border);
  width: 100%;
}

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

.game-card {
  background: #fff;
  border: 3px solid var(--border);
  border-radius: 20px;
  padding: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 5px 5px 0 var(--border);
  display: flex;
  flex-direction: column;
}

.game-card:hover { transform: translateY(-6px) rotate(1deg); box-shadow: 8px 8px 0 var(--border); }

.game-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
}

.game-card span { font-size: 15px; font-weight: 800; text-align: center; }

.content-area > h2 {
  font-family: 'Paytone One', sans-serif;
  font-size: 24px;
  color: var(--primary-dark);
  margin-bottom: 20px;
}

/* ── SEO Article Styles ── */
.seo-article { line-height: 1.8; }

.seo-article h2 {
  font-family: 'Paytone One', sans-serif;
  font-size: 26px;
  color: var(--primary-dark);
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 4px solid var(--secondary);
  position: relative;
}
.seo-article h2:first-child { margin-top: 0; }

.seo-article h3 {
  font-family: 'Paytone One', sans-serif;
  font-size: 20px;
  color: var(--primary);
  margin: 28px 0 12px;
  padding-left: 16px;
  border-left: 5px solid var(--secondary);
}

.seo-article p {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 16px;
}

.seo-article a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--secondary);
  text-underline-offset: 3px;
  transition: 0.2s;
}
.seo-article a:hover { color: var(--primary-dark); text-decoration-color: var(--accent); }

.seo-article ul, .seo-article ol {
  padding-left: 0;
  list-style: none;
  margin-bottom: 20px;
}

.seo-article ul li, .seo-article ol li {
  position: relative;
  padding: 10px 16px 10px 40px;
  margin-bottom: 8px;
  background: var(--bg);
  border: 2px solid rgba(19, 42, 19, 0.15);
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  transition: 0.2s;
}

.seo-article ul li:hover { border-color: var(--secondary); transform: translateX(4px); }

.seo-article ul li::before {
  content: '🍌';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}

/* Alternate list emojis */
.seo-article ul li:nth-child(2n)::before { content: '🐵'; }
.seo-article ul li:nth-child(3n)::before { content: '🛒'; }

/* ── Article Tables ── */
.article-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 16px;
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-weight: 600;
}

.article-table thead {
  background: var(--primary-dark);
  color: var(--secondary);
}

.article-table th {
  padding: 14px 18px;
  text-align: left;
  font-family: 'Paytone One', sans-serif;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.article-table td {
  padding: 12px 18px;
  border-top: 2px solid rgba(19, 42, 19, 0.1);
  color: var(--text);
}

.article-table tbody tr { background: #fff; transition: 0.2s; }
.article-table tbody tr:nth-child(even) { background: var(--bg); }
.article-table tbody tr:hover { background: #e8f5e0; }

/* ── FAQ Section ── */
.faq-section { margin-top: 10px; }

.faq-item {
  margin-bottom: 12px;
  border: 3px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--border);
  transition: 0.3s;
}

.faq-item:hover { transform: translateY(-2px); box-shadow: 6px 6px 0 var(--border); }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary-dark);
  color: #fff;
  font-family: 'Paytone One', sans-serif;
  font-size: 16px;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  transition: 0.2s;
}

.faq-q:hover { background: var(--primary); }

.faq-q .faq-icon {
  font-size: 22px;
  color: var(--secondary);
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .faq-q .faq-icon { transform: rotate(45deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  background: #fff;
}

.faq-item.open .faq-a { max-height: 200px; padding: 18px 20px; }

.faq-a p { margin: 0; font-size: 15px; color: var(--muted); font-weight: 500; }

/* ── Feature Cards ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.feature-card {
  background: var(--bg);
  border: 3px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 4px 4px 0 var(--border);
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover { transform: translateY(-4px) rotate(1deg); box-shadow: 6px 6px 0 var(--border); }

.feature-card .feat-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.feature-card .feat-text { font-weight: 700; font-size: 14px; color: var(--text); }

/* ── Mart Progress Cards ── */
.mart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.mart-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border: 3px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  box-shadow: 4px 4px 0 var(--border);
  color: #fff;
  transition: 0.3s;
}

.mart-card:hover { transform: scale(1.04); }
.mart-card .mart-num { font-family: 'Paytone One', sans-serif; font-size: 28px; color: var(--secondary); }
.mart-card .mart-name { font-weight: 700; font-size: 14px; margin-top: 4px; opacity: 0.9; }

/* ── Upgrade Badges ── */
.upgrade-list {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}

.upgrade-badge {
  background: var(--secondary);
  color: var(--border);
  border: 3px solid var(--border);
  border-radius: 50px;
  padding: 10px 22px;
  font-family: 'Paytone One', sans-serif;
  font-size: 14px;
  box-shadow: 3px 3px 0 var(--border);
  transition: 0.2s;
}

.upgrade-badge:hover { transform: translateY(-3px); box-shadow: 5px 5px 0 var(--border); }
.upgrade-badge .badge-icon { margin-right: 6px; }

@media (max-width: 768px) {
  .seo-article h2 { font-size: 22px; }
  .seo-article h3 { font-size: 18px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .mart-grid { grid-template-columns: repeat(2, 1fr); }
  .upgrade-list { justify-content: center; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .mart-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 700;
}

.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
  transition: 0.2s;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs span.sep {
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs span.current {
  color: var(--muted);
}

/* ── Footer Fixed ── */
footer {
  text-align: center;
  padding: 40px 20px;
  width: 100%;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: 85px;
  right: 25px;
  width: 50px;
  height: 50px;
  background: var(--secondary);
  border: 3px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 4px 4px 0 var(--border);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.back-to-top.show { opacity: 1; visibility: visible; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 25px; left: 25px; z-index: 2001; }
.toast {
  background: var(--primary-dark);
  color: #fff;
  padding: 12px 25px;
  border-radius: 12px;
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
  font-weight: 700;
  margin-top: 10px;
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Mobile ── */
@media (max-width: 1024px) { .games-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) {
  .wrap { padding: 74px 15px 40px; }
  .header-games, .nav-links { display: none; }
  
  header.top { padding: 0 15px; height: 56px; }
  .logo { font-size: 20px; gap: 8px; }
  .logo img { width: 30px; height: 30px; }

  .search-box {
    display: none;
    position: absolute;
    top: 64px;
    left: 15px;
    right: 15px;
    width: auto;
    z-index: 1002;
    background: #fff;
  }
  .search-box.show-mobile { display: flex; animation: slideDown 0.3s ease-out; }
  .search-dropdown { width: 100%; right: 0; left: 0; top: calc(100% + 8px); box-shadow: 8px 8px 0 var(--border); }
  
  .player-section { padding: 8px; border-radius: 20px; box-shadow: 6px 6px 0 var(--border); }
  .player-container { aspect-ratio: 4 / 5; max-height: 80vh; }
  .game-info-bar { flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px 5px 5px; }
  .game-title { font-size: 22px; width: 100%; line-height: 1.2; }
  .actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions .btn-share { grid-column: span 2; justify-content: center; }
  .btn { padding: 10px; font-size: 13px; justify-content: center; width: 100%; }

  .play-button { padding: 12px 30px; font-size: 24px; border-width: 3px; }
  
  .content-area { padding: 20px 15px; border-radius: 20px; box-shadow: 6px 6px 0 var(--border); }
  .content-area > h2 { font-size: 20px; margin-bottom: 15px; }

  .bottom-nav { display: flex; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  footer { padding-bottom: 90px; }
}

@media (max-width: 480px) {
  .logo { font-size: 18px; }
  .game-title { font-size: 20px; }
  .play-button { font-size: 20px; padding: 10px 25px; }
  .games-grid { gap: 10px; }
  .game-card { border-radius: 16px; padding: 8px; }
  .game-card span { font-size: 13px; }
  .back-to-top { bottom: 75px; right: 15px; width: 44px; height: 44px; }
}

@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: #fff;
  border-top: 4px solid var(--border);
  z-index: 1001;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--primary-dark); font-size: 11px; font-weight: 800; }
.nav-item svg { width: 22px; height: 22px; margin-bottom: 3px; }

/* ── Favorites Page Specifics ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.empty-state img { width: 100px; height: auto; border-radius: 15px; border: 3px solid var(--border); box-shadow: 6px 6px 0 var(--border); }
.empty-state h3 { font-family: 'Paytone One', sans-serif; font-size: 22px; color: var(--primary-dark); }
.empty-state p { color: var(--muted); font-weight: 600; max-width: 320px; margin: 0 auto; }
.btn-browse {
  display: inline-block;
  padding: 10px 25px;
  background: var(--secondary);
  color: var(--border);
  text-decoration: none;
  border-radius: 50px;
  font-family: 'Paytone One', sans-serif;
  box-shadow: 0 5px 0 var(--border);
  border: 3px solid var(--border);
  transition: 0.2s;
  margin-top: 10px;
}
.btn-browse:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--border); background: #fff; }
