/* ============================================================
   DARK MODERN CSS — GABUNGAN
   Chat + Landing Page
   ============================================================ */

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== VARIABEL GLOBAL ===== */
:root {
    /* --- Primary --- */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.4);

    /* --- Accent --- */
    --accent: #06b6d4;          /* cyan */
    --accent-2: #ec4899;         /* pink */
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;

    /* --- Background --- */
    --bg: #0a0a0f;
    --bg-main: #0a0a0f;          /* alias untuk chat */
    --bg-soft: #12121a;
    --bg-elevated: #1a1a24;
    --bg-glass: rgba(255, 255, 255, 0.04);

    /* --- Surface (alias untuk chat) --- */
    --surface: #12121a;
    --surface-hover: #1a1a24;

    /* --- Text --- */
    --text: #f1f5f9;
    --text-main: #f1f5f9;        /* alias untuk chat */
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* --- Border --- */
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* --- Radius --- */
    --radius: 14px;
    --radius-sm: 10px;

    /* --- Shadow --- */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.25);
}

/* ===== BODY ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Aurora background — global */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(236, 72, 153, 0.10) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: aurora 20s ease-in-out infinite alternate;
}

/* Body khusus chat — flex center */
body.chat-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

@keyframes aurora {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, -5%) rotate(5deg); }
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   NAVBAR (LANDING PAGE)
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
    text-decoration: none;
}

.logo i {
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-menu {
    display: flex;
    gap: 28px;
}

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s;
    border-radius: 2px;
}

.nav-menu a:hover { color: var(--text); }
.nav-menu a:hover::after { width: 100%; }

/* ============================================================
   BUTTONS (UMUM)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: 0.25s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.2), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-primary:hover::after { opacity: 1; }

.btn-outline {
    background: var(--bg-glass);
    color: var(--text);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* ===== Button Login (Navbar) ===== */
.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.25s;
    box-shadow: 0 4px 14px var(--primary-glow);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    font-family: inherit;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-login:hover::before { left: 100%; }

/* ============================================================
   HERO (LANDING PAGE)
   ============================================================ */
.hero {
    padding: 100px 0 70px;
    text-align: center;
    position: relative;
}

.hero-content { max-width: 720px; margin: 0 auto; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-glass);
    color: var(--primary);
    padding: 7px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 22px;
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 22px;
    color: var(--text);
}

.gradient-text {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.hero p {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 56px;
    flex-wrap: wrap;
}

.hero-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stats strong {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stats span {
    font-size: 13px;
    color: var(--text-dim);
}

/* ============================================================
   SECTION (LANDING PAGE)
   ============================================================ */
.section { padding: 80px 0; position: relative; }
.bg-soft { background: rgba(18, 18, 26, 0.5); }

.section-head {
    text-align: center;
    margin-bottom: 52px;
}

.section-head h2 {
    font-size: clamp(24px, 3.5vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
    color: var(--text);
}

.section-head p {
    color: var(--text-muted);
    font-size: 15px;
}

/* ===== Grid Game ===== */
.grid-game {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
}

.card-game {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    position: relative;
    overflow: hidden;
}

.card-game::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
    opacity: 0;
    transition: opacity 0.3s;
}

.card-game:hover {
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(139, 92, 246, 0.2);
}

.card-game:hover::before { opacity: 1; }

.card-img {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-elevated);
    position: relative;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.card-game:hover .card-img img { transform: scale(1.08); }

.card-game h3 {
    font-size: 14px;
    font-weight: 600;
    position: relative;
}

/* ===== Grid Feature ===== */
.grid-feature {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.feature {
    background: var(--bg-soft);
    padding: 30px 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow), 0 0 30px rgba(139, 92, 246, 0.1);
    transform: translateY(-4px);
}

.feature:hover::before { opacity: 1; }

.feature-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 18px;
    border: 1px solid var(--border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.feature h3 {
    font-size: 17px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text);
}

.feature p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Grid Step ===== */
.grid-step {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.step {
    text-align: center;
    padding: 28px 16px;
    border-radius: var(--radius);
    transition: 0.3s;
}

.step:hover { background: var(--bg-glass); }

.step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
    box-shadow: 0 0 24px var(--primary-glow);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.step h4 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.step p  { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   FOOTER (LANDING PAGE)
   ============================================================ */
.footer {
    background: #06060a;
    color: #cbd5e1;
    padding: 64px 0 28px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 44px;
    margin-bottom: 44px;
}

.footer h3, .footer h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 16px;
}

.footer h3 {
    font-size: 20px;
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer p, .footer a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.footer a:hover {
    color: var(--primary);
    transform: translateX(4px);
    display: inline-block;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
}

/* ============================================================
   CHAT — LOGIN BOX & CONTAINER
   ============================================================ */
.login-box,
.chat-container,
.modal-box {
    width: 440px;
    max-width: 100%;
    background: var(--bg-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 40px rgba(139, 92, 246, 0.1);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

/* ===== Chat Header ===== */
.chat-header {
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.9), rgba(15, 15, 25, 0.9));
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding: 16px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.chat-header span:first-child {
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Header Buttons ===== */
.header-buttons { display: flex; gap: 8px; }

.logout-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s;
}

.logout-btn:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

.clear-btn {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s;
}

.clear-btn:hover {
    background: var(--accent-yellow);
    color: #000;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

/* ===== Chat Box ===== */
.chat-box {
    height: 470px;
    padding: 20px;
    overflow-y: scroll;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(11, 15, 25, 0.6);
    position: relative;
}

.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-track { background: transparent; }
.chat-box::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
}
.chat-box::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

/* ===== Message ===== */
.message {
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 75%;
    word-wrap: break-word;
    position: relative;
    font-size: 14px;
    line-height: 1.45;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.message.incoming {
    background: var(--bg-elevated);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.message.outgoing {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.message.system {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    align-self: center;
    font-size: 11px;
    text-align: center;
    max-width: 90%;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    padding: 6px 14px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    float: right;
    margin-top: 4px;
    margin-left: 8px;
}

.message.incoming .message-time { color: var(--text-dim); }

/* ===== Chat Input Area ===== */
.chat-input-area {
    position: relative;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
}

/* ===== Emoji Picker ===== */
.emoji-picker {
    display: none;
    position: absolute;
    bottom: 90px;
    left: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.15);
    width: 280px;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(20px);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.emoji-picker span {
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
}

.emoji-picker span:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: scale(1.15);
}

/* ===== Chat Input ===== */
.chat-input {
    display: flex;
    padding: 10px 12px 4px 12px;
    background: var(--bg-soft);
    align-items: center;
    gap: 8px;
}

.emoji-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: var(--text);
}

.emoji-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.chat-input input {
    flex: 1;
    background: var(--bg);
    color: var(--text);
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.chat-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.chat-input input::placeholder { color: var(--text-dim); }

.chat-input button:not(.emoji-btn) {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s;
    box-shadow: 0 4px 14px var(--primary-glow);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.chat-input button:not(.emoji-btn)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.chat-input button:not(.emoji-btn):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.chat-input button:not(.emoji-btn):hover::before { left: 100%; }

.chat-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 14px 10px 14px;
    font-size: 11px;
    color: var(--text-dim);
}

/* ===== Login & Modal Form ===== */
.login-form,
.modal-form {
    padding: 28px 26px;
    text-align: left;
}

.login-form label,
.modal-form label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
}

.login-form input,
.modal-form input {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    padding: 11px 14px;
    margin: 8px 0 16px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.login-form input:focus,
.modal-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-form button,
.modal-form button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.25s;
    box-shadow: 0 4px 14px var(--primary-glow);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.login-form button::before,
.modal-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-form button:hover,
.modal-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.login-form button:hover::before,
.modal-form button:hover::before { left: 100%; }

/* ===== Cancel Button ===== */
.cancel-btn {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5 !important;
    margin-top: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    box-shadow: none !important;
}

.cancel-btn:hover {
    background: var(--accent-red) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5) !important;
}

/* ===== Error ===== */
.error {
    color: #fca5a5;
    font-size: 12px;
    margin-bottom: 14px;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

/* ===== Modal Overlay ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal khusus header merah */
.modal-box .chat-header[style*="7f1d1d"] {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.95), rgba(69, 10, 10, 0.95)) !important;
    color: #fca5a5 !important;
}

.modal-box .chat-header[style*="7f1d1d"]::after {
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
}

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track { background: var(--bg); }

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 5px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

/* ===== SELECTION ===== */
::selection {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
    .hero { padding: 64px 0 48px; }
    .hero-stats { gap: 32px; }
    .section { padding: 56px 0; }
}

@media (max-width: 480px) {
    .footer-top { grid-template-columns: 1fr; }
    .grid-game { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .card-game { padding: 12px; }
    .hero-actions { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    body::before { opacity: 0.5; }

    /* Chat */
    body.chat-page { padding: 10px; }
    .login-box, .chat-container, .modal-box { width: 100%; }
    .chat-box { height: 400px; }
    .chat-input input { font-size: 16px; }
    .emoji-picker { width: 240px; left: 8px; }
    .message { max-width: 85%; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    body::before { animation: none; }
}
