/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 80px 0;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.hero .btn {
    margin-bottom: 2rem;
}

.hero p {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Glassmorphism card */
.card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Features section */
.features {
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.5) 0%, rgba(226, 232, 240, 0.5) 100%);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #1e293b;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.feature-card p {
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .features h2 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .config-card h1 {
        font-size: 1.875rem;
    }

    .counter {
        gap: 0.875rem;
    }

    .btn-counter {
        width: 48px;
        height: 48px;
        font-size: 1.375rem;
    }

    #playerCount {
        font-size: 1.875rem;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .players-card h2 {
        font-size: 1.375rem;
    }

    .player-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .player-actions {
        width: 100%;
        margin-top: 1rem;
    }

    .modal-content {
        padding: 1.75rem;
    }

    .word-display {
        padding: 1.75rem;
        font-size: 1.75rem;
    }

    .endgame-card h1 {
        font-size: 2.25rem;
    }

    .endgame-actions .btn {
        min-width: 150px;
    }
}

/* Configuration page styles */
.config-page {
    padding: 80px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.config-card {
    max-width: 600px;
    margin: 0 auto;
}

.config-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
}

.counter-section {
    margin-bottom: 2rem;
    text-align: center;
}

.counter-section label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #374151;
}

.counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-counter {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    color: #64748b;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-counter:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-counter:active {
    transform: scale(0.95);
}

#playerCount {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    min-width: 60px;
    text-align: center;
}

.player-names {
    margin-bottom: 2rem;
}

.player-input {
    margin-bottom: 1rem;
}

.player-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.player-input input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.player-input input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.player-input input::placeholder {
    color: #9ca3af;
}

/* Debug page styles */
.debug-page {
    padding: 80px 0;
    min-height: 100vh;
}

.debug-card {
    max-width: 800px;
    margin: 0 auto;
}

.debug-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
}

.debug-section {
    margin-bottom: 2rem;
}

.debug-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2563eb;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.debug-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.debug-item strong {
    color: #1e293b;
    font-weight: 600;
}

.debug-item ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.debug-item li {
    margin-bottom: 0.25rem;
    color: #64748b;
}

.debug-actions {
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.debug-note {
    margin-bottom: 1.5rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
}

.debug-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.copy-status {
    color: #475569;
    font-size: 0.9rem;
}

.debug-item pre {
    background: rgba(15, 23, 42, 0.08);
    padding: 1rem;
    border-radius: 14px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.45;
    max-height: 420px;
}

/* Reveal roles page styles */
.reveal-page {
    padding: 80px 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.reveal-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.reveal-card h1 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
}

.reveal-subtitle {
    color: #64748b;
    margin-bottom: 2rem;
}

.player-reveal {
    margin-bottom: 2rem;
}

.player-info h2 {
    font-size: 1.5rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

.role-section {
    margin: 2rem 0;
}

.role-card {
    background: rgba(37, 99, 235, 0.1);
    border: 2px solid #2563eb;
    border-radius: 16px;
    padding: 2rem;
    margin: 1rem 0;
}

.role-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.role-card p {
    color: #374151;
    font-size: 1.1rem;
    font-weight: 500;
}

.reveal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.progress {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.game-start-section {
    margin-top: 2rem;
}

.game-start-section h2 {
    color: #059669;
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* Game page styles */
.game-page {
    padding: 40px 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1e293b;
}

.game-content {
    max-width: 900px;
    margin: 0 auto;
}

.players-recap {
    margin-bottom: 2rem;
}

.players-card {
    max-width: 100%;
}

.players-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.players-list {
    display: grid;
    gap: 1rem;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.player-item.eliminated {
    opacity: 0.6;
    background: rgba(239, 68, 68, 0.05);
    border-color: #fecaca;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
}

.player-status {
    font-size: 0.875rem;
    color: #64748b;
}

.player-item.eliminated .player-status {
    color: #ef4444;
}

.player-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #2563eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #1e293b;
}

.word-section {
    margin: 2rem 0;
}

.word-display {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.modal-content .btn {
    margin-top: 1rem;
    width: 100%;
}

@media (max-width: 768px) {
    .player-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .player-actions {
        width: 100%;
        margin-top: 1rem;
    }

    .game-header h1 {
        font-size: 2rem;
    }
}

/* End game */
.endgame-page {
    padding: 80px 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.endgame-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.endgame-card h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.endgame-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #64748b;
}

.endgame-subtitle.success {
    color: #059669;
}

.endgame-subtitle.warning {
    color: #b91c1c;
}

.endgame-summary {
    text-align: left;
    margin-bottom: 2rem;
}

.players-summary {
    display: grid;
    gap: 1rem;
}

.player-summary-card {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.player-summary-card.eliminated {
    opacity: 0.7;
    border-color: rgba(239, 68, 68, 0.35);
}

.player-summary-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.95rem;
}

.player-summary-name {
    font-weight: 600;
    color: #1e293b;
}

.player-summary-role {
    text-transform: capitalize;
    color: #475569;
}

.player-summary-word {
    color: #374151;
    font-weight: 500;
}

.player-summary-status {
    text-transform: capitalize;
    font-weight: 700;
    color: #64748b;
}

.endgame-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.endgame-actions .btn {
    min-width: 160px;
}

/* Additional responsive breakpoints */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .features h2 {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .config-card h1 {
        font-size: 1.75rem;
    }

    .counter {
        gap: 0.75rem;
    }

    .btn-counter {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    #playerCount {
        font-size: 1.75rem;
        min-width: 50px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .players-card h2 {
        font-size: 1.25rem;
    }

    .player-item {
        padding: 0.75rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-content h2 {
        font-size: 1.25rem;
    }

    .word-display {
        padding: 1.5rem;
        font-size: 1.5rem;
    }

    .endgame-card h1 {
        font-size: 2rem;
    }

    .endgame-actions .btn {
        min-width: 140px;
    }
}
