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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e0e0e0;
}

h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.ascii-art {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.ascii-art pre {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    color: #2c3e50;
    text-align: center;
}

.instructions {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.instruction-step {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.instruction-step h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.instruction-step ol, .instruction-step ul {
    margin-left: 20px;
}

.instruction-step li {
    margin-bottom: 8px;
}

.start-game-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

#playerName {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    flex: 1;
}

#playerName:focus {
    outline: none;
    border-color: #3498db;
}

#startGame {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#startGame:hover {
    background-color: #2980b9;
}

#startGame:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.game-interface {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stats-section {
    background-color: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.stat-label {
    font-weight: bold;
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2em;
    color: #3498db;
}

.feedback {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.guess-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.domain-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.domain-button {
    padding: 15px 20px;
    background-color: #ffffff;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.domain-button:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.domain-button.selected {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.domain-button.selected:hover {
    background-color: #2980b9;
    border-color: #21618c;
}

.domain-button:active {
    transform: translateY(0);
}

.domain-button-number {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
    text-align: center;
}

.domain-button.selected .domain-button-number {
    background-color: #c0392b;
}

@keyframes flash {
    0% { background-color: #ffffff; }
    50% { background-color: #ffd700; transform: scale(1.05); }
    100% { background-color: #ffffff; }
}

.guess-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

#guessInput {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    flex: 1;
}

#guessInput:focus {
    outline: none;
    border-color: #3498db;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button-primary {
    background-color: #3498db;
    color: white;
}

.button-primary:hover {
    background-color: #2980b9;
}

.button-secondary {
    background-color: #95a5a6;
    color: white;
}

.button-secondary:hover {
    background-color: #7f8c8d;
}

.button-danger {
    background-color: #e74c3c;
    color: white;
}

.button-danger:hover {
    background-color: #c0392b;
}

.button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.sites-opened {
    margin-top: 15px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
}

.final-results {
    background-color: #e8f5e8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.final-results h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.correct-guesses-section {
    background-color: #d4edda;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.correct-guesses-section h4 {
    color: #155724;
    margin-bottom: 10px;
}

.correct-guess-item {
    background-color: #ffffff;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 4px solid #28a745;
}

.correct-guess-company {
    font-weight: bold;
    color: #155724;
    margin-bottom: 5px;
}

.correct-guess-domains {
    font-size: 0.9em;
    color: #6c757d;
}

.results-actions {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.results-actions h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.dataset-info {
    background-color: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #b8daff;
}

.dataset-info h4 {
    color: #004085;
    margin-bottom: 10px;
}

.dataset-link {
    display: inline-block;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.dataset-link:hover {
    background-color: #0056b3;
    text-decoration: none;
}

.google-form-section {
    background-color: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
}

footer {
    text-align: center;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
    margin-top: 30px;
    color: #7f8c8d;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #7f8c8d;
}

.hidden {
    display: none;
}

.post-guess-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-guess-actions .button {
    width: 100%;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .start-game-form {
        flex-direction: column;
    }
    
    .guess-form {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .final-stats {
        grid-template-columns: 1fr;
    }
    
    .domain-buttons {
        grid-template-columns: 1fr;
    }
    
    .domain-button {
        min-height: 50px;
        padding: 12px 16px;
        font-size: 14px;
    }
}