* {
  box-sizing: border-box;
}

:root {
  --primary: #1e88e5;
  --accent: #ff6d00;
  --bg: #f7fbff;
  --card: #ffffff;
  --text: #16324f;
  --muted: #63809b;
  --shadow: 0 10px 24px rgba(30, 136, 229, 0.14);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 12% 10%, #e8f4ff 0, #f7fbff 38%),
    linear-gradient(180deg, #fafdff 0%, #f4f9ff 100%);
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(30, 136, 229, 0.12);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 6px 18px rgba(30, 136, 229, 0.12);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 170px;
  font-weight: 700;
  color: var(--primary);
}

.logo-link svg {
  width: 34px;
  height: 34px;
}

.nav-search {
  flex: 1;
  max-width: 420px;
}

.nav-search input {
  width: 100%;
  border: 1px solid rgba(30, 136, 229, 0.24);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  background: #fff;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--primary);
  background: rgba(30, 136, 229, 0.1);
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(30, 136, 229, 0.2);
}

.nav-back {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 109, 0, 0.12);
  color: #9a4e10;
  font-weight: 600;
}

body[data-page="play"] .site-header {
  position: fixed;
  inset: 14px auto auto 14px;
  width: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body[data-page="play"] .nav-inner {
  padding: 0;
}

body[data-page="play"] .nav-back {
  display: none;
}

body[data-page="play"] .logo-link {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 8px 22px rgba(30, 136, 229, 0.18);
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 16px 140px;
}

body[data-page="play"] main {
  max-width: none;
  margin: 0;
  padding: 72px 12px 92px;
  min-height: 100vh;
}

.page-hero {
  margin-bottom: 18px;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
}

.page-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.game-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(30, 136, 229, 0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: block;
  transform: translateY(0) scale(1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 30px rgba(30, 136, 229, 0.2);
}

.game-thumb {
  aspect-ratio: 1.3 / 1;
  background: linear-gradient(140deg, #e5f2ff, #fff4e8);
  display: grid;
  place-items: center;
}

.game-thumb svg {
  width: 86%;
  height: 86%;
}

.game-meta {
  padding: 10px 12px 12px;
}

.game-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.game-category {
  display: inline-block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  background: #edf5ff;
  border-radius: 999px;
  padding: 4px 10px;
}

.badge-coming {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 999px;
  color: #a45215;
  background: rgba(255, 109, 0, 0.16);
}

.filter-bar {
  margin: 8px 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  border: 1px solid rgba(30, 136, 229, 0.26);
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
}

.ad-slot {
  margin: 20px 0;
  background: #fff;
  border: 1px dashed rgba(30, 136, 229, 0.36);
  border-radius: var(--radius-lg);
  min-height: 90px;
  padding: 12px;
}

.ad-slot .ad-enabled,
.ad-slot .ad-consent-note {
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}

.ad-slot .ad-enabled {
  color: #0d5aa1;
  font-weight: 600;
}

.anchor-ad {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 0;
  z-index: 32;
  background: #ffffff;
  border: 1px dashed rgba(255, 109, 0, 0.5);
  border-radius: 12px 12px 0 0;
  min-height: 58px;
  padding: 10px 12px;
}

.anchor-ad .ad-enabled,
.anchor-ad .ad-consent-note {
  margin-top: 4px;
}

body[data-page="play"] .site-footer {
  display: none;
}

body[data-page="play"] .anchor-ad {
  left: 12px;
  right: 12px;
  bottom: 12px;
}

.cookie-consent-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  bottom: 72px;
  z-index: 38;
  width: min(1120px, calc(100vw - 20px));
  background: rgba(22, 50, 79, 0.96);
  color: #fff;
  padding: 14px 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.cookie-consent-copy {
  display: grid;
  gap: 4px;
}

.cookie-consent-copy strong {
  font-size: 14px;
}

.cookie-consent-copy span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.cookie-consent-copy a {
  color: #ffcf99;
  text-decoration: underline;
}

.cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-consent-accept {
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}

.site-footer {
  margin-top: 18px;
  padding: 24px 16px 100px;
  border-top: 1px solid rgba(30, 136, 229, 0.12);
  background: #ffffffd8;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.language-select {
  border-radius: 999px;
  border: 1px solid rgba(30, 136, 229, 0.2);
  padding: 7px 10px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.detail-cover {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(30, 136, 229, 0.16);
  padding: 20px;
  box-shadow: var(--shadow);
}

.detail-cover svg {
  width: 100%;
  height: auto;
}

.detail-info {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(30, 136, 229, 0.16);
  padding: 20px;
  box-shadow: var(--shadow);
}

.rating-stars {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
}

.rating-stars svg {
  width: 18px;
  height: 18px;
}

.play-btn {
  display: inline-block;
  margin-top: 14px;
  background: linear-gradient(135deg, #ff9b38, #ff6d00);
  color: #fff;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(255, 109, 0, 0.28);
}

.play-btn:hover,
.play-btn:focus-visible {
  transform: translateY(-2px);
}

.play-wrapper {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(30, 136, 229, 0.2);
  box-shadow: var(--shadow);
  padding: 14px;
}

body[data-page="play"] #play-root,
body[data-page="play"] .play-wrapper {
  height: calc(100vh - 168px);
}

body[data-page="play"] .play-wrapper {
  display: flex;
  flex-direction: column;
}

body[data-page="play"] .game-frame {
  flex: 1;
  min-height: 0;
}

body[data-page="play"] .ad-slot#play-banner-ad {
  margin-top: 0;
}

body[data-page="play"] #play-root .empty-state {
  height: calc(100vh - 188px);
  display: grid;
  place-items: center;
}

.game-frame {
  width: 100%;
  min-height: 68vh;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ecf5ff, #ffffff);
}

.empty-state {
  text-align: center;
  background: #fff;
  border: 1px dashed rgba(255, 109, 0, 0.45);
  border-radius: 18px;
  padding: 30px 14px;
}

@media (min-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

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

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

  .nav-inner {
    gap: 8px;
  }

  .cookie-consent-bar {
    left: 10px;
    transform: none;
    width: calc(100vw - 20px);
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-consent-actions {
    width: 100%;
  }

  body[data-page="play"] main {
    padding-top: 82px;
    padding-bottom: 106px;
  }

  body[data-page="play"] .site-header {
    inset: 10px auto auto 10px;
  }

  body[data-page="play"] #play-root,
  body[data-page="play"] .play-wrapper,
  body[data-page="play"] #play-root .empty-state {
    height: calc(100vh - 204px);
  }
}
