* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #121212;
    color: #e1e1e1;
    line-height: 1.6;
    background-image: linear-gradient(to bottom, #121212, #1a1a2e);
    min-height: 100vh;
    animation: pageFadeIn 0.6s ease-out forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #1e1e1e;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#game-title {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3d3d3d;
}

#game-title h1 {
    color: #bb86fc;
    font-size: 2.2rem;
    text-shadow: 0 0 10px rgba(187, 134, 252, 0.3);
    letter-spacing: 1px;
}

.game-screen {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    border-radius: 16px;
    background-color: #212121;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.game-screen.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #bb86fc;
    font-size: 1.6rem;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-weight: bold;
    color: #e1e1e1;
    font-size: 1.1rem;
}

.form-group input,
.form-group select {
    padding: 14px;
    font-size: 1.1rem;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    background-color: #2d2d2d;
    color: #e1e1e1;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23bb86fc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #bb86fc;
    box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.3);
}

.form-group select:hover {
    background-color: #333333;
}

.btn {
    padding: 14px 22px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    border-radius: 24px;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.primary-btn {
    background-color: #8a2be2;
    color: white;
}

.primary-btn:hover,
.primary-btn:focus {
    background-color: #bb86fc;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(187, 134, 252, 0.4);
}

.secondary-btn {
    background-color: #3d3d3d;
    color: white;
}

.secondary-btn:hover,
.secondary-btn:focus {
    background-color: #616161;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.danger-btn {
    background-color: #cf6679;
    color: #121212;
    font-weight: bold;
}

.danger-btn:hover,
.danger-btn:focus {
    background-color: #ff8a9d;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(207, 102, 121, 0.4);
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

/* Mode buttons */
.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #2d2d2d;
    border: 2px solid #3d3d3d;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background-color: #3d3d3d;
    border-color: #bb86fc;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(187, 134, 252, 0.3);
}

.mode-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 0.85rem;
    color: #b0b0b0;
    font-weight: normal;
    margin-top: 5px;
}

/* Category grid */
.category-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.category-btn {
    padding: 20px 15px;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.7), rgba(75, 0, 130, 0.7));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e1e1e1;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
    word-break: break-word;
    hyphens: auto;
}

.category-btn:hover {
    background: linear-gradient(135deg, rgba(158, 63, 246, 0.85), rgba(95, 20, 150, 0.85));
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.category-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Word display */
.word-container {
    background-color: #2d2d2d;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    border-left: 4px solid #bb86fc;
    margin: 20px 0;
}

.word-display {
    font-size: 2rem;
    font-weight: bold;
    color: #bb86fc;
    margin-top: 10px;
    word-break: break-word;
}

.category-label {
    font-size: 0.95rem;
    color: #03dac6;
    margin-top: 5px;
}

/* Question counter */
.question-counter {
    text-align: center;
    margin: 20px 0;
}

.counter-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.counter-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    background-color: #3d3d3d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.counter-btn:hover {
    background-color: #616161;
}

.question-count {
    font-size: 3rem;
    font-weight: bold;
    color: #bb86fc;
    min-width: 80px;
}

/* Results */
.results-container {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #3d3d3d;
}

.result-item:last-child {
    border-bottom: none;
}

.result-player {
    font-weight: 600;
    color: #e1e1e1;
}

.result-score {
    color: #bb86fc;
    font-weight: bold;
    font-size: 1.2rem;
}

.result-word {
    font-size: 0.85rem;
    color: #b0b0b0;
    margin-top: 3px;
}

/* Game info */
.game-info {
    text-align: center;
    margin-bottom: 10px;
}

#currentPlayerLabel {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e1e1e1;
}

/* Button animations */
.pulse-btn {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(138, 43, 226, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 16px rgba(138, 43, 226, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(138, 43, 226, 0.3);
    }
}

.glow-btn {
    position: relative;
    overflow: hidden;
}

.glow-btn:after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(187, 134, 252, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    animation: glowing 2s linear infinite;
}

@keyframes glowing {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animation for screen changes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.game-screen.active {
    animation: slideIn 0.4s ease-out;
}

p {
    color: #b0b0b0;
    font-size: 1.05rem;
    text-align: center;
}

.hidden {
    display: none;
}

/* Media Query for very small devices */
@media (max-width: 320px) {
    #game-title h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .word-display {
        font-size: 1.5rem;
    }

    .question-count {
        font-size: 2rem;
    }

    .category-list {
        gap: 10px;
    }

    .category-btn {
        padding: 15px 10px;
        font-size: 0.85rem;
        min-height: 70px;
    }
}

/* Scrollbar styling */
.category-list::-webkit-scrollbar {
    width: 8px;
}

.category-list::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.category-list::-webkit-scrollbar-thumb {
    background: #bb86fc;
    border-radius: 4px;
}

.category-list::-webkit-scrollbar-thumb:hover {
    background: #8a2be2;
}