:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #070b16;
  color: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 40%),
    linear-gradient(180deg, #020617 0%, #07101f 100%);
}

.site-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 10px;
}

.detail-header {
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: rgba(59, 130, 246, 0.18);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.2vw, 2.8rem);
}

.brand p {
  margin: 6px 0 0;
  color: #cbd5e1;
  max-width: 760px;
}

.detail-nav {
  margin: 12px 0 0;
}

.detail-nav a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 700;
}

.detail-nav a:hover {
  text-decoration: underline;
}

.search-shell {
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 0 20px 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

#searchInput {
  flex: 1 1 320px;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-size: 1rem;
}

#searchInput:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.8);
}

#resultCount {
  color: #94a3b8;
  font-size: 0.95rem;
}

.game-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.game-card,
.detail-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

.game-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(30, 41, 59, 0.98);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(59, 130, 246, 0.18);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card h2,
.detail-card h2 {
  margin: 0;
  font-size: 1.3rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.card-copy {
  color: #cbd5e1;
  line-height: 1.65;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.card-actions a,
.card-actions button {
  flex: 1 1 120px;
  padding: 12px 14px;
  border: none;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.card-actions a.play,
.card-actions button.play {
  background: #2563eb;
  color: white;
}

.card-actions a.details,
.card-actions button.details {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.card-actions a:hover,
.card-actions button:hover {
  transform: translateY(-1px);
}

.detail-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.detail-view {
  display: grid;
  gap: 20px;
}

.detail-top {
  display: grid;
  gap: 20px;
  align-items: start;
  grid-template-columns: minmax(0, 320px) 1fr;
}

.detail-top img,
.detail-top .icon-fallback {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  border-radius: 24px;
  background: rgba(59, 130, 246, 0.12);
}

.detail-top .icon-fallback {
  display: grid;
  place-items: center;
  font-size: 3rem;
}

.detail-copy {
  display: grid;
  gap: 16px;
}

.detail-copy p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.75;
}

.detail-copy strong {
  color: #f8fafc;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-actions a,
.detail-actions button {
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

.detail-actions a.play {
  background: #22c55e;
  color: #0f172a;
}

.detail-actions a.home {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.embed-shell {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 24px;
  overflow: hidden;
  min-height: 420px;
}

.embed-shell iframe {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: none;
}

/* Ad container styles */
.ad-container {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(148, 163, 184, 0.15);
  border-radius: 24px;
  padding: 20px;
  margin: 4px 0;
}

/* Header ad slot — banner style */
.header-ad {
  max-width: 1200px;
  margin: 12px auto 0;
  min-height: 90px;
  grid-column: auto;
}

.ad-placeholder {
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.5;
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto 28px;
  padding: 0 20px;
  color: #94a3b8;
  text-align: center;
}

@media (max-width: 760px) {
  .detail-top {
    grid-template-columns: 1fr;
  }
}
