* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.game-area {
    padding: 30px;
}

.story-display {
    margin-bottom: 30px;
}

.story-display h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.story-content {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 1.1em;
    line-height: 1.6;
}

.story-content p {
    margin-bottom: 10px;
}

.story-content .placeholder {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

.input-area {
    margin-bottom: 30px;
}

.input-area h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.4em;
}

#sentence-input {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1.1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#sentence-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.input-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

#char-count {
    color: #6c757d;
    font-size: 0.9em;
}

#submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.player-id label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

#player-name {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 1em;
    width: 200px;
}

#player-name:focus {
    outline: none;
    border-color: #4facfe;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-connected {
    color: #28a745;
}

.status-disconnected {
    color: #dc3545;
}

.status-connecting {
    color: #ffc107;
}

.instructions {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    margin: 20px 30px 30px;
    border-radius: 0 8px 8px 0;
}

.instructions h3 {
    color: #1976d2;
    margin-bottom: 10px;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    color: #333;
}

.sentence {
    padding: 10px;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
    position: relative;
}

.sentence .author {
    font-weight: bold;
    color: #4facfe;
}

.sentence .time {
    float: right;
    color: #6c757d;
    font-size: 0.8em;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .game-area {
        padding: 20px 15px;
    }
    
    .player-info {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    #player-name {
        width: 100%;
    }
}