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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

header {
    background-color: #2a2a2a;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #3a3a3a;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid #3a3a3a;
    color: #999;
}

.container {
    background-color: #2a2a2a;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.page {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    display: inline-block;
}

.btn:hover {
    background-color: #ff5252;
}

.btn-secondary {
    background-color: #4a4a4a;
}

.btn-secondary:hover {
    background-color: #5a5a5a;
}

.btn-danger {
    background-color: #d32f2f;
}

.btn-danger:hover {
    background-color: #c62828;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ff6b6b;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #999;
    font-size: 0.875rem;
}

.agent-card {
    background-color: #3a3a3a;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid #ff6b6b;
    transition: transform 0.2s;
}

.agent-card:hover {
    transform: translateX(5px);
}

.agent-card h3, .agent-card h4 {
    margin-bottom: 0.5rem;
    color: #ff6b6b;
}

.agent-selector-item {
    background-color: #3a3a3a;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s;
}

.agent-selector-item:hover {
    background-color: #4a4a4a;
}

.agent-selector-item.dragging {
    opacity: 0.5;
}

.chat-container {
    height: 600px;
    overflow-y: auto;
    background-color: #2a2a2a;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #3a3a3a;
}

.message {
    background-color: #3a3a3a;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message .agent-name {
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 0.5rem;
}

.message .timestamp {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #999;
    font-size: 0.85rem;
}

.message .content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.system-message {
    background-color: #4a3a3a;
    border: 2px solid #ff9800;
    text-align: center;
    padding: 1.5rem;
}

.control-panel {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-indicator.active {
    background-color: #4caf50;
    color: white;
}

.status-indicator.playing {
    background-color: #4caf50;
    color: white;
}

.status-indicator.paused {
    background-color: #ff9800;
    color: white;
}

.status-indicator.stopped {
    background-color: #f44336;
    color: white;
}

.status-indicator.completed {
    background-color: #2196f3;
    color: white;
}

.status-indicator.voting {
    background-color: #9c27b0;
    color: white;
}

/* 進行状況バーのスタイル */
.progress-container {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #3a3a3a;
}

.progress-bar {
    height: 20px;
    background-color: #4caf50;
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 5%;
}

.progress-bar.warning {
    background-color: #ff9800;
}

.progress-bar.danger {
    background-color: #ff6b6b;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.progress-text.warning {
    color: #ff9800;
    font-weight: bold;
}

.progress-text.danger {
    color: #ff6b6b;
    font-weight: bold;
}

/* 投票フェーズのスタイル */
.voting-phase {
    background-color: #4a3a5a;
    border: 2px solid #9c27b0;
    text-align: center;
}

.voting-result {
    background-color: #3a4a5a;
    border-left: 4px solid #2196f3;
}

.voting-summary {
    background-color: #5a3a3a;
    border: 2px solid #ff6b6b;
    padding: 1.5rem;
}

.warning-box {
    background-color: #3a3a3a;
    border-left: 4px solid #ff9800;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
}

.warning-box h4 {
    color: #ff9800;
    margin-bottom: 0.5rem;
}

.handout-item {
    background-color: #3a3a3a;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 1px solid #4a4a4a;
}

.handout-item h5 {
    color: #ff6b6b;
    margin-bottom: 0.5rem;
}

/* フェーズ設定 */
.phase-item {
    background-color: #3a3a3a;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    border: 1px solid #4a4a4a;
}

.phase-item h5 {
    color: #ff9800;
    margin-bottom: 0.5rem;
}

/* ハンドアウト割り当て */
.assignment-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.assignment-item {
    background-color: #3a3a3a;
    padding: 1rem;
    border-radius: 5px;
    border: 2px solid #4a4a4a;
}

.assignment-item.assigned {
    border-color: #ff6b6b;
}

.assignment-item h5 {
    color: #ff6b6b;
    margin-bottom: 0.5rem;
}

.handout-preview {
    background-color: #2a2a2a;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 3px;
    font-size: 0.9rem;
    max-height: 150px;
    overflow-y: auto;
}

.goal-section {
    background-color: #3a3a3a;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 5px;
    border-left: 4px solid #4caf50;
}

.secret-section {
    background-color: #3a3a3a;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 5px;
    border-left: 4px solid #f44336;
}

/* スクロールバーのスタイル */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    main {
        padding: 0 0.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .message .timestamp {
        position: static;
        display: block;
        margin-top: 0.5rem;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chat-container {
        height: 400px;
    }
}

/* ローディングアニメーション */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #ff6b6b;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #323232;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.success {
    background-color: #4caf50;
}

.toast.error {
    background-color: #f44336;
}

.toast.warning {
    background-color: #ff9800;
}