/*
Theme Name: aixxx.site
Theme URI: https://aixxx.site
Author: aixxx.site
Author URI: https://aixxx.site
Description: A modern dark-themed content platform WordPress theme. Features a top navigation, ranked content lists, new release grids, episode management with video links, and front-end user registration. Suitable for content platforms and series libraries.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: s18-style
Tags: dark, entertainment, two-columns, custom-menu, featured-images, translation-ready
*/

:root {
    --bg: #0b0d12;
    --bg-elevated: #14171f;
    --bg-card: #1a1e29;
    --bg-card-hover: #222737;
    --border: #2a3040;
    --text: #e8eaf0;
    --text-muted: #8b93a7;
    --text-dim: #5d6478;
    --primary: #e11d74;
    --primary-hover: #f5338a;
    --accent: #7c3aed;
    --gold: #f5b50a;
    --green: #22c55e;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --max-width: 1280px;
    --header-h: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", "Noto Sans Thai", "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

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

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

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

/* ===== Search form ===== */
.search-form {
    display: flex;
    align-items: center;
}

.search-field {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    padding: 8px 16px;
    font-size: 14px;
    font-family: inherit;
    width: 180px;
    transition: all 0.15s ease;
}

.search-field:focus {
    outline: none;
    border-color: var(--primary);
    width: 220px;
}

.search-field::placeholder {
    color: var(--text-dim);
}

@media (max-width: 600px) {
    .search-field {
        width: 120px;
    }
    .search-field:focus {
        width: 140px;
    }
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex;
    align-items: center;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.site-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav > ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: max-content;
}

.main-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: all 0.15s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--bg-card);
    color: var(--text);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* ===== Hero ===== */
.hero {
    padding: 48px 0 32px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 17px;
    max-width: 640px;
    margin: 0 auto;
}

/* ===== Sections ===== */
.section {
    padding: 32px 0;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.section-head h2 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-head h2 .emoji {
    font-size: 20px;
}

.section-head .view-all {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

.section-head .view-all:hover {
    color: var(--primary-hover);
}

/* ===== Ranked List ===== */
.ranked-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.rank-card {
    display: flex;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.rank-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.rank-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dim);
    line-height: 1;
    min-width: 36px;
    flex-shrink: 0;
}

.rank-card.top-3 .rank-number {
    background: linear-gradient(135deg, var(--gold), #ff8a00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rank-thumb {
    width: 72px;
    height: 96px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.rank-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rank-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rank-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.badge-18 {
    background: var(--primary);
    color: #fff;
}

.badge-tag {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-rank {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 6px;
    top: 8px;
    left: 8px;
}

.badge-rank.badge-rank-top3 {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

/* ===== Grid (new releases) ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-elevated);
    object-fit: cover;
    display: block;
}

.card-thumb-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.card-thumb-wrap .badge {
    position: absolute;
    top: 8px;
    left: 8px;
}

.card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

/* ===== Character Cards (trending) ===== */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.char-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.char-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.char-thumb {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: cover;
    background: var(--bg-elevated);
}

.char-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.char-tag {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    margin-bottom: 8px;
}

.char-stats {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.char-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.char-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

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

.char-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease;
}

.char-cta:hover {
    background: var(--primary-hover);
    color: #fff;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 0 24px;
    margin-top: 48px;
    background: var(--bg-elevated);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

/* ===== Single / Archive ===== */
.page-head {
    padding: 40px 0 24px;
}

.page-head h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-head p {
    color: var(--text-muted);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    padding: 24px 0;
}

.single-content {
    padding: 32px 0;
    max-width: 820px;
    margin: 0 auto;
}

.single-content h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 12px;
}

.single-content .meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.single-content .post-thumb-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 3 / 4;
    margin: 0 auto 24px;
    overflow: hidden;
    border-radius: var(--radius);
}

.single-content .post-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.single-content .entry {
    font-size: 16px;
    line-height: 1.8;
}

.single-content .entry p {
    margin-bottom: 18px;
}

.single-content .entry h2 {
    font-size: 24px;
    margin: 28px 0 14px;
}

/* ===== User menu (header, logged-in) ===== */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.user-chip:hover {
    border-color: var(--primary);
    color: var(--text);
}

.user-avatar {
    border-radius: 50%;
    width: 28px !important;
    height: 28px !important;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .user-name {
        display: none;
    }
    .user-chip {
        padding: 4px;
    }
}

/* ===== Auth page ===== */
.auth-wrap {
    max-width: 440px;
    margin: 48px auto 32px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.auth-tab:hover {
    color: var(--text);
}

.auth-tab.active {
    color: var(--text);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.auth-panel {
    display: none;
    padding: 28px;
}

.auth-panel.is-active {
    display: block;
    animation: authFade 0.2s ease;
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.15s ease;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.15);
}

.form-input::placeholder {
    color: var(--text-dim);
}

.form-field-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.form-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.form-link:hover {
    color: var(--primary-hover);
}

.form-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: -4px;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 4px;
}

.auth-notice {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.auth-notice.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.auth-notice.success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.auth-notice ul {
    margin: 6px 0 0 18px;
}

.auth-back {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-back a:hover {
    color: var(--primary);
}

/* ===== Episode list (single post & episode page) ===== */
.series-episodes {
    margin: 32px 0;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.series-episodes h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.episode-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    counter-reset: ep;
}

.series-episode-item {
    display: none;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.series-episode-item.is-active {
    display: block;
}

.series-episode-item h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.series-episode-item .episode-player {
    margin-bottom: 0;
}

.episode-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.episode-list li a:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(2px);
}

.episode-list li.current a {
    border-color: var(--primary);
    background: rgba(225, 29, 116, 0.1);
}

.ep-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.episode-list li.current .ep-num {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.ep-name {
    flex: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ep-play {
    color: var(--primary);
    font-size: 12px;
    flex-shrink: 0;
}

/* ===== Episode page ===== */
.episode-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 0;
}

.episode-breadcrumb {
    margin-bottom: 16px;
    font-size: 14px;
}

.episode-breadcrumb a {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.episode-breadcrumb a:hover {
    color: var(--primary);
}

.episode-title {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.3;
}

.episode-series-name {
    font-size: clamp(13px, 2.5vw, 15px);
    font-weight: 500;
    color: var(--text-muted);
}

.episode-ep-name {
    font-size: clamp(20px, 4vw, 28px);
}

.episode-meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.episode-meta strong {
    color: var(--text);
}

/* ===== Video player (vertical 9:16) ===== */
.episode-player {
    position: relative;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 9 / 16;
    width: 100%;
    max-width: 420px;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.episode-player iframe,
.episode-player video {
    width: 100%;
    height: 100%;
    border: none;
}

.episode-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.episode-video {
    background: #000;
}

.episode-link-fallback,
.episode-no-link {
    color: var(--text-muted);
    font-size: 15px;
    text-align: center;
    padding: 40px 20px;
}

.episode-thumb {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.episode-content {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.episode-content p {
    margin-bottom: 18px;
}

/* ===== Preview overlay (30-second trial) ===== */
.episode-player.player-preview {
    position: relative;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

/* Play gate button — shown before user clicks play */
.play-gate-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(11,13,18,0.6), rgba(26,30,41,0.8));
    border: none;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    pointer-events: auto;
    transition: background 0.2s ease;
}

.play-gate-btn:hover {
    background: linear-gradient(135deg, rgba(225,29,116,0.15), rgba(124,58,237,0.2));
}

.play-gate-btn:hover .play-icon {
    transform: scale(1.1);
}

.play-icon {
    color: var(--primary);
    filter: drop-shadow(0 4px 12px rgba(225,29,116,0.5));
    transition: transform 0.2s ease;
}

.play-gate-text {
    font-size: 16px;
    font-weight: 700;
    margin-top: 4px;
}

.play-gate-hint {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.play-gate-source {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Play gate container (placeholder before iframe loads) */
.play-gate {
    width: 100%;
    height: 100%;
    background: #000;
}

/* Timer badge */
.preview-timer {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.timer-icon {
    font-size: 14px;
}

/* Progress bar at bottom of player */
.preview-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 11;
}

.preview-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 1s linear;
}

/* Lock overlay */
.preview-lock {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(11, 13, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    animation: lockFade 0.4s ease;
    padding: 20px;
}

@keyframes lockFade {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.preview-lock-inner {
    text-align: center;
    padding: clamp(20px, 4vw, 36px);
    max-width: 380px;
    width: 100%;
}

.lock-icon {
    font-size: clamp(36px, 8vw, 52px);
    margin-bottom: 14px;
    line-height: 1;
}

.preview-lock-inner h3 {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.3;
}

.preview-lock-inner p {
    color: var(--text-muted);
    font-size: clamp(13px, 3vw, 15px);
    margin-bottom: 24px;
    line-height: 1.5;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.preview-actions .btn {
    width: 100%;
    max-width: 280px;
    padding: 13px 24px;
    font-size: 15px;
    justify-content: center;
}

/* When locked, cover entire player */
.preview-overlay.locked {
    pointer-events: auto;
}

/* ===== Episode prev/next nav ===== */
.episode-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 32px 0;
}

.ep-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.15s ease;
    min-width: 0;
}

.ep-nav-link:not(.ep-nav-disabled):hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.ep-nav-next {
    text-align: right;
}

.ep-nav-disabled {
    opacity: 0.4;
    cursor: default;
}

.ep-nav-label {
    font-size: 12px;
    color: var(--text-muted);
}

.ep-nav-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-list-section {
    margin: 32px 0;
}

.episode-list-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

/* ===== Membership page ===== */
.membership-page {
    max-width: 480px;
    margin: 48px auto 32px;
}

.membership-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.membership-card.is-valid {
    border-color: rgba(34, 197, 94, 0.3);
}

.membership-card.is-expired {
    border-color: rgba(239, 68, 68, 0.3);
}

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

.mem-avatar {
    border-radius: 50%;
    width: 64px !important;
    height: 64px !important;
    border: 2px solid var(--border);
}

.membership-user h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.membership-email {
    font-size: 14px;
    color: var(--text-muted);
}

.membership-status {
    margin-bottom: 20px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}

.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-expired {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.status-admin {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.membership-info {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--text-muted);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
}

.text-danger {
    color: #fca5a5;
}

.membership-expired-notice,
.membership-warning-notice {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
}

.membership-expired-notice {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.membership-warning-notice {
    background: rgba(245, 181, 10, 0.1);
    border: 1px solid rgba(245, 181, 10, 0.3);
}

.membership-expired-notice h3,
.membership-warning-notice h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.membership-expired-notice p,
.membership-warning-notice p {
    font-size: 14px;
    color: var(--text-muted);
}

.membership-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.membership-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* LINE button */
.btn-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #06c755;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-line:hover {
    background: #05b04c;
    color: #fff;
}

.line-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #06c755;
    font-weight: 800;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.copy-hint {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
}

.line-cta {
    margin-top: 12px;
}

.line-empty {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

.membership-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

/* Expiry notice bar (top of page) */
.s18-expiry-notice {
    background: rgba(245, 181, 10, 0.15);
    border-bottom: 1px solid rgba(245, 181, 10, 0.3);
    color: #fde68a;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
}

.s18-expiry-notice a {
    color: var(--primary);
    font-weight: 600;
    margin-left: 4px;
}

.s18-expiry-notice a:hover {
    color: var(--primary-hover);
}

/* ===== Hits page ===== */
.page-header {
    text-align: center;
    margin: 32px 0 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 15px;
}

.hits-filter {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hits-tab {
    padding: 8px 20px;
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.hits-tab:hover {
    color: var(--text);
    border-color: var(--primary);
}

.hits-tab.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.card-hits .views-count {
    color: var(--primary);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.pagination .page-numbers:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-numbers.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .main-nav {
        display: none;
    }

    .main-nav.open {
        display: flex;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        padding: 12px;
        gap: 4px;
    }

    .main-nav.open > ul {
        width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav.open a {
        width: 100%;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-actions .btn-ghost {
        display: none;
    }
}

@media (max-width: 600px) {
    .site-header .container {
        gap: 8px;
        padding: 0 12px;
    }

    .site-logo {
        font-size: 19px;
    }

    .header-actions {
        gap: 6px;
        margin-left: auto;
    }

    .search-field {
        max-width: 120px;
    }

    .container {
        padding: 0 16px;
    }

    .single-content {
        padding: 24px 0;
    }

    .single-content h1 {
        font-size: clamp(23px, 7vw, 30px);
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .single-content .post-thumb-wrap {
        max-width: 100%;
    }

    .series-episodes {
        padding: 16px;
        margin: 24px 0;
    }

    .series-episodes h2 {
        font-size: 18px;
    }

    .series-episode-item {
        scroll-margin-top: calc(var(--header-h) + 12px);
    }

    .hero {
        padding: 32px 0 16px;
    }

    .ranked-list {
        grid-template-columns: 1fr;
    }

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

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

    .section-head h2 {
        font-size: 18px;
    }

    /* Episode page mobile */
    .episode-page {
        padding: 16px 0;
    }

    .episode-player {
        border-radius: 10px;
        margin-bottom: 16px;
        max-width: 100%;
        max-height: 70vh;
    }

    .preview-timer {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 12px;
    }

    .preview-lock-inner {
        padding: 20px 16px;
    }

    .preview-actions .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .play-gate-text {
        font-size: 15px;
    }

    .play-gate-hint {
        font-size: 12px;
    }

    .play-icon {
        width: 52px !important;
        height: 52px !important;
    }

    /* Stack prev/next nav vertically on mobile */
    .episode-nav {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ep-nav-next {
        text-align: left;
    }

    .ep-nav-link {
        padding: 12px 14px;
    }

    /* Episode list: 2 columns on mobile */
    .episode-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .episode-list li a {
        padding: 8px 10px;
    }

    .ep-name {
        font-size: 13px;
    }

    /* Membership page mobile */
    .membership-page {
        margin: 24px auto;
    }

    .membership-card {
        padding: 20px 16px;
    }

    .membership-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .membership-actions {
        flex-direction: column;
    }

    .membership-actions .btn {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .episode-title {
        gap: 2px;
    }

    .preview-timer {
        font-size: 11px;
        padding: 4px 8px;
    }

    .lock-icon {
        font-size: 36px;
    }

    .preview-lock-inner h3 {
        font-size: 17px;
    }
}
