/* ============================================================
   NEON CYBER ARCADE — homepage theme
   ============================================================ */
:root {
  --bg: #07040f;
  --bg-alt: #0d0820;
  --panel: #120b28;
  --panel-2: #170f34;
  --line: #2a1f52;
  --magenta: #ff2bd6;
  --magenta-dim: #a3197f;
  --cyan: #24f5ff;
  --cyan-dim: #157f88;
  --yellow: #f6ff3c;
  --violet: #7b2fff;
  --text: #eaf6ff;
  --text-dim: #8f93c9;
  --font: 'Courier New', ui-monospace, "SF Mono", "Consolas", "Segoe UI Mono", monospace;
  --font-ui: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  background-image:
    linear-gradient(rgba(36, 245, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 43, 214, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  background-attachment: fixed;
}

[v-cloak] { display: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(7, 4, 15, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 0 20px rgba(255, 43, 214, 0.15);
}

.topbar-logo {
  font-family: var(--font);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 1px;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan), 0 0 18px rgba(36, 245, 255, 0.5);
}

.topbar-search-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--magenta);
  background: rgba(255, 43, 214, 0.08);
  color: var(--magenta);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 43, 214, 0.4);
}

/* ---------- Category Tabs ---------- */
.cat-tabs {
  position: sticky;
  top: 60px;
  z-index: 40;
  background: rgba(13, 8, 32, 0.9);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tabs-inner {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  width: max-content;
}

.cat-tab {
  font-family: var(--font);
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  white-space: nowrap;
  transition: all .15s;
}

.cat-tab.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(36, 245, 255, 0.1);
  box-shadow: 0 0 10px rgba(36, 245, 255, 0.35);
}

/* ---------- Search Bar ---------- */
.search-bar-wrap {
  position: sticky;
  top: 60px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--cyan);
}

.search-caret {
  color: var(--yellow);
  font-family: var(--font);
  font-weight: 700;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}
.search-input::placeholder { color: var(--text-dim); }

.search-cancel {
  font-family: var(--font);
  font-size: 12px;
  color: var(--magenta);
  background: none;
  border: 1px solid var(--magenta);
  border-radius: 3px;
  padding: 5px 10px;
}

/* ---------- Loading ---------- */
.loading-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 90px 0;
}

.loading-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--cyan);
  border-right-color: var(--magenta);
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 16px rgba(36, 245, 255, 0.5);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-txt {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

/* ---------- Section header ---------- */
.sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 10px;
}

.sec-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(246, 255, 60, 0.4);
}

.sec-more {
  font-family: var(--font);
  font-size: 11px;
  color: var(--cyan);
  background: none;
  border: 1px solid var(--cyan-dim);
  border-radius: 3px;
  padding: 4px 9px;
}

.sec-cnt {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- HERO ---------- */
.hero-sec { padding: 14px 14px 4px; }

.hero-card {
  position: relative;
  display: block;
  border: 1px solid var(--magenta);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, var(--panel), var(--bg-alt));
  box-shadow: 0 0 30px rgba(255, 43, 214, 0.25), inset 0 0 40px rgba(123, 47, 255, 0.1);
  min-height: 200px;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(36, 245, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 43, 214, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: .5;
  pointer-events: none;
}

.hero-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 10px var(--cyan);
  animation: scanline 3s linear infinite;
  z-index: 3;
}
@keyframes scanline {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.hero-img {
  position: relative;
  height: 150px;
  overflow: hidden;
}
.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) contrast(1.05);
}
.hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,4,15,0) 40%, rgba(7,4,15,0.95) 100%);
}

.hero-body {
  position: relative;
  z-index: 2;
  padding: 10px 16px 18px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font);
  font-size: 11px;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: 3px;
  padding: 2px 8px;
  margin-bottom: 8px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.hero-title {
  font-family: var(--font);
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
  position: relative;
  text-shadow: 2px 0 var(--magenta), -2px 0 var(--cyan);
}

.hero-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 10px;
  line-height: 1.4;
}

.hero-cta {
  font-family: var(--font);
  font-size: 12px;
  color: var(--bg);
  background: var(--cyan);
  padding: 6px 14px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 14px rgba(36, 245, 255, 0.6);
}

/* ---------- Arcade Cabinet carousel ---------- */
.cab-scroll {
  display: flex;
  gap: 14px;
  padding: 4px 16px 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.cab-scroll::-webkit-scrollbar { display: none; }

.cab-card {
  flex: 0 0 auto;
  width: 118px;
  scroll-snap-align: start;
  text-align: center;
}

.cab-frame {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 10px;
  border: 2px solid var(--cyan-dim);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(7,4,15,1), 0 0 16px rgba(36, 245, 255, 0.3);
}

.cab-frame img { width: 100%; height: 100%; object-fit: cover; }

.cab-idx {
  position: absolute;
  top: 4px;
  left: 4px;
  font-family: var(--font);
  font-size: 10px;
  color: var(--yellow);
  background: rgba(7,4,15,0.7);
  padding: 1px 5px;
  border-radius: 2px;
  z-index: 2;
}

.cab-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 20px rgba(255, 43, 214, 0.35);
  pointer-events: none;
}

.cab-nm {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text);
}

/* ---------- Terminal ---------- */
.term-sec { padding: 4px 14px 18px; }

.term-window {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #060312;
  box-shadow: 0 0 24px rgba(123, 47, 255, 0.2);
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.term-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.term-dot.r { background: #ff5f56; }
.term-dot.y { background: #ffbd2e; }
.term-dot.g { background: #27c93f; }

.term-path {
  margin-left: 8px;
  font-family: var(--font);
  font-size: 10px;
  color: var(--text-dim);
}

.term-body {
  padding: 10px 12px 14px;
  max-height: none;
}

.term-line {
  display: block;
  font-family: var(--font);
  font-size: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.07);
}
.term-line:last-child { border-bottom: none; }

.term-prompt { color: var(--yellow); margin-right: 6px; }
.term-cmd { color: var(--cyan); margin-right: 6px; }
.term-name { color: var(--text); font-weight: 700; margin-right: 8px; }
.term-flag { color: var(--magenta); }
.term-comment {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 11px;
  padding-left: 14px;
}

/* ---------- Leaderboard ---------- */
.board-sec { padding: 4px 14px 18px; }

.board-list { display: flex; flex-direction: column; gap: 8px; }

.board-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.board-row.top3 {
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(246, 255, 60, 0.25);
}

.board-rank {
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dim);
  width: 26px;
}
.board-row.top3 .board-rank { color: var(--yellow); }

.board-img {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.board-img img { width: 100%; height: 100%; object-fit: cover; }

.board-nm {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-tag {
  font-family: var(--font);
  font-size: 10px;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  border-radius: 3px;
  padding: 2px 6px;
  flex-shrink: 0;
}

/* ---------- Hex/diamond grid ---------- */
.hex-sec { padding: 4px 10px 18px; }

.hex-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 6px;
  padding: 10px 4px 0;
}

.hex-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hex-clip {
  width: 68px;
  height: 68px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--panel);
  border: none;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(36, 245, 255, 0.35);
}
.hex-clip img { width: 100%; height: 100%; object-fit: cover; }

.hex-ch {
  margin-top: 6px;
  font-family: var(--font);
  font-size: 9px;
  color: var(--magenta);
}

.hex-nm {
  font-size: 10.5px;
  color: var(--text-dim);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Rush row (Action) ---------- */
.rush-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 14px 18px;
}

.rush-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--magenta-dim);
}

.rush-img { aspect-ratio: 1.5; overflow: hidden; }
.rush-img img { width: 100%; height: 100%; object-fit: cover; }

.rush-lv {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font);
  font-size: 10px;
  background: var(--magenta);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(255, 43, 214, 0.7);
}

.rush-nm {
  padding: 8px 8px;
  font-size: 12px;
  margin: 0;
  color: var(--text);
}

/* ---------- Tile row (Puzzle) ---------- */
.tile-row {
  display: flex;
  gap: 12px;
  padding: 4px 14px 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tile-row::-webkit-scrollbar { display: none; }

.tile-card {
  flex: 0 0 auto;
  width: 96px;
  text-align: center;
}

.tile-img {
  width: 96px;
  height: 96px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid var(--cyan);
  transform: rotate(-1.5deg);
  box-shadow: 3px 3px 0 var(--magenta);
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; }

.tile-nm { margin-top: 8px; font-size: 11.5px; color: var(--text-dim); }

/* ---------- Orb row (Kids) ---------- */
.orb-row {
  display: flex;
  gap: 16px;
  padding: 6px 14px 20px;
  justify-content: space-between;
}

.orb-card { flex: 1; text-align: center; }

.orb-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--yellow);
  box-shadow: 0 0 16px rgba(246, 255, 60, 0.45);
}
.orb-img img { width: 100%; height: 100%; object-fit: cover; }

.orb-nm { margin-top: 8px; font-size: 11.5px; color: var(--text); }

/* ---------- Stream list (Sports) ---------- */
.stream-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 18px; }

.stream-row {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.stream-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
}

.stream-img { width: 52px; height: 52px; border-radius: 5px; overflow: hidden; flex-shrink: 0; }
.stream-img img { width: 100%; height: 100%; object-fit: cover; }

.stream-body { flex: 1; min-width: 0; }
.stream-nm { margin: 0; font-size: 13px; color: var(--text); font-weight: 600; }
.stream-tag {
  font-family: var(--font);
  font-size: 10px;
  color: var(--cyan);
}
.stream-desc {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Circuit grid (Adventure) ---------- */
.circuit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 14px 18px;
}

.circuit-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--violet);
  background: var(--panel);
}
.circuit-item img { width: 100%; aspect-ratio: 1.3; object-fit: cover; }

.circuit-nm {
  margin: 0;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  border-top: 1px solid var(--violet);
}

/* ---------- Racing banner ---------- */
.racing-sec { padding: 4px 14px 18px; }

.banner-single {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--cyan);
  box-shadow: 0 0 20px rgba(36, 245, 255, 0.3);
}
.banner-single img { width: 100%; height: 140px; object-fit: cover; }

.banner-ovl {
  position: absolute;
  left: 0; bottom: 0; right: 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, transparent, rgba(7,4,15,0.95));
}

.banner-badge {
  font-family: var(--font);
  font-size: 10px;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  padding: 2px 7px;
  border-radius: 3px;
}

.banner-title { margin: 6px 0 2px; font-size: 16px; font-weight: 700; color: var(--text); }
.banner-desc { margin: 0; font-size: 12px; color: var(--text-dim); }

/* ---------- File list (Girl) ---------- */
.girl-sec { padding: 4px 14px 18px; }

.file-list { display: flex; flex-direction: column; gap: 10px; }

.file-row {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 6px;
  background: linear-gradient(120deg, rgba(255,43,214,0.06), rgba(36,245,255,0.06));
  border: 1px solid var(--line);
}

.file-img { width: 56px; height: 56px; border-radius: 5px; overflow: hidden; flex-shrink: 0; }
.file-img img { width: 100%; height: 100%; object-fit: cover; }

.file-body { flex: 1; min-width: 0; }
.file-nm { margin: 0; font-size: 13px; color: var(--text); font-weight: 600; }
.file-desc { margin: 4px 0 0; font-size: 11.5px; color: var(--text-dim); }

/* ---------- Diamond row (Arcade) ---------- */
.diamond-row {
  display: flex;
  gap: 16px;
  padding: 6px 14px 20px;
  justify-content: center;
}

.diamond-card { flex: 1; max-width: 100px; }

.diamond-clip {
  width: 100%;
  aspect-ratio: 1;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  overflow: hidden;
  border: none;
  box-shadow: 0 0 14px rgba(123, 47, 255, 0.5);
}
.diamond-clip img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- All games grid ---------- */
.all-sec { padding: 4px 14px 24px; }

.all-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 6px;
}

.agcard {
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .15s;
}
.agcard:active { border-color: var(--cyan); }

.agcard-img { aspect-ratio: 1; overflow: hidden; }
.agcard-img img { width: 100%; height: 100%; object-fit: cover; }

.agcard-nm {
  padding: 6px 7px;
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-wrap { display: flex; justify-content: center; padding-top: 16px; }

.more-btn, .loadmore-btn {
  font-family: var(--font);
  font-size: 12px;
  color: var(--cyan);
  background: rgba(36, 245, 255, 0.08);
  border: 1px solid var(--cyan);
  border-radius: 20px;
  padding: 9px 22px;
  box-shadow: 0 0 12px rgba(36, 245, 255, 0.3);
}

/* ---------- Filter / Search header + grid ---------- */
.filter-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.filter-back {
  font-family: var(--font);
  font-size: 12px;
  color: var(--magenta);
  background: none;
  border: 1px solid var(--magenta);
  border-radius: 3px;
  padding: 5px 10px;
}

.filter-title { flex: 1; font-size: 15px; font-weight: 700; color: var(--text); }
.filter-cnt { font-family: var(--font); font-size: 12px; color: var(--text-dim); }

.grid-sec { padding: 14px 14px 24px; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gcard {
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}

.gcard-img { aspect-ratio: 1; overflow: hidden; }
.gcard-img img { width: 100%; height: 100%; object-fit: cover; }

.gcard-nm {
  padding: 6px 7px;
  margin: 0;
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-msg {
  text-align: center;
  padding: 60px 0;
  font-family: var(--font);
  color: var(--text-dim);
  font-size: 13px;
}

.loadmore-wrap { display: flex; justify-content: center; padding-top: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 0 90px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
  margin-top: 10px;
}
.site-footer a { color: var(--cyan); }

/* ---------- Back to top ---------- */
.totop-btn {
  position: fixed;
  right: 16px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--cyan);
  background: rgba(7,4,15,0.85);
  color: var(--cyan);
  font-size: 18px;
  box-shadow: 0 0 16px rgba(36, 245, 255, 0.5);
  z-index: 60;
}

/* ---------- Responsive: tablet/desktop widen ---------- */
@media (min-width: 640px) {
  .all-grid, .games-grid { grid-template-columns: repeat(4, 1fr); }
  .hex-grid { grid-template-columns: repeat(6, 1fr); }
  .rush-row { grid-template-columns: repeat(4, 1fr); }
  .circuit-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 960px) {
  .all-grid, .games-grid { grid-template-columns: repeat(6, 1fr); }
  .hero-img { height: 220px; }
}
