﻿/* ===================================================================
   Clflare Design System
   Bright gaming theme - sky blue, coral & mint palette
   =================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F4F8FB;
  color: #1E2A3A;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F4F8FB;
  --bg2: #E8F0F8;
  --bg3: #D4E4F2;
  --card: #FFFFFF;
  --card-hover: #F8FBFF;
  --fg: #1E2A3A;
  --fg2: #4A5E75;
  --fg3: #8A9BB5;
  --primary: #0EA5E9;
  --primary-l: #38BDF8;
  --primary-d: #0284C7;
  --accent: #F97316;
  --accent-l: #FB923C;
  --violet: #8B5CF6;
  --violet-l: #A78BFA;
  --warm: #FBBF24;
  --pink: #EC4899;
  --red: #EF4444;
  --green: #22C55E;
  --blue: #3B82F6;
  --orange: #F97316;
  --teal: #14B8A6;
  --grad1: linear-gradient(135deg, #0EA5E9, #3B82F6);
  --grad2: linear-gradient(135deg, #F97316, #FBBF24);
  --grad3: linear-gradient(135deg, #22C55E, #14B8A6);
  --grad4: linear-gradient(135deg, #8B5CF6, #EC4899);
  --grad5: linear-gradient(135deg, #FBBF24, #F97316);
  --grad6: linear-gradient(135deg, #14B8A6, #0EA5E9);
  --r1: 10px;
  --r2: 16px;
  --r3: 22px;
  --r4: 30px;
  --sh1: 0 2px 8px rgba(14, 165, 233, 0.06);
  --sh2: 0 4px 20px rgba(14, 165, 233, 0.08);
  --sh3: 0 8px 36px rgba(14, 165, 233, 0.12);
  --sh4: 0 12px 48px rgba(14, 165, 233, 0.18);
  --border: #E2E8F0;
  --border-l: #CBD5E1;
}

/* ---------- Layout ---------- */
.cf-container {
  position: relative;
  z-index: 1;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 720px) {
  .cf-container {
    padding: 0 16px;
  }
}

/* ---------- Header ---------- */
.cf-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.cf-header-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cf-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 20px;
}

.cf-logo img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
}

.cf-logo-text {
  background: var(--grad1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 22px;
  font-weight: 900;
}

.cf-header-search {
  display: none;
}

.cf-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.cf-nav a {
  padding: 8px 14px;
  border-radius: var(--r2);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg2);
  transition: all 0.2s;
  white-space: nowrap;
}

.cf-nav a:hover,
.cf-nav a.cf-nav-active {
  color: var(--primary);
  background: rgba(14, 165, 233, 0.08);
}

.cf-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  background: var(--bg2);
  margin-left: auto;
  flex-shrink: 0;
}

.cf-nav-toggle img {
  width: 20px;
  height: 20px;
}

.cf-mobile-nav {
  display: none;
  flex-direction: column;
  padding: 12px 16px;
  gap: 2px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh2);
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 99;
}

.cf-mobile-nav.cf-mobile-nav-open {
  display: flex;
}

.cf-mobile-nav a {
  padding: 12px 16px;
  border-radius: var(--r1);
  font-size: 15px;
  color: var(--fg);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.cf-mobile-nav a:last-child {
  border-bottom: none;
}

.cf-mobile-nav a:hover {
  background: var(--bg2);
  color: var(--primary);
}

@media (max-width: 1200px) {
  .cf-nav {
    display: none;
  }
  .cf-nav-toggle {
    display: flex;
  }
}

@media (max-width: 600px) {
  .cf-header-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .cf-logo {
    font-size: 17px;
  }
  .cf-logo img {
    width: 36px;
    height: 36px;
  }
  .cf-logo-text {
    font-size: 18px;
  }
}

/* ---------- Footer ---------- */
.cf-footer {
  position: relative;
  z-index: 1;
  margin-top: 80px;
  padding: 56px 24px 28px;
  background: #0F172A;
  border-top: 3px solid var(--primary);
}

.cf-footer-inner {
  max-width: 1340px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
}

.cf-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cf-footer-brand .cf-logo {
  font-size: 18px;
}

.cf-footer-brand .cf-logo-text {
  background: var(--grad1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.cf-footer-brand p {
  font-size: 14px;
  color: #94A3B8;
  max-width: 300px;
  line-height: 1.65;
}

.cf-footer-col h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-l);
  margin-bottom: 14px;
  font-weight: 700;
}

.cf-footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cf-footer-col a {
  font-size: 14px;
  color: #94A3B8;
  transition: color 0.2s;
}

.cf-footer-col a:hover {
  color: var(--primary-l);
}

.cf-footer-bottom {
  max-width: 1340px;
  margin: 36px auto 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #64748B;
}

@media (max-width: 860px) {
  .cf-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 540px) {
  .cf-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* ---------- Game Card ---------- */
.cf-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.cf-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad1);
  border-radius: var(--r2) 0 0 var(--r2);
  transition: width 0.3s;
  z-index: 2;
}

.cf-card:nth-child(6n+2)::before { background: var(--grad2); }
.cf-card:nth-child(6n+3)::before { background: var(--grad3); }
.cf-card:nth-child(6n+4)::before { background: var(--grad4); }
.cf-card:nth-child(6n+5)::before { background: var(--grad5); }
.cf-card:nth-child(6n+6)::before { background: var(--grad6); }

.cf-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: var(--sh3);
  border-color: var(--primary);
  z-index: 2;
}

.cf-card:hover::before {
  width: 6px;
}

.cf-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg2);
  margin-left: 4px;
  border-radius: 0;
}

.cf-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.cf-card:hover .cf-card-img img {
  transform: scale(1.05);
}

.cf-card-play-mini {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1;
}

.cf-card:hover .cf-card-play-mini {
  opacity: 1;
  transform: scale(1);
}

.cf-card-badge {
  position: absolute;
  top: 8px;
  left: 12px;
  background: rgba(249, 115, 22, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  z-index: 1;
}

.cf-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.cf-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}

.cf-card-rating-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #D97706;
  font-weight: 700;
}

.cf-card-rating-row .cf-card-star {
  font-size: 11px;
}

.cf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.cf-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--fg3);
}

.cf-card-type {
  color: var(--primary);
  font-weight: 600;
}

.cf-card-date {
  font-size: 11px;
  color: var(--fg3);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.cf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--r2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.cf-btn-primary {
  background: var(--grad1);
  color: #fff;
  box-shadow: var(--sh4);
}

.cf-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(14, 165, 233, 0.3);
}

.cf-btn-ghost {
  background: var(--bg2);
  color: var(--fg);
  border: 1px solid var(--border);
}

.cf-btn-ghost:hover {
  background: var(--bg3);
  border-color: var(--primary);
  color: var(--primary);
}

.cf-btn-pill {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 999px;
}

.cf-play-btn {
  background: var(--grad1);
  color: #fff;
  font-weight: 800;
  padding: 14px 32px;
  border-radius: var(--r2);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--sh4);
}

.cf-play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(14, 165, 233, 0.35);
}

.cf-play-icon {
  font-size: 14px;
}

/* ---------- Category Pills ---------- */
.cf-cat-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.cf-cat-pill {
  padding: 9px 18px;
  border-radius: var(--r2);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.22s;
  white-space: nowrap;
  cursor: pointer;
}

.cf-cat-pill:hover {
  color: var(--primary);
  border-color: rgba(14, 165, 233, 0.3);
  transform: translateY(-1px);
  box-shadow: var(--sh1);
}

.cf-cat-pill.cf-cat-pill-active {
  background: var(--grad1);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh4);
}

.cf-cat-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.cf-cat-pill-icon {
  font-size: 14px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Section Heading ---------- */
.cf-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 56px 0 22px;
  flex-wrap: wrap;
}

.cf-section-head h2 {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--fg);
}

.cf-section-head .cf-section-sub {
  color: var(--fg2);
  font-size: 14px;
  margin-top: 6px;
}

.cf-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.cf-section-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  padding: 8px 16px;
  border-radius: var(--r2);
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.cf-section-more:hover {
  background: rgba(14, 165, 233, 0.08);
  transform: translateX(3px);
}

/* ---------- Standard Grid ---------- */
.cf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .cf-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .cf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* ---------- Masonry ---------- */
.cf-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 18px;
}

.cf-masonry .cf-card {
  display: block;
}

@media (max-width: 1100px) {
  .cf-masonry {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .cf-masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .cf-masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ---------- More Section ---------- */
.cf-more-section {
  margin-top: 56px;
}

.cf-load-more-wrap {
  text-align: center;
  margin: 36px 0 0;
}

.cf-load-more {
  padding: 13px 34px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--fg);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.22s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cf-load-more:hover {
  background: var(--grad1);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh4);
}

.cf-load-more[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Scroll Actions ---------- */
.cf-scroll-actions {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.cf-scroll-actions button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s;
  box-shadow: var(--sh2);
}

.cf-scroll-actions button:hover {
  background: var(--primary-d);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--sh4);
}

.cf-scroll-actions button img {
  width: 20px;
  height: 20px;
}

/* ---------- Iframe Box ---------- */
.cf-iframe-box {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 10;
}

.cf-iframe-box iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
}

/* ---------- Detail Page ---------- */
.cf-detail-wrap {
  position: relative;
  z-index: 1;
  padding: 0 24px 36px;
  max-width: 1160px;
  margin: 0 auto;
}

.cf-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--fg2);
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 16px;
  padding: 8px 14px;
  border-radius: var(--r2);
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.cf-detail-back:hover {
  color: var(--primary);
  border-color: rgba(14, 165, 233, 0.3);
  transform: translateX(-3px);
}

/* Breadcrumb */
.cf-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg3);
  margin: 16px 0 12px;
  flex-wrap: wrap;
}

.cf-breadcrumb a {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.2s;
}

.cf-breadcrumb a:hover {
  color: var(--primary-d);
}

.cf-breadcrumb .cf-breadcrumb-sep {
  color: var(--fg3);
  font-size: 11px;
}

/* Detail Hero Banner */
.cf-detail-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 5;
  border-radius: var(--r3);
  overflow: hidden;
  background: var(--bg2);
  margin-bottom: 28px;
}

.cf-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cf-detail-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.7) 0%, transparent 100%);
  pointer-events: none;
}

.cf-detail-hero-title {
  position: absolute;
  bottom: 20px;
  left: 28px;
  z-index: 2;
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
  .cf-detail-hero {
    aspect-ratio: 16 / 7;
  }
  .cf-detail-hero-title {
    bottom: 12px;
    left: 16px;
    font-size: 20px;
  }
}

/* Detail Info Section */
.cf-detail-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 880px) {
  .cf-detail-content {
    grid-template-columns: 1fr;
  }
}

.cf-detail-info {
  min-width: 0;
}

.cf-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.cf-detail-tag {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--fg2);
}

.cf-detail-tag.cf-tag-rating {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.4);
  color: #D97706;
}

.cf-detail-tag.cf-tag-type {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.25);
  color: var(--primary);
}

.cf-detail-desc {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--fg2);
  margin-bottom: 26px;
}

.cf-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Game Info Sidebar Card */
.cf-game-info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 22px;
  box-shadow: var(--sh1);
  position: sticky;
  top: 80px;
}

.cf-game-info-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg2);
}

.cf-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg2);
  font-size: 13px;
}

.cf-info-row:last-child {
  border-bottom: none;
}

.cf-info-label {
  color: var(--fg3);
  font-weight: 600;
}

.cf-info-value {
  color: var(--fg);
  font-weight: 700;
}

.cf-rating-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
}

.cf-rating-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg2);
  border-radius: 99px;
  overflow: hidden;
}

.cf-rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FBBF24, #F97316);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.cf-rating-bar-num {
  font-size: 18px;
  font-weight: 900;
  color: #D97706;
}

/* Tab Card */
.cf-tab-card {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  overflow: hidden;
  box-shadow: var(--sh1);
}

.cf-tab-nav {
  display: flex;
  border-bottom: 2px solid var(--bg2);
  background: var(--bg);
}

.cf-tab-btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg3);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-align: center;
}

.cf-tab-btn:hover {
  color: var(--fg);
  background: rgba(14, 165, 233, 0.04);
}

.cf-tab-btn.cf-tab-active {
  color: var(--primary);
  background: var(--card);
}

.cf-tab-btn.cf-tab-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--primary);
  border-radius: 99px;
}

.cf-tab-panel {
  display: none;
  padding: 22px;
}

.cf-tab-panel.cf-tab-active {
  display: block;
}

.cf-tab-panel p {
  color: var(--fg2);
  line-height: 1.7;
  margin-bottom: 9px;
  font-size: 14px;
}

.cf-tab-panel p strong {
  color: var(--fg);
}

/* Controls Guide */
.cf-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.cf-control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg);
  border-radius: var(--r2);
  text-align: center;
}

.cf-control-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

.cf-control-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg);
}

.cf-control-desc {
  font-size: 11px;
  color: var(--fg3);
  line-height: 1.4;
}

@media (max-width: 500px) {
  .cf-controls-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 404 Page ---------- */
.cf-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  background: var(--bg);
}

.cf-404-inner {
  max-width: 560px;
}

.cf-404-code {
  font-size: clamp(100px, 18vw, 180px);
  font-weight: 900;
  line-height: 1;
  background: var(--grad1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  letter-spacing: -0.05em;
}

.cf-404-title {
  font-size: clamp(22px, 3.6vw, 32px);
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--fg);
}

.cf-404-sub {
  color: var(--fg2);
  margin-bottom: 28px;
  font-size: 15px;
}

.cf-404-search {
  display: flex;
  max-width: 440px;
  margin: 0 auto 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  box-shadow: var(--sh2);
}

.cf-404-search input {
  flex: 1;
  padding: 13px 18px;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.cf-404-search input::placeholder {
  color: var(--fg3);
}

.cf-404-search button {
  padding: 0 22px;
  background: var(--grad1);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.cf-404-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}

.cf-404-link {
  padding: 7px 14px;
  border-radius: var(--r2);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg2);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.cf-404-link:hover {
  color: var(--primary);
  border-color: rgba(14, 165, 233, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--sh1);
}

.cf-404-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 28px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.cf-404-game {
  aspect-ratio: 4 / 3;
  border-radius: var(--r2);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.22s;
}

.cf-404-game:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: var(--sh2);
}

.cf-404-game img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cf-404-game-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.85), transparent);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Text Page ---------- */
.cf-page {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}

.cf-page h1 {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.cf-page h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin: 28px 0 10px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--bg2);
}

.cf-page h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  margin: 18px 0 7px;
}

.cf-page p {
  color: var(--fg2);
  line-height: 1.7;
  margin-bottom: 12px;
  font-size: 14.5px;
}

.cf-page ul {
  margin: 10px 0 14px 18px;
  color: var(--fg2);
}

.cf-page ul li {
  margin-bottom: 7px;
  line-height: 1.6;
  font-size: 14.5px;
}

.cf-page a {
  color: var(--primary);
  text-decoration: underline;
}

.cf-page a:hover {
  color: var(--primary-d);
}

.cf-page-date {
  font-size: 12px;
  color: var(--fg3);
  margin-bottom: 22px;
}

.cf-page strong {
  color: var(--fg);
}

/* FAQ */
.cf-faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px 22px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}

.cf-faq-item:hover {
  box-shadow: var(--sh1);
  border-color: rgba(14, 165, 233, 0.2);
}

.cf-faq-item h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: var(--fg);
}

.cf-faq-item p {
  margin: 0;
  font-size: 13.5px;
}

/* ---------- Empty ---------- */
.cf-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--fg3);
}

.cf-empty-icon {
  font-size: 44px;
  margin-bottom: 14px;
  opacity: 0.5;
}

.cf-empty-text {
  font-size: 15px;
}

/* ---------- Utility ---------- */
.cf-hidden {
  display: none !important;
}

.cf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Animations ---------- */
@keyframes cf-pulse {
  0%, 100% {
    box-shadow: 0 0 16px rgba(14, 165, 233, 0.15);
  }
  50% {
    box-shadow: 0 0 32px rgba(14, 165, 233, 0.3);
  }
}

@keyframes cf-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.cf-anim-float {
  animation: cf-float 6s ease-in-out infinite;
}

.cf-anim-pulse {
  animation: cf-pulse 2.5s ease-in-out infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .cf-section-head {
    margin: 36px 0 16px;
  }
  .cf-scroll-actions {
    right: 10px;
    bottom: 10px;
  }
  .cf-scroll-actions button {
    width: 40px;
    height: 40px;
  }
}
