:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --accent-color: #3b82f6;
    --snake-color: #10b981;
}

/* Page-specific accent colors */
.admin-page {
    --accent-color: #ef4444;
}

.teams-page {
    --accent-color: #3b82f6;
}

.settings-page {
    --accent-color: #3b82f6;
}

.game-page {
    --accent-color: #3b82f6;
}

/* Game Specific Accent Colors */
.snake-game {
    --accent-color: #10b981;
    /* Green */
}

.moon-buggy-game {
    --accent-color: #f59e0b;
    /* Orange */
}

.icy-tower-game {
    --accent-color: #3b82f6;
    /* Blue */
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Unified Tab System */
.tab-container,
.admin-tabs-container {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid #334155;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.tab-nav,
.admin-tabs {
    display: flex;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px 12px 0 0;
}

.tab-btn,
.admin-tab {
    font-size: 16px;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

.tab-btn:hover,
.admin-tab:hover {
    color: white;
    background: rgba(var(--accent-color), 0.3);
}

.tab-btn.active,
.admin-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(var(--accent-color), 0.2);
}

/* Tab border radius containment */
.tab-btn:first-child,
.admin-tab:first-child {
    border-radius: 12px 0 0 0;
}

.tab-btn:first-child:hover,
.tab-btn:first-child.active,
.admin-tab:first-child:hover,
.admin-tab:first-child.active {
    border-radius: 12px 0 0 0;
}

.tab-btn:last-child,
.admin-tab:last-child {
    border-radius: 0 12px 0 0;
}

.tab-btn:last-child:hover,
.tab-btn:last-child.active,
.admin-tab:last-child:hover,
.admin-tab:last-child.active {
    border-radius: 0 12px 0 0;
}

.tab-content,
.admin-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.tab-panel,
.admin-tab-content {
    display: none;
}

.tab-panel.active,
.admin-tab-content.active {
    display: block;
}

.tab-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #334155;
    background: rgba(15, 23, 42, 0.3);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.tab-footer .primary-btn,
.tab-footer .save-status {
    display: none;
}

.tab-footer .primary-btn.active,
.tab-footer .save-status.active {
    display: block;
}

.tab-footer .save-status {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tab-footer .save-status.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid #22c55e;
    opacity: 1;
}

.tab-footer .save-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
    opacity: 1;
}

/* Tab footer inherits global primary-btn styles */

.admin-footer {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 1rem;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /*padding: 2rem;*/
    /* padding-top removed - spacing now handled by .top-bar margin */
    /* Space for top-bar + margin */
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile Message */
.mobile-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.mobile-content h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--accent-color), var(--snake-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-content p {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.mobile-subtitle {
    font-size: 1.1rem !important;
    color: #94a3b8;
}

/* Mobile responsive layout - show responsive content instead of overlay */

/* Global Icon Button Styles */
.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    transform: scale(1.2);
}

.icon-btn:hover svg {
    filter: drop-shadow(0 0 8px var(--accent-color));
    color: var(--accent-color);
}

/* Header Button - Used for back button, settings button, etc. */
.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.header-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    stroke: var(--text-color);
}

.header-btn:hover {
    transform: scale(1.2);
}

.header-btn:hover svg {
    filter: drop-shadow(0 0 8px var(--accent-color));
    stroke: var(--accent-color);
}

/* Legacy support - back-btn is now header-btn */
.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    stroke: var(--text-color);
}

.back-btn:hover {
    transform: scale(1.2);
}

.back-btn:hover svg {
    filter: drop-shadow(0 0 8px var(--accent-color));
    stroke: var(--accent-color);
}

/* Global Game Header Styles */
.top-bar {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: 1200px;
    height: 80px;
    margin-bottom: 20px;
    /* Gap dictated by top bar */
    background-color: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-radius: 0 0 24px 24px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Controls Legend Footer - mirrors top-bar but at bottom */
.controls-legend {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem 2rem;
    width: 100%;
    max-width: 1200px;
    background-color: rgba(30, 41, 59, 0.95) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.key {
    background-color: #334155;
    color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    border-bottom: 2px solid #1e293b;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* Desktop footer buttons - show text, hide icons */
@media (min-width: 769px) {
    .controls-legend .secondary-btn svg {
        display: none;
    }

    .controls-legend #footer-restart-btn::after {
        content: "Restart";
    }

    .controls-legend #footer-menu-btn::after {
        content: "Menu";
    }
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 20;
    /* Ensure clicks work */
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 20;
    /* Ensure clicks work */
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: auto;
    max-width: 60%;
    /* Prevent overlap with sides */
    white-space: nowrap;
    z-index: 10;
}

/* Game Stats in Header */
.header-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.header-stats .player-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.5);
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Neon glow for logged-in users */
.header-stats .player-name.logged-in-user {
    color: var(--accent-color);
    text-shadow:
        0 0 5px var(--accent-color-glow-strong, rgba(59, 130, 246, 0.4)),
        0 0 10px var(--accent-color-glow-medium, rgba(59, 130, 246, 0.2)),
        0 0 15px var(--accent-color-glow-weak, rgba(59, 130, 246, 0.1));
}

/* Game-themed neon glow for login prompt */
.header-stats .player-name.login-prompt {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 600;
    text-shadow:
        0 0 5px var(--accent-color-glow-strong, rgba(59, 130, 246, 0.4)),
        0 0 10px var(--accent-color-glow-medium, rgba(59, 130, 246, 0.2)),
        0 0 15px var(--accent-color-glow-weak, rgba(59, 130, 246, 0.1));
    cursor: pointer;
    animation: subtle-pulse 3s ease-in-out infinite;
}

.header-stats .player-name.login-prompt:hover {
    text-shadow:
        0 0 8px var(--accent-color-glow-strong, rgba(59, 130, 246, 0.4)),
        0 0 16px var(--accent-color-glow-medium, rgba(59, 130, 246, 0.2)),
        0 0 24px var(--accent-color-glow-weak, rgba(59, 130, 246, 0.1));
    transform: scale(1.02);
}

@keyframes subtle-pulse {

    0%,
    100% {
        opacity: 0.9;
        text-shadow:
            0 0 5px var(--accent-color-glow-strong, rgba(59, 130, 246, 0.4)),
            0 0 10px var(--accent-color-glow-medium, rgba(59, 130, 246, 0.2)),
            0 0 15px var(--accent-color-glow-weak, rgba(59, 130, 246, 0.1));
    }

    50% {
        opacity: 1;
        text-shadow:
            0 0 8px var(--accent-color-glow-strong, rgba(59, 130, 246, 0.4)),
            0 0 16px var(--accent-color-glow-medium, rgba(59, 130, 246, 0.2)),
            0 0 24px var(--accent-color-glow-weak, rgba(59, 130, 246, 0.1));
    }
}

.header-stats .game-data {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
    font-family: 'Outfit', sans-serif;
    /* Ensure font consistency */
}

.header-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-stats .stat-value {
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Page Title in Header (Non-Game Pages) */
.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Global Game Button Styles */
.game-button {
    padding: 12px 32px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--bg-color);
    background-color: var(--accent-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--accent-color);
}

.game-button:active {
    transform: translateY(0);
}

.container {
    width: 100%;
    position: relative;
}

/* Global Game Container Styles */
.game-container,
#game-container {
    /* Support both class and ID for now */
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    /* Default shadow */
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
    /* Centering */
    border: 2px solid #334155;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;

    /* Dynamic glow based on accent color */
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color), 0 0 40px rgba(var(--accent-color-rgb, 59, 130, 246), 0.4);
}

header {
    text-align: center;
    margin-bottom: 4rem;
    margin-top: 2rem;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--accent-color), var(--snake-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}



p {
    font-size: 1.2rem;
    color: #cbd5e1;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

/* Game-specific hover colors */
.game-card[data-game-slug="snake"]:hover {
    border-color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.game-card[data-game-slug="moon-buggy"]:hover {
    border-color: #f59e0b;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.game-card[data-game-slug="icy_tower"]:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.game-card[data-game-slug="mahjong"]:hover {
    border-color: #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.game-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.game-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.game-info p {
    font-size: 1rem;
    color: #94a3b8;
}

/* High Scores Row */
.high-scores-row {
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-row {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    width: 100%;
}

.score-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.score-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    min-width: 30px;
    flex-shrink: 0;
}

.score-username {
    color: var(--text-color);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    cursor: help;
    position: relative;
}

.score-username-popup {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.score-username:hover .score-username-popup {
    opacity: 1;
}

.score-username.personal {
    color: var(--accent-color);
}

.score-username.team-best {
    color: #10b981;
}

.score-value {
    font-weight: 600;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.score-value.na {
    color: #64748b;
    font-weight: normal;
}

.coming-soon {
    opacity: 0.5;
    cursor: default;
}

/* Add blue glow to coming-soon card on desktop */
.game-card.coming-soon {
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Game Status Row */
.game-status-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
    height: 32px;
    width: 100%;
}

.status-icon {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    position: relative;
    transition: transform 0.2s;
}

.status-icon:hover {
    transform: scale(1.2);
}

/* Status Popup */
.status-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    margin-bottom: 8px;
}

.status-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--accent-color) transparent transparent transparent;
}

.status-icon:hover .status-popup,
.status-icon:focus .status-popup,
.status-icon.active .status-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.game-card.coming-soon:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
    opacity: 0.8;
}

footer {
    margin-top: 4rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid #1e293b;
}

/* Welcome Section */
.welcome-section {
    position: relative;
    font-family: 'Outfit', sans-serif;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.8);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #334155;
    transition: all 0.2s;
}

.user-menu-toggle:hover {
    border-color: var(--accent-color);
    background: rgba(30, 41, 59, 1);
}

.chevron {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.user-menu-toggle.active .chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 8px;
    width: 150px;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 101;
}

.dropdown-menu.show {
    display: flex !important;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    color: #cbd5e1;
}

.dropdown-item:hover {
    background: #334155;
    color: white;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

/* Prevent background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #334155;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

.form-group input {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    width: 100%;
}

/* Global Primary Button - Single Source of Truth */
.primary-btn {
    font-size: 16px;
    padding: 12px 24px;
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1.2;
    background: var(--accent-color);
    color: white;
    min-width: 140px;
    height: auto;
}

.primary-btn:hover {
    background: transparent;
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(from var(--accent-color) r g b / 0.3);
}

.primary-btn.danger {
    background: #dc2626;
    border-color: #dc2626;
}

.primary-btn.danger:hover {
    background: transparent;
    color: #dc2626;
}

.secondary-btn {
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    border: none;
}

.secondary-btn {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
}

.secondary-btn:hover {
    background: #334155;
    color: white;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.notification-toast.slide-out {
    animation: slideOutRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Activation Page Styles */
body:has(.activation-container) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.activation-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
    animation: fadeIn 0.6s ease-out;
}

.activation-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.activation-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--accent-color), var(--snake-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.activation-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

.activation-button {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    margin: 0.5rem;
}

.activation-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--accent-color);
}

.activation-button.secondary {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.activation-button.secondary:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 20px var(--accent-color);
}

.error .activation-title {
    background: linear-gradient(to right, #ef4444, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

/* Modal Structure - NON-NEGOTIABLE PATTERN */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.modal-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    min-height: 0;
}

.modal-footer {
    height: 87px;
    padding: 0 2rem;
    border-top: 1px solid #334155;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* Team Modal Styles */
.team-modal-content {
    max-width: 700px;
    width: 90vw;
    min-height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}


/* No Team State */
.no-team-content {
    text-align: center;
    padding: 2rem 0;
}

.no-team-message {
    margin-bottom: 2rem;
}

.no-team-message p {
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.team-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Team Management */
.team-management {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.team-info-section,
.team-members-section {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 12px;
}

.team-info-section h3,
.team-members-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.team-details p {
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.team-details strong {
    color: white;
    min-width: 100px;
    display: inline-block;
}

/* Team Creation Form */
.create-team-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: white;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #334155;
    background: var(--bg-color);
    color: white;
    font-family: inherit;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Flag Selection */
.flag-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid #334155;
}

.flag-option {
    background: none;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.flag-option:hover {
    border-color: #475569;
    background: #1e293b;
}

.flag-option.selected {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

/* Team Members */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid #334155;
}

.member-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.member-name {
    font-weight: 600;
    color: white;
}

.member-role {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.member-role.admin {
    background: var(--accent-color);
    color: white;
}

.member-role.member {
    background: #475569;
    color: #e2e8f0;
}

.member-status {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.member-status.active {
    background: #10b981;
    color: white;
}

.member-status.pending {
    background: #f59e0b;
    color: white;
}

/* Button Styles */
.small-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.danger-btn {
    background: #ef4444;
    color: white;
}

.danger-btn:hover {
    background: #dc2626;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    width: 100%;
}

/* Team Member View */
.team-member-view {
    padding: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .team-modal-content {
        width: 95vw;
        max-height: 90vh;
    }

    .team-management {
        gap: 1.5rem;
    }

    .team-actions {
        flex-direction: column;
        align-items: center;
    }

    .flag-selection {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    }

    .member-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .team-list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .team-list-info {
        align-items: center;
    }
}

/* Team Switching */
.switch-team-content {
    padding: 1rem 0;
}

.switch-team-description {
    margin-bottom: 1.5rem;
    color: #94a3b8;
    text-align: center;
}

.teams-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-list-item {
    background: var(--bg-color);
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.team-list-item:hover {
    border-color: #475569;
    transform: translateY(-2px);
}

.team-list-item.current-team {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

.team-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.team-list-info {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.team-list-flag {
    font-size: 2rem;
    line-height: 1;
}

.team-list-details {
    flex: 1;
}

.team-list-name {
    margin: 0 0 0.5rem 0;
    color: white;
    font-size: 1.25rem;
}

.current-team-badge {
    color: var(--accent-color);
    font-size: 0.875rem;
    font-weight: normal;
    margin-left: 0.5rem;
}

.team-list-meta {
    margin: 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

.team-list-description {
    margin: 0 0 0.5rem 0;
    color: #e2e8f0;
    font-style: italic;
}

.team-list-motto {
    margin: 0;
    color: var(--accent-color);
    font-style: italic;
    font-size: 0.875rem;
}

.privacy-badge {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    opacity: 0.8;
}

.pending-application {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.875rem;
    background: rgba(245, 158, 11, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Team Tabs System */
.team-tabs-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.team-tabs {
    display: flex;
    border-bottom: 1px solid #334155;
    background: #1e293b;
    flex-shrink: 0;
}

.team-tab {
    font-size: 16px;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

.team-tab:hover {
    color: white;
    background: rgba(59, 130, 246, 0.1);
}

.team-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

.team-tab-content {
    display: none;
    padding: 0;
}

.team-tab-content.active {
    display: block;
}

/* Request Management */
.pending-requests,
.my-applications {
    padding: 1rem 0;
}

.requests-list,
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-item,
.application-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid #334155;
    border-radius: 8px;
}

.request-info,
.application-info {
    flex: 1;
}

.request-info h4,
.application-info h4 {
    margin: 0 0 0.5rem 0;
    color: white;
}

.request-date,
.application-date {
    margin: 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

.application-status {
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.application-status.status-pending {
    color: #f59e0b;
}

.application-status.status-accepted {
    color: #10b981;
}

.application-status.status-declined {
    color: #ef4444;
}

.request-actions,
.application-actions {
    display: flex;
    gap: 0.5rem;
}

.no-requests,
.no-applications {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.no-applications p {
    margin-bottom: 0.5rem;
}

.loading,
.error {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.error {
    color: #ef4444;
}

.team-footer-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    width: 100%;
}


/* =========================================
   Utility Classes (Tailwind-style)
   ========================================= */

/* --- Margin --- */

/* All sides */
.m-0 {
    margin: 0 !important;
}

.m-1 {
    margin: 0.25rem !important;
}

.m-2 {
    margin: 0.5rem !important;
}

.m-3 {
    margin: 0.75rem !important;
}

.m-4 {
    margin: 1rem !important;
}

.m-5 {
    margin: 1.25rem !important;
}

.m-6 {
    margin: 1.5rem !important;
}

.m-8 {
    margin: 2rem !important;
}

.m-10 {
    margin: 2.5rem !important;
}

.m-12 {
    margin: 3rem !important;
}

.m-16 {
    margin: 4rem !important;
}

.m-20 {
    margin: 5rem !important;
}

.m-24 {
    margin: 6rem !important;
}

.m-32 {
    margin: 8rem !important;
}

.m-auto {
    margin: auto !important;
}

/* Horizontal (X-axis) */
.mx-0 {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.mx-1 {
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
}

.mx-2 {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
}

.mx-3 {
    margin-left: 0.75rem !important;
    margin-right: 0.75rem !important;
}

.mx-4 {
    margin-left: 1rem !important;
    margin-right: 1rem !important;
}

.mx-5 {
    margin-left: 1.25rem !important;
    margin-right: 1.25rem !important;
}

.mx-6 {
    margin-left: 1.5rem !important;
    margin-right: 1.5rem !important;
}

.mx-8 {
    margin-left: 2rem !important;
    margin-right: 2rem !important;
}

.mx-10 {
    margin-left: 2.5rem !important;
    margin-right: 2.5rem !important;
}

.mx-12 {
    margin-left: 3rem !important;
    margin-right: 3rem !important;
}

.mx-16 {
    margin-left: 4rem !important;
    margin-right: 4rem !important;
}

.mx-20 {
    margin-left: 5rem !important;
    margin-right: 5rem !important;
}

.mx-24 {
    margin-left: 6rem !important;
    margin-right: 6rem !important;
}

.mx-32 {
    margin-left: 8rem !important;
    margin-right: 8rem !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Vertical (Y-axis) */
.my-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.my-1 {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.my-2 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.my-3 {
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

.my-4 {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

.my-5 {
    margin-top: 1.25rem !important;
    margin-bottom: 1.25rem !important;
}

.my-6 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.my-8 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
}

.my-10 {
    margin-top: 2.5rem !important;
    margin-bottom: 2.5rem !important;
}

.my-12 {
    margin-top: 3rem !important;
    margin-bottom: 3rem !important;
}

.my-16 {
    margin-top: 4rem !important;
    margin-bottom: 4rem !important;
}

.my-20 {
    margin-top: 5rem !important;
    margin-bottom: 5rem !important;
}

.my-24 {
    margin-top: 6rem !important;
    margin-bottom: 6rem !important;
}

.my-32 {
    margin-top: 8rem !important;
    margin-bottom: 8rem !important;
}

.my-auto {
    margin-top: auto !important;
    margin-bottom: auto !important;
}

/* Top */
.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 0.75rem !important;
}

.mt-4 {
    margin-top: 1rem !important;
}

.mt-5 {
    margin-top: 1.25rem !important;
}

.mt-6 {
    margin-top: 1.5rem !important;
}

.mt-8 {
    margin-top: 2rem !important;
}

.mt-10 {
    margin-top: 2.5rem !important;
}

.mt-12 {
    margin-top: 3rem !important;
}

.mt-16 {
    margin-top: 4rem !important;
}

.mt-20 {
    margin-top: 5rem !important;
}

.mt-24 {
    margin-top: 6rem !important;
}

.mt-32 {
    margin-top: 8rem !important;
}

.mt-auto {
    margin-top: auto !important;
}

/* Right */
.mr-0 {
    margin-right: 0 !important;
}

.mr-1 {
    margin-right: 0.25rem !important;
}

.mr-2 {
    margin-right: 0.5rem !important;
}

.mr-3 {
    margin-right: 0.75rem !important;
}

.mr-4 {
    margin-right: 1rem !important;
}

.mr-5 {
    margin-right: 1.25rem !important;
}

.mr-6 {
    margin-right: 1.5rem !important;
}

.mr-8 {
    margin-right: 2rem !important;
}

.mr-10 {
    margin-right: 2.5rem !important;
}

.mr-12 {
    margin-right: 3rem !important;
}

.mr-16 {
    margin-right: 4rem !important;
}

.mr-20 {
    margin-right: 5rem !important;
}

.mr-24 {
    margin-right: 6rem !important;
}

.mr-32 {
    margin-right: 8rem !important;
}

.mr-auto {
    margin-right: auto !important;
}

/* Bottom */
.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-5 {
    margin-bottom: 1.25rem !important;
}

.mb-6 {
    margin-bottom: 1.5rem !important;
}

.mb-8 {
    margin-bottom: 2rem !important;
}

.mb-10 {
    margin-bottom: 2.5rem !important;
}

.mb-12 {
    margin-bottom: 3rem !important;
}

.mb-16 {
    margin-bottom: 4rem !important;
}

.mb-20 {
    margin-bottom: 5rem !important;
}

.mb-24 {
    margin-bottom: 6rem !important;
}

.mb-32 {
    margin-bottom: 8rem !important;
}

.mb-auto {
    margin-bottom: auto !important;
}

/* Left */
.ml-0 {
    margin-left: 0 !important;
}

.ml-1 {
    margin-left: 0.25rem !important;
}

.ml-2 {
    margin-left: 0.5rem !important;
}

.ml-3 {
    margin-left: 0.75rem !important;
}

.ml-4 {
    margin-left: 1rem !important;
}

.ml-5 {
    margin-left: 1.25rem !important;
}

.ml-6 {
    margin-left: 1.5rem !important;
}

.ml-8 {
    margin-left: 2rem !important;
}

.ml-10 {
    margin-left: 2.5rem !important;
}

.ml-12 {
    margin-left: 3rem !important;
}

.ml-16 {
    margin-left: 4rem !important;
}

.ml-20 {
    margin-left: 5rem !important;
}

.ml-24 {
    margin-left: 6rem !important;
}

.ml-32 {
    margin-left: 8rem !important;
}

.ml-auto {
    margin-left: auto !important;
}

/* --- Padding --- */

/* All sides */
.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 0.25rem !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-3 {
    padding: 0.75rem !important;
}

.p-4 {
    padding: 1rem !important;
}

.p-5 {
    padding: 1.25rem !important;
}

.p-6 {
    padding: 1.5rem !important;
}

.p-8 {
    padding: 2rem !important;
}

.p-10 {
    padding: 2.5rem !important;
}

.p-12 {
    padding: 3rem !important;
}

.p-16 {
    padding: 4rem !important;
}

.p-20 {
    padding: 5rem !important;
}

.p-24 {
    padding: 6rem !important;
}

.p-32 {
    padding: 8rem !important;
}

/* Horizontal (X-axis) */
.px-0 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.px-1 {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

.px-2 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.px-3 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.px-5 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

.px-6 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.px-8 {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.px-10 {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
}

.px-12 {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
}

.px-16 {
    padding-left: 4rem !important;
    padding-right: 4rem !important;
}

.px-20 {
    padding-left: 5rem !important;
    padding-right: 5rem !important;
}

.px-24 {
    padding-left: 6rem !important;
    padding-right: 6rem !important;
}

.px-32 {
    padding-left: 8rem !important;
    padding-right: 8rem !important;
}

/* Vertical (Y-axis) */
.py-0 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.py-1 {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.py-5 {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

.py-6 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.py-8 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

.py-10 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

.py-12 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.py-16 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

.py-20 {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}

.py-24 {
    padding-top: 6rem !important;
    padding-bottom: 6rem !important;
}

.py-32 {
    padding-top: 8rem !important;
    padding-bottom: 8rem !important;
}

/* Top */
.pt-0 {
    padding-top: 0 !important;
}

.pt-1 {
    padding-top: 0.25rem !important;
}

.pt-2 {
    padding-top: 0.5rem !important;
}

.pt-3 {
    padding-top: 0.75rem !important;
}

.pt-4 {
    padding-top: 1rem !important;
}

.pt-5 {
    padding-top: 1.25rem !important;
}

.pt-6 {
    padding-top: 1.5rem !important;
}

.pt-8 {
    padding-top: 2rem !important;
}

.pt-10 {
    padding-top: 2.5rem !important;
}

.pt-12 {
    padding-top: 3rem !important;
}

.pt-16 {
    padding-top: 4rem !important;
}

.pt-20 {
    padding-top: 5rem !important;
}

.pt-24 {
    padding-top: 6rem !important;
}

.pt-32 {
    padding-top: 8rem !important;
}

/* Right */
.pr-0 {
    padding-right: 0 !important;
}

.pr-1 {
    padding-right: 0.25rem !important;
}

.pr-2 {
    padding-right: 0.5rem !important;
}

.pr-3 {
    padding-right: 0.75rem !important;
}

.pr-4 {
    padding-right: 1rem !important;
}

.pr-5 {
    padding-right: 1.25rem !important;
}

.pr-6 {
    padding-right: 1.5rem !important;
}

.pr-8 {
    padding-right: 2rem !important;
}

.pr-10 {
    padding-right: 2.5rem !important;
}

.pr-12 {
    padding-right: 3rem !important;
}

.pr-16 {
    padding-right: 4rem !important;
}

.pr-20 {
    padding-right: 5rem !important;
}

.pr-24 {
    padding-right: 6rem !important;
}

.pr-32 {
    padding-right: 8rem !important;
}

/* Bottom */
.pb-0 {
    padding-bottom: 0 !important;
}

.pb-1 {
    padding-bottom: 0.25rem !important;
}

.pb-2 {
    padding-bottom: 0.5rem !important;
}

.pb-3 {
    padding-bottom: 0.75rem !important;
}

.pb-4 {
    padding-bottom: 1rem !important;
}

.pb-5 {
    padding-bottom: 1.25rem !important;
}

.pb-6 {
    padding-bottom: 1.5rem !important;
}

.pb-8 {
    padding-bottom: 2rem !important;
}

.pb-10 {
    padding-bottom: 2.5rem !important;
}

.pb-12 {
    padding-bottom: 3rem !important;
}

.pb-16 {
    padding-bottom: 4rem !important;
}

.pb-20 {
    padding-bottom: 5rem !important;
}

.pb-24 {
    padding-bottom: 6rem !important;
}

.pb-32 {
    padding-bottom: 8rem !important;
}

/* Left */
.pl-0 {
    padding-left: 0 !important;
}

.pl-1 {
    padding-left: 0.25rem !important;
}

.pl-2 {
    padding-left: 0.5rem !important;
}

.pl-3 {
    padding-left: 0.75rem !important;
}

.pl-4 {
    padding-left: 1rem !important;
}

.pl-5 {
    padding-left: 1.25rem !important;
}

.pl-6 {
    padding-left: 1.5rem !important;
}

.pl-8 {
    padding-left: 2rem !important;
}

.pl-10 {
    padding-left: 2.5rem !important;
}

.pl-12 {
    padding-left: 3rem !important;
}

.pl-16 {
    padding-left: 4rem !important;
}

.pl-20 {
    padding-left: 5rem !important;
}

.pl-24 {
    padding-left: 6rem !important;
}

.pl-32 {
    padding-left: 8rem !important;
}

/* ============================================
 * MOBILE RESPONSIVE STYLES FOR HEADER BAR
 * ============================================ */

/* Mobile header adjustments */
@media (max-width: 768px) {
    .top-bar {
        height: 50px;
        /* Smaller height on mobile */
        padding: 0 1rem;
        /* Reduced padding */
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
        /* Remove border radius on mobile for full-width */
    }

    /* Mobile-optimized footer controls */
    .controls-legend {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        padding: 8px 16px !important;
        gap: 8px !important;
        justify-content: space-between !important;
        align-items: center !important;
        height: 50px !important;
        width: calc(100% - 40px) !important;
        max-width: calc(1200px - 40px) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        border-top-left-radius: 12px !important;
        border-top-right-radius: 12px !important;

    }

    /* Hide the desktop click instruction on mobile */
    .controls-legend .control-item:first-child {
        display: none !important;
    }

    /* Mobile compact icon buttons */
    .controls-legend .secondary-btn {
        font-size: 14px !important;
        padding: 6px 8px !important;
        min-width: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Help button - show text with count */
    .controls-legend .help-control .secondary-btn {
        padding: 6px 12px !important;
        min-width: auto !important;
        white-space: nowrap !important;
    }

    /* Mobile footer button layout */
    .controls-legend .control-item {
        margin: 0 !important;
    }

    /* Mobile-specific: hide text content, show only icons for compact buttons */
    .controls-legend #footer-restart-btn::after,
    .controls-legend #footer-menu-btn::after {
        display: none !important;
    }

    .header-btn {
        width: 36px;
        height: 36px;
    }

    .header-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Remove hover effects on touch devices */
    .header-btn:hover {
        transform: none;
    }

    /* Add touch feedback instead */
    .header-btn:active {
        transform: scale(0.9);
    }

    /* Mobile user menu adjustments */
    .user-menu-toggle {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .dropdown-menu {
        right: -8px;
        /* Align better on mobile */
        min-width: 150px;
        font-size: 0.9rem;
    }

    .dropdown-item {
        padding: 12px 16px;
        /* Larger touch targets */
        min-height: 44px;
        /* Apple's recommended touch target */
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .top-bar {
        height: 60px;
        padding: 0 0.75rem;
    }

    .header-btn {
        width: 32px;
        height: 32px;
    }

    .header-btn svg {
        width: 18px;
        height: 18px;
    }

    .user-menu-toggle {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .dropdown-menu {
        font-size: 0.85rem;
        min-width: 140px;
    }

    .dropdown-item {
        padding: 10px 14px;
    }
}

/* Game-specific mobile header adjustments */
@media (max-width: 768px) {
    .stats-display {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.8rem;
        text-align: center;
        line-height: 1.2;
    }

    .stats-display #username-display {
        font-size: 0.9rem;
        font-weight: 600;
    }

    .stat-item {
        font-size: 0.75rem;
    }
}

/* Landscape mobile orientation for header */
@media (max-width: 768px) and (orientation: landscape) {
    .top-bar {
        height: 40px;
    }

    .stats-display {
        flex-direction: row;
        gap: 0.5rem;
        font-size: 0.7rem;
    }

    .stats-display #username-display {
        font-size: 0.8rem;
    }
}

/* ============================================
 * MOBILE MAIN PAGE LAYOUT
 * ============================================ */

/* Mobile-only: Show Snake, Snowy Mountain, and Mahjong games */
@media (max-width: 768px) {

    /* Hide all games on mobile first */
    .game-card {
        display: none !important;
    }

    /* Then explicitly show mobile-friendly games */
    .game-card[data-game-slug="snake"],
    .game-card[data-game-slug="snowy_mountain"],
    .game-card[data-game-slug="mahjong"] {
        display: block !important;
    }

    /* Center the mobile-friendly game cards */
    .game-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 2rem auto;
        padding: 0px;
    }

    /* Adjust Snake game card for mobile */
    .game-card[data-game-slug="snake"] {
        padding: 2rem;
        border-radius: 16px;
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
        border: 2px solid rgba(16, 185, 129, 0.3);
        box-shadow:
            0 0 30px rgba(16, 185, 129, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .game-card[data-game-slug="snake"]:hover {
        border-color: rgba(16, 185, 129, 0.6);
        box-shadow:
            0 0 40px rgba(16, 185, 129, 0.3),
            0 15px 40px rgba(0, 0, 0, 0.4);
    }

    /* Make Snake icon bigger on mobile */
    .game-card[data-game-slug="snake"] .game-icon {
        font-size: 5rem;
        margin-bottom: 1.5rem;
        text-shadow: 0 0 20px #10b981;
    }

    /* Adjust text for mobile Snake card */
    .game-card[data-game-slug="snake"] h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: #10b981;
        text-shadow: 0 0 15px #10b981;
    }

    .game-card[data-game-slug="snake"] p {
        font-size: 1.1rem;
        line-height: 1.5;
        color: #cbd5e1;
        text-align: center;
    }

    /* Adjust Snowy Mountain game card for mobile */
    .game-card[data-game-slug="snowy_mountain"] {
        padding: 2rem;
        border-radius: 16px;
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
        border: 2px solid rgba(147, 197, 253, 0.3);
        box-shadow:
            0 0 30px rgba(147, 197, 253, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.3);
        margin-bottom: 1.5rem;
    }

    .game-card[data-game-slug="snowy_mountain"]:hover {
        border-color: rgba(147, 197, 253, 0.6);
        box-shadow:
            0 0 40px rgba(147, 197, 253, 0.3),
            0 15px 40px rgba(0, 0, 0, 0.4);
    }

    /* Make Snowy Mountain icon bigger on mobile */
    .game-card[data-game-slug="snowy_mountain"] .game-icon {
        font-size: 5rem;
        margin-bottom: 1.5rem;
        text-shadow: 0 0 20px #93c5fd;
    }

    /* Adjust text for mobile Snowy Mountain card */
    .game-card[data-game-slug="snowy_mountain"] h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: #93c5fd;
        text-shadow: 0 0 15px #93c5fd;
    }

    .game-card[data-game-slug="snowy_mountain"] p {
        font-size: 1.1rem;
        line-height: 1.5;
        color: #cbd5e1;
        text-align: center;
    }

    /* Adjust Mahjong game card for mobile */
    .game-card[data-game-slug="mahjong"] {
        padding: 2rem;
        border-radius: 16px;
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
        border: 2px solid rgba(168, 85, 247, 0.3);
        box-shadow:
            0 0 30px rgba(168, 85, 247, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.3);
        margin-bottom: 1.5rem;
    }

    .game-card[data-game-slug="mahjong"]:hover {
        border-color: rgba(168, 85, 247, 0.6);
        box-shadow:
            0 0 40px rgba(168, 85, 247, 0.3),
            0 15px 40px rgba(0, 0, 0, 0.4);
    }

    /* Make Mahjong icon bigger on mobile */
    .game-card[data-game-slug="mahjong"] .game-icon {
        font-size: 5rem;
        margin-bottom: 1.5rem;
        text-shadow: 0 0 20px #a855f7;
    }

    /* Adjust text for mobile Mahjong card */
    .game-card[data-game-slug="mahjong"] h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: #a855f7;
        text-shadow: 0 0 15px #a855f7;
    }

    .game-card[data-game-slug="mahjong"] p {
        font-size: 1.1rem;
        line-height: 1.5;
        color: #cbd5e1;
        text-align: center;
    }

    /* Style the coming-soon card to match game card width and add blue glow */
    .game-card.coming-soon {
        max-width: 400px;
        margin: 1rem auto !important;
        padding: 2rem;
        border-radius: 16px;
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95)) !important;
        border: 2px solid rgba(59, 130, 246, 0.3) !important;
        box-shadow:
            0 0 30px rgba(59, 130, 246, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.3) !important;
        opacity: 0.7 !important;
    }

    .game-card.coming-soon:hover {
        transform: translateY(-10px) !important;
        border-color: var(--accent-color) !important;
        box-shadow:
            0 0 40px rgba(59, 130, 246, 0.4),
            0 15px 40px rgba(0, 0, 0, 0.4) !important;
        opacity: 0.9 !important;
    }
}

/* Mobile note for desktop users */
.mobile-library-note {
    display: none;
}

@media (max-width: 768px) {
    .mobile-library-note {
        display: block;
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
        border: 2px solid rgba(59, 130, 246, 0.3);
        border-radius: 16px;
        padding: 2rem;
        margin: 2rem auto;
        max-width: 400px;
        text-align: center;
        color: #cbd5e1;
        box-shadow:
            0 0 30px rgba(59, 130, 246, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .mobile-library-note h3 {
        color: var(--accent-color);
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .mobile-library-note p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0;
    }
}

/* Mobile Body Padding */
@media (max-width: 768px) {
    body {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Privacy Settings Neon Button */
.privacy-settings-link.neon-button {
    display: inline-block;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 20px 0;
    transition: all 0.3s ease;
    box-shadow:
        0 0 20px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.privacy-settings-link.neon-button:hover {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
    box-shadow:
        0 0 30px rgba(16, 185, 129, 0.3),
        0 0 60px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.privacy-settings-link.neon-button:active {
    transform: translateY(0);
    box-shadow:
        0 0 20px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================ */
/* GAME STATS ADMIN TABLE STYLES */
/* ============================================ */



.games-table-container {
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
}

.games-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-color);
}

.games-table th {
    background: var(--accent-color);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}

.games-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.games-table th.sortable:hover {
    background: #4f46e5;
}

.games-table th.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 12px;
}

.games-table th.sortable.active::after {
    opacity: 1;
}

.games-table th.sortable.active.desc::after {
    content: '↓';
}

.games-table th.sortable.active.asc::after {
    content: '↑';
}

.games-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    vertical-align: top;
}

.games-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.game-info strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.game-info small {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.3;
}

.engagement-score {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.engagement-score.score-high {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.engagement-score.score-medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.engagement-score.score-low {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.games-table .loading,
.games-table .error,
.games-table .no-data {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-style: italic;
}

.games-table .error {
    color: #ef4444;
}

.games-summary {
    background: var(--card-bg);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.games-summary h4 {
    margin: 0 0 16px 0;
    color: var(--accent-color);
    font-size: 18px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

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

.summary-stat .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.summary-stat .stat-label {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .games-table-container {
        overflow-x: auto;
    }

    .games-table {
        min-width: 800px;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
 * MOBILE UI IMPROVEMENTS
 * ============================================ */
/* Mobile Primary Button and Tab Optimization */
@media (max-width: 768px) {

    /* Smaller, more compact buttons */
    .primary-btn {
        font-size: 14px !important;
        padding: 10px 18px !important;
        min-width: 100px !important;
    }

    /* Hide emojis in tab buttons on mobile */
    .admin-tab,
    .tab-btn {
        font-size: 14px !important;
        padding: 0.8rem 1rem !important;
    }

    /* Mobile-friendly tabs with emojis and shorter labels */
    .admin-tab[data-tab="my-team"] {
        font-size: 0 !important;
    }

    .admin-tab[data-tab="my-team"]:after {
        content: "👥 My Team";
        font-size: 14px;
    }

    .admin-tab[data-tab="browse"] {
        font-size: 0 !important;
    }

    .admin-tab[data-tab="browse"]:after {
        content: "🔍 Browse";
        font-size: 14px;
    }

    .admin-tab[data-tab="requests"] {
        font-size: 0 !important;
    }

    .admin-tab[data-tab="requests"]:after {
        content: "📋 Requests";
        font-size: 14px;
    }

    /* Hamburger menu for mobile context menu */
    .welcome-section .user-menu-toggle {
        width: 35px !important;
        height: 35px !important;
        border-radius: 6px;
        border: 1px solid #334155;
        background: rgba(30, 41, 59, 0.8);
        backdrop-filter: blur(10px);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        padding: 0 !important;
    }

    .welcome-section .user-menu-toggle span {
        display: none !important;
        /* Hide welcome text */
    }

    /* Hamburger icon */
    .welcome-section .user-menu-toggle:before {
        content: '';
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text-color);
        box-shadow: 0 6px 0 var(--text-color), 0 12px 0 var(--text-color);
        transition: all 0.3s ease;
        position: relative;
        top: -5px;
    }

    .welcome-section .user-menu-toggle:hover:before {
        background: var(--accent-color);
        box-shadow: 0 6px 0 var(--accent-color), 0 12px 0 var(--accent-color);
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .primary-btn {
        font-size: 12px !important;
        padding: 8px 14px !important;
        min-width: 80px !important;
    }

    /* Ensure mobile games are visible on extra small screens */
    .game-card {
        display: none !important;
    }

    .game-card[data-game-slug="snake"],
    .game-card[data-game-slug="snowy_mountain"],
    .game-card[data-game-slug="mahjong"] {
        display: block !important;
    }
}