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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    overflow: hidden;
}

#auth-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-card {
    background: #34495e;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 320px;
}

.auth-card h1 {
    margin-bottom: 8px;
    color: #f1c40f;
}

.auth-card input,
select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: none;
    border-radius: 6px;
    font-size: 14px;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

button {
    padding: 10px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.1s;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #7f8c8d !important;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.btn-secondary {
    background: #2980b9;
}

.msg {
    margin-top: 10px;
    font-size: 13px;
    color: #e74c3c;
}

.room-item {
    background: #2c3e50;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-item button {
    padding: 6px 12px;
    font-size: 13px;
}

header {
    background: #1a252f;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1c40f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* 修正: マップのコンテナ背景 */
.board-container {
    background: #2980b9;
}

.sidebar {
    background: #1a252f;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    overflow-y: auto;
}

.panel {
    background: #2c3e50;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.panel h3 {
    font-size: 13px;
    margin-bottom: 10px;
    color: #bdc3c7;
    border-bottom: 1px solid #34495e;
    padding-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resource-vertical-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 5px;
}

.res-row {
    background: #34495e;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.res-row .emoji {
    font-size: 18px;
    margin-right: 10px;
}

.res-row .val {
    margin-left: auto;
    font-size: 20px;
    color: #f1c40f;
}

.cost-guide {
    background: #1a252f;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #bdc3c7;
    line-height: 1.6;
    border: 1px dashed #7f8c8d;
}

.action-btn {
    padding: 12px;
    font-size: 14px;
    letter-spacing: 0.5px;
}

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

.chat-input input {
    flex: 1;
    padding: 8px;
    border-radius: 4px;
    border: none;
    background: #ecf0f1;
}

.chat-input button {
    padding: 8px 12px;
}

#chat-logs::-webkit-scrollbar {
    width: 8px;
}

#chat-logs::-webkit-scrollbar-track {
    background: #1a252f;
}

#chat-logs::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.overlay-box {
    background: #2c3e50;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    width: 400px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .sidebar {
        width: 100% !important;
        border: none !important;
        border-top: 2px solid #f1c40f !important;
    }
}