/* ==========================================================================
   NovelRealm - High Security Anti-Scraping DRM & Fullscreen Reader Stylesheet
   ========================================================================== */

:root {
    /* Color Palette - Premium Dark Mode */
    --bg-main: #060a13;          /* Deep Midnight Navy */
    --bg-card: rgba(18, 26, 43, 0.75); /* Semi-transparent Glass */
    --bg-card-hover: rgba(28, 38, 59, 0.9);
    --bg-header: rgba(6, 10, 19, 0.65); /* Glassmorphism Header */

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-gold: #fbbf24;      /* Brighter Glowing Gold */
    --accent-gold-hover: #f59e0b;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;

    /* OS Native Font Stacks */
    --font-thai-default: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Leelawadee UI', sans-serif;
    --font-thai-serif: 'Noto Serif Thai', 'TH Sarabun New', 'Angsana New', Georgia, serif;
    --font-thai-modern: 'Prompt', 'Bai Jamjuree', sans-serif;

    /* UI Measurements */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ANTI-COPY & SELECTION LOCKDOWN 100% */
.unselectable,
.unselectable * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* PRINT PROTECTION */
@media print {
    html, body {
        display: none !important;
    }
}

/* Content Protection Layer — hide ALL inline elements inside reader paragraphs by default */
.chapter-body-text .unselectable > * {
    display: none !important;
    font-size: 0px !important;
    color: transparent !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* Reset & OS Normalization */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-thai-default);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-x: hidden;
    touch-action: manipulation;
}

/* FULLSCREEN READING MODE STYLES */
body.fullscreen-active .main-header {
    display: none !important;
}

body.fullscreen-active .reader-controls-bar {
    top: 10px !important;
}

body.fullscreen-active .main-wrapper {
    padding-top: 0.5rem !important;
}

body.fullscreen-active .reader-view-container {
    max-width: 1000px !important;
}

.btn-ctrl-fullscreen {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: var(--accent-gold) !important;
    font-weight: 600;
}

.btn-ctrl-fullscreen:hover {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: var(--accent-gold) !important;
}

/* SLIP UPLOAD & ADMIN STYLES */
.slip-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.slip-input-label:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.slip-preview-box {
    text-align: center;
    background: #000;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slip-preview-img {
    max-width: 100%;
    max-height: 250px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.admin-slips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-slip-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.admin-slip-thumb {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
}

.admin-slip-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.admin-slip-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

/* DRM Badge in Header */
.drm-badge {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-green);
    font-weight: 600;
}

/* Utility Helpers */
.hidden { display: none !important; }
.text-primary { color: var(--accent-blue) !important; }
.text-warning { color: var(--accent-gold) !important; }
.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-lg { font-size: 1.25rem; font-weight: 700; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.p-3 { padding: 1rem; }
.style-glass { background: rgba(255, 255, 255, 0.04); border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,0.08); }

/* Custom Scrollbar across OS */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Reading Progress Bar (Fixed Top) */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold));
    transition: width 0.15s ease-out;
}

/* Header & Clean Reader Navigation */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: env(safe-area-inset-top, 0px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--accent-blue);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-thai-modern);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-highlight {
    color: var(--accent-gold);
}

.brand-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--accent-blue);
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Coins Badge */
.coins-badge {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 38px;
}

.coins-badge:hover {
    background: rgba(245, 158, 11, 0.22);
    transform: translateY(-1px);
}

.coin-icon {
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.coin-amount {
    font-family: var(--font-thai-modern);
    font-weight: 700;
    color: var(--accent-gold);
}

.coin-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-topup-mini {
    background: var(--accent-gold);
    color: #000;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
}

/* Touch-Optimized Responsive Buttons */
.btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1.3rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: var(--accent-blue-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-secondary { background: #334155; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-success { background: var(--accent-green); color: #fff; }
.btn-success:hover { background: var(--accent-green-hover); }
.btn-warning { background: var(--accent-gold); color: #000; }
.btn-warning:hover { background: var(--accent-gold-hover); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid #334155; color: var(--text-primary); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); border-color: #64748b; }
.btn-danger-outline { background: transparent; border: 1px solid rgba(239, 68, 68, 0.4); color: var(--accent-red); }
.btn-danger-outline:hover { background: rgba(239, 68, 68, 0.15); }
.btn-block { width: 100%; }
.btn-lg { padding: 0.9rem 1.6rem; font-size: 1.05rem; min-height: 50px; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; min-height: 36px; }
.btn-profile { background: #1e293b; color: var(--text-primary); border: 1px solid #334155; }

/* Main Wrapper */
.main-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease-out; }

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

/* Novel Overview Card */
.novel-overview-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    gap: 2.25rem;
    margin-bottom: 2.25rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.novel-overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(59, 130, 246, 0.15);
}

.novel-overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.novel-cover-wrapper { flex-shrink: 0; }

.novel-cover-art {
    width: 160px;
    aspect-ratio: 499 / 700;
    height: auto;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.cover-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    transition: transform 0.3s ease;
}

.novel-cover-art:hover .cover-image-img {
    transform: scale(1.05);
}

.cover-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.novel-meta-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.novel-category-tag {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.novel-title {
    font-family: var(--font-thai-modern);
    font-size: clamp(1.4rem, 3.5vw, 2.1rem);
    font-weight: 700;
    line-height: 1.3;
}

.novel-author-row {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.novel-synopsis {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 850px;
    white-space: pre-line;
}

.novel-action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Chapters Grid */
.chapters-list-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.chapter-card-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 60px;
}

.chapter-card-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.chapter-card-info h4 {
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chapter-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    white-space: nowrap;
}

.tag-free { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }

/* Reader Controls Bar & Collapsible Customizer */
.reader-controls-bar {
    position: relative;
    top: 0;
    z-index: 90;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

body.fullscreen-active .reader-controls-bar {
    position: relative !important;
    top: 0 !important;
    margin-bottom: 1.5rem !important;
}

.reader-toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.controls-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-ctrl {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--text-primary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-ctrl:hover { background: #334155; }

.btn-ctrl-toggle-panel {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: var(--accent-blue);
    font-weight: 600;
}

.btn-ctrl-toggle-panel:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: var(--accent-blue);
}

.reader-customizer {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 300px;
    opacity: 1;
    overflow: hidden;
}

.reader-customizer.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    border-top: none !important;
    pointer-events: none;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.theme-buttons { display: flex; gap: 0.35rem; }

.btn-theme {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 34px;
}

.theme-light { background: #ffffff; color: #1e293b; }
.theme-sepia { background: #f4ecd8; color: #433422; }
.theme-dark { background: #161b22; color: #c9d1d9; border-color: #30363d; }

.btn-theme.active {
    outline: 2px solid var(--accent-blue);
    font-weight: 700;
}

.font-size-ctrl {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e293b;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid #334155;
}

.btn-ctrl-small {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
}

.form-select-sm {
    background: #1e293b;
    color: var(--text-primary);
    border: 1px solid #334155;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    min-height: 34px;
}

/* Reader Canvas & Watermark Overlay */
.reader-view-container {
    max-width: 860px;
    margin: 0 auto 3rem auto;
    position: relative;
}

.reader-canvas {
    border-radius: var(--radius-md);
    padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1.25rem, 6vw, 4rem);
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    min-height: 600px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.watermark-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-content: space-around;
    opacity: 0.09;
    user-select: none;
}

.watermark-item {
    transform: rotate(-25deg);
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 1.6rem;
    color: currentColor;
}

.reader-canvas.theme-light {
    background-color: #ffffff;
    --reader-bg: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.reader-canvas.theme-sepia {
    background-color: #f4ecd8;
    --reader-bg: #f4ecd8;
    color: #3d2e1e;
    border: 1px solid #e2d9c5;
}

.reader-canvas.theme-dark {
    background-color: #12161a;
    --reader-bg: #12161a;
    color: #d1d5db;
    border: 1px solid #1f2937;
}

.chapter-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid currentColor;
    opacity: 0.9;
}

.chapter-header, .chapter-body-text {
    position: relative;
    z-index: 2;
    /* Create a halo effect using the theme's background color to cleanly mask out the watermark behind the text */
    text-shadow: 
        0 0 2px var(--reader-bg),
        0 0 4px var(--reader-bg),
        0 0 6px var(--reader-bg),
        0 0 10px var(--reader-bg),
        0 0 15px var(--reader-bg),
        0 0 20px var(--reader-bg);
}

.chapter-title-heading {
    font-family: var(--font-thai-modern);
    font-size: clamp(1.4rem, 4vw, 2.1rem);
    font-weight: 700;
    margin-top: 0.75rem;
}

.chapter-body-text p {
    margin-bottom: 1.6rem;
    text-indent: 2rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* F12 Warning Security Modal */
.security-alert-card {
    border: 3px solid var(--accent-red) !important;
    background: #0f172a !important;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.5) !important;
}

.warning-icon-pulse {
    font-size: 4rem;
    color: var(--accent-red);
    animation: pulseIcon 1s infinite alternate;
}

@keyframes pulseIcon {
    from { transform: scale(1); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5)); }
    to { transform: scale(1.15); filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.9)); }
}

.countdown-warning-box {
    background: rgba(239, 68, 68, 0.12);
    border: 2px dashed rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.25rem 0;
}

.countdown-big-number {
    font-family: var(--font-thai-modern);
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--accent-red);
    line-height: 1;
    margin: 0.5rem 0;
}

.unit-sec { font-size: 1.1rem; font-weight: 700; color: var(--accent-red); }

.ban-alert-text {
    font-size: 0.95rem;
    color: #f87171;
    line-height: 1.6;
}

/* Locked Content Paywall */
.locked-paywall-container {
    margin: 3rem 0;
    text-align: center;
}

.paywall-glass-card {
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.paywall-icon-circle {
    width: 65px;
    height: 65px;
    background: rgba(245, 158, 11, 0.15);
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent-gold);
}

.security-shield-notice {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.75rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 600px;
}

.paywall-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-unlock-action {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-weight: 700;
    padding: 0.85rem 1.8rem;
    border-radius: 50px;
    font-size: 1.05rem;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.chapter-footer-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid currentColor;
    opacity: 0.9;
    gap: 0.5rem;
}

.btn-nav-chapter {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 42px;
}

/* Modals & Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeIn 0.2s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-sm { max-width: 440px; }
.modal-md { max-width: 520px; }
.modal-lg { max-width: 780px; }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.btn-close-modal:hover { color: var(--text-primary); }
.modal-body { padding: 1.5rem; }

/* Package Selection Grid */
.package-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.package-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

.package-card:active {
    transform: scale(0.96);
}

@media (hover: hover) {
    .package-card:hover {
        transform: translateY(-4px);
        background: rgba(14, 165, 233, 0.08);
        border-color: rgba(14, 165, 233, 0.5);
        box-shadow: 0 10px 25px rgba(14, 165, 233, 0.2);
    }
}

.package-card.active {
    background: rgba(14, 165, 233, 0.12);
    border-color: #0ea5e9;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4), inset 0 0 10px rgba(14, 165, 233, 0.2);
    transform: scale(1.02);
}

.package-coins {
    font-family: var(--font-thai-modern);
    font-size: 1.2rem;
    font-weight: 700;
    color: #0ea5e9;
}

.package-price { font-size: 0.9rem; color: var(--text-secondary); }

.package-badge {
    position: absolute;
    top: -10px;
    right: 8px;
    background: #0ea5e9;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 50px;
}

/* Premium Animations */
@keyframes lightning-flicker {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px #0ea5e9); }
    3%, 7% { opacity: 0.5; filter: none; }
    5%, 9% { opacity: 1; filter: drop-shadow(0 0 12px #0ea5e9) brightness(1.5); }
    15% { opacity: 1; filter: drop-shadow(0 0 4px #0ea5e9); }
}

.package-coins .fa-bolt-lightning {
    animation: lightning-flicker 4s infinite;
}

@keyframes pulse-highlight {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 15px rgba(14, 165, 233, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.pulse-highlight {
    animation: pulse-highlight 1s ease-out 2;
}

/* PromptPay QR Box */
.promptpay-qr-box {
    background: linear-gradient(145deg, #0f172a, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.promptpay-qr-box::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.merchant-privacy-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.qr-mock-code {
    width: 170px;
    height: 170px;
    margin: 0 auto 1rem auto;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.qr-big-icon { font-size: 6.5rem; color: #000; }

.qr-brand-overlay {
    position: absolute;
    background: #003764;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.qr-payment-details { margin-bottom: 1.25rem; }

.qr-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* Premium Button Class */
.btn-premium-gradient {
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: #fff;
    border: none;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

/* RGB Neon Border Button */
/* RGB Neon Border Button */
.btn-rgb-border {
    position: relative;
    background: transparent;
    z-index: 1;
    transition: transform 0.15s ease, filter 0.15s ease;
    box-shadow: 0 5px 25px rgba(14, 165, 233, 0.5);
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    overflow: hidden;
}

.btn-rgb-border::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 300vw; height: 300vw;
    background: conic-gradient(#ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    animation: rotate-rgb 2.5s linear infinite;
    z-index: -1;
}

.btn-rgb-border:active {
    transform: scale(0.95);
}

@keyframes rotate-rgb {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.btn-premium-gradient:active {
    transform: scale(0.95);
}

@media (hover: hover) {
    .btn-premium-gradient:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(14, 165, 233, 0.6);
        filter: brightness(1.1);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: calc(100vw - 50px);
}

.toast {
    background: #1e293b;
    color: var(--text-primary);
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    animation: slideInRight 0.3s ease-out;
}

.toast-success { border-left-color: var(--accent-green); }
.toast-error { border-left-color: var(--accent-red); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}


/* ULTRA-MODERN AUTH MODAL STYLES */
.modal-auth-modern {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 0;
    max-width: 480px;
    width: 92%;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(59, 130, 246, 0.2);
}

.auth-card-banner {
    position: relative;
    background: linear-gradient(135deg, #1e1b4b, #312e81, #1e293b);
    padding: 2.25rem 1.75rem 1.75rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-banner-glow {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    filter: blur(20px);
}

.auth-banner-icon {
    font-size: 2.8rem;
    color: #818cf8;
    margin-bottom: 0.6rem;
    filter: drop-shadow(0 0 15px rgba(129, 140, 248, 0.5));
}

.auth-card-banner h2 {
    font-family: var(--font-thai-modern);
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.auth-card-banner p {
    font-size: 0.85rem;
    color: #c7d2fe;
}

.btn-close-auth-modern {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-auth-modern:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.auth-modern-tabs {
    display: flex;
    background: #1e293b;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.5rem;
}

.auth-m-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.7rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-m-tab.active {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.form-floating-group {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon-left {
    position: absolute;
    left: 1.1rem;
    color: #64748b;
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
}

.form-control-modern {
    width: 100%;
    padding: 0.85rem 1.1rem 0.85rem 2.8rem;
    border-radius: 12px;
    background: #1e293b;
    border: 1.5px solid #334155;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.form-control-modern:focus {
    outline: none;
    border-color: #6366f1;
    background: #0f172a;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.form-control-modern:focus + .form-icon-left,
.form-floating-group:focus-within .form-icon-left {
    color: #818cf8;
}

.toggle-pass-icon {
    position: absolute;
    right: 1.1rem;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-pass-icon:hover {
    color: #fff;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
    transition: all 0.25s ease;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.5);
}

.btn-success-gradient {
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    transition: all 0.25s ease;
}

.btn-success-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.5);
}

.pass-strength-container {
    font-size: 0.8rem;
}

.pass-strength-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    color: #94a3b8;
}

/* Universal Responsive Breakpoints */
@media (max-width: 900px) {
    .header-container { flex-wrap: wrap; }
    .novel-overview-card { flex-direction: column; text-align: center; align-items: center; padding: 1.5rem; }
    .novel-cover-art { margin: 0 auto; width: 130px; height: auto; aspect-ratio: 499 / 700; }
    .novel-author-row { justify-content: center; }
    .novel-action-buttons { justify-content: center; }
    .reader-controls-bar { top: 55px; padding: 0.5rem 0.75rem; }
    .reader-customizer { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .control-item { justify-content: space-between; }
    .admin-slip-card { flex-direction: column; text-align: center; }
    .admin-slip-thumb { width: 100%; height: 180px; }
}

@media (max-width: 600px) {
    .header-container { padding: 0.5rem 0.85rem; }
    .brand-name { font-size: 1.15rem; }
    .brand-tagline { display: none; }
    .main-nav { overflow-x: auto; width: 100%; padding-bottom: 0.25rem; }
    .header-actions { width: 100%; justify-content: center; margin-top: 0.4rem; flex-wrap: wrap; gap: 0.4rem; }
    .drm-badge-text { display: none; }
    .drm-badge { padding: 0.4rem 0.6rem; }
    .coins-badge { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
    .btn-profile { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
    
    .novel-title { font-size: 1.35rem; }
    .chapters-grid { grid-template-columns: 1fr; }
    .reader-canvas { padding: 1.25rem 0.85rem; }
    
    /* Reader Toolbar Mobile Optimizations */
    .reader-toolbar-header { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .controls-group { justify-content: center; flex-wrap: wrap; width: 100%; gap: 0.4rem; }
    .btn-ctrl { padding: 0.5rem 0.6rem; font-size: 0.85rem; flex: 1 1 auto; justify-content: center; }
    .btn-ctrl-toggle-panel { width: 100%; justify-content: center; padding: 0.6rem; font-size: 0.9rem; }
    
    .paywall-glass-card { padding: 1.75rem 1rem; }
    .paywall-actions { flex-direction: column; width: 100%; }
    .btn-unlock-action { width: 100%; }
    .toast-container { left: 15px; right: 15px; bottom: 15px; max-width: none; }

    /* Mobile Auth & Register Modal Optimizations */
    .modal-backdrop {
        padding: 0.75rem 0.5rem;
        align-items: flex-start;
        padding-top: max(0.85rem, env(safe-area-inset-top, 0.85rem));
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    }
    .modal-auth-modern {
        width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 18px;
    }
    .auth-card-banner {
        padding: 1.25rem 1rem 1rem !important;
    }
    .auth-banner-icon {
        font-size: 2.2rem !important;
        margin-bottom: 0.3rem !important;
    }
    .auth-card-banner h2 {
        font-size: 1.2rem !important;
    }
    .auth-card-banner p {
        font-size: 0.8rem !important;
    }
    .modal-body.p-4 {
        padding: 1rem !important;
    }
    .auth-modern-tabs {
        margin-bottom: 1rem;
    }
    .auth-m-tab {
        padding: 0.55rem 0.4rem;
        font-size: 0.85rem;
    }
    .form-floating-group {
        margin-top: 0.6rem !important;
    }
    .form-control-modern {
        padding: 0.7rem 0.85rem 0.7rem 2.5rem;
        font-size: 0.9rem;
    }
    .captcha-box {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 0.6rem !important;
    }
    .captcha-box input {
        width: 100% !important;
    }
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }
}

/* --- VIRTUAL GIFTING SYSTEM --- */
.gift-modal-card { max-width: 480px; width: 90%; background: #0f172a !important; border: 1px solid #334155; border-radius: 16px; padding: 1.8rem; box-shadow: 0 20px 40px rgba(0,0,0,0.7); position: relative; }
.gift-modal-title { text-align: center; color: #fff; margin-bottom: 0.5rem; }
.gift-modal-subtitle { text-align: center; color: #94a3b8; font-size: 0.9rem; margin-bottom: 1.5rem; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }
.gift-item { background: rgba(30, 41, 59, 0.8); border: 1px solid #334155; border-radius: 12px; padding: 1rem; text-align: center; cursor: pointer; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gift-item:hover { transform: translateY(-5px) scale(1.05); border-color: #f59e0b; box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2); background: rgba(245, 158, 11, 0.1); }
.gift-icon { margin-bottom: 0.75rem; }
.gift-img { width: 80px; height: 80px; object-fit: cover; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.4); border: 2px solid transparent; transition: all 0.3s ease; }
.gift-item:hover .gift-img { box-shadow: 0 0 15px rgba(245,158,11,0.6); border-color: #f59e0b; }
.gift-name { color: #fff; font-size: 0.9rem; font-weight: bold; margin-bottom: 0.25rem; }
.gift-price { color: #f59e0b; font-size: 0.8rem; }
.glow-effect { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8)); }
.glow-text { text-shadow: 0 0 8px rgba(245, 158, 11, 0.8); color: #fbbf24; }
.floating-gift { position: fixed; z-index: 10001; left: 50%; bottom: 10%; pointer-events: none; animation: floatUp 3.5s cubic-bezier(0.25, 1, 0.5, 1) forwards; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.floating-gift img { width: 140px; height: 140px; border-radius: 24px; box-shadow: 0 0 30px rgba(245,158,11,0.5); border: 3px solid #fbbf24; }
.gift-sender-message { position: absolute; bottom: -40px; left: 50%; transform: translateX(-50%); width: max-content; text-align: center; font-size: 1.25rem; font-weight: bold; color: #fbbf24; text-shadow: 0px 2px 8px rgba(0,0,0,0.9); }
@keyframes floatUp { 
    0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; } 
    10% { transform: translate(-50%, -10vh) scale(1.2); opacity: 1; } 
    50% { transform: translate(-50%, -40vh) scale(1); opacity: 0.9; } 
    100% { transform: translate(-50%, -80vh) scale(0.8); opacity: 0; } 
}


/* Profile & History Modal Styling */
.profile-summary-header { display: flex; align-items: center; gap: 1.5rem; background: rgba(255,255,255,0.03); padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: white; box-shadow: 0 4px 15px rgba(59,130,246,0.3); }
.profile-info-text { flex: 1; }
.profile-info-text h3 { margin: 0 0 0.2rem 0; font-size: 1.3rem; color: #f8fafc; }
.profile-info-text p { margin: 0 0 0.5rem 0; color: #94a3b8; font-size: 0.9rem; }
.profile-coins-card { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); border-radius: 10px; padding: 1rem; text-align: center; min-width: 150px; }
.profile-coins-card .label { font-size: 0.8rem; color: #fbbf24; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.profile-coins-card .amount { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 0.5rem 0; }
.history-logs-section { background: rgba(15, 23, 42, 0.5); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); overflow: hidden; }
.history-tab-buttons { display: flex; border-bottom: 1px solid rgba(255,255,255,0.05); }
.hist-btn { flex: 1; background: transparent; border: none; padding: 1rem; color: #94a3b8; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.hist-btn:hover { color: #f8fafc; background: rgba(255,255,255,0.02); }
.hist-btn.active { color: #3b82f6; border-bottom: 2px solid #3b82f6; background: rgba(59, 130, 246, 0.05); }
.history-list-box { display: none; max-height: 300px; overflow-y: auto; padding: 0.5rem; }
.history-list-box.active { display: block; }
.history-list-box::-webkit-scrollbar { width: 6px; }
.history-list-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.history-item-row { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); display: flex; justify-content: space-between; align-items: center; border-radius: 8px; transition: background 0.2s; }
.history-item-row:hover { background: rgba(255,255,255,0.02); }
.history-item-row:last-child { border-bottom: none; }

/* --- ADMIN DASHBOARD MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* Header Card adjustments */
    .admin-header-card { 
        flex-direction: column; 
        align-items: center; 
        gap: 1.2rem; 
        text-align: center;
        padding: 1.25rem 1rem;
    }
    .admin-header-card > div {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0.5rem;
    }
    .admin-header-card h2 {
        font-size: 1.25rem !important;
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
    }
    
    /* KPI Cards scaling */
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Tabs scrolling to prevent squishing */
    .admin-nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    /* Make tables horizontally scrollable */
    .admin-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Tab content headers (flexbox with titles and buttons) */
    .style-glass[style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
        text-align: center;
    }
    .style-glass[style*="justify-content: space-between"] > div {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        width: 100%;
    }
    .style-glass[style*="justify-content: space-between"] h3,
    .style-glass[style*="justify-content: space-between"] h4,
    .style-glass[style*="justify-content: space-between"] span {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
        display: block;
    }
    .style-glass[style*="justify-content: space-between"] button {
        flex: 1;
        white-space: nowrap;
    }

    /* Modals */
    .modal-card {
        width: 95%;
        margin: 2rem auto;
        padding: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    /* Stack KPI cards on very small screens */
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

.rgb-border-inner {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.rgb-border-inner.p-large {
    padding: 1rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.rgb-border-inner.p-medium {
    padding: 0.8rem;
    font-size: 1.1rem;
    font-weight: bold;
}
