* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    background: #0d0d12;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(124, 58, 237, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 80% 50%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(251, 191, 36, 0.06) 0%, transparent 50%);
    min-height: 100vh;
    color: #e8e8ec;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== HOME PAGE ========== */
.home-page {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
    animation: homeFadeIn 0.6s ease-out;
}

@keyframes homeFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(180deg, #fff 0%, #c4b5fd 40%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.4));
}

.hero-dash {
    -webkit-text-fill-color: #a78bfa;
    filter: none;
}

.hero-tagline {
    font-size: 1.15rem;
    color: #94a3b8;
    margin-bottom: 48px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.home-leaderboards {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 900px;
    margin-bottom: 40px;
}

.home-leaderboard {
    flex: 1;
    min-width: 260px;
    max-width: 420px;
    background: rgba(20, 20, 28, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.home-leaderboard-duel {
    border-color: rgba(124, 58, 237, 0.2);
}

.home-leaderboard-daily {
    border-color: rgba(14, 165, 233, 0.2);
}

.home-leaderboard-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 4px;
    text-align: center;
    letter-spacing: 0.05em;
}

.home-leaderboard-daily .home-leaderboard-title {
    color: #38bdf8;
}

.home-leaderboard-sub {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 14px;
}

.home-leaderboard-list {
    max-height: 220px;
    overflow-y: auto;
}

.home-leaderboard-list .home-lb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 6px;
    background: rgba(30, 30, 42, 0.8);
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.home-leaderboard-list .home-lb-row:hover {
    background: rgba(45, 45, 60, 0.9);
    border-color: rgba(124, 58, 237, 0.3);
}

.home-lb-row .home-lb-rank {
    font-weight: 800;
    color: #7c3aed;
    min-width: 32px;
    font-size: 1rem;
}

.home-lb-row .home-lb-name {
    flex: 1;
    font-weight: 600;
    color: #e2e8f0;
    padding: 0 12px;
}

.home-lb-row .home-lb-stats {
    font-size: 0.9rem;
    color: #22c55e;
    font-weight: 600;
}

.home-leaderboard-list .home-lb-empty {
    text-align: center;
    color: #64748b;
    padding: 24px 16px;
    font-size: 0.95rem;
}

.home-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 900px;
}

.home-btn {
    padding: 20px 28px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    font-family: 'Outfit', sans-serif;
}

.home-btn:hover {
    transform: translateY(-3px);
}

/* Practice: smaller, left-aligned to match Duel leaderboard */
.home-btn-practice {
    flex: 0 0 auto;
    padding: 14px 22px;
    font-size: 1rem;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: #e2e8f0;
    border-color: rgba(100, 116, 139, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.home-btn-practice:hover {
    border-color: #64748b;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.home-btn-center {
    flex: 1;
    min-width: 160px;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #fff;
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.35);
}

.home-btn-center:hover {
    border-color: #a78bfa;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.5);
}

.home-btn-right {
    flex: 1;
    min-width: 160px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

.home-btn-right:hover {
    border-color: #38bdf8;
    box-shadow: 0 8px 28px rgba(14, 165, 233, 0.4);
}

.back-home-btn {
    background: rgba(50, 50, 65, 0.9);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.3);
    padding: 8px 14px;
    font-size: 0.95rem;
    border-radius: 8px;
    margin-right: 16px;
}

.back-home-btn:hover {
    background: rgba(70, 70, 90, 0.95);
    border-color: #a78bfa;
}

/* Practice view: single Wordle, unlimited */
.practice-view,
.play-view {
    animation: homeFadeIn 0.3s ease-out;
}

.practice-view.hidden,
.play-view.hidden {
    display: none !important;
}

.practice-view:not(.hidden),
.play-view:not(.hidden) {
    display: block;
}

.practice-area {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
}

.practice-status {
    color: #94a3b8;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.practice-grid {
    margin: 0 auto 24px;
}

.practice-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.practice-controls input {
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 200px;
    background: rgba(30, 30, 42, 0.9);
    color: #e2e8f0;
}

.practice-controls input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.practice-next-wrap {
    padding: 20px;
    background: rgba(30, 30, 42, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.practice-result-text {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 16px;
}

.practice-next-btn {
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border-radius: 10px;
}

.practice-next-btn:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

#gamePage header {
    background: rgba(20, 20, 28, 0.95);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

#gamePage header h1 {
    color: #a78bfa;
    font-family: 'Bangers', cursive;
    font-size: 1.75rem;
    letter-spacing: 0.03em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-info span {
    font-weight: bold;
    color: #e0e0e0;
}

.creator-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    margin-right: 8px;
}

.creator-badge-small {
    color: #f59e0b;
    margin-left: 4px;
}

.modal-hint {
    color: #aaa;
    font-size: 14px;
    margin: -10px 0 15px;
}

button {
    padding: 10px 20px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

button:hover {
    background: #6d28d9;
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

button:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
    opacity: 0.6;
}

.game-container {
    display: flex;
    gap: 20px;
}

.game-area {
    flex: 1;
    background: rgba(30, 30, 46, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar {
    width: 300px;
    background: rgba(30, 30, 46, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.sidebar h2 {
    color: #7c3aed;
    margin-bottom: 15px;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-item {
    padding: 15px;
    background: rgba(40, 40, 60, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    color: #e0e0e0;
}

.user-item:hover {
    background: rgba(60, 60, 80, 0.9);
    border-color: #7c3aed;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.user-item.active {
    background: #7c3aed;
    color: white;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.6);
}

.empty-message {
    color: #888;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.game-status {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 5px;
    background: rgba(40, 40, 60, 0.8);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wordle-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 0 auto;
    max-width: 400px;
}

.letter-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(40, 40, 60, 0.8);
    color: #e0e0e0;
    text-transform: uppercase;
    transition: all 0.3s;
}

.letter-cell.filled {
    border-color: rgba(255, 255, 255, 0.5);
}

.letter-cell.gray {
    background: #787c7e;
    color: white;
    border-color: #787c7e;
}

.letter-cell.yellow {
    background: #c9b458;
    color: white;
    border-color: #c9b458;
}

.letter-cell.green {
    background: #6aaa64;
    color: white;
    border-color: #6aaa64;
}

.letter-cell.hidden-letter {
    color: transparent;
    text-shadow: none;
}

.grids-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
    margin: 20px 0;
    flex-wrap: wrap;
}

.grid-section {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    text-align: center;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.grid-section h3 {
    color: #7c3aed;
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
    font-size: 1.2em;
    margin: 0;
}

.timer {
    background: rgba(40, 40, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 1.1em;
    font-weight: bold;
    color: #7c3aed;
    font-family: 'Courier New', monospace;
    min-width: 70px;
    text-align: center;
}

.timer.running {
    border-color: #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
    animation: pulse 2s infinite;
}

.timer.finished {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
    }
}

.game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.hidden-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.letter-cell.input-cell {
    cursor: text;
    border-color: #7c3aed;
    background: rgba(60, 50, 80, 0.5);
}

.letter-cell.input-cell:focus-within,
.wordle-grid:has(.input-cell) .letter-cell.input-cell:hover {
    border-color: #a78bfa;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
}

.letter-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 420px;
}

.letter-key {
    width: 28px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
    background: rgba(50, 50, 65, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.letter-key.used-gray {
    background: #787c7e;
    border-color: #787c7e;
    color: #fff;
}

.letter-key.used-yellow {
    background: #c9b458;
    border-color: #c9b458;
    color: #fff;
}

.letter-key.used-green {
    background: #6aaa64;
    border-color: #6aaa64;
    color: #fff;
}

.opponent-status {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 10px;
    text-align: center;
    min-height: 1.4em;
}

.challenge-area {
    text-align: center;
    padding: 40px;
    color: #aaa;
}

.daily-section {
    margin-top: 25px;
    padding: 20px;
    background: rgba(40, 40, 60, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.daily-section h3 {
    color: #7c3aed;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.daily-status {
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
}

.daily-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.daily-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.bot-challenge {
    margin-bottom: 20px;
}

.sidebar-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.bot-btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    background: rgba(60, 60, 80, 0.9);
    font-size: 13px;
}

.bot-btn:hover {
    background: rgba(80, 80, 100, 0.95);
    border-color: #7c3aed;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(40, 40, 60, 0.8);
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 15px;
}

.leaderboard-row .rank {
    font-weight: bold;
    color: #7c3aed;
    min-width: 28px;
}

.leaderboard-row .lb-name {
    flex: 1;
    font-weight: 600;
}

.leaderboard-row .lb-stats {
    color: #22c55e;
    font-size: 14px;
}

.leaderboard-sub {
    color: #888;
    font-size: 14px;
    margin: -10px 0 10px;
}

.modal-wide {
    min-width: 360px;
    max-width: 480px;
}

.secondary-btn {
    background: #4a4a6a;
}

.secondary-btn:hover {
    background: #5a5a7a;
}

.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1e1e2e;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 300px;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #7c3aed;
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.modal-content input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    margin-bottom: 20px;
    background: rgba(40, 40, 60, 0.8);
    color: #e0e0e0;
}

.modal-content input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.modal-content input::placeholder {
    color: #888;
}

.modal-content button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

/* Notification System */
.notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    animation: slideIn 0.3s ease-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.notification.error {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.notification.success {
    border-left: 4px solid #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.notification.info {
    border-left: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.notification.warning {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.notification-close {
    background: none;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.accept-btn {
    flex: 1;
    background: #22c55e;
}

.accept-btn:hover {
    background: #16a34a;
}

.decline-btn {
    flex: 1;
    background: #ef4444;
}

.decline-btn:hover {
    background: #dc2626;
}

/* Animations */
@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

.letter-cell.animating {
    animation: flip 0.5s;
}

