:root {
    --primary-color: #6C5CE7;
    --secondary-color: #a29bfe;
    --background-color: #ffe0e9;
    --card-back: #0984e3;
    --text-color: #2d3436;
    --font-family: 'Outfit', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}



.container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1000px;
    text-align: center;
}

.hidden {
    display: none !important;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

input {
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--secondary-color);
    font-size: 1rem;
    margin: 10px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

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

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.player-checkbox {
    display: none;
}

.player-label {
    padding: 10px;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.player-checkbox:checked+.player-label {
    background-color: var(--primary-color);
    color: white;
}

.groups-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.group-box {
    border: 2px dashed var(--secondary-color);
    padding: 15px;
    border-radius: 10px;
    min-width: 150px;
    min-height: 100px;
}

.group-member {
    background-color: #fab1a0;
    padding: 5px;
    margin: 5px;
    border-radius: 5px;
    cursor: grab;
}

/* Game Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f2f6;
    padding: 15px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

#current-player-info {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

#game-status {
    font-size: 1.4rem;
    color: #636e72;
    font-weight: 500;
}

#next-turn-btn {
    background-color: #e17055;
    font-size: 1.1rem;
    padding: 12px 25px;
    box-shadow: 0 4px 6px rgba(225, 112, 85, 0.3);
}

#next-turn-btn:hover {
    background-color: #d63031;
    transform: translateY(-2px);
}

/* Card Game Styles */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
}

.card {
    aspect-ratio: 3/4;
    background-color: transparent;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}

.card:hover .card-inner {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.flipped:hover .card-inner {
    transform: rotateY(180deg) translateY(0);
    /* Disable hover lift when flipped if desired, or keep it */
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    overflow: hidden;
}

.card-front {
    background: linear-gradient(135deg, #ffffff 0%, #f5f6fa 100%);
    color: var(--text-color);
    transform: rotateY(180deg);
    border: 3px solid var(--primary-color);
}

.card-back {
    background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
    color: white;
    font-family: 'Outfit', sans-serif;
}

/* Add a pattern to card back */
.card-back::after {
    content: "?";
    font-size: 3rem;
    opacity: 0.8;
}

.start-btn {
    font-size: 1.2rem;
    padding: 15px 30px;
    background-color: #00b894;
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

.question-bubble {
    background-color: #74b9ff;
    color: white;
    padding: 20px;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.5);
}

.question-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #74b9ff transparent;
    display: block;
    width: 0;
}

#answer-input {
    width: 80%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
}

#answer-input:focus {
    border-color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-oops {
    background-color: #d63031;
    color: white;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    /* Playful font */
    font-size: 1.2rem;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 0 #c0392b;
    transition: transform 0.1s;
}

.btn-oops:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-okay {
    background-color: #00b894;
    color: white;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    font-size: 1.2rem;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 0 #00947e;
    transition: transform 0.1s;
}

.btn-okay:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-exit {
    background-color: transparent;
    border: 2px solid #ff7675;
    color: #ff7675;
    font-size: 1.2rem;
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-exit:hover {
    background-color: #ff7675;
    color: white;
    transform: rotate(90deg);
}