:root {
    --bg-dark: #0b0b12;
    --bg-card: rgba(22, 20, 33, 0.75);
    --text-primary: #f7f2ff;
    --text-secondary: rgba(247, 242, 255, 0.72);
    --accent-gold: #ff5fa2;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --accent-lavender: #b79bff;
    --accent-peach: #ffb4a2;
    --border: rgba(255, 255, 255, 0.10);
    --shadow: 0 20px 60px rgba(0,0,0,0.45);
    --sidebar-w: 240px;
}

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

body {
    font-family: ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, #090912, var(--bg-dark));
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: -20vh -20vw;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        radial-gradient(520px 360px at 18% 20%, rgba(255, 95, 162, 0.20), transparent 60%),
        radial-gradient(560px 420px at 80% 25%, rgba(183, 155, 255, 0.16), transparent 62%),
        radial-gradient(620px 460px at 55% 85%, rgba(255, 180, 210, 0.13), transparent 60%),
        radial-gradient(820px 560px at 35% 65%, rgba(56, 189, 248, 0.09), transparent 65%);
    filter: saturate(1.05);
    animation: bgFloat 18s ease-in-out infinite;
    opacity: 0.95;
}

body::after {
    background:
        radial-gradient(900px 560px at 70% 70%, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.78)),
        repeating-radial-gradient(circle at 30% 40%, rgba(255,255,255,0.05) 0 1px, transparent 1px 8px);
    mix-blend-mode: soft-light;
    opacity: 0.35;
    animation: bgDrift 28s linear infinite;
}

@keyframes bgFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    35% { transform: translate3d(18px, -14px, 0) scale(1.02); }
    70% { transform: translate3d(-14px, 16px, 0) scale(1.01); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes bgDrift {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-18px, 10px, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, rgba(22, 20, 33, 0.92), rgba(22, 20, 33, 0.72));
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: fixed;
    height: 100%;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 10px 22px rgba(255, 95, 162, 0.30));
    animation: logoFloat 12s ease-in-out infinite;
}

.brand-name {
    font-weight: 900;
    letter-spacing: 0.2px;
    font-size: 1.25rem;
    background: linear-gradient(90deg, var(--accent-gold), rgba(255, 180, 210, 0.95));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: lowercase;
}

@keyframes logoFloat {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    40% { transform: translate3d(0, -4px, 0) rotate(-3deg); }
    70% { transform: translate3d(0, 2px, 0) rotate(2deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

.user-panel {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
    background: rgba(0,0,0,0.18);
    border-radius: 1rem;
}

.user-panel img {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid rgba(255, 95, 162, 0.65);
    margin-bottom: 0.5rem;
    object-fit: cover;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;
    transition: background-color 0.25s, transform 0.25s, color 0.25s, border-color 0.25s;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 95, 162, 0.12);
    color: var(--text-primary);
    border-color: rgba(255, 95, 162, 0.35);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    flex-grow: 1;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.header {
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2rem;
    color: var(--text-primary);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.3s;
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--accent-gold);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.3s;
    box-shadow: var(--shadow);
}

.game-card-link {
    text-decoration: none;
    color: inherit;
}

.game-card-link:focus-visible {
    outline: 2px solid rgba(255, 95, 162, 0.6);
    outline-offset: 3px;
}

.game-card:hover {
    border-color: rgba(255, 95, 162, 0.5);
    transform: translateY(-2px);
}

.game-icon {
    font-size: 2rem;
    background: rgba(255, 95, 162, 0.14);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 95, 162, 0.28);
}

.game-info h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.game-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: rgba(255, 95, 162, 0.9);
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

.win { color: var(--accent-green); font-weight: bold; }
.loss { color: var(--accent-red); font-weight: bold; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 95, 162, 0.35);
    background: linear-gradient(90deg, rgba(255, 95, 162, 0.95), rgba(183, 155, 255, 0.85));
    color: #120814;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 16px 40px rgba(255, 95, 162, 0.18);
    transition: transform 0.25s, filter 0.25s;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: radial-gradient(240px 90px at 10% 30%, rgba(255,255,255,0.55), transparent 60%),
        radial-gradient(180px 90px at 85% 50%, rgba(255,255,255,0.35), transparent 65%);
    opacity: 0.0;
    transition: opacity 0.25s;
}

.btn-primary:hover::before { opacity: 0.6; }

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.btn-primary-lg {
    padding: 0.65rem 1.05rem;
    font-size: 0.95rem;
}

.originals-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.25rem 1.05rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border);
    background:
        radial-gradient(900px 380px at 18% 15%, rgba(255, 95, 162, 0.22), transparent 60%),
        radial-gradient(900px 380px at 80% 30%, rgba(183, 155, 255, 0.16), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.18));
    box-shadow: var(--shadow);
}

.originals-hero h1 {
    font-size: 1.65rem;
    margin-bottom: 0.35rem;
}

.originals-hero p {
    color: var(--text-secondary);
    max-width: 64ch;
    line-height: 1.35;
}

.originals-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.9rem;
    align-items: center;
    margin: 1rem 0 1.25rem;
}

.searchbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: 1.05rem;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 55px rgba(0,0,0,0.35);
}

.searchbar input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.chip-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.24);
    color: var(--text-primary);
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s, border-color 0.25s, background-color 0.25s;
}

.chip.active {
    border-color: rgba(255, 95, 162, 0.45);
    background: rgba(255, 95, 162, 0.14);
}

.chip:hover { transform: translateY(-1px); }

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

.original-card {
    display: flex;
    flex-direction: column;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0,0,0,0.20);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 22px 70px rgba(0,0,0,0.45);
    transform: translate3d(0,0,0);
    transition: transform 0.25s, border-color 0.25s, filter 0.25s;
}

.original-card:hover {
    transform: translate3d(0, -2px, 0);
    border-color: rgba(255, 95, 162, 0.35);
    filter: brightness(1.02);
}

.original-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: rgba(255,255,255,0.04);
    display: grid;
    place-items: center;
    position: relative;
}

.original-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.original-meta {
    padding: 0.85rem 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.original-name {
    font-weight: 1000;
    letter-spacing: 0.2px;
    font-size: 1.05rem;
}

.original-sub {
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.8rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    font-weight: 900;
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
    body::before,
    body::after { animation: none !important; }
}
