:root {
  --primary: #2563eb;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --accent: #f59e0b;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --ad-bg: #111111;
  --header-height: 64px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  height: var(--header-height);
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.025em;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a:hover {
  color: var(--primary);
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 101;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block !important;
  }
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: var(--card-bg);
    padding: 80px 20px;
    transition: 0.3s;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
  }
  nav.active {
    right: 0;
  }
  nav ul {
    flex-direction: column;
    gap: 2rem;
  }
}

/* Footer */
footer {
  background-color: var(--card-bg);
  padding: 3rem 0;
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

footer h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

footer ul {
  list-style: none;
}

footer ul li {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--text-muted);
}

footer a:hover {
  color: var(--text);
}

.copyright {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Ad Slots */
.ad-slot {
  background: var(--ad-bg);
  border-radius: 8px;
  margin: 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-header { width: 728px; height: 90px; }
.ad-in-content { width: 336px; height: 280px; }
.ad-game { width: 300px; height: 250px; }
.ad-footer { width: 728px; height: 90px; }

@media (max-width: 768px) {
  .ad-header, .ad-footer { width: 320px; height: 50px; }
  .ad-in-content { width: 300px; height: 250px; }
}

/* Game Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.game-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.game-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-card img, .game-card svg {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
}

.game-card-info {
  padding: 0.5rem;
  background: var(--card-bg);
  flex-grow: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.game-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.game-card-category {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: capitalize;
  display: block;
}

/* Game Page Layout */
.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.game-canvas-wrapper {
  position: relative;
  background: #000;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
  max-width: 100%;
  width: fit-content;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

canvas {
  max-width: 100%;
  height: auto !important;
  display: block;
}

.game-info-section {
  max-width: 800px;
  margin: 2rem auto;
}

.game-info-section h1 { margin: 1.5rem 0 1rem; }
.game-info-section h2 { margin: 1.5rem 0 0.5rem; font-size: 1.5rem; }
.game-info-section p { margin-bottom: 1rem; color: var(--text-muted); }

/* Layout for Directory */
.directory-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.filter-group h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-item {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-muted);
}

.filter-item:hover, .filter-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.filter-item.active {
  background: var(--primary);
  color: white;
}

.search-box {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.search-box:focus {
  border-color: var(--primary);
}

/* Share Tools */
.title-share-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.title-share-wrapper h1 {
  margin: 0 !important;
}

.share-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: var(--card-bg);
  color: var(--text);
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.share-copy { font-size: 1rem; padding: 0.3rem 0.6rem; }
.share-line { background: #00b900; color: white; border: none; }
.share-fb { background: #1877f2; color: white; border: none; }
.share-wa { background: #25d366; color: white; border: none; }
.share-tg { background: #0088cc; color: white; border: none; }

@media (max-width: 600px) {
  .title-share-wrapper {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Utilities */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: white;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}
