* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #000;
    text-align: center;
}

h2 {
    font-size: 2rem;
    color: #000;
    text-align: center;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #555;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

/* サーバー統計表示 */
.server-stats {
    width: 100%;
    max-width: 400px;
    border: 1px solid #000;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 10px;
    border: 1px solid #000;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-size: 1.1rem;
    color: #000;
    font-weight: 600;
}

.stat-value {
    font-size: 1.3rem;
    color: #000;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.name-input-area {
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
}

.name-input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #000;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
}

.name-input:focus {
    border-color: #555;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 10px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #000;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn-danger {
    background: #000;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn-send {
    background: #000;
    color: white;
    padding: 10px 20px;
    font-size: 1rem;
    margin: 0;
    margin-left: 10px;
}

.btn-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn-vote {
    background: #000;
    color: white;
    padding: 15px 30px;
    font-size: 1rem;
}

.btn-vote:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn-vote.disabled {
    background: #ccc;
}

.status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    display: none;
}

.status.info {
    border: 1px solid #000;
}

.status.error {
    background-color: #000;
    color: #c62828;
    border: 2px solid #c62828;
}

.game-info {
    border: 1px solid #000;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.header-area {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

/* お題エリア */
.word-area {
    border: 1px solid #000;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
}

.word-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #d84315;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.word-hint {
    color: #555;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* タイマー */
.timer-area {
    border: 1px solid #000;
    padding: 4px 12px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
    font-family: 'Courier New', monospace;
}

.timer-display.timer-warning {
    color: #000;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* チャットエリア */
.chat-area {
    margin: 20px 0;
    width: 100%;
}

.chat-messages {
    height: 50vh;
    overflow-y: auto;
    border: 1px solid #000;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.chat-message {
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.chat-message.other {
    background-color: #fff;
    border: 1px solid #000;
    margin-right: auto;
    max-width: 80%;
}

.chat-message.me {
    background-color: #f0f0f0;
    border: 1px solid #000;
    color: #000;
    margin-left: auto;
    text-align: right;
    max-width: 80%;
}

.chat-message.system {
    border: 1px solid #000;
    background-color: #fff;
    color: #000;
    font-style: italic;
    text-align: center;
    max-width: 100%;
    margin: 8px auto;
}

.chat-player {
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 8px;
    display: block;
}

.chat-message.other .chat-player {
    color: #000;
}

.chat-message.me .chat-player {
    color: #000;
}

.chat-text {
    display: block;
}

.chat-message.other .chat-text {
    color: #333;
}

.chat-message.me .chat-text {
    color: #000;
}

.chat-input-area {
    display: flex;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #000;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #000;
}

.chat-input:disabled {
    background-color: #000;
    cursor: not-allowed;
}

/* 投票エリア */
.voting-area {
    width: 100%;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #000;
    border-radius: 15px;
}

.voting-instruction {
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
}

.voting-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.vote-status {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    display: none;
}

.vote-status.success {
    border: 1px solid #000;
    color: #000;
}

/* 結果画面 */
.result-content {
    margin: 20px 0;
    width: 100%;
}

.result-section {
    border: 1px solid #000;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
}

.result-section h3 {
    color: #000;
    margin-bottom: 10px;
}

.word-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 5px;
}

.word-badge.majority {
    border: 1px solid #000;
    color: #000;
}

.word-badge.minority {
    border: 1px solid #000;
    color: #000;
}

.vote-result {
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #000;
    border-radius: 5px;
    font-size: 0.9rem;
}

.result-winner {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.result-winner.village-win {
    border: 1px solid #000;
    color: #2e7d32;
}

.result-winner.wolf-win {
    border: 1px solid #000;
    color: #d84315;
}

.message {
    font-size: 1.2rem;
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #000;
    border-radius: 25px;
    color: #555;
    text-align: center;
}

/* スクロールバーのカスタマイズ */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #000;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #000;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .word-display {
        font-size: 2rem;
    }

    .timer-display {
        font-size: 2rem;

        @media (max-width: 768px) {
            font-size: 1rem;
        }
    }

    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .voting-buttons {
        grid-template-columns: 1fr;
    }

    .game-info {
        flex-direction: column;
        text-align: center;
    }

    .chat-messages {
        height: 80vh;
    }

    .chat-text {
        font-size: 0.8rem;
    }

    .chat-player {
        font-size: 0.6rem;
    }

    .chat-message.other {
        max-width: 90%;
    }

    .chat-message.me {
        max-width: 90%;
    }

    #send-button {
        padding: 14px 16px;
        font-size: 0.8rem;
    }

    .screen {
        padding: 4px;
    }
}