: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);
}

/* Player Screen */
.player-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.player-instruction {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Contest Screen */
.contest-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contest-card h2 {
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.contest-content p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.contest-result {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.contest-result h3 {
    color: var(--accent-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.contest-result p {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: bold;
}

.contest-actions {
    margin-top: 30px;
}

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

.dice-container h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.dice-area {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    justify-items: center;
}

.dice {
    width: 60px;
    height: 60px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dice:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.dice.selected {
    border-color: var(--accent-color);
    background: rgba(231, 76, 60, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.dice.rolling {
    animation: diceRoll 0.5s ease-in-out;
}

@keyframes diceRoll {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(0.9); }
    75% { transform: rotate(270deg) scale(1.1); }
}

.dice-face {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

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

.dice-instruction {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 1rem;
}

/* .dice-sequence {
    background: #f8f9fa;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
} */

.dice-sequence {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 5px 10px;
    margin-bottom: 5px;
    text-align: center;
    font-size: 1rem;
    color: var(--primary-color);

}

.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);
}

/* Buttons */
.start-btn {
    width: 100%;
    padding: 16px 24px;
    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);
    margin-top: 20px;
}

.start-btn:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
}

.start-btn:disabled {
    background: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.secondary-btn:hover {
    background: #6c7b7d;
    transform: translateY(-2px);
}

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

.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;
}

.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);
}

/* 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;
}


/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .dice-area {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .dice {
        width: 50px;
        height: 50px;
    }
    
    .dice-face {
        font-size: 1.5rem;
    }
    
    .setup-card, .player-card, .dice-container {
        padding: 20px;
    }
}