:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --secondary: #00cec9;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --accent-win: #00b894;
    --accent-lose: #ff7675;
    --accent-draw: #fdcb6e;
    --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;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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: 11px;
    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: 30px 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: 8px;
    font-size: 22px;
}

p {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 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, opacity 0.2s;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    margin-top: 12px;
}

.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);
}

.btn.secondary {
    background: var(--glass);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.subtext {
    font-size: 12px;
    margin-top: 15px;
    height: 18px;
}

/* Game Container */
#game-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.score-board {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.player.active {
    color: var(--secondary);
}

.avatar {
    font-size: 28px;
    margin-bottom: 5px;
}

.name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

.score {
    font-size: 20px;
    font-weight: 800;
    margin-top: 5px;
}

.vs {
    display: flex;
    align-items: center;
    font-weight: 800;
    color: var(--text-dim);
    margin: 0 20px;
}

/* Battle Area */
#battle-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.choices-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    width: 100%;
}

.choice-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-card:hover {
    background: var(--glass);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.choice-card:active {
    transform: scale(0.98);
}

.choice-emoji {
    font-size: 40px;
    margin-right: 20px;
}

.choice-label {
    font-size: 18px;
    font-weight: 600;
}

#waiting-msg {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    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: 28px;
    text-align: center;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 320px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.reveal-area {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 25px;
}

.reveal-choice {
    font-size: 48px;
    width: 80px;
    height: 80px;
    background: var(--glass);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.reveal-vs {
    font-weight: 800;
    color: var(--text-dim);
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-height: 600px) {
    .choices-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .choice-card {
        flex-direction: column;
        padding: 10px;
    }

    .choice-emoji {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 32px;
    }

    .choice-label {
        font-size: 14px;
    }
}