* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
}

.screen {
    text-align: center;
}

.hidden {
    display: none !important;
}

h1 {
    margin-bottom: 2rem;
    color: #2c3e50;
}

h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.input-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

#game-id-container, #join-container {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.game-id-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

#game-id {
    font-family: monospace;
    font-size: 1.2rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#copy-id {
    padding: 0.5rem 1rem;
    background: #27ae60;
}

#copy-id:hover {
    background: #219a52;
}

#connection-status {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#status-message {
    color: #2c3e50;
    font-weight: 500;
}

input[type="text"] {
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: #3498db;
}

button {
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

.game-header {
    margin-bottom: 2rem;
}

.player-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player .name {
    font-weight: bold;
    color: #2c3e50;
}

.player .score {
    font-size: 1.5rem;
    color: #3498db;
}

#paragraph-display {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
}

#progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0;
    background: #3498db;
    transition: width 0.3s ease;
}

#typing-input {
    width: 100%;
    margin-bottom: 1rem;
}

.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    background: #f8f9fa;
    color: #2c3e50;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#winner-display {
    font-size: 1.5rem;
    color: #27ae60;
    margin: 1.5rem 0;
}

#play-again-button {
    background-color: #27ae60;
}

#play-again-button:hover {
    background-color: #219a52;
}
