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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
}

.card {
    padding: 20px;
}

h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 2px;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ff3344;
}

.divider {
    margin: 30px 0;
    color: #999;
    font-size: 0.9rem;
}

.result {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.result strong {
    color: #667eea;
    font-size: 1.5rem;
    letter-spacing: 3px;
}

.hint {
    color: #888;
    font-size: 0.9rem;
    margin-top: 10px;
}

.error {
    color: #ff4757;
    font-size: 0.9rem;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

/* Game Page */
.game-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.game-panel {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.game-info {
    text-align: center;
    margin-bottom: 20px;
}

.game-info p {
    margin: 8px 0;
    color: #555;
}

.game-info strong {
    color: #667eea;
    font-size: 1.2rem;
}

.board-container {
    display: flex;
    justify-content: center;
}

#board {
    background: #f7d794;
    border-radius: 4px;
    cursor: pointer;
}

.chat-panel {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 300px;
    display: flex;
    flex-direction: column;
    height: 550px;
}

.chat-panel h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.chat-messages {
    flex: 1;
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    word-wrap: break-word;
}

.chat-message.host {
    background: #e8f0fe;
    text-align: left;
}

.chat-message.guest {
    background: #f0e8fe;
    text-align: left;
}

.chat-message.system {
    background: #f5f5f5;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}

.chat-input-container {
    display: flex;
    gap: 8px;
}

.chat-input-container {
    display: flex;
    gap: 8px;
}

.chat-input-container textarea {
    flex: 1;
    margin: 0;
    text-align: left;
    letter-spacing: normal;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    min-width: 0;
    resize: none;
    font-family: inherit;
}

.chat-input-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

.game-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.game-controls .btn {
    flex: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .chat-panel {
        width: 100%;
        height: 350px;
    }

    #board {
        width: 320px;
        height: 320px;
    }
}
