@charset "UTF-8";

/* --- 全体レイアウト --- */
.hug-main {
    background-color: #e0e0e0;
    padding-top: var(--header-height);
    height: 100vh;
    overflow: hidden;
}

.hug-interface {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 1rem;
    padding: 1rem;
}

/* --- 左サイドバー (受付) --- */
.hug-sidebar {
    width: 350px;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin: 0 0 1rem;
    border-bottom: 2px solid #eee;
}

.game-status {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #555;
    margin-bottom: 1rem;
}

/* 避難者カードエリア */
.current-card-area {
    flex: 1;
    background: #f0f4f8;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ドラッグ可能なカード */
.evacuee-card {
    background: #fff;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    padding: 1.5rem;
    cursor: grab;
    transition: transform 0.2s;
    border-left: 8px solid var(--color-secondary);
    user-select: none;
}
.evacuee-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.card-face {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.card-face-icon {
    font-size: 3rem; /* 絵文字用 */
    line-height: 1;
}
.card-face img {
    width: 60px; height: 60px; object-fit: contain;
}

.card-info h3 { margin: 0; font-size: 1.2rem; }
.card-tags { display: flex; gap: 0.5rem; margin-top: 0.3rem; flex-wrap: wrap; }
.tag { font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; color: #fff; background: #999; }
.tag.red { background: #e53935; } /* 医療・緊急 */
.tag.blue { background: #1e88e5; } /* 配慮 */
.tag.green { background: #43a047; } /* ペット */

.card-request {
    background: #fff8e1;
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    color: #5d4037;
    position: relative;
}
.card-request::before {
    content: '要望';
    position: absolute; top: -10px; left: 10px;
    background: #ffa000; color: #fff; font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
}

/* オペレーターエリア */
.operator-feedback {
    min-height: 120px;
}
.operator-feedback .dialogue-turn { margin: 0; padding: 1rem; }
.operator-feedback p { font-size: 0.9rem; }

/* --- 右サイド (体育館マップ) --- */
.hug-map-wrapper {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.gym-label {
    text-align: center; font-weight: bold; font-size: 1.2rem; margin-bottom: 1rem; color: #333;
    border-bottom: 2px double #ccc; padding-bottom: 0.5rem;
}

.gym-layout {
    flex: 1;
    display: grid;
    grid-template-rows: 60px 1fr 40px; /* ステージ / 床 / 入口 */
    gap: 1rem;
    border: 4px solid #333;
    padding: 1rem;
    background-color: #e0f7fa; /* 体育館の床イメージ */
}

/* 各ゾーン共通 */
.gym-zone {
    background: rgba(255,255,255,0.8);
    border: 2px dashed #90a4ae;
    border-radius: 8px;
    position: relative;
    padding: 2rem 1rem 1rem;
    transition: background 0.3s;
    overflow: hidden;
}
.gym-zone.drag-over {
    background: #b2ebf2;
    border-color: var(--color-primary);
    border-style: solid;
}

.zone-name {
    position: absolute; top: 0; left: 0; width: 100%;
    background: #cfd8dc; color: #455a64; font-size: 0.8rem; font-weight: bold;
    text-align: center; padding: 2px 0;
}
.gym-zone small {
    position: absolute; bottom: 5px; right: 5px; font-size: 0.7rem; color: #888;
}

/* ゾーン配置 (Grid) */
.gym-main-floor {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 左:一般 / 右:特殊 */
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
}

/* ゾーンごとの色分け */
.stage-zone { background: #424242; color: #fff; border: none; display: flex; align-items: center; justify-content: center; }
.medical-zone { border-color: #ef5350; background: rgba(255, 235, 238, 0.6); }
.special-zone { border-color: #ffa726; background: rgba(255, 248, 225, 0.6); }
.pet-zone { border-color: #66bb6a; background: rgba(232, 245, 233, 0.6); }

/* 配置された人 */
.occupants {
    display: flex; flex-wrap: wrap; gap: 5px; height: 100%; align-content: flex-start;
}
.person-dot {
    width: 30px; height: 30px; border-radius: 50%;
    background: #fff; border: 1px solid #ccc;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: default;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.person-dot img { width: 100%; height: 100%; object-fit: contain; }

/* 入口 */
.gym-entrance {
    background: #ccc; text-align: center; font-weight: bold; padding: 0.5rem;
}

/* --- 結果画面 --- */
.result-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 2000;
    display: none; align-items: center; justify-content: center;
}
.result-card {
    background: #fff; padding: 3rem; border-radius: 16px; text-align: center; max-width: 500px;
}

/* レスポンシブ */
@media (max-width: 900px) {
    .hug-interface { flex-direction: column; overflow-y: auto; height: auto; }
    .hug-sidebar { width: 100%; height: auto; }
    .hug-map-wrapper { height: 600px; }
    .gym-main-floor { grid-template-columns: 1fr; }
}