/* ============================================
   SmartSpot Pro — Mobile-First Game Site
   Dark gaming aesthetic, touch-optimized
   ============================================ */

:root {
  --bg:        #0d0d1a;
  --bg2:       #12122a;
  --card:      #1a1a35;
  --card2:     #20204a;
  --border:    rgba(255,255,255,0.08);
  --accent:    #6c63ff;
  --accent2:   #ff6584;
  --accent3:   #00d4aa;
  --text:      #e8e8f0;
  --muted:     #8888aa;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --nav-h:     56px;
  --bot-h:     64px;
  --safe-bot:  env(safe-area-inset-bottom, 0px);
}

/* ── Reset ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  padding-bottom: calc(var(--bot-h) + var(--safe-bot));
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }
img { display: block; max-width: 100%; }

/* ── Top Header ───────────────────────────── */
.site-header {
  background: rgba(13,13,26,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 200;
}
.site-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.02em;
}
.site-logo .logo-sub { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

.site-nav { display: none; gap: 1.5rem; align-items: center; }
@media (min-width: 768px) {
  .site-nav { display: flex; }
  .site-nav a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
  .site-nav a:hover, .site-nav a.active { color: var(--accent); }
}

.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--card);
  border-radius: 8px;
  padding: 3px;
}
.lang-switcher a {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
}
.lang-switcher a.active,
.lang-switcher a:hover { background: var(--accent); color: #fff; }

/* ── Bottom Navigation (mobile only) ────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(18,18,42,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  height: calc(var(--bot-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
}
.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  height: var(--bot-h);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.15s;
  padding: 0 4px;
}
.bottom-nav a .icon { font-size: 1.4rem; line-height: 1; }
.bottom-nav a.active { color: var(--accent); }
@media (max-width: 767px) { .bottom-nav { display: block; } }

/* ── Page Wrapper ─────────────────────────── */
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem; }
@media (min-width: 768px) { .wrap { padding: 2rem 1.5rem; } }

/* ── Premium Hero ─────────────────────────── */
.premium-hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(26,26,53,0.8) 0%, rgba(13,13,26,0.95) 100%);
  border: 1px solid rgba(108,99,255,0.2);
}
@media (min-width: 900px) {
  .premium-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .hero-content {
    flex: 1;
    max-width: 50%;
  }
  .hero-visual {
    flex: 1;
    display: flex;
    justify-content: flex-end;
  }
}
.hero-badge {
  display: inline-block;
  background: rgba(0, 212, 170, 0.2);
  color: var(--accent3);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 212, 170, 0.4);
}
.site-hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.3rem;
  color: var(--accent3);
  letter-spacing: 0.02em;
}
.site-hero-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.hero-game-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.premium-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.premium-hero p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}
.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-img-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  z-index: 1;
}
.hero-img-wrapper img {
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  border: 2px solid rgba(108,99,255,0.3);
  transition: transform 0.3s;
}
.hero-img-wrapper:hover img {
  transform: scale(1.02);
}
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(108,99,255,0.4) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: -1;
  filter: blur(40px);
  pointer-events: none;
}

/* ── Glassmorphism ────────────────────────── */
.glass-panel {
  background: rgba(26, 26, 53, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: rotate(45deg);
  animation: glowSweep 3s infinite;
}
@keyframes glowSweep {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  min-height: 44px;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #7b72ff; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,99,255,0.4); }
.btn-primary:active { transform: scale(0.97); }
.btn-outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-play {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(108,99,255,0.45);
  width: 100%;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(108,99,255,0.55); color: #fff; }
.btn-play:active { transform: scale(0.98); }

/* ── Section Label ────────────────────────── */
.section-label { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.section-label h2 { font-size: 1.05rem; font-weight: 800; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.05em; }
.section-label .line { flex: 1; height: 1px; background: var(--border); }

/* Portal discovery controls */
.portal-tools {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.35rem;
}
.portal-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(26, 26, 53, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
}
.portal-search span { color: var(--accent3); font-size: 1rem; }
.portal-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}
.portal-search input::placeholder { color: var(--muted); }
.category-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}
.category-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(32, 32, 74, 0.72);
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.category-chip:hover,
.category-chip.active {
  background: rgba(108, 99, 255, 0.22);
  border-color: rgba(108, 99, 255, 0.55);
  color: #fff;
}
.portal-rail {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.75rem;
}
@media (min-width: 900px) {
  .portal-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.portal-panel {
  background: rgba(26, 26, 53, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}
.portal-panel-title {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.portal-mini-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.portal-mini-card {
  align-items: center;
  background: rgba(32, 32, 74, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.55rem;
  text-align: left;
  transition: transform 0.16s, border-color 0.16s;
}
.portal-mini-card:hover {
  border-color: rgba(0, 212, 170, 0.38);
  transform: translateY(-1px);
}
.portal-mini-thumb {
  background: var(--card);
  border-radius: 7px;
  flex: 0 0 44px;
  height: 44px;
  overflow: hidden;
}
.portal-mini-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.portal-mini-copy {
  display: grid;
  min-width: 0;
}
.portal-mini-copy strong,
.portal-mini-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-mini-copy strong { font-size: 0.78rem; }
.portal-mini-copy small { color: var(--muted); font-size: 0.7rem; }
.portal-muted {
  color: var(--muted);
  font-size: 0.82rem;
}
.portal-empty {
  color: var(--muted);
  margin: 0 0 1rem;
  padding: 0.9rem;
  text-align: center;
}

/* ── Game Grid ────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 2rem;
}
@media (min-width: 600px) { .game-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 900px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── Game Card ────────────────────────────── */
.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.game-card:active { transform: scale(0.97); }
@media (hover: hover) {
  .game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(108,99,255,0.25);
    border-color: rgba(108,99,255,0.4);
  }
}
.game-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
  position: relative;
}
.game-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.55));
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-card:hover .thumb-overlay,
.game-card:active .thumb-overlay { opacity: 1; }
.thumb-play-icon {
  width: 42px; height: 42px;
  background: rgba(108,99,255,0.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.game-card-body {
  padding: 0.65rem 0.85rem 0.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.game-card-body h3 { font-size: 0.88rem; font-weight: 700; line-height: 1.3; }
.game-card-body .desc {
  font-size: 0.73rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem;
  border-top: 1px solid var(--border);
}
.genre-badge {
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(108,99,255,0.18);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.play-label { font-size: 0.73rem; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 3px; }

/* ── Ad Slot ──────────────────────────────── */
.ad-slot {
  background: var(--card);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 1rem 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot-tall { min-height: 250px; }

/* ── Game Detail ──────────────────────────── */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent); }

.game-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.game-title-row h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; line-height: 1.2; }
.game-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }

.badge { font-size: 0.7rem; padding: 3px 9px; border-radius: 20px; font-weight: 700; letter-spacing: 0.03em; }
.badge-lang { background: rgba(108,99,255,0.2); color: var(--accent); }
.badge-genre { background: rgba(255,101,132,0.2); color: var(--accent2); }
.badge-new { background: rgba(0,212,170,0.2); color: var(--accent3); }

.lang-pills { display: flex; gap: 0.35rem; }
.pill {
  font-size: 0.78rem;
  padding: 5px 13px;
  border-radius: 20px;
  background: var(--card2);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all 0.2s;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.pill:hover, .pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Mobile play CTA (shown on very small screens) */
.mobile-fullscreen-cta {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  margin-bottom: 0.75rem;
}
.mobile-fullscreen-cta p { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 420px) { .mobile-fullscreen-cta { display: flex; } }

/* Game Frame */
.game-frame-wrap {
  width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
}
.game-frame-wrap iframe {
  width: 100%;
  border: none;
  display: block;
  height: 75svh;
  min-height: 380px;
  max-height: 100svh;
}
/* 모바일 세로 (portrait) */
@media (max-width: 420px) {
  .game-frame-wrap iframe { height: 80svh; min-height: 380px; }
}
/* 모바일 가로 (landscape) */
@media (max-height: 500px) and (orientation: landscape) {
  .game-frame-wrap iframe { height: 92svh; min-height: 260px; }
}
/* 태블릿 */
@media (min-width: 421px) and (max-width: 767px) {
  .game-frame-wrap iframe { height: 82svh; min-height: 460px; }
}
/* 태블릿 가로 */
@media (min-width: 421px) and (max-width: 767px) and (orientation: landscape) {
  .game-frame-wrap iframe { height: 88svh; min-height: 340px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .game-frame-wrap iframe { height: 80svh; min-height: 540px; }
}
@media (min-width: 1024px) {
  .game-frame-wrap iframe { height: min(860px, 84vh); min-height: 600px; }
}
/* 게임 페이지: 광고 사이드가 없을 때 iframe을 더 크게 */
.game-page-layout .game-frame-wrap iframe {
  height: 78svh;
  min-height: 420px;
}
@media (max-height: 500px) and (orientation: landscape) {
  .game-page-layout .game-frame-wrap iframe { height: 90svh; min-height: 240px; }
}
@media (min-width: 1024px) {
  .game-page-layout .game-frame-wrap iframe { height: min(860px, 84vh); min-height: 600px; }
}

.frame-fullscreen-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
  z-index: 10;
}
.frame-fullscreen-btn:hover { background: rgba(108,99,255,0.7); }

/* ── Play-Now CTA (description pages that link to /play/) ── */
.play-now-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1rem;
  text-align: center;
}
.play-now-btn {
  display: inline-block;
  padding: 0.9rem 2.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
  text-decoration: none;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 18px rgba(108,99,255,0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}
.play-now-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 24px rgba(108,99,255,0.5);
}
.play-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Info Panels ──────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 0.85rem 0;
}
.panel-title {
  font-weight: 800;
  font-size: 0.76rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.list { padding-left: 1.1rem; }
.list li { margin-bottom: 0.4rem; font-size: 0.875rem; color: var(--muted); }
.list li strong { color: var(--text); }

/* ── Filter Bar ───────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 34px;
}
.filter-btn.active,
.filter-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Related Grid ─────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 600px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Footer ───────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3rem;
}
.footer-links { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ══════════════════════════════════════════
   DEVICE EMULATOR FRAME
   ══════════════════════════════════════════ */

/* Game page 3-column layout */
.game-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0.5rem;
}
@media (min-width: 1100px) {
  .game-page-layout {
    grid-template-columns: 180px 1fr 180px;
    align-items: start;
    gap: 1.25rem;
  }
}
@media (min-width: 1300px) {
  .game-page-layout {
    grid-template-columns: 220px 1fr 220px;
  }
}

/* Side ad columns */
.ad-side {
  display: none;
}
@media (min-width: 1100px) {
  .ad-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
  }
}
.ad-side .ad-slot {
  width: 100%;
  min-height: 250px;
  margin: 0;
}
.ad-side .ad-slot-sky {
  min-height: 600px;
}

/* ── Tablet Emulator (landscape) ─────────── */
.device-tablet {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 880px;

  /* Device shell */
  background: linear-gradient(145deg, #1e1e2e 0%, #252540 50%, #1a1a30 100%);
  border-radius: 28px;
  padding: 18px 22px 22px;
  box-shadow:
    0 0 0 2px rgba(108,99,255,0.3),
    0 0 0 4px #0d0d1a,
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.device-tablet::before {
  /* Top bar with camera */
  content: '';
  display: block;
  width: 60px;
  height: 8px;
  background: #0d0d1a;
  border-radius: 4px;
  margin: 0 auto 14px;
  box-shadow: 0 0 0 1px rgba(108,99,255,0.2);
}
.device-tablet::after {
  /* Home bar at bottom */
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  margin: 14px auto 0;
}
.device-tablet .device-screen {
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.device-tablet .device-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Side buttons on tablet */
.device-tablet .device-btn-vol {
  position: absolute;
  left: -6px;
  top: 80px;
  width: 5px;
  height: 28px;
  background: linear-gradient(to right, #111, #222);
  border-radius: 3px 0 0 3px;
  box-shadow: 0 14px 0 #1a1a2e, 0 28px 0 #1a1a2e;
}
.device-tablet .device-btn-pwr {
  position: absolute;
  right: -6px;
  top: 80px;
  width: 5px;
  height: 36px;
  background: linear-gradient(to left, #111, #222);
  border-radius: 0 3px 3px 0;
}

/* ── Phone Emulator (portrait) ───────────── */
.device-phone {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 400px;

  background: linear-gradient(145deg, #1e1e2e 0%, #252540 50%, #1a1a30 100%);
  border-radius: 44px;
  padding: 16px 14px 24px;
  box-shadow:
    0 0 0 2px rgba(108,99,255,0.3),
    0 0 0 4px #0d0d1a,
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.device-phone::before {
  /* Dynamic island / notch */
  content: '';
  display: block;
  width: 80px;
  height: 22px;
  background: #0d0d1a;
  border-radius: 0 0 14px 14px;
  margin: -16px auto 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.device-phone::after {
  /* Home bar */
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 12px auto 0;
}
.device-phone .device-screen {
  background: #000;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.device-phone .device-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
/* Phone side buttons */
.device-phone .device-btn-vol {
  position: absolute;
  left: -6px;
  top: 100px;
  width: 4px;
  height: 30px;
  background: linear-gradient(to right, #111, #1e1e2e);
  border-radius: 3px 0 0 3px;
  box-shadow: 0 40px 0 #1a1a2e;
}
.device-phone .device-btn-pwr {
  position: absolute;
  right: -6px;
  top: 120px;
  width: 4px;
  height: 50px;
  background: linear-gradient(to left, #111, #1e1e2e);
  border-radius: 0 3px 3px 0;
}

/* Device label strip */
.device-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.device-label-text {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.device-fullscreen-btn {
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.device-fullscreen-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Ad slot updates ──────────────────────── */
.ad-slot {
  background: var(--card);
  border: 1px dashed rgba(108,99,255,0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 90px;
  margin: 0.75rem 0;
  overflow: hidden;
}
.ad-slot-banner { min-height: 90px; }
.ad-slot-rect { min-height: 250px; width: 100%; }

/* Genre badges update */
.genre-badge.Arcade  { background: rgba(255,165,0,0.15);  color: #ffa500; }
.genre-badge.RPG     { background: rgba(147,51,234,0.15); color: #a855f7; }
.genre-badge.Casual  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.genre-badge.Puzzle  { background: rgba(59,130,246,0.15); color: #3b82f6; }

/* ── Game Player Modal ────────────────────── */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.game-modal.active {
  opacity: 1;
  pointer-events: all;
}
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}
.modal-content {
  position: relative;
  width: 95%;
  max-width: 1200px;
  height: 90%;
  max-height: 800px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.game-modal.active .modal-content {
  transform: scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(13, 13, 26, 0.95);
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: var(--accent2);
}
.modal-body {
  flex: 1;
  position: relative;
  background: #000;
}
.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.game-frame-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(108,99,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: -1;
}
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── SNS Share Buttons ── */
.share-section {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.2rem 0;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
}
.share-section .share-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  margin-right: 0.2rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}
.share-btn:hover { opacity: 0.82; }
.share-twitter { background: #000; color: #fff; }
.share-reddit  { background: #ff4500; color: #fff; }
.share-copy    { background: rgba(108,99,255,0.2); color: var(--accent); border: 1px solid rgba(108,99,255,0.4); cursor: pointer; font-family: inherit; }

/* Portal shell refresh */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 220;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 11, 24, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.portal-header__inner,
.portal-shell,
.portal-footer__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.portal-header__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text);
}

.portal-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.portal-brand__text {
  display: grid;
  gap: 0.1rem;
}

.portal-brand__text strong {
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.1;
}

.portal-brand__text small {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.1;
}

.portal-nav,
.portal-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.portal-nav a,
.portal-lang-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  transition: color 0.18s ease, background 0.18s ease;
}

.portal-nav a:hover,
.portal-nav a.is-active,
.portal-lang-link:hover,
.portal-lang-link.is-active {
  color: #fff;
  background: rgba(108, 99, 255, 0.18);
}

.portal-shell {
  display: grid;
  gap: 1.6rem;
  padding: 2rem 0 4rem;
}

.portal-hero,
.portal-page-hero {
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 960px) {
  .portal-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  }

  .portal-page-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

.portal-hero__copy,
.portal-page-hero,
.portal-featured-card,
.portal-section,
.portal-panel {
  background: linear-gradient(180deg, rgba(24, 28, 52, 0.86), rgba(14, 17, 33, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.portal-hero__copy,
.portal-page-hero,
.portal-featured-card,
.portal-panel,
.portal-section {
  padding: 1.35rem;
}

.portal-kicker,
.portal-section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent3);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-hero h1,
.portal-page-hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
  margin: 0.6rem 0 0.9rem;
  color: #fff;
}

.portal-hero p,
.portal-page-hero p,
.portal-section__summary,
.portal-card p {
  color: #bcc1d8;
}

.portal-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.1rem 0 1.35rem;
}

.portal-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.2rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
}

.portal-btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.portal-btn--secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.portal-btn--full {
  width: 100%;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.portal-stats--compact {
  width: min(420px, 100%);
}

.portal-stats div {
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}

.portal-stats dt {
  color: #fff;
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
  font-weight: 900;
  line-height: 1.1;
}

.portal-stats dd {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.portal-featured-card {
  display: grid;
  gap: 1rem;
}

.portal-featured-card__media {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.portal-featured-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-featured-card__body {
  display: grid;
  gap: 0.8rem;
}

.portal-featured-card__body h2 {
  color: #fff;
  font-size: 1.55rem;
  line-height: 1.15;
}

.portal-featured-card__meta,
.portal-card__top,
.portal-card__actions,
.portal-panel__header,
.portal-section__header,
.portal-footer__inner,
.portal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.portal-featured-card__meta,
.portal-card__top {
  flex-wrap: wrap;
}

.portal-controls {
  flex-direction: column;
  align-items: stretch;
}

.portal-controls--library {
  margin-top: -0.2rem;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.18);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

.portal-chip--accent {
  background: rgba(0, 212, 170, 0.18);
  color: var(--accent3);
}

.portal-panel__header h2,
.portal-section__header h2 {
  color: #fff;
  font-size: 1.2rem;
}

.portal-panel__header a,
.portal-section__header a,
.portal-footer nav a,
.portal-text-link {
  color: #c4c9df;
  font-weight: 700;
  font-size: 0.88rem;
}

.portal-text-link--accent {
  color: var(--accent3);
}

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

.portal-game-grid--library {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .portal-game-grid,
  .portal-game-grid--library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .portal-game-grid--library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.portal-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
}

.portal-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.portal-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.portal-card:hover .portal-card__media img {
  transform: scale(1.03);
}

.portal-card__body {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
}

.portal-card__body h3 {
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.24;
}

.portal-card__body p {
  font-size: 0.88rem;
  line-height: 1.58;
}

.portal-card__frame {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-mini-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .portal-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-copy-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 860px) {
  .portal-copy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.portal-copy-card {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.portal-copy-card h3 {
  color: #fff;
  margin-bottom: 0.55rem;
  font-size: 1rem;
}

.portal-copy-card p {
  color: #bcc1d8;
  font-size: 0.88rem;
}

.portal-empty-state {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #bcc1d8;
  font-size: 0.9rem;
}

.portal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.25rem 0 2.8rem;
}

.portal-footer__inner {
  flex-wrap: wrap;
}

.portal-footer strong {
  color: #fff;
}

.portal-footer p {
  color: var(--muted);
  margin-top: 0.25rem;
  font-size: 0.86rem;
}

@media (max-width: 860px) {
  .portal-header__inner {
    min-height: unset;
    padding: 0.9rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .portal-shell,
  .portal-header__inner,
  .portal-footer__inner {
    width: min(100% - 24px, 1180px);
  }

  .portal-hero__copy,
  .portal-page-hero,
  .portal-featured-card,
  .portal-panel,
  .portal-section {
    padding: 1rem;
    border-radius: 16px;
  }

  .portal-stats {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .portal-panel__header,
  .portal-section__header,
  .portal-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-card__actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
