:root {
    --bg-color: #0b0d10;
    --panel-bg: #15181e;
    --panel-border: #2c333e;
    --text-main: #e2e8f0;
    --text-sub: #8b9bb4;
    --accent: #cfa858; /* 古代の金 */
    --accent-hover: #ebcd7d;
    --cyber-green: #4ade80;
    
    --rarity-common: #8b9bb4;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b;
    --rarity-mythic: #ef4444;
    --rarity-relic: #ff00ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 50% 0%, #1e232d 0%, transparent 50%),
        linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)),
        url('data:image/svg+xml;utf8,<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><rect width="10" height="10" fill="none" stroke="%231a202c" stroke-width="1"/></svg>');
    color: var(--text-main);
    font-family: 'Courier New', 'Hiragino Kaku Gothic ProN', sans-serif; /* 考古学×ハッカー感 */
    line-height: 1.6;
}

.container { max-width: 800px; margin: 0 auto; padding: 20px; }

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed var(--panel-border);
}

header h1 {
    font-size: 2.8rem;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(207, 168, 88, 0.3);
    letter-spacing: 2px;
}

.status-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

.rank-display, .point-display {
    background: linear-gradient(145deg, var(--panel-bg), #111419);
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    font-weight: bold;
    font-size: 1.1rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.share-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    transition: 0.2s;
}

.x-btn { background: #000; color: #fff; border: 1px solid #333; }
.x-btn:hover { background: #111; }
.copy-btn { background: var(--panel-border); color: #fff; }
.copy-btn:hover { background: #3e4856; }
.mt-10 { margin-top: 10px; width: 100%; }

.category-select select {
    padding: 12px;
    background: #000;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: inherit;
}

.category-select select option[disabled] { color: #555; }

.dig-btn {
    background: linear-gradient(to bottom, var(--accent), #9a7b3c);
    color: #000;
    border: none;
    padding: 15px 50px;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 6px 0 #6b5323, 0 10px 20px rgba(0,0,0,0.8);
    font-family: inherit;
}

.dig-btn:hover { filter: brightness(1.1); transform: translateY(2px); box-shadow: 0 4px 0 #6b5323, 0 8px 15px rgba(0,0,0,0.8); }
.dig-btn:active { transform: translateY(6px); box-shadow: 0 0 0 #6b5323, 0 2px 5px rgba(0,0,0,0.8); }

.hidden { display: none !important; }

.result-card {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 10px;
    padding: 30px;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.02) 10px, rgba(255,255,255,0.02) 20px);
}

.rarity-badge {
    position: absolute;
    top: -15px; right: 20px;
    padding: 5px 20px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.2);
}

.info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0;
    background: #08090a; padding: 15px; border-radius: 5px; border-left: 3px solid var(--accent);
}

.description-box, .analysis-box { margin-bottom: 20px; }
.description-box h3, .analysis-box h3 { color: var(--accent); font-size: 1.2rem; margin-bottom: 10px; border-bottom: 1px solid #333; padding-bottom: 5px; }
.ai-comment { margin-top: 10px; color: var(--cyber-green); font-style: italic; }

.visit-btn {
    display: block; text-align: center; background: #1d4ed8; color: white;
    text-decoration: none; padding: 15px; border-radius: 5px; font-weight: bold;
    border: 1px solid #3b82f6; transition: 0.3s;
}
.visit-btn:hover { background: #2563eb; box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); }

.logbook { margin-top: 50px; background: var(--panel-bg); padding: 20px; border-radius: 10px; border: 1px solid var(--panel-border); }
#log-list { list-style: none; max-height: 300px; overflow-y: auto; padding-right: 10px; }
#log-list li { background: #0b0d10; padding: 10px; margin-bottom: 10px; border-left: 4px solid var(--text-sub); font-size: 0.95rem; border-radius: 0 5px 5px 0;}

/* 発掘演出 */
#digging-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 100;
    display: flex; justify-content: center; align-items: center;
    flex-direction: column;
}
.digging-text { font-size: 3rem; color: var(--accent); animation: pulse 0.5s infinite alternate; font-weight: bold; }
@keyframes pulse { from { transform: scale(1); opacity: 0.8;} to { transform: scale(1.1); opacity: 1;} }
.shake { animation: shake 0.3s infinite; }
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.mitsuki-alert { animation: mitsukiGlow 1.5s infinite alternate; border-color: var(--rarity-relic); background: #1a001a; }
@keyframes mitsukiGlow { from { box-shadow: 0 0 20px rgba(255, 0, 255, 0.3); } to { box-shadow: 0 0 40px rgba(255, 0, 255, 0.8); } }

/* 前回のベースはそのままに、アニメーションと広告枠を追加 */
:root {
    --bg-color: #0b0d10;
    --panel-bg: #15181e;
    --panel-border: #2c333e;
    --text-main: #e2e8f0;
    --text-sub: #8b9bb4;
    --accent: #cfa858;
    --cyber-green: #4ade80;
    --rarity-common: #8b9bb4;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b;
    --rarity-mythic: #ef4444;
    --rarity-relic: #ff00ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-color); color: var(--text-main); font-family: 'Courier New', sans-serif; line-height: 1.6; }
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
header { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px dashed var(--panel-border); }
header h1 { font-size: 2.8rem; color: var(--accent); }
.status-panel { display: flex; justify-content: center; gap: 20px; margin: 15px 0; }
.rank-display, .point-display { background: var(--panel-bg); padding: 10px 20px; border: 1px solid var(--accent); border-radius: 5px; font-weight: bold; }
.share-buttons { display: flex; justify-content: center; gap: 10px; }
.share-btn { padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; font-family: inherit; }
.x-btn { background: #000; color: #fff; border: 1px solid #333; }
.copy-btn { background: var(--panel-border); color: #fff; border: none;}
.mt-10 { margin-top: 15px; width: 100%; }

.category-select select { padding: 12px; background: #000; color: var(--accent); border: 1px solid var(--accent); font-size: 1.1rem; }
.dig-btn { background: linear-gradient(to bottom, var(--accent), #9a7b3c); color: #000; border: none; padding: 15px 50px; font-size: 1.8rem; font-weight: bold; border-radius: 8px; cursor: pointer; }
.hidden { display: none !important; }

.result-card { background: var(--panel-bg); border: 2px solid var(--panel-border); border-radius: 10px; padding: 30px; position: relative; }
.rarity-badge { position: absolute; top: -15px; right: 20px; padding: 5px 20px; border-radius: 20px; font-weight: bold; border: 1px solid rgba(255,255,255,0.2); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0; background: #08090a; padding: 15px; border-left: 3px solid var(--accent); }
.description-box { margin-bottom: 20px; }
.description-box h3 { color: var(--accent); border-bottom: 1px solid #333; }

.visit-btn { display: block; text-align: center; background: #1d4ed8; color: white; text-decoration: none; padding: 15px; border-radius: 5px; font-weight: bold; }

.logbook { margin-top: 50px; background: var(--panel-bg); padding: 20px; border: 1px solid var(--panel-border); }
#log-list { list-style: none; max-height: 300px; overflow-y: auto; }
#log-list li { background: #0b0d10; padding: 10px; margin-bottom: 10px; border-left: 4px solid var(--text-sub); }

/* 🌟 アフィリエイト・昔のウザい広告風CSS */
.vintage-ad {
    background: #000; border: 2px solid #ff0000; padding: 10px; text-align: center; font-weight: bold;
    font-family: 'MS PGothic', sans-serif;
}
.vintage-ad a { color: #ffff00; text-decoration: none; display: block; }
.vintage-ad a:hover { color: #ff00ff; text-decoration: underline; }
.ad-badge { background: #ff0000; color: #fff; padding: 2px 5px; font-size: 0.8rem; margin-right: 10px; }
.blink-ad { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { border-color: #00ff00; } }

/* 🔨 ガチンガチン発掘アニメーション */
#digging-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 100;
    display: flex; justify-content: center; align-items: center; flex-direction: column;
}
.digging-animation { position: relative; width: 150px; height: 150px; display: flex; justify-content: center; align-items: flex-end; }
.hammer { font-size: 5rem; position: absolute; top: -20px; right: 0; transform-origin: bottom left; }
.rock { font-size: 5rem; position: absolute; bottom: 0; left: 20px; }
.spark { font-size: 6rem; position: absolute; bottom: 10px; left: 10px; z-index: 10; }
.digging-text { font-size: 2rem; color: var(--accent); margin-top: 20px; font-weight: bold; }

/* ハンマーを振り下ろすアニメーション用クラス (JSで付与) */
.swing { animation: hammerSwing 0.4s ease-in; }
@keyframes hammerSwing {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(45deg); }
    100% { transform: rotate(-45deg); }
}
.break-rock { animation: rockBreak 0.2s forwards; }
@keyframes rockBreak {
    100% { transform: scale(1.2) translateY(10px); opacity: 0.5; filter: grayscale(100%); }
}

.mitsuki-alert { animation: mitsukiGlow 1.5s infinite alternate; border-color: var(--rarity-relic); }
@keyframes mitsukiGlow { from { box-shadow: 0 0 20px rgba(255,0,255,0.3); } to { box-shadow: 0 0 40px rgba(255,0,255,0.8); } }

/* ベースカラーと基本設定 */
:root {
    --bg-color: #0b0d10;
    --panel-bg: #15181e;
    --panel-border: #2c333e;
    --text-main: #e2e8f0;
    --text-sub: #8b9bb4;
    --accent: #cfa858;
    --cyber-green: #4ade80;
    --rarity-common: #8b9bb4;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b;
    --rarity-mythic: #ef4444;
    --rarity-relic: #ff00ff;
    --rarity-unknown: #00ffff; /* ランダム用 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-color); color: var(--text-main); font-family: 'Courier New', sans-serif; line-height: 1.6; overflow-x: hidden;}
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
header { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px dashed var(--panel-border); }
header h1 { font-size: 2.8rem; color: var(--accent); }
.status-panel { display: flex; justify-content: center; gap: 20px; margin: 15px 0; }
.rank-display, .point-display { background: var(--panel-bg); padding: 10px 20px; border: 1px solid var(--accent); border-radius: 5px; font-weight: bold; }
.share-buttons { display: flex; justify-content: center; gap: 10px; }
.share-btn { padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; font-family: inherit; }
.x-btn { background: #1d4ed8; color: #fff; border: none; }
.copy-btn { background: var(--panel-border); color: #fff; border: none;}
.mt-10 { margin-top: 15px; width: 100%; }

.category-select select { padding: 12px; background: #000; color: var(--accent); border: 1px solid var(--accent); font-size: 1.1rem; }
.dig-btn { background: linear-gradient(to bottom, var(--accent), #9a7b3c); color: #000; border: none; padding: 15px 50px; font-size: 1.8rem; font-weight: bold; border-radius: 8px; cursor: pointer; }
.hidden { display: none !important; }

.result-card { background: var(--panel-bg); border: 2px solid var(--panel-border); border-radius: 10px; padding: 30px; position: relative; }
.rarity-badge { position: absolute; top: -15px; right: 20px; padding: 5px 20px; border-radius: 20px; font-weight: bold; border: 1px solid rgba(255,255,255,0.2); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0; background: #08090a; padding: 15px; border-left: 3px solid var(--accent); }
.description-box { margin-bottom: 20px; }
.description-box h3 { color: var(--accent); border-bottom: 1px solid #333; }

.visit-btn { display: block; text-align: center; background: #10b981; color: white; text-decoration: none; padding: 15px; border-radius: 5px; font-weight: bold; }

.logbook { margin-top: 50px; background: var(--panel-bg); padding: 20px; border: 1px solid var(--panel-border); }
#log-list { list-style: none; max-height: 300px; overflow-y: auto; }
#log-list li { background: #0b0d10; padding: 10px; margin-bottom: 10px; border-left: 4px solid var(--text-sub); }

/* アフィリエイト広告 */
.vintage-ad { background: #000; border: 2px solid #ff0000; padding: 10px; text-align: center; font-weight: bold; }
.vintage-ad a { color: #ffff00; text-decoration: none; display: block; }
.ad-flex { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ad-img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; border: 1px solid #fff; }
.ad-badge { background: #ff0000; color: #fff; padding: 2px 5px; font-size: 0.8rem; margin-right: 10px; }
.blink-ad { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { border-color: #00ff00; } }

/* 発掘アニメーション */
#digging-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 1000;
    display: flex; justify-content: center; align-items: center; flex-direction: column;
}
.digging-animation { position: relative; width: 150px; height: 150px; display: flex; justify-content: center; align-items: flex-end; }
.hammer { font-size: 5rem; position: absolute; top: -20px; right: 0; transform-origin: bottom left; }
.rock { font-size: 5rem; position: absolute; bottom: 0; left: 20px; }
.spark { font-size: 6rem; position: absolute; bottom: 10px; left: 10px; z-index: 10; }
.digging-text { font-size: 2rem; color: var(--accent); margin-top: 20px; font-weight: bold; }

.swing { animation: hammerSwing 0.4s ease-in; }
@keyframes hammerSwing { 0% { transform: rotate(0deg); } 30% { transform: rotate(45deg); } 100% { transform: rotate(-45deg); } }
.break-rock { animation: rockBreak 0.2s forwards; }
@keyframes rockBreak { 100% { transform: scale(1.2) translateY(10px); opacity: 0.5; filter: grayscale(100%); } }

.mitsuki-alert { animation: mitsukiGlow 1.5s infinite alternate; border-color: var(--rarity-relic); }
@keyframes mitsukiGlow { from { box-shadow: 0 0 20px rgba(255,0,255,0.3); } to { box-shadow: 0 0 40px rgba(255,0,255,0.8); } }

/* トースト通知 */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: rgba(20, 20, 30, 0.95); border-left: 5px solid var(--accent); color: #fff;
    padding: 15px 20px; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.8);
    font-weight: bold; animation: slideInToast 0.3s forwards, fadeOutToast 0.3s 3s forwards;
}
@keyframes slideInToast { from { transform: translateX(120%); } to { transform: translateX(0); } }
@keyframes fadeOutToast { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* ベーススタイル（前回踏襲） */
:root {
    --bg-color: #0b0d10; --panel-bg: #15181e; --panel-border: #2c333e;
    --text-main: #e2e8f0; --text-sub: #8b9bb4; --accent: #cfa858;
    --rarity-common: #8b9bb4; --rarity-rare: #3b82f6; --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b; --rarity-mythic: #ef4444; --rarity-unknown: #00ffff; --rarity-relic: #ff00ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-color); color: var(--text-main); font-family: 'Courier New', sans-serif; line-height: 1.6; }
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
header { text-align: center; margin-bottom: 20px; }
h1 { font-size: 2.5rem; color: var(--accent); margin-bottom: 10px; }
.status-panel { display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; }
.rank-display, .point-display { background: var(--panel-bg); padding: 8px 15px; border: 1px solid var(--accent); border-radius: 5px; font-weight: bold; }

/* 進捗バー */
.progress-bar-container { background: #000; padding: 10px; border-radius: 5px; border: 1px solid var(--panel-border); }
.progress-text { font-size: 0.9rem; margin-bottom: 5px; text-align: right; color: var(--accent); }
.progress-bar { width: 100%; height: 10px; background: #333; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #cfa858); width: 0%; transition: width 0.5s ease; }

.mt-10 { margin-top: 15px; }
.share-btn { padding: 10px; border-radius: 5px; cursor: pointer; font-weight: bold; border: none; width: 100%; font-family: inherit; }
.x-btn { background: #1d4ed8; color: #fff; }

.category-select select { width: 100%; padding: 12px; background: #000; color: var(--accent); border: 1px solid var(--accent); font-size: 1.1rem; margin-bottom: 15px; }
.dig-btn { width: 100%; background: linear-gradient(to bottom, var(--accent), #9a7b3c); color: #000; padding: 15px; font-size: 1.5rem; font-weight: bold; border-radius: 8px; cursor: pointer; border: none; }
.hidden { display: none !important; }

/* 結果カード */
.result-card { background: var(--panel-bg); border: 2px solid var(--panel-border); border-radius: 10px; padding: 20px; position: relative; margin-top: 20px; }
.rarity-badge { position: absolute; top: -15px; right: 20px; padding: 5px 15px; border-radius: 20px; font-weight: bold; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; background: #000; padding: 10px; border-left: 3px solid var(--accent); }
.description-box h3 { color: var(--accent); border-bottom: 1px solid #333; margin-bottom: 5px; }
.visit-btn { display: block; text-align: center; background: #10b981; color: white; text-decoration: none; padding: 15px; border-radius: 5px; font-weight: bold; margin-top: 15px; }

/* 広告・支援物資 */
.vintage-ad { background: #000; border: 1px solid var(--accent); padding: 10px; text-align: center; border-radius: 5px; }
.vintage-ad h3 { font-size: 0.9rem; color: var(--accent); margin-bottom: 5px; }
.vintage-ad a { color: #fff; text-decoration: none; }
.ad-flex { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ad-img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }

/* タブ・図鑑・実績 */
.tabs { display: flex; gap: 5px; margin-bottom: 15px; }
.tab-btn { flex: 1; padding: 10px; background: #000; color: #fff; border: 1px solid var(--panel-border); cursor: pointer; }
.tab-btn.active { background: var(--panel-bg); border-color: var(--accent); border-bottom: none; color: var(--accent); font-weight: bold; }
.tab-content { background: var(--panel-bg); padding: 15px; border: 1px solid var(--panel-border); border-radius: 0 0 5px 5px; }

.zukan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.zukan-item { background: #000; border: 1px solid #333; padding: 10px; text-align: center; font-size: 0.8rem; border-radius: 5px; opacity: 0.5; filter: grayscale(100%); }
.zukan-item.found { opacity: 1; filter: grayscale(0%); border-color: var(--accent); }
.zukan-item i { font-size: 1.5rem; margin-bottom: 5px; display: block; }

.achievement-list { list-style: none; }
.achievement-item { background: #000; padding: 10px; margin-bottom: 5px; border-left: 3px solid #333; opacity: 0.5; display: flex; align-items: center; gap: 10px; }
.achievement-item.unlocked { opacity: 1; border-color: #f59e0b; }
.achievement-icon { font-size: 1.5rem; color: #555; }
.unlocked .achievement-icon { color: #f59e0b; }

/* アニメ・トースト */
#digging-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.85); z-index: 1000; display:flex; flex-direction:column; justify-content:center; align-items:center; }
.digging-animation { position: relative; width: 100px; height: 100px; display:flex; align-items:flex-end; justify-content:center; }
.hammer { font-size: 4rem; position:absolute; top:-20px; right:-20px; transform-origin: bottom left; }
.rock { font-size: 4rem; position:absolute; bottom:0; }
.spark { font-size: 5rem; position:absolute; z-index: 10; }
.swing { animation: hammerSwing 0.4s ease-in; }
@keyframes hammerSwing { 0% {transform:rotate(0deg);} 30% {transform:rotate(45deg);} 100% {transform:rotate(-45deg);} }
.break-rock { animation: rockBreak 0.2s forwards; }
@keyframes rockBreak { 100% {transform:scale(1.2) translateY(10px); opacity:0.5; filter:grayscale(100%);} }
.mitsuki-alert { animation: mitsukiGlow 1.5s infinite alternate; border-color: var(--rarity-relic); }
@keyframes mitsukiGlow { from { box-shadow: 0 0 20px rgba(255,0,255,0.3); } to { box-shadow: 0 0 40px rgba(255,0,255,0.8); } }

#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(20,20,30,0.95); border-left: 5px solid var(--accent); color: #fff; padding: 15px; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.8); font-weight: bold; animation: slideInToast 0.3s forwards, fadeOutToast 0.3s 3.5s forwards; }
@keyframes slideInToast { from {transform: translateX(120%);} to {transform: translateX(0);} }
@keyframes fadeOutToast { from {transform: translateX(0); opacity:1;} to {transform: translateX(120%); opacity:0;} }

/* ベーススタイル */
:root {
    --bg-color: #0b0d10; --panel-bg: #15181e; --panel-border: #2c333e;
    --text-main: #e2e8f0; --text-sub: #8b9bb4; --accent: #cfa858;
    --rarity-common: #8b9bb4; --rarity-rare: #3b82f6; --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b; --rarity-mythic: #ef4444; --rarity-unknown: #00ffff; --rarity-relic: #ff00ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-color); color: var(--text-main); font-family: 'Courier New', sans-serif; line-height: 1.6; }
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
header { text-align: center; margin-bottom: 20px; }
h1 { font-size: 2.5rem; color: var(--accent); margin-bottom: 5px; }
.subtitle { color: var(--text-sub); margin-bottom: 15px; }

/* 遊び方説明 (新規) */
.instruction-box { background: rgba(207, 168, 88, 0.1); border: 1px solid var(--accent); padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: left; font-size: 0.95rem; }
.instruction-box h3 { color: var(--accent); margin-bottom: 5px; font-size: 1.1rem; }

.status-panel { display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; }
.rank-display, .point-display { background: var(--panel-bg); padding: 8px 15px; border: 1px solid var(--accent); border-radius: 5px; font-weight: bold; }

/* 進捗バー */
.progress-bar-container { background: #000; padding: 10px; border-radius: 5px; border: 1px solid var(--panel-border); }
.progress-text { font-size: 0.9rem; margin-bottom: 5px; text-align: right; color: var(--accent); }
.progress-bar { width: 100%; height: 10px; background: #333; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #cfa858); width: 0%; transition: width 0.5s ease; }

.mt-10 { margin-top: 15px; }
.share-btn { padding: 12px; border-radius: 5px; cursor: pointer; font-weight: bold; border: none; width: 100%; font-family: inherit; font-size: 1rem;}
.x-btn { background: #1d4ed8; color: #fff; }

.category-select { margin-bottom: 20px; }
.blink-label { display: block; color: var(--accent); margin-bottom: 8px; font-weight: bold; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.7; } 50% { opacity: 1; } 100% { opacity: 0.7; } }
.category-select select { width: 100%; padding: 15px; background: #000; color: var(--accent); border: 2px solid var(--accent); font-size: 1.1rem; border-radius: 5px; }
.dig-btn { width: 100%; background: linear-gradient(to bottom, var(--accent), #9a7b3c); color: #000; padding: 18px; font-size: 1.5rem; font-weight: bold; border-radius: 8px; cursor: pointer; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.hidden { display: none !important; }

/* 結果カード */
.result-card { background: var(--panel-bg); border: 2px solid var(--panel-border); border-radius: 10px; padding: 25px; position: relative; margin-top: 20px; }
.rarity-badge { position: absolute; top: -15px; right: 20px; padding: 5px 15px; border-radius: 20px; font-weight: bold; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; background: #000; padding: 15px; border-left: 3px solid var(--accent); border-radius: 4px;}
.description-box h3 { color: var(--accent); border-bottom: 1px solid #333; margin-bottom: 8px; padding-bottom: 5px;}
.visit-btn { display: block; text-align: center; background: #10b981; color: white; text-decoration: none; padding: 15px; border-radius: 5px; font-weight: bold; margin-top: 20px; }

/* 広告・支援物資 */
.vintage-ad { background: #000; border: 1px solid var(--accent); padding: 15px; text-align: center; border-radius: 5px; }
.vintage-ad h3 { font-size: 0.9rem; color: var(--accent); margin-bottom: 10px; }
.vintage-ad a { color: #fff; text-decoration: none; }
.ad-flex { display: flex; align-items: center; justify-content: center; gap: 15px; text-align: left; }
.ad-img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }

/* タブ・図鑑・実績 */
.tabs { display: flex; gap: 5px; margin-bottom: 15px; }
.tab-btn { flex: 1; padding: 12px; background: #000; color: #fff; border: 1px solid var(--panel-border); cursor: pointer; font-weight: bold; }
.tab-btn.active { background: var(--panel-bg); border-color: var(--accent); border-bottom: none; color: var(--accent); }
.tab-content { background: var(--panel-bg); padding: 20px; border: 1px solid var(--panel-border); border-radius: 0 0 5px 5px; }

.zukan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.zukan-item { background: #000; border: 1px solid #333; padding: 15px 5px; text-align: center; font-size: 0.75rem; border-radius: 5px; opacity: 0.4; filter: grayscale(100%); }
.zukan-item.found { opacity: 1; filter: grayscale(0%); border-color: var(--accent); box-shadow: 0 0 5px rgba(207, 168, 88, 0.3); }
.zukan-item i { font-size: 1.8rem; margin-bottom: 8px; display: block; }

.achievement-list { list-style: none; }
.achievement-item { background: #000; padding: 15px; margin-bottom: 8px; border-left: 4px solid #333; opacity: 0.5; display: flex; align-items: center; gap: 15px; border-radius: 4px;}
.achievement-item.unlocked { opacity: 1; border-color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.achievement-icon { font-size: 2rem; color: #555; }
.unlocked .achievement-icon { color: #f59e0b; }

/* アニメ・トースト */
#digging-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.9); z-index: 1000; display:flex; flex-direction:column; justify-content:center; align-items:center; }
.digging-animation { position: relative; width: 120px; height: 120px; display:flex; align-items:flex-end; justify-content:center; }
.hammer { font-size: 5rem; position:absolute; top:-20px; right:-20px; transform-origin: bottom left; }
.rock { font-size: 5rem; position:absolute; bottom:0; }
.spark { font-size: 6rem; position:absolute; z-index: 10; }
.swing { animation: hammerSwing 0.4s ease-in; }
@keyframes hammerSwing { 0% {transform:rotate(0deg);} 30% {transform:rotate(45deg);} 100% {transform:rotate(-45deg);} }
.break-rock { animation: rockBreak 0.2s forwards; }
@keyframes rockBreak { 100% {transform:scale(1.2) translateY(10px); opacity:0.5; filter:grayscale(100%);} }
.mitsuki-alert { animation: mitsukiGlow 1.5s infinite alternate; border-color: var(--rarity-relic); }
@keyframes mitsukiGlow { from { box-shadow: 0 0 20px rgba(255,0,255,0.3); } to { box-shadow: 0 0 40px rgba(255,0,255,0.8); } }

#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(20,20,30,0.95); border-left: 5px solid var(--accent); color: #fff; padding: 15px 20px; border-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.8); font-weight: bold; animation: slideInToast 0.3s forwards, fadeOutToast 0.3s 3.5s forwards; }
@keyframes slideInToast { from {transform: translateX(120%);} to {transform: translateX(0);} }
@keyframes fadeOutToast { from {transform: translateX(0); opacity:1;} to {transform: translateX(120%); opacity:0;} }

/* 📱 スマホ用レスポンシブデザイン */
@media (max-width: 600px) {
    h1 { font-size: 1.8rem; }
    .status-panel { flex-direction: column; gap: 10px; align-items: center; }
    .rank-display, .point-display { width: 100%; text-align: center; }
    .info-grid { grid-template-columns: 1fr; }
    .dig-btn { padding: 15px; font-size: 1.3rem; }
    .zukan-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    #toast-container { bottom: 10px; right: 10px; left: 10px; }
}

/* 🚪 脱出ボタンのレトロスタイル */
.exit-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #000;
    color: var(--text-sub);
    border: 1px solid var(--panel-border);
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 500;
    transition: all 0.2s ease;
}

.exit-btn:hover {
    background: rgba(239, 68, 68, 0.1); /* 非常口レッド */
    color: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* スマホ用の位置調整 */
@media (max-width: 600px) {
    .exit-btn {
        position: static; /* スマホではヘッダーの上に綺麗に並ぶように */
        display: inline-flex;
        margin-bottom: 15px;
    }
}
