:root {
    --primary: #ffde59;
    /* Bright Yellow */
    --primary-dark: #f9d423;
    --secondary: #ff66c4;
    /* Playful Pink */
    --accent: #5ce1e6;
    /* Aqua Blue */
    --bg-light: #fff9e6;
    --text-dark: #444;
    --card-bg: #ffffff;
    --shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&family=Bubblegum+Sans&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--accent);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Soft pattern background */
    background-image: radial-gradient(#ffffff 2px, transparent 2px);
    background-size: 30px 30px;
}

#app {
    width: 100%;
    max-width: 450px;
    height: 100%;
    max-height: 800px;
    background: var(--bg-light);
    border: 10px solid white;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    position: relative;
    padding: 30px;
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hidden {
    display: none !important;
    transform: scale(0.8);
    opacity: 0;
}

/* Settings Bar */
.settings-bar {
    position: absolute;
    top: 20px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.lang-selector {
    display: flex;
    gap: 8px;
}

.lang-btn,
.mute-btn {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    line-height: 1;
}

.lang-btn:active,
.mute-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

.lang-btn.active {
    background: var(--primary);
    border: 2px solid white;
}

/* Kids Typography */
.logo {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 4rem;
    color: var(--secondary);
    text-shadow: 4px 4px 0px white;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.1));
}

.logo span {
    color: var(--accent);
}

.subtitle {
    font-weight: 700;
    color: #888;
    margin-bottom: 3rem;
}

/* Bouncy Buttons */
.btn {
    padding: 1.2rem 2rem;
    border-radius: 25px;
    border: none;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-bottom: 1.2rem;
    font-family: 'Bubblegum Sans', cursive;
    position: relative;
    top: 0;
}

.primary {
    background-color: var(--primary);
    color: var(--text-dark);
    box-shadow: 0 8px 0 var(--primary-dark);
}

.primary:active {
    top: 4px;
    box-shadow: 0 4px 0 var(--primary-dark);
}

.secondary {
    background-color: white;
    color: var(--secondary);
    box-shadow: 0 8px 0 #eee;
    border: 2px solid #eee;
}

.secondary:active {
    top: 4px;
    box-shadow: 0 4px 0 #eee;
}

/* Pairing Screen - Kids Style */
.pairing-container h2 {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.scanner {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    background: white;
    margin: 0 auto 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.radar {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 30px;
    border: 5px solid var(--accent);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

#room-info {
    background: white;
    padding: 15px;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 3px dashed var(--accent);
}

#my-peer-id {
    font-size: 2.5rem;
    color: var(--accent);
    display: block;
    font-family: 'Bubblegum Sans', cursive;
}

.input-group input {
    width: 100%;
    background: white;
    border: 3px solid #eee;
    padding: 1rem;
    border-radius: 20px;
    font-size: 1.5rem;
    text-align: center;
    font-family: 'Bubblegum Sans', cursive;
    margin-bottom: 1rem;
}

/* Game Screen */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px;
}

.player-card {
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.score {
    font-size: 2.5rem;
    color: var(--secondary);
    font-family: 'Bubblegum Sans';
}

/* Lobby List */
#lobby-container {
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
}

#lobby-title {
    font-family: 'Bubblegum Sans', cursive;
    color: var(--secondary);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.player-list {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 10px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid transparent;
}

.player-item:hover {
    transform: scale(1.02);
    border-color: var(--primary);
}

.player-item .player-name {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.player-item .player-id {
    background: var(--light-bg);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--secondary);
}

.lobby-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

@keyframes battle-zoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.anim-shake {
    animation: shake 0.5s ease-in-out;
}

.anim-zoom {
    animation: battle-zoom 0.5s ease-in-out;
}

.battle-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.choice-slot {
    width: 140px;
    height: 140px;
    border-radius: 35px;
    background: white;
    border: 6px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.choice-slot.waiting {
    border-style: dashed;
    border-color: #eee;
}

.choice-slot svg {
    width: 80px;
    height: 80px;
    color: var(--secondary);
}

#game-status {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 2rem;
    color: var(--text-dark);
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    min-width: 200px;
}

.controls {
    display: flex;
    gap: 15px;
    padding-bottom: 20px;
}

.choice-btn {
    background: white;
    border: none;
    border-radius: 25px;
    padding: 15px;
    box-shadow: var(--shadow);
    cursor: pointer;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.choice-btn:hover {
    transform: translateY(-5px);
}

.choice-btn:active {
    transform: translateY(0);
}

.choice-btn svg {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
    color: var(--accent);
}

.choice-btn span {
    font-weight: 700;
    font-size: 1rem;
}

/* Result Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.result-card {
    background: white;
    border-radius: 40px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 100%;
    max-width: 320px;
    border: 8px solid var(--primary);
    transform: scale(1);
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

#result-text {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 3rem;
    margin-bottom: 2rem;
    line-height: 1.2;
}

/* Confetti Container */
#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
}