:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --secondary: #00cec9;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --accent-red: #ff7675;
    --accent-yellow: #feca57;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-weight: 800;
    font-size: 24px;
    background: linear-gradient(135deg, var(--text-light), var(--text-dim));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--glass);
    border: 1px solid var(--border);
    font-weight: 600;
}

/* Lobby */
#lobby-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.card {
    background: var(--bg-card);
    padding: 40px 20px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.icon-wrapper {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.3));
}

h2 {
    margin-bottom: 10px;
    font-size: 22px;
}

p.subtext {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 15px;
    min-height: 20px;
}

.btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    margin-top: 20px;
}

.btn.secondary {
    background: var(--glass);
    color: var(--text-light);
    border: 1px solid var(--border);
}

/* Game Area */
#game-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-board {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.player.active {
    opacity: 1;
}

.player .avatar {
    font-size: 24px;
    margin-bottom: 5px;
}

.player .name {
    font-size: 12px;
    font-weight: 600;
}

.vs {
    display: flex;
    align-items: center;
    font-weight: 800;
    color: var(--text-dim);
    font-size: 14px;
}

.board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 380px;
    aspect-ratio: 7/6;
    background: var(--bg-card);
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.cell {
    background: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.3s ease;
    position: relative;
}

.cell::before {
    content: '';
    display: block;
    padding-bottom: 100%;
}

.cell.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.disc {
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    animation: drop 0.4s ease;
}

.disc.red {
    background: radial-gradient(circle at 30% 30%, var(--accent-red), #d63031);
    box-shadow: 0 2px 8px rgba(255, 118, 117, 0.5);
}

.disc.yellow {
    background: radial-gradient(circle at 30% 30%, var(--accent-yellow), #f39c12);
    box-shadow: 0 2px 8px rgba(254, 202, 87, 0.5);
}

@keyframes drop {
    from {
        transform: translateY(-400%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border);
    width: 80%;
    max-width: 300px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal h2 {
    font-size: 28px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff, #bbb);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal p {
    color: var(--text-dim);
    margin-bottom: 25px;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}