@charset "UTF-8";

/* --- 全体レイアウト --- */
.dig-main {
    background-color: #e3f2fd;
    padding-top: var(--header-height);
    min-height: 100vh; /* height: 100vh だとコンテンツが多いとはみ出るため min-height に */
    display: flex;
    flex-direction: column;
    align-items: center; /* 左右中央揃え */
    justify-content: flex-start; /* 上詰め */
    padding-bottom: 2rem;
}

.dig-interface {
    width: 95%; /* スマホでキツキツにならないよう */
    max-width: 1000px;
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ヘッダー */
.dig-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.dig-title h1 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* アイコン風装飾 */
.dig-title h1::before { content: '🔍'; font-size: 1.5rem; }

.dig-title p { margin: 0.5rem 0 0; font-size: 0.95rem; color: #666; }

.dig-status {
    display: flex; gap: 2rem; align-items: center;
    background: #f8f9fa; padding: 0.5rem 1.5rem; border-radius: 50px;
}
.status-item { font-weight: bold; font-size: 1.1rem; color: #444; }
.highlight { color: #e91e63; font-size: 1.5rem; font-family: var(--font-title); }
.reset-btn {
    padding: 0.5rem 1.2rem; font-size: 0.9rem;
    border: 1px solid #ddd; background: #fff; border-radius: 8px;
    cursor: pointer; transition: all 0.2s; font-weight: bold; color: #555;
}
.reset-btn:hover { background: #f0f0f0; color: #333; }

/* --- マップエリア --- */
.dig-map-container {
    width: 100%;
    /* アスペクト比を維持しつつレスポンシブに */
    aspect-ratio: 16 / 9;
    background-color: #aed581; /* 緑地 */
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    cursor: url('/images/common/cursor-loupe.png'), crosshair; /* ルーペカーソルがあれば */
    border: 4px solid #333;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1);

    /* CSSで描く街並み (ベース) */
    background-image: 
        /* 空 */
        linear-gradient(#81d4fa 0%, #b3e5fc 40%, transparent 40%),
        /* 道路 (横) */
        linear-gradient(transparent 55%, #8d6e63 55%, #8d6e63 75%, transparent 75%),
        /* 道路 (縦) */
        linear-gradient(90deg, transparent 30%, #8d6e63 30%, #8d6e63 45%, transparent 45%);
}

/* マップ上のオブジェクト配置用クラス */
.obj {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 3rem; /* 絵文字の基本サイズ */
    z-index: 5;
    pointer-events: none; /* クリック判定は .dig-spot が行う */
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

/* 特定オブジェクトのサイズ調整 */
.obj-large { font-size: 5rem; } /* 学校など */
.obj-small { font-size: 2rem; } /* 小物 */

/* --- 判定スポット --- */
.dig-spot {
    position: absolute;
    width: 60px; height: 60px;
    /* border: 1px dashed rgba(255,0,0,0.5); デバッグ用 */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
}

/* 発見済みエフェクト */
.dig-spot.found-danger {
    pointer-events: none;
}
.dig-spot.found-danger::after {
    content: '⚠️';
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 2.5rem;
    animation: stamp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dig-spot.found-safe {
    pointer-events: none;
}
.dig-spot.found-safe::after {
    content: '⭕';
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 2.5rem;
    animation: stamp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stamp {
    0% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* --- 解説エリア --- */
.dig-dialogue-area {
    min-height: 140px;
    background: #fdfdfd;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    padding: 1rem;
    display: flex;
    align-items: center;
}
.dig-dialogue-area .dialogue-turn {
    margin: 0; width: 100%; box-shadow: none; background: transparent;
}

/* css/dig.css 追記部分 */

/* オブジェクト共通 */
.obj {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 3rem; /* 絵文字用 */
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 画像オブジェクトのスタイル */
.obj img {
    height: 80px; /* キャラクターサイズ */
    width: auto;
    object-fit: contain;
}

/* サイズバリエーション */
.obj-large { font-size: 5rem; }
.obj-small { font-size: 2rem; }

/* --- リザルトオーバーレイの強化 --- */
.result-overlay {
    position: fixed; /* 画面に固定 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* 背景を暗くして没入感を出す */
    z-index: 1000;
    display: none; /* JSで flex に切り替え */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px); /* 背景をぼかす（イマドキ風） */
}

.result-card {
    background: #fff;
    padding: 3rem 2rem;
    border-radius: 30px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 6px solid var(--color-primary); /* メインカラーで縁取り */
    position: relative;
    animation: resultPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes resultPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-card h2 {
    font-size: 2.5rem;
    color: #e91e63;
    margin-bottom: 1.5rem;
    font-family: var(--font-title);
    text-shadow: 2px 2px 0px #fce4ec;
}

/* クラッカーのような装飾を擬似要素で追加 */
.result-card::before, .result-card::after {
    content: '🎊';
    position: absolute;
    font-size: 3rem;
    top: -20px;
}
.result-card::before { left: -20px; transform: rotate(-20deg); }
.result-card::after { right: -20px; transform: rotate(20deg); }

/* ボタンを大きく押しやすく */
.result-card .cta-button {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 50px;
    font-size: 1.2rem;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}
.result-card .cta-button:hover {
    transform: scale(1.05);
}