/* Reset en basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button, input, select, textarea {
    font-family: inherit;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Clash Display', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body {
    font-family: 'Clash Display', sans-serif;
    letter-spacing: 0.75px;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* App container */
#app {
    width: 100%;
    min-height: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Screens */
.screen {
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 30px 20px;
    text-align: center;
}

.screen.active {
    display: flex;
}

/* Game Logo */
.game-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);

}

/* Start Screen */
#start-screen h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#start-screen .subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
    margin-bottom: 20px;
}

/* Player Selection Grid */
#player-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
}

.player-checkbox {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.player-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(233, 69, 96, 0.5);
}

.player-checkbox.selected {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
}

.player-checkbox input {
    display: none;
}

.player-checkbox .checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.player-checkbox.selected .checkmark {
    background: #e94560;
    border-color: #e94560;
}

.player-checkbox.selected .checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.player-checkbox .player-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
}

/* Selection Info & Actions */
.selection-info {
    font-size: 1rem;
    color: #888;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selection-info svg {
    width: 18px;
    height: 18px;
    color: #e94560;
}

#selected-count {
    color: #e94560;
    font-weight: bold;
    font-size: 1.2rem;
}

.selection-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    padding: 16px 48px;
    font-family: 'Clash Display', sans-serif;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn.small svg {
    width: 16px;
    height: 16px;
}

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

.btn.primary {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.6);
}

.btn.primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Game Screen */
#game-screen {
    justify-content: space-between;
    padding: 30px 20px;
    min-height: 100dvh;
}

#round-counter {
    font-size: 1rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#round-counter svg {
    width: 16px;
    height: 16px;
}

.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Players Display */
#players-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.player-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e94560;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.5);
    margin-bottom: 10px;
}

.player-card.rival .player-photo {
    border-color: #ffd700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
}

.player-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

.player-nickname {
    font-size: 0.9rem;
    color: #a0a0a0;
    font-style: italic;
}

/* Challenge Container */
#challenge-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    padding: 20px;
    position: relative;
}

#category-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

/* Info Icon */
.info-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.info-icon svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.info-icon:hover svg {
    color: #e94560;
    transform: scale(1.1);
}

/* Tooltip */
.tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    animation: tooltipFadeIn 0.3s ease;
}

.tooltip.hidden {
    display: none;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tooltip-content {
    background: rgba(30, 30, 50, 0.98);
    border: 2px solid #e94560;
    border-radius: 16px;
    padding: 20px 25px;
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.tooltip-content p {
    color: #fff;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

/* Tooltip backdrop */
.tooltip-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.tooltip-backdrop.hidden {
    display: none;
}

#challenge-text {
    font-size: 1.6rem;
    line-height: 1.5;
    text-align: center;
    color: #fff;
    max-width: 100%;
}

/* Responsive */
@media (max-width: 480px) {
    .game-logo {
        width: 120px;
        height: 120px;
    }

    #start-screen h1 {
        font-size: 1.8rem;
    }

    #player-selection {
        grid-template-columns: repeat(2, 1fr);
    }

    .player-checkbox {
        padding: 10px 12px;
    }

    .player-checkbox .player-label {
        font-size: 1rem;
    }

    .player-photo {
        width: 90px;
        height: 90px;
    }

    .player-name {
        font-size: 1rem;
    }

    #challenge-text {
        font-size: 1.3rem;
    }

    .btn {
        padding: 14px 36px;
        font-size: 1.1rem;
    }

    .btn.small {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Multi-player layout */
#players-display.multi-player {
    gap: 15px;
}

#players-display.multi-player .player-photo {
    width: 80px;
    height: 80px;
}

#players-display.multi-player .player-name {
    font-size: 1rem;
}

/* VS indicator for rivals */
.vs-indicator {
    font-size: 1.5rem;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

