/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Container Styles */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px 0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.header-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.round-badge {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.timer-small {
    background: #ff6b6b;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Menu Styles */
.menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

/* Button Styles */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
}

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

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

.btn-primary {
    background: #4caf50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #2196f3;
    color: white;
}

.btn-secondary:hover {
    background: #0b7dda;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.3rem;
    position: relative;
}

.btn-description {
    display: block;
    font-size: 0.85rem;
    font-weight: normal;
    margin-top: 5px;
    opacity: 0.9;
}

.btn-join,
.btn-next-round {
    margin-bottom: 10px;
}

/* Info Section */
.info {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.info h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.info ol {
    padding-left: 20px;
    line-height: 1.8;
}

.info li {
    margin-bottom: 10px;
}

/* Form Styles */
.form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Error Message */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}

/* Success Message */
.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.checkmark {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.submitted-answer {
    margin-top: 10px;
    font-size: 0.95rem;
}

/* Game Code Display */
.game-code {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 10px;
    font-size: 1.2rem;
}

/* Player Status */
.player-status {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.player-status p {
    margin: 5px 0;
}

/* Lobby Players List */
.lobby-players-list {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lobby-players-list h3 {
    margin-bottom: 15px;
    color: #667eea;
}

#lobby-players-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lobby-player-item {
    background: #f5f5f5;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lobby-player-name {
    font-weight: bold;
}

.host-badge {
    background: #ffd700;
    color: #333;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* Hint Text */
.hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Question Container */
.question-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.question-container h2 {
    color: #667eea;
    font-size: 1.8rem;
    line-height: 1.4;
}

.question-container-small {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.question-container-small h3 {
    color: #667eea;
    font-size: 1.3rem;
}

/* Answer Section */
.answer-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Forfeit Warning */
.forfeit-warning {
    background: #ff6b6b;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Reveal Info */
.reveal-info {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.your-answer-highlight {
    margin-top: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.answer-bubble {
    background: #667eea;
    color: white;
    padding: 15px 25px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Score Display */
.player-score-display {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.score-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4caf50;
}

.cow-icon {
    font-size: 2rem;
}

.pink-cow-icon {
    font-size: 3rem;
}

#pink-cow-status {
    background: #ffebee;
    padding: 15px;
    border-radius: 10px;
    color: #c62828;
    font-weight: bold;
}

/* Scoreboard */
.scoreboard-compact {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 8px;
}

.score-row.highlight {
    background: #fff3cd;
    border: 2px solid #ffd700;
}

.player-name-score {
    font-weight: bold;
}

.player-score-value {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Winner Announcement */
.winner-announcement {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.winner-announcement h2 {
    color: #ffd700;
    font-size: 2rem;
}

.final-scores {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ========== WATCH MODE STYLES ========== */

.watch-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.watch-container {
    width: 100vw;
    height: 100vh;
    padding: 40px;
}

.watch-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.watch-header h1 {
    font-size: 4rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.watch-header h2 {
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.round-info {
    font-size: 2rem;
    color: white;
    font-weight: bold;
}

/* Passcode Display */
.passcode-display {
    text-align: center;
    margin-bottom: 50px;
}

.passcode-display h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.passcode {
    background: white;
    color: #667eea;
    font-size: 6rem;
    font-weight: bold;
    padding: 40px 80px;
    border-radius: 20px;
    display: inline-block;
    letter-spacing: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.join-instructions {
    color: white;
    font-size: 1.5rem;
    margin-top: 20px;
    opacity: 0.9;
}

/* Player List Lobby */
.player-list-lobby {
    text-align: center;
    color: white;
}

.player-list-lobby h3 {
    font-size: 2rem;
    margin-bottom: 30px;
}

#lobby-players {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.lobby-player-card {
    background: white;
    color: #667eea;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.lobby-player-card.host {
    background: #ffd700;
    color: #333;
}

/* Timer Display */
.timer-display {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.timer-circle {
    background: white;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

#timer-text {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
}

.timer-circle.warning #timer-text {
    color: #ff6b6b;
}

/* Question Display */
.question-display {
    background: white;
    padding: 50px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.question-display h2 {
    color: #667eea;
    font-size: 3rem;
    line-height: 1.4;
}

.question-display-small {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.question-display-small h3 {
    color: #667eea;
    font-size: 2rem;
}

/* Player Grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.player-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.player-card-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.player-card-status {
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
}

.player-card.answered .player-card-status {
    background: #e8f5e9;
    color: #2e7d32;
}

.player-card.not-answered .player-card-status {
    background: #fff3cd;
    color: #856404;
}

.player-card.forfeited {
    opacity: 0.6;
}

.player-card.forfeited .player-card-name {
    color: #ff6b6b;
}

.player-card.forfeited .player-card-status {
    background: #ffebee;
    color: #c62828;
}

/* Forfeit Banner */
.forfeit-banner {
    background: #fa7f7f;
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 15px;
    margin-top: 30px;
    animation: pulse 1s infinite;
}

/* Reveal List */
.reveal-list {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reveal-item {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    animation: fadeInSlide 0.5s forwards;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal-player-name {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.reveal-answer {
    font-size: 1.8rem;
    color: #333;
    background: #f5f5f5;
    padding: 15px 30px;
    border-radius: 10px;
}

.reveal-item.unique {
    border: 4px solid #ff6b6b;
    background: #ffebee;
}

.reveal-item.unique .reveal-answer {
    background: white;
}

.pink-cow-badge {
    font-size: 3rem;
    margin-left: 20px;
}

/* Scoreboard */
.scoreboard {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.scoreboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 1.8rem;
}

.scoreboard-row.leader {
    background: #fff3cd;
    border: 3px solid #ffd700;
}

.scoreboard-player-name {
    font-weight: bold;
    color: #333;
}

.scoreboard-score {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #4caf50;
}

.next-round-prompt {
    text-align: center;
    color: white;
    font-size: 1.8rem;
    margin-top: 40px;
}

/* Winner Display */
.winner-display {
    text-align: center;
    margin-bottom: 50px;
}

.winner-display h2 {
    color: white;
    font-size: 3rem;
    margin-bottom: 20px;
}

.winner-name {
    background: white;
    color: #ffd700;
    font-size: 5rem;
    font-weight: bold;
    padding: 40px 80px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.trophy {
    font-size: 6rem;
}

.final-scoreboard {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Error Container */
.error-container {
    text-align: center;
    color: white;
    padding: 50px;
}

.error-container h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error-container p {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

/* Screen Management */
.screen {
    animation: fadeIn 0.5s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .btn-large {
        padding: 15px 25px;
        font-size: 1.1rem;
    }

    .question-container h2 {
        font-size: 1.5rem;
    }

    .watch-header h1 {
        font-size: 2.5rem;
    }

    .passcode {
        font-size: 3rem;
        padding: 20px 40px;
        letter-spacing: 8px;
    }

    .player-grid {
        grid-template-columns: 1fr;
    }

    .question-display h2 {
        font-size: 2rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Review Screen Styles */
.review-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.review-section {
    margin-bottom: 20px;
}

.review-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

#answer-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-group {
    background: #f5f5f5;
    border: 3px solid transparent;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.answer-group:hover {
    background: #e8f5e9;
}

.answer-group.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

.answer-group.winning {
    border-color: #4caf50;
    background: #e8f5e9;
}

.answer-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.answer-group-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.answer-group-count {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.answer-group-players {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.player-chip {
    background: white;
    border: 1px solid #ddd;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #555;
}

#winners-list,
#pink-cow-assignment {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.winner-item,
.pink-cow-item {
    background: #f5f5f5;
    border: 3px solid transparent;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.winner-item:hover,
.pink-cow-item:hover {
    background: #e8f5e9;
}

.winner-item.selected {
    border-color: #4caf50;
    background: #e8f5e9;
}

.pink-cow-item.selected {
    border-color: #ff6b6b;
    background: #ffebee;
}

.winner-item-name,
.pink-cow-item-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.winner-badge {
    background: #4caf50;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
}

.pink-cow-badge-review {
    background: #ff6b6b;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Watch Mode Review Screen */
.review-message {
    max-width: 800px;
    margin: 50px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.loading-dots {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
