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

:root {
    --bg: #0a0a0b;
    --surface: #141416;
    --border: rgba(255,255,255,0.06);
    --primary: #7c5cfc;
    --primary-glow: rgba(124, 92, 252, 0.15);
    --success: #34d399;
    --danger: #f43f5e;
    --warning: #fbbf24;
    --text: #e8e8ed;
    --text-secondary: #71717a;
    --text-dim: #52525b;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── Navbar ─── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 2.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--text);
    pointer-events: none;
}

.server-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.server-icon:hover {
    transform: scale(1.15) rotate(5deg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.username {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.balance-display {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ─── Navbar Dropdown ─── */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.dropdown-trigger:hover {
    background: rgba(255,255,255,0.05);
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.dropdown-menu.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-menu a {
    color: var(--text);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
    background: #1a1a1e;
    color: white;
}

.dropdown-menu a.logout {
    color: var(--danger);
}

.dropdown-menu a.logout:hover {
    background: rgba(244, 63, 94, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* ─── Buttons ─── */
button, input, select, a, .primary-btn, .outline-btn, .back-btn, .mine-tile, .lane-btn, .crash-btn, .action-btn, .chip, .pf-link {
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button, .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    box-shadow: 0 0 0 0 var(--primary-glow);
}

.primary-btn:hover {
    background: #6d4ee0;
    box-shadow: 0 0 30px 5px var(--primary-glow);
    transform: translateY(-1px);
}

.primary-btn:active {
    transform: translateY(0) scale(0.98);
}

.primary-btn:disabled {
    background: #27272a;
    color: #52525b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.outline-btn {
    background: transparent;
    border: 1px solid #3f3f46;
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    text-decoration: none;
}

.outline-btn:hover {
    border-color: #52525b;
    color: var(--text);
}

.back-btn {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text);
}

/* ─── Layout ─── */
.dashboard {
    max-width: 860px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.game-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ─── Hero ─── */
.hero {
    text-align: center;
    margin-bottom: 5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #c084fc, #7c5cfc, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero p {
    color: var(--text-dim);
    font-size: 1rem;
    font-weight: 400;
}

/* ─── Stats ─── */
.stats-panel {
    display: flex;
    gap: 2px;
    margin-bottom: 5rem;
    background: var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.stat-card {
    flex: 1;
    background: var(--surface);
    padding: 1.75rem;
    text-align: center;
    transition: background 0.2s;
}

.stat-card:hover {
    background: #1a1a1e;
}

.stat-card h3 {
    color: var(--text-dim);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.highlight {
    color: var(--warning) !important;
}

/* ─── Games Grid ─── */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.game-card {
    background: var(--surface);
    padding: 2.5rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    display: block;
    cursor: pointer;
}

.game-card:hover:not(.locked) {
    background: #1a1a1e;
}

.game-card:hover:not(.locked) .game-icon {
    transform: translateY(-4px) scale(1.1);
}

.game-card.locked {
    opacity: 0.35;
    cursor: default;
}

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.game-card h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.game-card p {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
}

/* ─── Login Prompt ─── */
.login-prompt {
    text-align: center;
    padding: 6rem 0;
}

.login-prompt h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ─── Slot Machine ─── */
.slot-machine {
    text-align: center;
}

.reels {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.reel {
    font-size: 4rem;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.bet-input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.bet-input-group label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bet-input-group input {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    width: 140px;
    height: 44px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.bet-input-group input:focus {
    border-color: var(--primary);
}

.controls .primary-btn {
    height: 44px;
    padding: 0 2rem;
}

.status-msg {
    font-size: 1rem;
    font-weight: 600;
    min-height: 1.5rem;
    color: var(--text-secondary);
}

.win { color: var(--success); }
.lose { color: var(--danger); }

/* ─── Section Headers ─── */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 4rem;
}

.section-header h2 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Alert Banner ─── */
.alert-banner {
    background: var(--surface);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 10px 10px 0;
    margin-bottom: 3rem;
    animation: fade-up 0.5s ease-out 0.05s both;
}

.alert-banner p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

/* ─── Leaderboard ─── */
.leaderboard {
    animation: fade-up 0.6s ease-out 0.3s both;
}

.lb-list {
    display: flex;
    flex-direction: column;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.lb-row:hover {
    background: rgba(255,255,255,0.02);
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-rank {
    width: 32px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
}

.lb-rank.gold { color: #fbbf24; }
.lb-rank.silver { color: #a1a1aa; }
.lb-rank.bronze { color: #d97706; }

.lb-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-name .you {
    font-size: 0.7rem;
    color: var(--primary);
    margin-left: 0.4rem;
}

.lb-coins {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--warning);
}

.lb-level {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dim);
    width: 60px;
    text-align: right;
}

.provably-fair {
    margin-top: 1.5rem;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    word-break: break-all;
    display: block;
    opacity: 0.8;
}
.provably-fair span {
    color: #fff;
    font-weight: 600;
}

/* ─── Chat ─── */
.chat-section {
    animation: fade-up 0.6s ease-out 0.4s both;
}

.chat-box {
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
}

.chat-messages {
    height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}

.chat-msg {
    font-size: 0.85rem;
    line-height: 1.4;
    animation: fade-up 0.25s ease-out;
    word-break: break-all;
    overflow-wrap: break-word;
    width: 100%;
    max-width: 100%;
}

.chat-msg .chat-author {
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.4rem;
}

.chat-msg .chat-text {
    color: var(--text-secondary);
    word-break: break-all;
    overflow-wrap: anywhere;
}

.chat-msg.system-msg .chat-text {
    color: var(--text-dim);
    font-style: italic;
}

.chat-input-row {
    display: flex;
    border-top: 1px solid var(--border);
}

.chat-input-row input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0.875rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    min-width: 0;
}

.chat-input-row input::placeholder {
    color: var(--text-dim);
}

.chat-input-row button {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0 1.25rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.chat-input-row button:hover {
    color: #9b85ff;
}

/* ─── Server Info ─── */
.server-info {
    animation: fade-up 0.6s ease-out 0.35s both;
}

.server-details {
    display: flex;
    gap: 2px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.server-detail {
    flex: 1;
    background: var(--surface);
    padding: 1.25rem;
    text-align: center;
}

.server-detail .detail-value {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.server-detail .detail-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ─── Two Column Layout ─── */
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    margin-top: 1rem;
}

.two-col > div {
    min-width: 0;
}

/* ─── Animations ─── */
@keyframes spin-blur {
    0% { transform: translateY(0); }
    25% { transform: translateY(-6px); }
    50% { transform: translateY(6px); }
    75% { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}

.spinning {
    animation: spin-blur 0.08s infinite;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard .hero { animation: fade-up 0.6s ease-out; }
.dashboard .alert-banner { animation: fade-up 0.6s ease-out 0.05s both; }
.dashboard .stats-panel { animation: fade-up 0.6s ease-out 0.1s both; }
.dashboard .games-grid { animation: fade-up 0.6s ease-out 0.2s both; }

/* ─── Responsive ─── */
@media (max-width: 700px) {
    .dashboard { padding: 2rem 1rem; }
    .games-grid { grid-template-columns: 1fr; }
    .stats-panel { flex-direction: column; }
    .two-col { grid-template-columns: minmax(0, 1fr); }
    .hero h1 { font-size: 1.75rem; }
    .navbar { 
        padding: 0.5rem 1rem; 
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
        justify-content: center;
        gap: 10px;
    }
    .logo {
        position: static;
        transform: none;
    }
    .navbar > div {
        gap: 1rem !important;
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    .server-details { flex-direction: column; }
}

/* ─── Cosmetics ─── */
.color_gold { color: #fbbf24 !important; text-shadow: 0 0 15px rgba(251, 191, 36, 0.4); }
.color_neon { color: #22d3ee !important; text-shadow: 0 0 15px rgba(34, 211, 238, 0.4); }
.color_blood { color: #f43f5e !important; text-shadow: 0 0 15px rgba(244, 63, 94, 0.4); }
@keyframes falling-petals-1 {
    0% { transform: translate(0, -5px) rotate(0deg); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translate(-8px, 18px) rotate(180deg); opacity: 0; }
}

@keyframes falling-petals-2 {
    0% { transform: translate(0, -5px) rotate(45deg); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translate(8px, 18px) rotate(225deg); opacity: 0; }
}

.color_blossom {
    color: #f472b6 !important; 
    text-shadow: 0 0 15px rgba(244, 114, 182, 0.4);
    position: relative;
    display: inline-block;
}

.color_blossom::before, .color_blossom::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fbcfe8;
    border-radius: 50% 0 50% 50%;
    top: -6px;
    pointer-events: none;
    opacity: 0;
}

.color_blossom::before {
    left: 15%;
    animation: falling-petals-1 2.5s ease-in-out infinite;
}

.color_blossom::after {
    right: 15%;
    background: #f472b6;
    animation: falling-petals-2 3s ease-in-out infinite 1.2s;
}

@keyframes rainbow-text {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.color_rainbow {
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-text 2s linear infinite;
    display: inline-block;
    font-weight: 800;
}

@keyframes pulse-fire {
    0% { text-shadow: 0 0 10px #ff4500, 0 0 20px #ff4500, 0 0 30px #ff8c00; color: #ff4500; }
    50% { text-shadow: 0 0 20px #ff0000, 0 0 30px #ff4500, 0 0 40px #ff8c00; color: #ff0000; }
    100% { text-shadow: 0 0 10px #ff4500, 0 0 20px #ff4500, 0 0 30px #ff8c00; color: #ff4500; }
}

.color_inferno {
    animation: pulse-fire 1.5s infinite alternate;
    font-weight: 800;
}

@keyframes glitch-anim {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}

.badge-hacker {
    color: #0f0;
    font-family: monospace;
    text-shadow: 0 0 5px #0f0;
    animation: glitch-anim 0.3s infinite;
    display: inline-block;
}

.badge-diamond {
    color: #b9f2ff;
    text-shadow: 0 0 15px #b9f2ff, 0 0 30px #b9f2ff;
    animation: fade-up 1s infinite alternate;
    display: inline-block;
}

/* --- New Colors --- */
@keyframes wave-text {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.color_ocean {
    background: linear-gradient(90deg, #0284c7, #38bdf8, #0ea5e9, #0284c7);
    background-size: 200% 200%;
    color: transparent !important;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wave-text 3s ease infinite;
    font-weight: 800;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px #c084fc, 0 0 20px #c084fc; }
    50% { opacity: 0.8; text-shadow: 0 0 2px #c084fc; }
}
.color_galaxy {
    color: #d8b4fe !important;
    animation: twinkle 2s ease-in-out infinite;
    font-weight: 800;
    letter-spacing: 1px;
}

@keyframes toxic-bubble {
    0% { filter: hue-rotate(0deg); text-shadow: 0 0 10px #22c55e; }
    50% { filter: hue-rotate(30deg); text-shadow: 0 0 20px #4ade80, 0 -3px 5px #22c55e; }
    100% { filter: hue-rotate(0deg); text-shadow: 0 0 10px #22c55e; }
}
.color_toxic {
    color: #4ade80 !important;
    animation: toxic-bubble 1.5s infinite;
    font-weight: 800;
}

/* --- New Badges --- */
@keyframes bounce-cute {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.badge-kitty {
    display: inline-block;
    animation: bounce-cute 1s ease-in-out infinite;
}

@keyframes spin-slow {
    100% { transform: rotate(360deg); }
}
.badge-star {
    display: inline-block;
    animation: spin-slow 4s linear infinite;
    text-shadow: 0 0 15px #fde047;
}

@keyframes float-ghost {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.8; }
    50% { transform: translateY(-4px) translateX(2px); opacity: 1; text-shadow: 0 0 10px rgba(255,255,255,0.8); }
}
.badge-ghost {
    display: inline-block;
    animation: float-ghost 3s ease-in-out infinite;
}

@keyframes dragon-breathe {
    0%, 100% { filter: drop-shadow(0 0 2px #ef4444); }
    50% { filter: drop-shadow(0 0 10px #f97316); }
}
.badge-dragon {
    display: inline-block;
    animation: dragon-breathe 2s ease-in-out infinite;
}
