:root {
    --bg: #080b14;
    --bg-alt: #0e0a1f;
    --panel: #121026;
    --panel-2: #1a1535;
    --panel-3: #262048;
    --text: #f6f8fc;
    --muted: #a99fc9;
    --accent: #38bdf8;
    --accent-2: #22d3ee;
    --ac: #38bdf8;
    --ac2: #22d3ee;
    --accent-soft: rgba(56, 189, 248, 0.14);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.12);
    --border: rgba(56, 189, 248, 0.16);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    --radius: 24px;
    --radius-sm: 12px;
    --radius-xs: 10px;
    --container: 1240px;
    --sidebar-bg: #0d0a1d;
    --sidebar-hover: rgba(255,255,255,0.04);
    --sidebar-active: rgba(56,189,248,0.12);
    --sidebar-text: #a99fc9;
    --sidebar-text-active: #f6f8fc;
    --glass-bg: rgba(13, 10, 29, 0.85);
}

:root.light, html.light {
    --bg: #f4f2fb;
    --bg-alt: #ffffff;
    --panel: #ffffff;
    --panel-2: #e6f7fd;
    --panel-3: #d3eefc;
    --text: #10202e;
    --muted: #4f7189;
    --accent: #0ea5e9;
    --accent-2: #0891b2;
    --ac: #0ea5e9;
    --ac2: #0891b2;
    --accent-soft: rgba(14, 165, 233, 0.1);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --border: rgba(14, 165, 233, 0.14);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.06);
    --sidebar-bg: #ffffff;
    --sidebar-hover: rgba(14,165,233,0.05);
    --sidebar-active: rgba(14,165,233,0.12);
    --sidebar-text: #6b6590;
    --sidebar-text-active: #1c1a2e;
    --glass-bg: rgba(255, 255, 255, 0.9);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 26%),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 24%),
        radial-gradient(circle at bottom center, rgba(34, 211, 238, 0.06), transparent 40%),
        linear-gradient(180deg, #121026 0%, #080b14 44%, #05070d 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

iframe {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    line-height: 1.15;
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

strong {
    color: var(--text);
}

code,
pre {
    font-family: Consolas, "Courier New", monospace;
}

.container {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

.page-shell {
    padding: 28px 0 70px;
}

.stack-lg {
    display: grid;
    gap: 24px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(5, 9, 17, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
}

.nav-shell,
.nav-links,
.action-row,
.tag-row,
.pill-row,
.section-headline {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-shell {
    justify-content: space-between;
    min-height: 74px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark__icon,
.avatar-orb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5), transparent 32%),
        linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #08111c;
    font-size: 1.1rem;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(88, 166, 255, 0.22);
}

.brand-mark__image,
.profile-avatar-image {
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark__image {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.brand-mark strong {
    display: block;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-mark small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-toggle-button {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.nav-toggle-button span {
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
}

.nav-links a {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    transition: color 0.18s ease, opacity 0.18s ease;
    opacity: 0.9;
}

.nav-links a:hover {
    color: var(--accent);
    opacity: 1;
}

.nav-pill,
.btn,
button,
.pill-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    cursor: pointer;
    font-weight: 700;
    transition:
        transform 0.18s ease,
        opacity 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.nav-pill:hover,
.btn:hover,
button:hover,
.pill-link:hover {
    transform: translateY(-1px);
}

.btn-primary,
.nav-pill {
    background: linear-gradient(135deg, var(--accent), #9bf7dc 55%, var(--accent-2));
    color: #07121d;
    box-shadow: 0 14px 30px rgba(124, 246, 211, 0.22);
}

.btn-secondary,
.pill-link {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-danger {
    background: var(--danger-soft);
    color: #ffe0e0;
    border: 1px solid rgba(255, 107, 107, 0.34);
}

.panel,
.hero-banner,
.auth-panel,
.profile-hero-card,
.admin-hero,
.stats-hero {
    background: linear-gradient(180deg, rgba(20, 28, 44, 0.96), rgba(12, 17, 29, 0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel,
.auth-panel,
.admin-hero {
    padding: 20px;
}

.panel-soft {
    background: rgba(255, 255, 255, 0.025);
}

.panel-accent {
    background:
        radial-gradient(circle at top right, rgba(124, 246, 211, 0.12), transparent 35%),
        linear-gradient(145deg, rgba(88, 166, 255, 0.14), rgba(10, 18, 32, 0.92));
}

.panel-accent .btn {
    margin-top: 18px;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.hero-copy h1,
.admin-hero h1,
.details-hero__copy h1 {
    font-size: clamp(2.3rem, 4.4vw, 4rem);
    line-height: 1;
    margin-bottom: 14px;
}

.hero-copy .hero-text {
    max-width: 62ch;
}

.hero-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.hero-banner,
.details-hero,
.watch-layout,
.content-grid {
    display: grid;
    gap: 24px;
}

.hero-banner {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    padding: 34px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.hero-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(7, 11, 20, 0.86) 28%, rgba(7, 11, 20, 0.48) 58%, rgba(7, 11, 20, 0.2) 100%);
    pointer-events: none;
    z-index: -1;
}

.search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    margin-top: 24px;
}

form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: rgba(8, 12, 22, 0.9);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(103, 232, 214, 0.5);
    box-shadow: 0 0 0 3px rgba(103, 232, 214, 0.08);
}

textarea {
    min-height: 160px;
    resize: vertical;
}

.spotlight-card {
    position: relative;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 500px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.spotlight-card img {
    width: 100%;
    height: 100%;
    min-height: 500px;
    object-fit: cover;
    transform: scale(1.03);
}

.spotlight-overlay {
    position: absolute;
    inset: auto 0 0;
    padding: 28px;
    background: linear-gradient(180deg, transparent 10%, rgba(4, 8, 15, 0.96));
}

.spotlight-overlay h2 {
    margin: 12px 0 8px;
    font-size: 2rem;
}

.section-headline {
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-headline h2 {
    font-size: 1.55rem;
}

.pill,
.meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 11px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pill-soft {
    background: var(--accent-soft);
    color: var(--accent);
}

.pill-link {
    border: 1px solid transparent;
}

.pill-link.is-active,
.feed-item--active {
    border-color: var(--accent);
    background: rgba(103, 232, 214, 0.12);
}

.content-grid,
.watch-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
}

/* =============================================
   IMPROVED ANIME LIST UI
   - Clean grid, consistent cards, better badges
   - Perfect image aspect ratio & spacing
   - Responsive & hover effects
   ============================================= */

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 28px 20px;
    margin-top: 8px;
}

.anime-card {
    background: transparent;
    border-radius: 24px;
    transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;
    position: relative;
}

.anime-card:hover {
    transform: translateY(-6px);
}

.anime-card__media {
    position: relative;
    display: block;
    border-radius: 20px;
    overflow: hidden;
    background: var(--panel-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.25s ease;
}

.anime-card:hover .anime-card__media {
    box-shadow: 0 20px 32px -14px rgba(0, 0, 0, 0.6);
}

.anime-card img {
    width: 100%;
    aspect-ratio: 2 / 2.8;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.anime-card:hover img {
    transform: scale(1.03);
}

.anime-card__badges {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.anime-mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    padding: 0 8px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.anime-mini-badge--dark {
    background: rgba(124, 246, 211, 0.9);
    color: #07121d;
    border: none;
}

.anime-card__body {
    padding: 14px 8px 8px 8px;
}

.anime-card h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}

.anime-card h3 a {
    color: var(--text);
    transition: color 0.2s ease;
}

.anime-card h3 a:hover {
    color: var(--accent);
}

.anime-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.anime-card__dot {
    width: 3px;
    height: 3px;
    background: var(--muted);
    border-radius: 50%;
    opacity: 0.6;
}

.anime-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(124, 246, 211, 0.12);
    padding: 4px 10px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    border: 0.5px solid rgba(124, 246, 211, 0.3);
}

/* =============================================
   END OF ANIME LIST UI IMPROVEMENTS
   ============================================= */

.feed-list,
.ranking-list {
    display: grid;
    gap: 12px;
}

.feed-item,
.ranking-item {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.feed-item {
    grid-template-columns: 76px minmax(0, 1fr);
}

.ranking-item {
    grid-template-columns: 36px 76px minmax(0, 1fr);
}

.feed-item img,
.ranking-item img {
    width: 76px;
    height: 96px;
    border-radius: 14px;
    object-fit: cover;
}

.feed-item strong,
.ranking-item strong {
    display: block;
    margin-bottom: 4px;
    line-height: 1.35;
}

.feed-item p,
.ranking-item p {
    font-size: 0.84rem;
    line-height: 1.45;
}

.ranking-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(103, 232, 214, 0.1);
    color: var(--accent);
    font-weight: 800;
}

.details-hero {
    grid-template-columns: 300px minmax(0, 1fr);
    background:
        radial-gradient(circle at top right, rgba(124, 246, 211, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(20, 28, 44, 0.96), rgba(12, 17, 29, 0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.details-hero > img {
    width: 100%;
    border-radius: 20px;
    aspect-ratio: 3 / 4.2;
    object-fit: cover;
}

.details-hero__copy {
    min-width: 0;
}

.details-hero__copy .tag-row {
    margin: 16px 0;
}

.details-hero__copy > p {
    margin-bottom: 18px;
}

.stats-grid,
.stats-hero,
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.stats-grid div,
.stat-box,
.info-grid div {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, rgba(124, 246, 211, 0.08), rgba(88, 166, 255, 0.08));
}

.stats-grid span,
.stat-box span,
.info-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.stats-grid strong,
.stat-box strong,
.info-grid strong {
    font-size: 1.05rem;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.episode-card {
    display: block;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--panel);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.episode-card img {
    width: 100%;
    height: 162px;
    object-fit: cover;
}

.episode-card > div {
    padding: 14px;
}

.episode-card h3 {
    margin: 10px 0 8px;
    font-size: 1rem;
    line-height: 1.35;
}

.video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius);
    background: #05070d;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}

.server-board {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.server-board > div {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.server-board strong {
    display: block;
    margin-bottom: 10px;
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.comment-form {
    margin-bottom: 18px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-inline input[type="checkbox"] {
    width: auto;
}

.comment-item__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.comment-item:last-child {
    border-bottom: 0;
}

.comment-item strong {
    display: block;
    margin-bottom: 6px;
}

.profile-hero-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(124, 246, 211, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(20, 28, 44, 0.96), rgba(12, 17, 29, 0.98));
}

.avatar-orb {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 22px;
    font-size: 2rem;
}

.profile-avatar-image {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 22px;
}

.role-pill--green {
    background: rgba(56, 214, 111, 0.16);
    color: #8ef0ad;
    border-color: rgba(56, 214, 111, 0.35);
}

.role-badge--super-admin {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(251, 191, 36, 0.22));
    color: #fecaca;
}

.role-badge--content-admin {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(34, 211, 238, 0.22));
    color: #bfdbfe;
}

.role-badge--moderator {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(16, 185, 129, 0.22));
    color: #bbf7d0;
}

.role-badge--user {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(71, 85, 105, 0.24));
    color: #e2e8f0;
}

.role-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.role-icon-badge.role-badge--super-admin,
.role-badge--super-admin.role-icon-badge {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), 0 0 18px rgba(239, 68, 68, 0.65), inset 0 0 10px rgba(239, 68, 68, 0.3);
    animation: roleBadgeGlow 1.8s ease-in-out infinite;
}

.role-icon-badge.role-badge--content-admin,
.role-badge--content-admin.role-icon-badge {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), 0 0 16px rgba(59, 130, 246, 0.6), inset 0 0 10px rgba(34, 211, 238, 0.28);
    animation: roleBadgeGlow 2s ease-in-out infinite;
    border-color: rgba(59, 130, 246, 0.5);
}

.role-icon-badge.role-badge--moderator {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), 0 0 14px rgba(34, 197, 94, 0.5), inset 0 0 8px rgba(34, 197, 94, 0.25);
    animation: roleBadgeGlow 2.2s ease-in-out infinite;
    border-color: rgba(34, 197, 94, 0.45);
}

@keyframes roleBadgeGlow {
    0%, 100% { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), 0 0 12px currentColor; }
    50% { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), 0 0 26px currentColor, 0 0 40px currentColor; }
}

.forum-mini-badge.role-badge--super-admin,
.forum-mini-badge.role-badge--content-admin,
.forum-mini-badge.role-badge--moderator {
    border-width: 2px;
    animation: roleBadgeGlow 1.8s ease-in-out infinite;
    color: #fbbf24;
}

.profile-link-inline {
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

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

.verification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.28), rgba(34, 211, 238, 0.2));
    color: #dbeafe;
    border: 1px solid rgba(147, 197, 253, 0.35);
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.18);
}

.auth-shell {
    width: min(620px, calc(100% - 32px));
    margin: 0 auto;
}

.form-shell {
    max-width: 900px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-inline-form {
    display: contents;
}

.user-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.chart-grid,
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.chart-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.chart-bars {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.chart-bar-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 36px;
    gap: 12px;
    align-items: center;
}

.chart-bar-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.chart-bar-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.checkbox-grid {
    display: grid;
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.checkbox-grid input[type="checkbox"] {
    width: auto;
}

.feed-item--stack {
    grid-template-columns: 1fr;
}

.notice {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(103, 232, 214, 0.1);
    border: 1px solid rgba(103, 232, 214, 0.32);
    color: var(--text);
}

.danger {
    background: var(--danger-soft);
    border-color: rgba(255, 107, 107, 0.4);
}

pre {
    overflow-x: auto;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 30px 0;
    color: var(--muted);
    background: rgba(3, 5, 10, 0.46);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.footer-grid strong {
    display: block;
    margin-bottom: 6px;
}

.footer-grid p a {
    color: var(--text);
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin: 0 0 20px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-col ul a:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--muted);
}

.footer-bottom strong {
    color: var(--text);
}

@media (max-width: 1040px) {
    .hero-banner,
    .details-hero,
    .content-grid,
    .watch-layout {
        grid-template-columns: 1fr;
    }

    .spotlight-card,
    .spotlight-card img {
        min-height: 340px;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100%, calc(100% - 20px));
    }

    .nav-shell,
    .action-row,
    .tag-row,
    .pill-row,
    .section-headline {
        flex-wrap: wrap;
    }

    .brand-mark {
        align-items: flex-start;
    }

    .brand-mark small {
        white-space: normal;
    }

    .nav-toggle-button {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 14px 0 4px;
    }

    .nav-links a {
        padding: 10px 0;
    }

    .nav-toggle:checked ~ .nav-links {
        display: flex;
    }

    .hero-banner {
        padding: 22px;
    }

    .details-hero {
        padding: 18px;
    }

    /* Anime grid responsive improvements */
    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 20px 14px;
    }

    .anime-card__body {
        padding: 10px 6px 6px 6px;
    }

    .anime-card h3 {
        font-size: 0.9rem;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .anime-card__meta {
        font-size: 0.7rem;
        gap: 6px;
    }

    .anime-mini-badge {
        height: 22px;
        font-size: 0.6rem;
        padding: 0 6px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding-top: 18px;
    }

    .search-bar {
        grid-template-columns: 1fr;
    }

    .hero-meta-row {
        gap: 10px;
    }

    .episode-grid {
        grid-template-columns: 1fr;
    }

    .ranking-item {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .ranking-index {
        display: none;
    }

    .profile-hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn,
    button,
    .pill-link,
    .nav-pill {
        width: 100%;
    }

    .chart-bar-row {
        grid-template-columns: 1fr;
    }

    .chart-bar-row strong {
        text-align: right;
    }

    .admin-table {
        min-width: 640px;
    }
}

@media (max-width: 480px) {
    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 12px;
    }

    .anime-card__media {
        border-radius: 16px;
    }

    .anime-card__body {
        padding: 8px 4px 4px 4px;
    }

    .anime-card h3 {
        font-size: 0.85rem;
    }

    .anime-card__meta {
        font-size: 0.65rem;
    }
}
/* =============================================
   HERO SLIDER & SWIPER STYLES
   ============================================= */

.hero-slider {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: linear-gradient(180deg, rgba(20, 28, 44, 0.96), rgba(12, 17, 29, 0.98));
}

.hero-slider .hero-banner {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 40px;
}

.swiper-pagination-bullet {
    background: var(--text) !important;
    opacity: 0.3 !important;
}

.swiper-pagination-bullet-active {
    background: var(--accent) !important;
    opacity: 1 !important;
    width: 24px !important;
    border-radius: 4px !important;
}

.swiper-button-next, .swiper-button-prev {
    color: var(--accent) !important;
    background: rgba(0, 0, 0, 0.3);
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease;
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 18px !important;
    font-weight: 900;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.5);
}

.search-section {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.search-section .search-bar {
    width: 100%;
    max-width: 800px;
    margin-top: 0;
}

@media (max-width: 992px) {
    .hero-slider .hero-banner {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    
    .hero-slider .spotlight-card {
        display: none;
    }
}

/* Gift Animation */
@keyframes giftShake {
  0% { transform: rotate(0); }
  15% { transform: rotate(10deg); }
  30% { transform: rotate(-10deg); }
  45% { transform: rotate(5deg); }
  60% { transform: rotate(-5deg); }
  75% { transform: rotate(2deg); }
  85% { transform: rotate(-2deg); }
  100% { transform: rotate(0); }
}
.gift-shake { animation: giftShake 0.6s ease-in-out; }


/* Nav Profile */
.nav-profile-link { display: flex; align-items: center; }
.nav-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.nav-avatar-placeholder { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; font-weight: 800; font-size: 1rem; border: 2px solid rgba(255,255,255,0.1); }


/* Adjusted Profile Sizes */
.nav-avatar, .nav-avatar-placeholder { width: 34px !important; height: 34px !important; font-size: 0.85rem !important; }
.big-avatar, .big-avatar-placeholder { width: 110px !important; height: 110px !important; border-radius: 30px !important; font-size: 2.2rem !important; }


/* Final Size Adjustments and Visibility Fix */
.nav-avatar, .nav-avatar-placeholder { width: 30px !important; height: 30px !important; min-width: 30px !important; flex-shrink: 0 !important; font-size: 0.8rem !important; }
.big-avatar, .big-avatar-placeholder { width: 90px !important; height: 90px !important; min-width: 90px !important; border-radius: 24px !important; font-size: 2rem !important; }


/* Fix Nav Overflow */
.nav-links { gap: 20px !important; overflow: visible !important; }
.nav-profile-link { margin-left: 5px; }


/* Watchlist Dropdown Widget */
.watchlist-dropdown {
    position: relative;
    display: inline-block;
}

.watchlist-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.watchlist-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.watchlist-toggle i {
    width: 18px;
    height: 18px;
}

.watchlist-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 100;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.watchlist-option {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none !important;
    cursor: pointer;
    justify-content: flex-start;
}

.watchlist-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.watchlist-option.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.watchlist-option--danger {
    color: var(--danger);
    margin-top: 4px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
}

.watchlist-option--danger:hover {
    background: var(--danger-soft);
    color: #ff8080;
}

.watchlist-hint {
    font-size: 0.85rem;
    color: var(--muted);
}

.watchlist-hint a {
    color: var(--accent);
    text-decoration: underline;
}


/* =============================================
   ADMIN SETTINGS — NEW UI COMPONENTS
   Toggle Switch, Settings Grid, Toggle Cards
   ============================================= */

/* Form shell for settings pages */
.form-shell {
    display: grid;
    gap: 0;
}

.form-shell form {
    gap: 16px;
}

/* 2-column responsive settings grid */
.settings-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Toggle card row */
.settings-toggle-row {
    display: grid;
    gap: 12px;
}

/* Individual toggle card */
.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 0.22s ease, background 0.22s ease;
}

.toggle-card--on {
    border-color: rgba(124, 246, 211, 0.35);
    background: rgba(124, 246, 211, 0.06);
}

.toggle-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.97rem;
}

/* iOS-style toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 50px;
    height: 28px;
    cursor: pointer;
    gap: 0;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.22s ease, border-color 0.22s ease;
}

.toggle-switch input:checked ~ .toggle-track {
    background: linear-gradient(135deg, var(--accent), #58a6ff);
    border-color: transparent;
    box-shadow: 0 0 14px rgba(124, 246, 211, 0.28);
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
    transform: translateX(22px);
}

/* Announcement banner (sitewide) */
.announcement-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 24px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #07121d;
    font-weight: 700;
    font-size: 0.92rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(124, 246, 211, 0.22);
}

.announcement-banner a {
    color: #07121d;
    text-decoration: underline;
}

.announcement-banner .close-announcement {
    background: none;
    border: none;
    color: #07121d;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
    border-radius: 4px;
}

.announcement-banner .close-announcement:hover {
    opacity: 1;
    transform: none;
}

@media (max-width: 640px) {
    .settings-grid-2 {
        grid-template-columns: 1fr;
    }
    .toggle-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ══════════════════════════════════════
   Collectible Card System
   ══════════════════════════════════════ */

.card-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-item:hover {
    z-index: 10;
}

/* Legendary Card Glow */
.card-glow-legendary {
    background: linear-gradient(135deg, rgba(255,215,0,0.15) 0%, rgba(255,140,0,0.1) 50%, rgba(255,215,0,0.15) 100%);
    animation: legendaryGlow 2s ease-in-out infinite;
}
@keyframes legendaryGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255,215,0,0.3), inset 0 0 15px rgba(255,215,0,0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255,215,0,0.5), 0 0 50px rgba(255,215,0,0.2), inset 0 0 25px rgba(255,215,0,0.15);
    }
}

/* Epic Card Glow */
.card-glow-epic {
    background: linear-gradient(135deg, rgba(14,165,233,0.12) 0%, rgba(99,102,241,0.08) 50%, rgba(14,165,233,0.12) 100%);
    animation: epicGlow 3s ease-in-out infinite;
}
@keyframes epicGlow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(14,165,233,0.25), inset 0 0 12px rgba(14,165,233,0.08);
    }
    50% {
        box-shadow: 0 0 25px rgba(14,165,233,0.4), 0 0 40px rgba(14,165,233,0.15), inset 0 0 20px rgba(14,165,233,0.12);
    }
}

/* Rare Card Subtle Glow */
.card-item[style*="border-color"][style*="rgb(59"] {
    transition: box-shadow 0.3s ease;
}

/* Card Drop Animation */
.card-drop-reveal {
    animation: cardDropReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes cardDropReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(180deg);
    }
    60% {
        transform: scale(1.05) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* Card Shimmer Effect for Legendary */
.card-glow-legendary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.06) 45%,
        rgba(255,255,255,0.12) 50%,
        rgba(255,255,255,0.06) 55%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    border-radius: inherit;
    pointer-events: none;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Card hover lift */
.card-item:hover .card-glow-legendary,
.card-item:hover .card-glow-epic {
    animation-duration: 1s;
}

/* Aura border on profile */
.aura-border {
    position: relative;
    overflow: hidden;
}
.aura-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent), transparent, var(--accent-2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: auraRotate 4s linear infinite;
    opacity: 0.4;
    pointer-events: none;
}
@keyframes auraRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ══════════════════════════════════════
   Sidebar Navigation
   ══════════════════════════════════════ */

.site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg, #080b14);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex !important;
    flex-direction: column !important;
    z-index: 60;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.site-sidebar.collapsed {
    width: 68px;
}
.site-main {
    margin-left: 240px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.sidebar-collapsed .site-main {
    margin-left: 68px;
}

/* Sidebar Header */
.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    min-height: 64px;
    background: linear-gradient(180deg, rgba(14,165,233,0.08), transparent);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    overflow: hidden;
}
.sidebar-logo {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(56,189,248,0.35);
    box-shadow: 0 0 16px rgba(14,165,233,0.25);
}
.sidebar-brand-text {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text, #fff);
    white-space: nowrap;
    transition: opacity 0.2s, width 0.3s;
    background: linear-gradient(90deg, #fff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.collapsed .sidebar-brand-text {
    opacity: 0;
    width: 0;
}
.sidebar-toggle {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(14,165,233,0.12);
    border: 1px solid rgba(56,189,248,0.25);
    color: #c4b5fd;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.sidebar-toggle:hover {
    background: rgba(14,165,233,0.25);
    color: #fff;
    border-color: #38bdf8;
}
.sidebar-toggle-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}
.collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

/* Sidebar Search */
.sidebar-search {
    padding: 14px 12px 10px;
}
.sidebar-search-form {
    position: relative;
    display: flex;
    align-items: center;
}
.sidebar-search-icon {
    position: absolute;
    left: 11px;
    width: 14px;
    height: 14px;
    color: var(--muted, #888);
    pointer-events: none;
    flex-shrink: 0;
}
.sidebar-search-input {
    width: 100%;
    padding: 9px 10px 9px 32px;
    background: rgba(14,165,233,0.07);
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: 11px;
    color: var(--text, #fff);
    font-size: 0.75rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}
.sidebar-search-input:focus {
    border-color: #38bdf8;
    background: rgba(14,165,233,0.12);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.sidebar-search-input::placeholder {
    color: var(--muted, #888);
    font-weight: 600;
}
.collapsed .sidebar-search {
    opacity: 0;
    width: 0;
    padding: 0;
    overflow: hidden;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
.sidebar-section {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(56,189,248,0.06);
}
.sidebar-section:last-child {
    border-bottom: none;
}

/* Sidebar Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted, #888);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.15s;
    position: relative;
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.sidebar-link:hover {
    background: rgba(56,189,248,0.09);
    color: var(--text, #fff);
}
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(14,165,233,0.18), rgba(14,165,233,0.04));
    color: #e9e2ff;
    border: 1px solid rgba(56,189,248,0.25);
    box-shadow: inset 0 0 20px rgba(14,165,233,0.08);
}
.sidebar-link.active .sidebar-icon {
    color: #38bdf8;
}
.sidebar-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #38bdf8, #22d3ee);
    border-radius: 0 3px 3px 0;
}
.sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--sidebar-text);
    transition: color 0.15s;
}
.sidebar-link:hover .sidebar-icon {
    color: #38bdf8;
}
.sidebar-link-text {
    transition: opacity 0.2s;
    overflow: hidden;
}
.collapsed .sidebar-link-text {
    opacity: 0;
    width: 0;
}
.collapsed .sidebar-badge {
    display: none;
}

/* Sidebar Link Colors */
.sidebar-link-gold { color: var(--muted, #888); }
.sidebar-link-gold:hover { color: #f59e0b !important; }
.sidebar-link-pink { color: var(--muted, #888); }
.sidebar-link-pink:hover { color: #22d3ee !important; }
.sidebar-link-green { color: var(--muted, #888); }
.sidebar-link-green:hover { color: #22c55e !important; }
.sidebar-link-accent { color: var(--accent, #22c55e); }

/* Sidebar Badge */
.sidebar-badge {
    margin-left: auto;
    background: var(--accent, #22c55e);
    color: #000;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 99px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar Chevron */
.sidebar-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.sidebar-dropdown-toggle .sidebar-chevron {
    transition: transform 0.2s, opacity 0.2s;
}
.sidebar-dropdown-toggle.open .sidebar-chevron {
    transform: rotate(180deg);
}
.collapsed .sidebar-chevron {
    opacity: 0;
    width: 0;
}

/* Sidebar Dropdown */
.sidebar-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sidebar-dropdown.open {
    max-height: 2000px;
}
.sidebar-genre-link {
    display: block;
    padding: 6px 12px 6px 40px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted, #888);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.sidebar-genre-link:hover {
    color: var(--accent, #22c55e);
    background: rgba(255,255,255,0.03);
}
.collapsed .sidebar-dropdown {
    max-height: 0 !important;
    overflow: hidden;
}

/* Sidebar Footer */
.sidebar-foot {
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
}
.sidebar-user:hover {
    background: rgba(255,255,255,0.06);
}
.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.sidebar-avatar-placeholder {
    background: linear-gradient(135deg, var(--accent, #22c55e), var(--accent-2, #06b6d4));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 900;
}
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s;
}
.sidebar-user-name {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-level {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--accent, #22c55e);
}
.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
}
.collapsed .sidebar-user {
    justify-content: center;
    padding: 8px;
}

/* Sidebar Notif */
.sidebar-notif-wrap {
    position: relative;
}

/* Collapsed Tooltips */
.collapsed .sidebar-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg, #080b14);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text, #fff);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .site-sidebar {
        display: none !important;
    }
    .site-main {
        margin-left: 0 !important;
    }
}

/* ══════════════════════════════════════
   Gift Box Card Drop Animation
   ══════════════════════════════════════ */

.gift-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.5s;
}
.gift-particle {
    position: absolute;
    border-radius: 50%;
    animation: particleBurst 1s ease-out forwards;
}
@keyframes particleBurst {
    0% { transform: scale(0) translate(0, 0); opacity: 1; }
    100% { transform: scale(1) translate(calc(var(--dx, 50px)), calc(var(--dy, -80px))); opacity: 0; }
}

/* Gift Box */
.gift-box-wrapper {
    position: relative;
    cursor: pointer;
    animation: giftFloat 2s ease-in-out infinite;
}
@keyframes giftFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.gift-box {
    width: 140px;
    height: 140px;
    position: relative;
    margin: 0 auto;
}
.gift-box-lid {
    position: absolute;
    top: 0;
    left: -10px;
    right: -10px;
    height: 40px;
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    border-radius: 12px 12px 4px 4px;
    z-index: 2;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: left bottom;
    box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}
.gift-box-lid::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 20px solid #ffd700;
}
.gift-ribbon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 100%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.gift-box-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(135deg, #ffd700, #d97706);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 30px rgba(255,215,0,0.2);
    overflow: hidden;
}
.gift-ribbon-v {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 100%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.gift-glow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 40px;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.5;
    animation: giftGlowPulse 1.5s ease-in-out infinite;
}
@keyframes giftGlowPulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.2); }
}

.gift-hint {
    animation: hintPulse 1.5s ease-in-out infinite;
}
@keyframes hintPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Gift Box Open Animation */
@keyframes giftBoxOpen {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    30% { transform: scale(1.2) rotate(-5deg); }
    60% { transform: scale(1.3) rotate(5deg); opacity: 1; }
    100% { transform: scale(0) rotate(15deg); opacity: 0; }
}

/* Card Reveal */
.card-reveal-anim {
    animation: cardReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}
@keyframes cardReveal {
    0% { opacity: 0; transform: scale(0.3) rotateY(180deg); }
    60% { transform: scale(1.05) rotateY(-10deg); opacity: 1; }
    100% { opacity: 1; transform: scale(1) rotateY(0deg); }
}

/* Card Frame */
.card-frame {
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.frame-gold { border-color: #ffd700; box-shadow: 0 0 40px rgba(255,215,0,0.4), 0 20px 60px rgba(0,0,0,0.5); }
.frame-purple { border-color: #0ea5e9; box-shadow: 0 0 35px rgba(14,165,233,0.35), 0 20px 60px rgba(0,0,0,0.5); }
.frame-blue { border-color: #3b82f6; box-shadow: 0 0 30px rgba(59,130,246,0.3), 0 20px 60px rgba(0,0,0,0.5); }
.frame-gray { border-color: #6b7280; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

/* Card Portrait */
.card-portrait {
    position: relative;
    height: 280px;
    overflow: hidden;
}
.card-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.card-frame:hover .card-portrait-img {
    transform: scale(1.05);
}
.card-portrait-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,1) 0%, rgba(15,23,42,0.3) 40%, transparent 70%);
}
.card-rarity-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}
.card-xp-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(34,197,94,0.9);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    border-radius: 99px;
    z-index: 2;
}

/* Card Info */
.card-info {
    padding: 16px 20px 20px;
    text-align: center;
}
.card-name {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
}
.card-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}
.card-anime {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Card Shimmer for Epic/Legendary */
.card-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.06) 45%,
        rgba(255,255,255,0.12) 50%,
        rgba(255,255,255,0.06) 55%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s linear infinite;
    pointer-events: none;
    z-index: 5;
}

/* Responsive Card */
@media (max-width: 400px) {
    .card-portrait { height: 220px; }
    .card-info { padding: 12px 16px 16px; }
    .card-name { font-size: 0.95rem; }
}

/* Search Dropdown (homepage / global search) */
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 99999;
    max-height: 420px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
}
.search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}
.search-item:hover { background: var(--sidebar-hover); border-left-color: var(--accent); }
.search-item img {
    width: 44px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.search-item .info { flex: 1; min-width: 0; }
.search-item .title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-item .meta {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-item .arrow {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 900;
    flex-shrink: 0;
}
