/* ============================================================
           CINCO UI — Design System Tokens
           Dark Grey + White Theme
           ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap');

:root {
    /* ---- Surface palette ---- */
    --surface-000: #18181b;
    --surface-050: #1e1e22;
    --surface-100: #252528;
    --surface-150: #2c2c30;
    --surface-200: #343438;
    --surface-300: #404046;
    --surface-400: #545460;
    --surface-500: #6e6e7a;

    /* ---- Text palette ---- */
    --text-primary: #f0f0f2;
    --text-secondary: #b0b0b8;
    --text-tertiary: #78788a;
    --text-inverse: #18181b;

    /* ---- Accent palette ---- */
    --accent: #f0b232;
    --accent-hover: #f5c45a;
    --accent-muted: rgba(240, 178, 50, .12);
    --accent-glow: rgba(240, 178, 50, .25);

    /* ---- Semantic ---- */
    --success: #34d399;
    --success-muted: rgba(52, 211, 153, .12);
    --warning: #fbbf24;
    --warning-muted: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-muted: rgba(248, 113, 113, .12);
    --info: #60a5fa;
    --info-muted: rgba(96, 165, 250, .12);

    /* ---- Border / Divider ---- */
    --border-subtle: rgba(255, 255, 255, .06);
    --border-default: rgba(255, 255, 255, .10);
    --border-strong: rgba(255, 255, 255, .18);

    /* ---- Elevation (box-shadow) ---- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .40);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, .50);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* ---- Radius ---- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* ---- Spacing scale ---- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ---- Typography ---- */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 0.75rem;
    --font-sm: 0.8125rem;
    --font-base: 0.9375rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.375rem;
    --font-2xl: 1.75rem;
    --font-3xl: 2.25rem;
    --font-4xl: 3rem;

    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-loose: 1.75;

    /* ---- Transition ---- */
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* ---- Layout ---- */
    --content-max-width: 1200px;
}

/* ============================================================
           Reset & Base
           ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
.site-title {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--surface-000);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

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

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

::selection {
    background: var(--accent);
    color: var(--text-inverse);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-050);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-500);
}

/* ============================================================
           Utility Classes
           ============================================================ */
.container {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.text-sm {
    font-size: var(--font-sm);
}

.text-lg {
    font-size: var(--font-lg);
}

.text-xl {
    font-size: var(--font-xl);
}

.text-2xl {
    font-size: var(--font-2xl);
}

.text-3xl {
    font-size: var(--font-3xl);
}

.font-normal {
    font-weight: 400;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-accent {
    color: var(--accent);
}

.text-danger {
    color: var(--danger);
}

.text-center {
    text-align: center;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[x-cloak] {
    display: none !important;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

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

.animate-fade-in {
    animation: fadeIn var(--duration-normal) var(--ease-out) both;
}

.stagger>*:nth-child(1) {
    animation-delay: 0ms;
}

.stagger>*:nth-child(2) {
    animation-delay: 60ms;
}

.stagger>*:nth-child(3) {
    animation-delay: 120ms;
}

.stagger>*:nth-child(4) {
    animation-delay: 180ms;
}

.stagger>*:nth-child(5) {
    animation-delay: 240ms;
}

.stagger>*:nth-child(6) {
    animation-delay: 300ms;
}

/* ============================================================
           Component Styles (Mapped to Design System)
           ============================================================ */
.header {
    background: rgba(30, 30, 34, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: var(--space-4) 0;
}

.site-title {
    font-size: var(--font-xl);
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    border: none;
    font-size: var(--font-sm);
    gap: var(--space-2);
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

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

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

.btn-ghost:hover {
    background: var(--surface-100);
    color: var(--text-primary);
}

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-1);
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--duration-fast);
}

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

/* Inputs */
.input-group {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.input-search {
    width: 100%;
    padding: var(--space-2) var(--space-4);
    padding-left: var(--space-10);
    background: var(--surface-100);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    font-family: var(--font-family);
    font-size: var(--font-sm);
}

.input-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

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

.search-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    width: 16px;
    height: 16px;
}

/* Layout / Spacing */
.main-content {
    flex-grow: 1;
    padding: var(--space-8) 0;
}

.section-mb {
    margin-bottom: var(--space-12);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-8 {
    margin-top: var(--space-8);
}

/* Threat Banner */
.alert-warning {
    background: var(--warning-muted);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    text-align: center;
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-glow);
}

.alert-warning p {
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.alert-warning strong {
    color: var(--text-primary);
}

.progress-container {
    width: 100%;
    max-width: 500px;
    margin: var(--space-4) auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-full);
    height: 24px;
    overflow: hidden;
    border: 2px solid var(--border-strong);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes progressStripes {
    from {
        background-position: 1rem 0;
    }

    to {
        background-position: 0 0;
    }
}

.progress-bar {
    height: 100%;
    width: 20%;
    background-color: var(--accent);
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progressStripes 1s linear infinite;
    transition: width 1s ease-in-out;
    box-shadow: 0 0 15px var(--accent-glow);
    border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.progress-text {
    font-size: var(--font-md);
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.highlight-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--accent);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    margin: var(--space-4) auto;
    max-width: 600px;
}

/* Typography components */
.section-title {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-title svg {
    color: var(--accent);
    width: 20px;
    height: 20px;
}

/* Game Grid & Cards */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-6);
    }
}

.game-card {
    background: var(--surface-100);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/5;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    z-index: 3;
    transition: left 0.7s ease;
}

.game-card:hover::after {
    left: 150%;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 12px 24px rgba(240, 178, 50, 0.2);
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: transform 0.5s ease;
}

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

.game-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 20, 25, 0.95) 0%, rgba(20, 20, 25, 0.2) 50%, rgba(20, 20, 25, 0.8) 100%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-card-overlay {
    opacity: 1;
}

.game-title {
    color: var(--text-primary);
    font-size: var(--font-sm);
    font-weight: 800;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.game-card:hover .game-title {
    transform: translateY(0);
}

.play-icon-overlay {
    align-self: center;
    margin-top: auto;
    margin-bottom: auto;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--surface-000);
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px var(--accent-glow);
}

.game-card:hover .play-icon-overlay {
    transform: scale(1);
}

.play-icon-overlay svg {
    width: 24px;
    height: 24px;
    margin-left: 4px;
}

/* Loading Skeleton */
.skeleton {
    background: var(--surface-100);
    border-radius: var(--radius-md);
    aspect-ratio: 4/5;
    animation: pulse 2s infinite;
    border: 1px solid var(--border-subtle);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal {
    background: var(--surface-050);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.modal-large {
    max-width: 1100px;
    height: 85vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-default);
    background: var(--surface-100);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
}

.sub-card {
    background: var(--surface-100);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    text-align: center;
    margin-top: var(--space-6);
}

.sub-card ul {
    list-style: none;
    color: var(--text-secondary);
    margin: var(--space-4) 0;
    font-size: var(--font-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sub-card li::before {
    content: "✓";
    color: var(--accent);
    margin-right: var(--space-2);
    font-weight: bold;
}

/* Game Player */
.game-iframe-container {
    flex-grow: 1;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    inset: 0;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-default);
    padding: var(--space-8) 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--font-sm);
    background: var(--surface-000);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
}

/* Hide specific elements on mobile */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

/* --- Next Style Block --- */

.premium-banner {
    background: linear-gradient(135deg, rgba(240, 178, 50, 0.1) 0%, rgba(20, 20, 25, 0.9) 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    margin-bottom: var(--space-8);
    box-shadow: 0 0 30px rgba(240, 178, 50, 0.15);
    position: relative;
    overflow: hidden;
}

.premium-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(240, 178, 50, 0.1) 0%, transparent 60%);
    animation: rotateGlow 10s linear infinite;
    z-index: 0;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.premium-content {
    position: relative;
    z-index: 1;
}

.premium-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--surface-000);
    font-weight: 800;
    text-transform: uppercase;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    letter-spacing: 1px;
    margin-bottom: var(--space-4);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- Next Style Block --- */

.split-modal {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .split-modal {
        flex-direction: row;
    }
}

.premium-sidebar {
    background: linear-gradient(to bottom, var(--surface-100), var(--surface-000));
    padding: var(--space-6);
    border-right: 1px solid var(--border-default);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.premium-form-area {
    padding: var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.feature-icon {
    color: var(--accent);
    margin-right: var(--space-3);
    margin-top: 2px;
    flex-shrink: 0;
}

.qr-box {
    background: white;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-md);
}

.qr-box img {
    width: 150px;
    height: 150px;
}