/* ============================================================
   GameCube variant - copy of style.css
   Dark theme (#121212) with red accent (#e63e20), uppercase
   condensed headings, pill buttons, GameCube covers (1280x1816).
   All comments in English per project convention.
   ============================================================ */

/* === Design tokens === */
:root {
    --bg: #121212;
    --bg-soft: #161616;
    --surface: #1a1a1a;
    --surface-2: #202020;
    --surface-3: #262626;
    --border: #2a2a2a;
    --border-light: #333333;
    --accent: #e63e20;
    --accent-hover: #ff4a26;
    --accent-soft: rgba(230, 62, 32, 0.12);
    --text: #ffffff;
    --text-muted: #b0b0b0;
    --text-faint: #808080;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 8px;
    --radius-lg: 12px;
    --font-head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 6px 20px rgba(230, 62, 32, 0.35);
    --max-width: 1280px;
}

/* === Reset & base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-hover);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--text);
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style-position: inside;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    line-height: 1.2;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 28px 0 48px;
}

/* === Generic buttons (superpsx: red, rounded, uppercase) === */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-light);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 2px solid var(--accent);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 68px;
    padding: 10px 0;
}

.logo {
    flex-shrink: 0;
}

.logo-img {
    max-height: clamp(34px, 4.5vw, 46px);
    width: auto;
}

/* Nav */
.main-nav {
    flex: 1;
    min-width: 0;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex-wrap: wrap;
}

.nav-list > li {
    position: relative;
}

.nav-link {
    display: block;
    padding: 10px 14px;
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: var(--surface-2);
}

.nav-list > li:hover > .nav-link {
    color: var(--text);
}

/* Dropdown */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 110;
}

.nav-list > li:hover > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.nav-dropdown a:hover {
    color: var(--text);
    background: var(--surface-2);
    padding-left: 20px;
}

/* Search */
.header-search {
    flex-shrink: 0;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.search-form:focus-within {
    border-color: var(--accent);
}

.search-input {
    width: 200px;
    padding: 9px 14px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
}

.search-input::placeholder {
    color: var(--text-faint);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 38px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: var(--accent-hover);
}

/* Mobile toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
}

/* Mobile-only search box inside the hamburger panel — hidden on desktop by default */
.mobile-nav-search {
    display: none;
    padding: 14px 20px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.mobile-nav-search .search-form {
    width: 100%;
}

.mobile-nav-search .search-input {
    width: 100%;
    min-width: 0;
}

/* ============================================================
   HERO / BANNER
   ============================================================ */
.banner-section {
    margin: -28px -20px 32px;
}

.banner-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.banner-slide a {
    display: block;
    position: relative;
}

.banner-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
}

.banner-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 40px 32px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.banner-caption h2 {
    font-size: 40px;
    color: var(--text);
}

.banner-caption p {
    color: var(--text-muted);
    margin-top: 6px;
}

/* Static hero (superpsx style: dark gradient + red glow) */
.banner-static {
    position: relative;
    padding: 72px 40px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(ellipse 60% 90% at 85% 10%, rgba(230, 62, 32, 0.22), transparent 60%),
        linear-gradient(135deg, #1a1a1a 0%, #101010 100%);
    border: 1px solid var(--border);
    overflow: hidden;
}

.banner-static::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
}

.banner-inner {
    max-width: 640px;
}

.banner-kicker {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-hover);
    margin-bottom: 10px;
}

.banner-inner h1 {
    font-size: 58px;
    color: var(--text);
}

.banner-inner > p {
    color: var(--text-muted);
    font-size: 17px;
    margin: 14px 0 28px;
}

/* ============================================================
   SUPERPSX HERO CAROUSEL (4 featured games, flag="f")
   Mirrors the superpsx.com homepage hero: blurred backdrop,
   big cover on the right, thumbnails underneath, auto-rotate.
   ============================================================ */
.spsx-hero {
    position: relative;
    height: 620px;
    margin: -28px -20px 28px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0b0c0f;
    color: #fff;
}

.spsx-hero-bgs {
    position: absolute;
    inset: 0;
}

.spsx-hero-bg {
    position: absolute;
    inset: -60px;
    width: calc(100% + 120px);
    height: calc(100% + 120px);
    max-width: none;
    object-fit: cover;
    filter: blur(40px) saturate(1.3);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.spsx-hero-bg.is-on {
    opacity: 0.8;
}

/* Left-to-right dark scrim so the text stays readable */
.spsx-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.84) 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.25) 100%);
}

/* Bottom fade into the page background */
.spsx-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 96px;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), var(--bg));
}

.spsx-hero-in {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 120px 32px 0;
}

.spsx-slide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 56px;
    align-items: start;
}

.spsx-slide[hidden] {
    display: none;
}

.spsx-slide.is-on .spsx-slide-txt {
    animation: spsxUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.spsx-slide.is-on .spsx-slide-cover {
    animation: spsxUp 0.6s 0.06s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes spsxUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.spsx-slide-txt {
    max-width: 600px;
    padding-top: 8px;
}

.spsx-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.spsx-slide-t {
    margin: 18px 0 14px;
    padding: 0;
    font-family: var(--font-head);
    font-size: clamp(36px, 4.4vw, 58px);
    line-height: 0.98;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.005em;
}

.spsx-slide-t a,
.spsx-slide-t a:hover {
    color: #fff;
}

.spsx-slide-p {
    margin: 0 0 26px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.84);
}

.spsx-slide-act {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Pill buttons (red primary + outlined ghost), same as superpsx */
.spsx-cta,
.spsx-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s, background-color 0.2s, border-color 0.2s;
}

.spsx-cta:hover {
    filter: brightness(1.12);
    color: #fff;
}

.spsx-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.spsx-ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.spsx-cta:active,
.spsx-ghost:active {
    transform: scale(0.97);
}

.spsx-cta-lg {
    height: 54px;
    padding: 0 30px;
    font-size: 16px;
}

.spsx-slide-cover {
    display: block;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    overflow: hidden;
    background: #1b1e25;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.spsx-slide-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spsx-thumbs {
    position: absolute;
    right: 32px;
    top: 458px;
    width: 260px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.spsx-thumb {
    position: relative;
    flex: 0 0 58px;
    width: 58px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #1b1e25;
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.25s, transform 0.25s, border-color 0.25s;
}

.spsx-thumb:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.spsx-thumb.is-on {
    opacity: 1;
    border-color: #fff;
}

.spsx-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Auto-rotate progress bar inside the active thumbnail */
.spsx-thumb-p {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: #fff;
}

/* Spinner (shared by detail download buttons) */
.js-dl-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dl-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.is-verifying .js-dl-spinner {
    display: inline-block;
}

.is-verifying .js-dl-icon-lock,
.js-dl-revealed .js-dl-icon-lock {
    display: none;
}

@keyframes dl-spin {
    to { transform: rotate(360deg); }
}

/* Unlocked pulse glow: one-time flash, no persistent animation */
@keyframes unlock-pulse {
    0% { box-shadow: 0 0 0 0 rgba(230, 62, 32, 0.6); }
    100% { box-shadow: 0 0 0 18px rgba(230, 62, 32, 0); }
}

/* Password chip: click to copy */
.js-dl-pwd-value {
    display: inline-block;
    padding: 1px 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.js-dl-pwd-value:hover {
    background: rgba(255, 255, 255, 0.28);
}

.js-dl-pwd-value.copied::after {
    content: attr(data-copied);
    margin-left: 6px;
    color: #fff;
    font-size: 11px;
}

/* ============================================================
   PLATFORM NAV (superpsx-style category chips)
   ============================================================ */
.platform-nav {
    margin: -8px 0 36px;
}

.platform-nav-inner {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}

.platform-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.platform-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.platform-chip-name {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text);
}

.platform-chip-count {
    font-size: 12px;
    color: var(--accent-hover);
    font-weight: 600;
}

/* ============================================================
   SECTION BLOCKS & TITLES
   ============================================================ */
.section-block {
    margin-bottom: 44px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.section-title {
    font-size: 28px;
    color: var(--text);
}

.section-more {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-hover);
    white-space: nowrap;
}

.section-more:hover {
    color: var(--text);
}

/* ============================================================
   GAME GRID & CARDS
   ============================================================ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px;
}

/* Horizontal scroll row (superpsx signature layout) */
.game-scroll-row {
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}

.game-scroll-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 190px;
    gap: 20px;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.game-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-accent);
}

.game-card-link {
    display: block;
    color: inherit;
}

/* Cover: GameCube 1280x1816 portrait */
.game-card-cover {
    position: relative;
    aspect-ratio: 1280 / 1816;
    background: var(--surface-3);
    overflow: hidden;
}

.game-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .game-cover-img {
    transform: scale(1.05);
}

.game-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
}

.game-cover-placeholder span {
    font-family: var(--font-head);
    font-size: 34px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-faint);
    letter-spacing: 2px;
}

/* Flag badges on covers */
.game-flags {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.flag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--font-head);
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #fff;
    line-height: 1.3;
}

.flag-h { background: var(--accent); }
.flag-c { background: #d97706; }
.flag-f { background: #7c3aed; }
.flag-s { background: #0891b2; }
.flag-j { background: #4b5563; }

.game-card-body {
    padding: 12px 14px 14px;
}

.game-card-title {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-faint);
}

.meta-views::before {
    content: "👁 ";
}

/* ============================================================
   CATEGORY GRID
   ============================================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.category-card {
    display: block;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    transition: all 0.25s ease;
}

.category-card:hover {
    background: var(--surface-2);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.category-card-title {
    font-size: 21px;
    color: var(--text);
    margin-bottom: 4px;
}

.category-card-count {
    font-size: 13px;
    color: var(--accent-hover);
    font-weight: 600;
}

/* ============================================================
   CONTENT + SIDEBAR LAYOUT
   ============================================================ */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.widget-title {
    padding: 13px 18px;
    font-size: 19px;
    color: var(--text);
    background: var(--surface-2);
    border-bottom: 2px solid var(--accent);
}

.widget-content {
    padding: 16px 18px;
}

/* Hot games list */
.hot-games-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hot-game-link {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hot-game-thumb {
    width: 52px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-3);
}

.hot-game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-faint);
}

.hot-game-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hot-game-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-game-link:hover .hot-game-title {
    color: var(--accent-hover);
}

.hot-game-meta {
    font-size: 12px;
    color: var(--text-faint);
}

/* Tag cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-block;
    padding: 4px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tag-item:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-soft);
}

/* Category list in sidebar */
.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.category-list a:hover {
    background: var(--surface-2);
    color: var(--text);
    padding-left: 14px;
}

.cat-count {
    font-size: 12px;
    color: var(--text-faint);
}

/* Article list (kept for future use: guides / article lists) */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-item-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.article-item-link:hover {
    border-color: var(--accent);
    background: var(--surface-2);
}

.article-item-title {
    font-size: 17px;
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: none;
}

.article-item-date {
    font-size: 12.5px;
    color: var(--text-faint);
    white-space: nowrap;
}

/* ============================================================
   RECENTLY ADDED GAMES (index page, two-column compact list)
   Thumbnail 84px wide, GameCube cover ratio 1280/1816
   ============================================================ */
.latest-game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.latest-game-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.latest-game-item:hover {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: translateY(-2px);
}

.latest-game-cover {
    position: relative;
    width: 84px;
    flex-shrink: 0;
    aspect-ratio: 1280 / 1816;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-3);
}

.latest-game-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.latest-game-item:hover .latest-game-img {
    transform: scale(1.05);
}

.latest-game-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-faint);
}

.latest-game-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    min-width: 0;
}

.latest-game-title {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.latest-game-item:hover .latest-game-title {
    color: var(--accent-hover);
}

.latest-game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--text-faint);
}

.latest-game-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.latest-game-flags:empty {
    display: none;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13.5px;
}

.breadcrumb-link {
    color: var(--text-muted);
}

.breadcrumb-link:hover {
    color: var(--accent-hover);
}

.breadcrumb-sep {
    color: var(--text-faint);
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

/* ============================================================
   FILTERS / SORT / TOOLBAR (list + AJAX browse page)
   ============================================================ */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Reset both <a> and <button> filter options to look identical */
a.filter-option,
button.filter-option {
    padding: 5px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
}

a.filter-option:hover,
button.filter-option:hover {
    border-color: var(--accent);
    color: var(--text);
}

a.filter-option.active,
button.filter-option.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.filter-count {
    font-style: normal;
    font-size: 11px;
    opacity: 0.75;
    margin-left: 2px;
}

.filter-loading {
    color: var(--text-faint);
    font-size: 14px;
    padding: 6px 0;
}

.filter-reset-btn {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent-hover);
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-reset-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* Sort bar */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.sort-label {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.sort-option {
    padding: 6px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

.sort-option:hover {
    border-color: var(--accent);
    color: var(--text);
}

.sort-option.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Browse header (AJAX page) */
.browse-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px 28px;
    margin-bottom: 24px;
    background:
        radial-gradient(ellipse 40% 100% at 100% 0%, rgba(230, 62, 32, 0.15), transparent 70%),
        var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.browse-header-icon {
    font-size: 38px;
    line-height: 1;
}

.browse-title {
    font-size: 32px;
    color: var(--text);
}

.browse-desc {
    color: var(--text-muted);
    margin-top: 4px;
}

.browse-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.browse-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.browse-result-count {
    font-size: 13px;
    color: var(--text-faint);
}

/* AJAX grid loading spinner */
.browser-grid-wrap {
    position: relative;
    min-height: 200px;
}

.browser-grid-wrap.is-loading::after {
    content: "";
    position: absolute;
    top: 60px;
    left: 50%;
    width: 36px;
    height: 36px;
    margin-left: -18px;
    border: 3px solid var(--surface-3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: grid-spin 0.8s linear infinite;
}

@keyframes grid-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    font-family: var(--font-body);
    transition: all 0.2s ease;
    cursor: pointer;
}

a.page-btn:hover,
button.page-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: var(--text-faint);
    padding: 0 4px;
}

/* ============================================================
   CATEGORY / SEARCH / TAG PAGE HEADERS
   ============================================================ */
.category-header {
    padding: 24px 28px;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.category-page-title {
    font-size: 30px;
    color: var(--text);
}

.category-page-desc {
    color: var(--text-muted);
    margin-top: 6px;
}

.search-header {
    margin-bottom: 20px;
}

.search-title {
    font-size: 32px;
    color: var(--text);
}

.search-keyword {
    color: var(--text-muted);
    margin-top: 6px;
}

.search-keyword strong {
    color: var(--accent-hover);
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 46px;
    line-height: 1;
}

.btn-back {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 24px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-back:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* ============================================================
   GAME DETAIL PAGE
   ============================================================ */
.game-detail-header {
    display: flex;
    gap: 32px;
    padding: 28px;
    background:
        radial-gradient(ellipse 40% 80% at 100% 0%, rgba(230, 62, 32, 0.1), transparent 70%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}

/* Cover: GameCube 1280x1816 ratio, 237x336 display size */
.game-detail-cover {
    flex-shrink: 0;
    width: 237px;
    height: 336px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-3);
    box-shadow: var(--shadow);
}

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

.detail-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 44px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-faint);
    background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
}

.game-detail-info {
    flex: 1;
    min-width: 0;
}

.game-detail-title {
    font-size: 40px;
    color: var(--text);
    margin-bottom: 14px;
}

.game-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-bottom: 14px;
}

.meta-item {
    font-size: 13.5px;
    color: var(--text-muted);
}

.meta-label {
    color: var(--text-faint);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    font-family: var(--font-head);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.game-detail-flags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.game-detail-desc {
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--surface-2);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
}

.game-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

/* Big red "Download Game" button */
.goto-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 34px;
    background: var(--accent);
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-head);
    font-size: 19px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.25s ease;
}

.goto-download-btn:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}

/* Same-tag text links */
.desc-related-links {
    margin-bottom: 28px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.desc-related-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text);
    margin-bottom: 10px;
}

.desc-related-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px 20px;
}

.desc-related-list a {
    font-size: 13.5px;
    color: var(--text-muted);
}

.desc-related-list a::before {
    content: "▸ ";
    color: var(--accent);
}

.desc-related-list a:hover {
    color: var(--accent-hover);
}

/* Description section */
.desc-section {
    margin-bottom: 32px;
}

.desc-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.desc-section-title {
    font-size: 26px;
    color: var(--text);
    white-space: nowrap;
}

.desc-section-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--accent), transparent);
}

/* Rich text content */
.game-full-desc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    color: var(--text-muted);
    font-size: 15px;
    overflow-wrap: break-word;
}

.game-full-desc h1, .game-full-desc h2, .game-full-desc h3, .game-full-desc h4 {
    color: var(--text);
    margin: 20px 0 10px;
}

.game-full-desc h2 { font-size: 24px; }
.game-full-desc h3 { font-size: 20px; }

.game-full-desc p {
    margin-bottom: 12px;
}

.game-full-desc a {
    color: var(--accent-hover);
    text-decoration: underline;
}

.game-full-desc img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 12px 0;
}

/* Embedded videos (e.g. the "Related Videos" block in the article content) */
.game-full-desc iframe,
.game-full-desc video {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #000;
    vertical-align: top;
}

/* Desktop: two videos per row, 16:9 ratio, never overflowing the container */
.game-full-desc iframe,
.game-full-desc video {
    display: inline-block;
    width: calc(50% - 12px);
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0 4px 12px 0;
}

/* A paragraph that only wraps a video becomes inline so two videos share one row */
.game-full-desc p:has(> iframe:only-child),
.game-full-desc p:has(> video:only-child) {
    display: inline;
    margin: 0;
}

.game-full-desc ul, .game-full-desc ol {
    margin: 0 0 12px 20px;
}

.game-full-desc li {
    margin-bottom: 6px;
}

.game-full-desc blockquote {
    padding: 10px 18px;
    margin: 12px 0;
    background: var(--surface-2);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
}

.table-scroll {
    overflow-x: auto;
    margin: 12px 0;
}

.game-full-desc table {
    width: 100%;
    border-collapse: collapse;
}

.game-full-desc th,
.game-full-desc td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.game-full-desc th {
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-head);
    text-transform: uppercase;
}

/* ============================================================
   DOWNLOAD SECTION (three-state protected buttons)
   ============================================================ */
.download-section {
    margin-bottom: 32px;
}

.download-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 26px 28px;
}

.download-title {
    font-size: 26px;
    color: var(--text);
    margin-bottom: 6px;
}

.download-tips {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 18px;
}

.download-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

/* Locked state: red (primary) / dark (secondary) + lock icon, clickable */
.download-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 520px;
    padding: 16px 22px;
    border-radius: var(--radius);
    border: 2px solid transparent;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.25s ease;
}

.download-btn-primary {
    background: var(--accent);
    color: #fff;
}

.download-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.download-btn-secondary {
    background: var(--surface-2);
    border-color: var(--border-light);
    color: var(--text);
}

.download-btn-secondary:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Verifying state: translucent + spinner, click still handled by JS */
.download-btn.is-verifying {
    opacity: 0.75;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.download-btn-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.download-btn-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.download-btn-label {
    font-family: var(--font-head);
    font-size: 19px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.download-btn-sub {
    font-size: 12.5px;
    opacity: 0.85;
}

/* Unlocked state: primary turns solid accent, one-time pulse glow */
.js-dl-revealed.download-btn-primary {
    animation: unlock-pulse 0.5s ease 1;
}

.js-dl-revealed.download-btn-secondary {
    border-color: var(--accent);
}

.download-tips ul {
    margin: 8px 0 0 20px;
    color: var(--text-muted);
}

.download-tips li {
    margin-bottom: 4px;
}

/* ============================================================
   LOCAL DOWNLOAD MODAL (detail-local.html)
   Opened by the "Local Download" button: file info, browser
   suggestion, direct link and a continue-in-this-browser action.
   ============================================================ */
body.local-dl-lock {
    overflow: hidden;
}

.local-dl-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.local-dl-modal.is-open {
    display: flex;
}

.local-dl-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
}

.local-dl-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
    animation: local-dl-in 0.22s ease-out;
}

@keyframes local-dl-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.local-dl-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text-faint);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.local-dl-close:hover {
    color: var(--text);
    background: var(--surface-3);
}

.local-dl-title {
    padding-right: 28px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    margin-bottom: 16px;
}

/* Browser suggestion block */
.local-dl-promo {
    padding: 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(230, 62, 32, 0.12) 0%, rgba(230, 62, 32, 0.03) 100%);
    border: 1px solid rgba(230, 62, 32, 0.35);
    border-radius: var(--radius);
}

.local-dl-promo-badge {
    display: inline-block;
    padding: 3px 9px;
    margin-bottom: 8px;
    background: var(--accent);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
}

.local-dl-promo-text {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.local-dl-promo-btn {
    display: inline-block;
    padding: 9px 22px;
    background: var(--accent);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    transition: background 0.2s ease, transform 0.1s ease;
}

.local-dl-promo-btn:hover {
    background: var(--accent-hover);
    color: #fff;
}

.local-dl-promo-btn:active {
    transform: scale(0.97);
}

.local-dl-promo-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-faint);
}

/* Primary action: continue in the current browser (the only download trigger) */
.local-dl-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    background: var(--surface-3);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    transition: all 0.22s ease;
}

.local-dl-continue:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}


/* ============================================================
   COMMENTS SECTION
   ============================================================ */
.comments-section {
    margin-bottom: 32px;
}

.comment-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.comment-form-title {
    font-size: 21px;
    color: var(--text);
    margin-bottom: 16px;
}

.comment-reply-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
}

.comment-reply-cancel {
    background: transparent;
    border: none;
    color: var(--accent-hover);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--font-body);
}

.comment-reply-cancel:hover {
    color: var(--text);
}

.comment-form-field {
    margin-bottom: 16px;
}

.comment-form-field label {
    display: block;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent);
}

.comment-form textarea {
    resize: vertical;
    min-height: 110px;
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: var(--text-faint);
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.captcha-row input {
    max-width: 200px;
}

.captcha-row img {
    height: 42px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.comment-form-actions {
    display: flex;
    gap: 12px;
}

.comment-submit-btn {
    padding: 12px 30px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-submit-btn:hover {
    background: var(--accent-hover);
}

.comment-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comment-reset-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-reset-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.comment-form-msg {
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.comment-form-msg.error {
    display: block;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid var(--error);
    color: #fca5a5;
}

.comment-form-msg.success {
    display: block;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid var(--success);
    color: #86efac;
}

/* Comment list */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.comment-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 50%;
    color: #fff;
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.comment-user {
    font-weight: 700;
    color: var(--text);
    font-size: 14.5px;
}

.comment-date {
    font-size: 12.5px;
    color: var(--text-faint);
}

.comment-quote {
    padding: 8px 14px;
    margin-bottom: 8px;
    background: var(--surface-2);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    color: var(--text-muted);
    font-size: 13.5px;
}

.comment-content {
    color: var(--text-muted);
    font-size: 14.5px;
    overflow-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 18px;
    margin-top: 10px;
}

.comment-action {
    font-size: 13px;
    color: var(--text-faint);
    transition: color 0.2s ease;
}

.comment-action:hover {
    color: var(--accent-hover);
}

.comment-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-faint);
    background: var(--surface);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
}

/* ============================================================
   RELATED / SCREENSHOTS / PARAMS / PREV-NEXT
   ============================================================ */
.related-section {
    margin-bottom: 16px;
}

.related-section .section-title {
    font-size: 26px;
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.screenshots-section {
    margin-bottom: 32px;
}

.screenshots-section .section-title {
    font-size: 26px;
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.screenshot-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: zoom-in;
}

.screenshot-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.screenshot-item:hover .screenshot-img {
    transform: scale(1.03);
}

.params-section {
    margin-bottom: 32px;
}

.params-section .section-title {
    font-size: 26px;
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.params-table th,
.params-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}

.params-table tr:last-child th,
.params-table tr:last-child td {
    border-bottom: none;
}

.param-name {
    width: 200px;
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-head);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-value {
    color: var(--text-muted);
}

.prev-next-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.prev-link,
.next-link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    max-width: 48%;
    font-size: 14px;
}

.nav-label {
    color: var(--text-faint);
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.prev-link a,
.next-link a {
    color: var(--accent-hover);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prev-link a:hover,
.next-link a:hover {
    color: var(--text);
}

/* ============================================================
   GENERIC PAGES (about / contact / single page)
   ============================================================ */
.page-content {
    max-width: 860px;
    margin: 0 auto;
}

.page-title {
    font-size: 34px;
    color: var(--text);
    margin-bottom: 20px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.page-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 30px;
    color: var(--text-muted);
}

.page-body h2, .page-body h3 {
    color: var(--text);
    margin: 18px 0 10px;
}

.page-body p {
    margin-bottom: 12px;
}

.page-body ul, .page-body ol {
    margin: 0 0 12px 20px;
}

.page-body img {
    border-radius: var(--radius);
    margin: 12px 0;
}

.about-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 18px;
}

.about-section h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 10px;
}

.about-section p,
.about-section li {
    color: var(--text-muted);
}

.about-section ul {
    margin-left: 20px;
}

/* Contact page */
.contact-intro {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 24px;
    align-items: start;
}

.contact-info-card,
.contact-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
}

.contact-info-title {
    font-size: 21px;
    color: var(--text);
    margin-bottom: 16px;
}

.contact-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.contact-info-icon {
    font-size: 22px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 10px;
    flex-shrink: 0;
}

.contact-info-label {
    display: block;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-faint);
}

.contact-info-value {
    color: var(--text);
    font-size: 14.5px;
}

.contact-info-tips {
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: 6px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.contact-info-tips p {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 6px;
}

.contact-info-tips ul {
    margin-left: 18px;
}

/* Contact form reuses comment form field look */
.contact-form-field {
    margin-bottom: 16px;
}

.contact-form-field label {
    display: block;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.required-mark {
    color: var(--accent-hover);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-faint);
}

.contact-form .captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-form .captcha-row input {
    max-width: 200px;
}

.contact-form .captcha-row img {
    height: 42px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.contact-form-actions {
    display: flex;
    gap: 12px;
}

.contact-submit-btn {
    padding: 12px 30px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.contact-submit-btn:hover {
    background: var(--accent-hover);
}

.contact-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contact-reset-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-reset-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.contact-form-msg {
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.contact-form-msg.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid var(--error);
    color: #fca5a5;
}

.contact-form-msg.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid var(--success);
    color: #86efac;
}

/* ============================================================
   ERROR / CLOSE PAGES
   ============================================================ */
.error-page,
.close-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-code {
    font-family: var(--font-head);
    font-size: 110px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
    text-shadow: 0 0 40px rgba(230, 62, 32, 0.4);
    margin-bottom: 8px;
}

.error-title {
    font-size: 32px;
    color: var(--text);
    margin-bottom: 10px;
}

.error-desc {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.error-suggest p {
    color: var(--text-faint);
    margin-bottom: 10px;
}

.error-search {
    justify-content: center;
}

.error-search .search-input {
    width: 280px;
}

.close-content h1 {
    font-size: 34px;
    color: var(--text);
    margin-bottom: 12px;
}

.close-content p {
    color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    margin-top: auto;
    background: #0d0d0d;
    border-top: 2px solid var(--accent);
}

/* CTA banner (superpsx-style help banner) */
.footer-cta {
    background:
        radial-gradient(ellipse 50% 120% at 90% 0%, rgba(230, 62, 32, 0.18), transparent 70%),
        var(--surface);
    border-bottom: 1px solid var(--border);
}

.footer-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 28px;
    padding-bottom: 28px;
    flex-wrap: wrap;
}

.footer-cta-text h3 {
    font-size: 26px;
    color: var(--text);
    margin-bottom: 4px;
}

.footer-cta-text p {
    color: var(--text-muted);
    font-size: 14px;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding: 36px 20px 28px;
}

.footer-title {
    font-size: 17px;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-hover);
    padding-left: 4px;
}

.footer-contact p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 6px;
}

.footer-bottom {
    padding: 18px 20px 26px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.copyright {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 6px;
}

.footer-tips {
    color: var(--text-faint);
    font-size: 12.5px;
    max-width: 720px;
    margin: 0 auto;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 90;
    box-shadow: var(--shadow-accent);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .banner-inner h1 {
        font-size: 46px;
    }
}

/* --- Tablet (≤ 900px): hamburger appears early, nav folds into a slide-down panel,
   the search box moves into the panel (hidden from header, shown inside nav) --- */
@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;         /* push the hamburger all the way to the right edge */
    }

    .header-search {
        display: none;
    }

    .mobile-nav-search {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        z-index: 105;
    }

    .main-nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 20px;
    }

    .nav-link {
        padding: 12px 16px;
    }

    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--accent);
        border-radius: 0;
        margin-left: 14px;
    }

    .header-inner {
        gap: 16px;
    }

    /* Hero: narrower cover column + smaller thumbnails */
    .spsx-slide {
        grid-template-columns: minmax(0, 1fr) 200px;
        gap: 28px;
    }

    .spsx-thumbs {
        width: 200px;
        top: auto;
        bottom: 40px;
    }

    .spsx-thumb {
        flex-basis: 44px;
        width: 44px;
        height: 56px;
    }
}

/* --- Phone (≤ 768px): logo + hamburger on one row; search is only shown inside the panel --- */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: nowrap;
        gap: 10px;
        min-height: 56px;
        padding: 6px 0;
    }

    .mobile-menu-toggle {
        flex-shrink: 0;
        width: 40px;
        height: 38px;
    }

    /* Hero: single column, cover hidden, thumbnails move below the text */
    .spsx-hero {
        height: auto;
        margin: -28px -14px 24px;
    }

    .spsx-hero-in {
        padding: 72px 16px 40px;
    }

    .spsx-slide {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .spsx-slide-txt {
        padding-top: 0;
    }

    .spsx-slide-cover {
        display: none;
    }

    .spsx-slide-t {
        font-size: 32px;
        margin: 12px 0 10px;
    }

    .spsx-slide-p {
        font-size: 15px;
        margin-bottom: 18px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .spsx-slide-act .spsx-cta,
    .spsx-slide-act .spsx-ghost {
        height: 48px;
        padding: 0 18px;
        font-size: 15px;
    }

    .spsx-thumbs {
        position: static;
        width: auto;
        justify-content: flex-start;
        margin-top: 20px;
    }

    /* Local download modal: tighter padding, full-width dialog */
    .local-dl-modal {
        padding: 12px;
    }

    .local-dl-dialog {
        padding: 22px 18px;
        max-height: 92vh;
    }

    .local-dl-title {
        font-size: 15px;
    }

    /* Recently added games: single column on small screens */
    .latest-game-grid {
        grid-template-columns: 1fr;
    }

    .latest-game-cover {
        width: 76px;
    }

    /* Detail header stacks vertically; mobile cover 150x213 */
    .game-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .game-detail-cover {
        width: 150px;
        height: 213px;
    }

    .game-detail-title {
        font-size: 30px;
    }

    .game-detail-meta,
    .game-detail-tags,
    .game-detail-flags {
        justify-content: center;
    }

    .game-full-desc {
        padding: 18px;
    }

    /* Embedded videos: one per row on mobile */
    .game-full-desc iframe,
    .game-full-desc video {
        width: 100%;
    }

    .download-card {
        padding: 18px;
    }

    .banner-img {
        height: 220px;
    }

    .banner-caption {
        padding: 40px 20px 20px;
    }

    .banner-caption h2 {
        font-size: 26px;
    }

    .banner-static {
        padding: 44px 24px;
    }

    .banner-inner h1 {
        font-size: 36px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .footer-cta-inner {
        flex-direction: column;
        text-align: center;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .game-scroll-track {
        grid-auto-columns: 150px;
        gap: 14px;
    }

    .game-card-title {
        font-size: 16px;
    }

    .prev-link,
    .next-link {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }

    .banner-section {
        margin: -28px -14px 28px;
    }

    .banner-inner h1 {
        font-size: 30px;
    }

    .game-detail-title {
        font-size: 26px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .download-btn {
        max-width: 100%;
    }
}
