:root {
    --heart-size: 20px;
    --primary-color: #fafbc1;     /* Dark navy */
    --secondary-color: #4A69BD;   /* Deep blue */
    --accent-color: #2E86C1;      /* Bright blue */
    --success-color: #27AE60;     /* Vibrant green */
    --player1-bg:  #D6EAF8;       /* Light sky blue */ 
    --player2-bg:  #EBF5FB;       /* Lighter sky blue */
    --text-color: black;        /* Black */
}

body {
    background: #fff5d7; 
    min-height: 100vh;
    color: #333; 
}

/* Improved styling for custom category section */
#customCategoryInner {
    background-color: rgba(255, 243, 243, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) inset;
    border: 2px dashed rgba(255, 118, 117, 0.3) !important;
}

.accordion-header{
    background: white;
}

.accordion-item{
    background: white;
}

.container {
    /* background: rgba(255, 255, 255, 0.5); */
    border-radius: 5px;
    /* box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15); */
    /* backdrop-filter: blur(4px); */
    padding: 0.5rem;
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

.player-area {
    min-height: 80px;
    border-radius: 12px;
    padding: 10px 15px;
    box-shadow: 0 3px 10px rgb(250, 251, 193, 0.1);
    transition: transform 0.3s ease;
}

.player-area:hover {
    transform: translateY(-3px);
}

.player-area:nth-child(1) {
    background: var(--player1-bg);
}

.player-area:nth-child(2) {
    background: var(--player2-bg);
}

.hearts-container {
    display: flex;
    gap: 3px;
    margin-top: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0;
}

.heart {
    width: var(--heart-size);
    height: var(--heart-size);
    color: #ff6b6b;
    filter: drop-shadow(0 2px 4px rgb(23, 32, 42, 0.1));
    flex-shrink: 0;
    display: inline-block;
    position: relative;
    /* Fix for black dot issue */
    line-height: 1;
    font-size: var(--heart-size);
}

.bi-heart {
    color: rgba(27, 38, 49, 0.3);
}

.question-container {
    font-size: 1.5rem;
    min-height: 120px;
    display: block;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #28f0cb);
    border-radius: 25px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 8px 25px rgba(23, 32, 42, 0.15);
    position: relative;
    overflow: hidden;
    border: 3px solid white;
    transition: all 0.3s ease;
}

.question-container::before {
    content: "?";
    position: absolute;
    top: -15px;
    right: -15px;
    width: 70px;
    height: 70px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    opacity: 0.2;
    z-index: 0;
}

.question-container h2 {
    font-size: 1.8rem;
    color: #2d3436;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

.topic-button {
    font-size: 0.9rem;
    margin: 3px;
    min-width: auto;
    background: var(--secondary-color);
    border: none;
    border-radius: 15px;
    padding: 5px 10px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.topic-button i {
    font-size: 1rem;
}

.topic-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    background: #45b7ae;
}

#voiceBtn, #repeatBtn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-color), #28f0cb);
    border: 3px solid white;
    color: white;
    box-shadow: 0 6px 20px rgba(23, 32, 42, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#voiceBtn::before, #repeatBtn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#voiceBtn:hover, #repeatBtn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(27, 38, 49, 0.2);
}

#voiceBtn:hover::before, #repeatBtn:hover::before {
    opacity: 1;
}

.listening {
    animation: pulse 1.5s infinite;
    background: #82d480 !important;
    box-shadow: 0 4px 0 #6ab168 !important;
}

.voice-feedback {
    min-height: 60px;
    padding: 18px;
    margin: 20px 0;
    background: linear-gradient(135deg, #28f0cb, var(--primary-color));
    border-radius: 20px;
    font-style: italic;
    box-shadow: 0 6px 20px rgba(23, 32, 42, 0.12);
    border: 2px solid white;
    position: relative;
    overflow: hidden;
}

.voice-feedback::before {
    content: "🎤";
    position: absolute;
    bottom: -15px;
    left: -10px;
    font-size: 1.8rem;
    opacity: 0.15;
    transform: rotate(-15deg);
}

#voiceText {
    color: #ff6b6b;
    margin: 0;
    color: #2d3436;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes celebrateParticle {
    0% {
        transform: scale(0.5) translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.5) translate(calc((random(100) - 50) * 1px), calc((random(100) - 50) * -1px)) rotate(360deg);
        opacity: 0;
    }
}

@keyframes celebrateCentral {
    0% {
        transform: translate(-50%, -50%) scale(0.1) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
        opacity: 1;
    }
    40% {
        transform: translate(-50%, -50%) scale(0.9) rotate(270deg);
    }
    60% {
        transform: translate(-50%, -50%) scale(1.1) rotate(360deg);
    }
    80% {
        transform: translate(-50%, -50%) scale(1) rotate(360deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

@keyframes dropIn {
    from {
        transform: translateY(-100vh);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.winner-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(240, 248, 255, 0.8);
    z-index: 1000;
    animation: fadeIn 0.5s ease-out;
}

.celebration-content {
    text-align: center;
    color: #1B2631;
    animation: scaleIn 0.5s ease-out;
}

.celebration-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(46, 134, 193, 0.5);
}

.loser-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(240, 248, 255, 0.8);
    z-index: 1000;
    animation: fadeIn 0.5s ease-out;
}

.loser-content {
    text-align: center;
    color: #1B2631;
    animation: dropIn 0.5s ease-out;
}

.loser-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.floating-emoji {
    position: fixed;
    font-size: 2rem;
    z-index: 1001;
    animation: float linear forwards;
    pointer-events: none;
}

.celebration-particle {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 1000;
    animation: celebrateParticle 1.5s ease-out forwards;
    opacity: 0;
}

.celebration-central {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    pointer-events: none;
    z-index: 1001;
    animation: celebrateCentral 1.5s ease-out forwards;
}

/* Add new styles for index page */
.index-container {
    background: #fff5d7;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.parallax-element {
    position: absolute;
    transition: transform 0.2s ease-out;
}

.game-character {
    width: 60px;
    height: 60px;
}

/* Game character SVGs */
.crab-svg {
    fill: #ff6b6b;
    width: 100%;
    height: 100%;
}

.airplane-svg {
    width: 100%;
    height: 100%;
}

.balloon-svg {
    width: 100%;
    height: 100%;
}

.star-svg {
    fill: #6c5ce7;
    width: 36px;
    height: 36px;
}

.index-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    text-align: center;
}

/* Stats Cards Styles */
.stats-container {
    margin: 2rem auto;
    max-width: 800px;
}

.stats-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.stats-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.2rem;
    min-width: 160px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid #ffd93d;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.stats-icon {
    font-size: 2rem;
    color: #00b894;
    margin-bottom: 0.8rem;
}

.stats-content h3 {
    font-size: 2.2rem;
    font-weight: bold;
    margin: 0;
    color: #2d3436;
}

.stats-content p {
    font-size: 0.9rem;
    color: #636e72;
    margin: 0;
}

.game-title {
    color: #2d3436;
    font-size: 3.5rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.start-button {
    background: #00b894;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #00a187;
}


/* Game button base styles */
.game-button {
    position: relative;
    overflow: hidden;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    background: #6c5ce7;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}


.button-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.button-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    animation: rotate 3s linear infinite;
}


.restart-button {
    background: #00b894;
    color: white;
    border: none;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Waiting Area Styles */
.waiting-title {
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.share-text {
    color: #2d3436;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.share-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.share-input {
    background-color: rgba(255, 255, 255, 0.9);
    border: 3px solid var(--primary-color);
    border-radius: 25px 0 0 25px !important;
    font-size: 1rem;
    padding: 15px 20px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #2d3436;
    transition: all 0.3s ease;
    height: auto;
}

.share-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(40, 240, 203, 0.25);
}

.share-button {
    border-radius: 0 25px 25px 0 !important;
    background: var(--primary-color);
    color: #2d3436;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.share-button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.share-button .button-glow {
    opacity: 0.1;
}

.share-button:hover .button-glow {
    opacity: 0.3;
}

/* Video Call Styles */
#video-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

#gameSelectorArea{
    margin-top: 1rem !important;
}

.video-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.video-participant-fun {
    flex: 1;
    min-width: 280px;
    position: relative;
}

@media (max-width: 768px) {
    .video-grid {
        flex-direction: column;
    }
    
    .video-participant-fun {
        margin-bottom: 15px;
    }
}

.video-participant {
    position: relative;
    text-align: center;
}

.video-label {
    padding: 3px 6px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 4px;
    position: absolute;
    bottom: 5px;
    left: 5px;
    z-index: 2;
    font-size: 0.75rem;
}

#local-video, #remote-video {
    width: 100%;
    height: 100%;
    background-color: #222;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 0;
    left: 0;
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.video-control-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: #444;
    color: white;
    transition: all 0.2s ease;
}

.video-control-button:hover {
    background-color: #555;
    transform: scale(1.05);
}

.video-control-button.muted {
    background-color: #dc3545;
}

.video-control-button.video-off {
    background-color: #dc3545;
}

#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 10px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: bold;
    animation: fadeIn 0.3s ease-out;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Custom Category Section Styles */
.custom-category-section {
    background: linear-gradient(135deg, var(--primary-color), #28f0cb); 
    border-radius: 10px; 
    border: 2px solid white; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    margin-top: 0.75rem;
    position: relative;
    overflow: hidden;
}

.custom-category-section::before {
    content: "✨";
    position: absolute;
    top: -10px;
    right: -5px;
    font-size: 2rem;
    opacity: 0.1;
    transform: rotate(15deg);
}

.custom-category-section h5 {
    color: #2d3436; 
    font-weight: bold; 
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.custom-category-input {
    border-radius: 15px 0 0 15px !important; 
    border: 1px solid white !important; 
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
}

.custom-category-button {
    background: var(--accent-color) !important; 
    color: white !important; 
    border-radius: 0 15px 15px 0 !important; 
    border: 1px solid white !important;
    transition: all 0.3s ease;
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
}

.custom-category-button:hover {
    background: #217dbb !important;
    transform: translateY(-1px);
}

.category-status-text {
    color: #2d3436; 
    font-weight: 500;
}

.category-help-text {
    color: #2d3436; 
    font-weight: 500;
    display: block;
    margin-top: 0.5rem;
}

/* Game Selector Styles */
.game-selector {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 15px;
}

.game-type-button {
    padding: 5px 10px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-type-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.game-type-button.active {
    background: var(--success-color);
    font-weight: bold;
}

/* Quick Draw Game Styles */
#quickDrawArea {
    margin: 10px auto;
    display: none;
    max-width: 640px;
    border-radius: 10px;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color), #28f0cb);
    box-shadow: 0 4px 12px rgba(23, 32, 42, 0.15);
    border: 2px solid white;
}

.captured-frame-container {
    margin: 10px auto;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Drawing prompt styling */
.drawing-prompt-container {
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.drawing-prompt {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0;
    animation: pulse 2s infinite;
}

/* Countdown timer styling */
.countdown-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
}

.progress {
    height: 30px;
    border-radius: 15px;
    background-color: #f1f1f1;
    overflow: hidden;
}

.progress-bar, .progress-bar-fun {
    height: 100%;
    background-color: #2ecc71;
    transition: width 1s linear;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    /* Add stronger border and shadow */
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

/* Progress fun styles - special styling for game timers */
.progress-fun {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 2px;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.progress-bar-fun {
    height: 100%;
    background: linear-gradient(90deg, #ff5e62, #ff9966); /* Bright gradient */
    border-radius: 10px;
    transition: width 1s linear;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* When time is running low */
.progress-bar.warning, .progress-bar-fun.warning {
    background: linear-gradient(90deg, #f7b733, #fc4a1a);
}

.progress-bar.danger, .progress-bar-fun.danger {
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}3);
}

#capturedFrame {
    width: 100%;
    height: auto;
    display: block;
}

#frameTimestamp {
    text-align: center;
    font-size: 0.9rem;
    color: #2d3436;
    margin-top: 8px;
    font-style: italic;
}

/* Overlay Games Content Styles */
#games-content {
    padding-top: 1rem;
    transition: all 0.3s ease-in-out;
}

#games-content.active {
    animation: slideUp 0.5s ease-in-out forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Handle smaller screens */
@media (max-height: 700px) {
    #games-content {
        max-height: 60vh;
    }
}