:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --background-color: #ecf0f1;
    --card-background: #ffffff;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3rem;
    color: silver;
    /* text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); */
    margin-bottom: 10px;
}

.subtitle {
    color: silver;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

/* Setup Screen */
.setup-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    flex: 1;
}

.setup-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.info-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 25px 0;
}

.info-buttons .info-btn:first-child {
    grid-column: 1 / -1;
}

.info-btn {
    padding: 12px 16px;
    background: var(--background-color);
    color: var(--primary-color);
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.info-btn:hover {
    border-color: var(--secondary-color);
    background: #f0f0f0;
    transform: translateY(-1px);
}

.info-icon {
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#player-name-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

#player-name-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#add-player-btn {
    padding: 12px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

#add-player-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.players-list h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.impostors-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    color: #856404;
    font-size: 0.9rem;
    text-align: center;
    animation: fadeInScale 0.3s ease-out;
}

.impostors-notice.hidden {
    display: none;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.players-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 60px;
}

.player-tag {
    background: var(--background-color);
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
}

.player-tag .remove-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-btn {
    width: 100%;
    padding: 16px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.start-btn:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-2px);
}

.start-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

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

#round-info {
    background: rgba(255, 255, 255, 0.2);
    color: silver;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

.game-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.player-display h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.tap-instruction {
    color: var(--text-light);
    font-style: italic;
    margin-top: 20px;
}

.role-display {
    text-align: center;
}

.role-display.hidden {
    display: none;
}

.role-type {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    display: inline-block;
}

.role-type.civilian {
    background: #e8f5e8;
    color: var(--success-color);
}

.role-type.impostor {
    background: #fdeaea;
    color: var(--accent-color);
}

.secret-word {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 30px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-actions {
    margin-top: 20px;
    text-align: center;
}

.secondary-btn {
    padding: 10px 20px;
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Rules Screen */
.rules-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    flex: 1;
    max-height: 80vh;
    overflow-y: auto;
}

.rules-card h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.rules-content {
    margin-bottom: 25px;
}

.rule-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--background-color);
    border-radius: var(--border-radius);
}

.rule-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.rule-section p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.rule-section ul {
    padding-left: 20px;
    line-height: 1.6;
}

.rule-section li {
    margin-bottom: 5px;
}

.rules-actions {
    text-align: center;
}

/* iOS Screen */
.ios-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    flex: 1;
    max-height: 80vh;
    overflow-y: auto;
}

.ios-card h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.ios-intro {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: var(--border-radius);
}

.ios-steps {
    margin-bottom: 25px;
}

.ios-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--background-color);
    border-radius: var(--border-radius);
}

.step-number {
    background: var(--secondary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.step-content p {
    line-height: 1.5;
    margin: 0;
}

.ios-icon {
    font-size: 1.1rem;
}

.ios-result {
    background: #e8f5e8;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 25px;
}

.ios-actions {
    text-align: center;
}

/* Android Screen */
.android-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    flex: 1;
    max-height: 80vh;
    overflow-y: auto;
}

.android-card h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.android-intro {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: var(--border-radius);
}

.android-steps {
    margin-bottom: 25px;
}

.android-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--background-color);
    border-radius: var(--border-radius);
}

.android-alternative {
    background: #fff3cd;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.android-alternative h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.android-alternative ul {
    padding-left: 20px;
    line-height: 1.6;
}

.android-alternative li {
    margin-bottom: 5px;
}

.android-icon {
    font-size: 1.1rem;
    font-weight: bold;
}

.android-result {
    background: #e8f5e8;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 25px;
}

.android-actions {
    text-align: center;
}

/* Round End Screen */
.round-end-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    flex: 1;
    text-align: center;
}

.round-end-card h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.round-end-subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1rem;
}

.round-end-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.option-btn {
    background: var(--card-background);
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-btn:hover {
    border-color: var(--secondary-color);
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.option-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.option-text h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1rem;
}

.option-text p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
}

/* End Screen */
.end-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    flex: 1;
    text-align: center;
}

.end-card h2 {
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.game-summary {
    margin: 30px 0;
}

.summary-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--background-color);
    border-radius: var(--border-radius);
}

.summary-section h3 {
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 1.1rem;
}

.word-display {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.roles-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.role-summary-item {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.role-summary-item.civilian {
    background: #e8f5e8;
    color: var(--success-color);
}

.role-summary-item.impostor {
    background: #fdeaea;
    color: var(--accent-color);
}

.end-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.end-actions button {
    min-width: 150px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .setup-card, .game-card, .end-card, .round-end-card, .rules-card, .ios-card, .android-card {
        padding: 20px;
    }
    
    .player-display h2 {
        font-size: 2rem;
    }
    
    .secret-word {
        font-size: 2.2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .info-buttons {
        grid-template-columns: 1fr;
    }
    
    .info-buttons .info-btn:first-child {
        grid-column: auto;
    }
    
    .end-actions {
        flex-direction: column;
    }
    
    .end-actions button {
        min-width: auto;
    }
    
    .round-end-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .option-btn {
        padding: 15px;
    }
    
    .option-icon {
        font-size: 1.5rem;
    }
    
    .ios-step {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .android-step {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .step-number {
        align-self: center;
    }
}