/* --- 全体スタイル --- */
:root {
    --main-bg-color: #fdf6e4;
    --accent-color: #d3382c;
    --text-color: #3a2e22;
    --stamp-bg: #fff;
    --stamp-border-color: #dccdbb;
    --stamp-acquired-bg: #ffeb3b;
    --font-main: 'Noto Sans JP', sans-serif;
    --font-title: 'Mochiy Pop One', sans-serif;
}
html, body {
    margin: 0;
    padding: 0;
    background-color: var(--main-bg-color);
}
body {
    font-family: var(--font-main);
    color: var(--text-color);
    text-align: center;
}

/* --- ヘッダー --- */
header {
    background-color: var(--accent-color);
    color: white;
    padding: 20px 15px;
    border-bottom: 5px solid #a12a21;
}
header h1 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.3);
}
header p { margin: 5px 0 0; font-size: 0.9rem; }

main { padding: 20px 15px; }

/* --- スタンプカード --- */
#stamp-card-container h2 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    margin-top: 0;
}
#stamp-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 20px auto;
}
.stamp {
    position: relative;
    background-color: var(--stamp-bg);
    border: 2px dashed var(--stamp-border-color);
    border-radius: 15px;
    padding: 20px 10px;
    transition: all 0.4s ease-in-out;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.stamp .oni-icon {
    font-size: 3rem;
    filter: grayscale(100%);
    opacity: 0.4;
    transition: all 0.4s;
}
.stamp .stamp-name {
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 5px;
    color: #b0a89a;
    transition: color 0.4s;
}

/* ロックされたスタンプのスタイル */
.stamp.locked {
    background-color: #f7f7f7;
    border-style: solid;
    border-color: #e0e0e0;
    opacity: 0.6;
}
.stamp.locked .oni-icon { opacity: 0.3; }
.stamp.locked .stamp-name { color: #c0c0c0; }

/* 獲得済みのスタイル */
.stamp.acquired {
    background-color: var(--stamp-acquired-bg);
    border: 3px solid var(--accent-color);
    transform: scale(1.05);
    opacity: 1;
}
.stamp.acquired .stamp-name { color: var(--text-color); }
.stamp.acquired .oni-icon {
    filter: grayscale(0%);
    opacity: 1;
    transform: rotate(15deg) scale(1.2);
}
.stamp .acquired-mark {
    display: none;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--accent-color);
    border: 4px solid var(--accent-color);
    border-radius: 10px;
    padding: 5px 15px;
    background-color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}
.stamp.acquired .acquired-mark { display: block; }

#progress-text { font-size: 1.2rem; font-weight: bold; margin-top: 25px; }

/* --- 特典エリア --- */
#reward-container {
    background-color: #fff;
    border: 5px double var(--accent-color);
    border-radius: 10px;
    padding: 20px; margin: 30px auto;
    max-width: 500px;
    transition: opacity 0.5s, transform 0.5s;
}
#reward-container h2 { font-family: var(--font-title); color: var(--accent-color); }
#reward-image { width: 100%; max-width: 300px; margin: 10px 0; border-radius: 5px; }

/* --- ボタン --- */
#action-buttons { margin-top: 30px; }
.primary-button, #reset-button, .modal-button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.primary-button {
    font-family: var(--font-title);
    font-size: 1.2rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.2s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.3); }
.primary-button:disabled { background-color: #ccc; cursor: not-allowed; box-shadow: none; transform: none; }
.primary-button:active { transform: scale(0.95); }

#reset-button {
    margin-top: 20px; background: none; border: 1px solid var(--text-color);
    color: var(--text-color); font-size: 0.8rem; padding: 5px 10px;
    border-radius: 5px;
}

/* --- モーダル共通 --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center;
    z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.modal-content {
    background: var(--main-bg-color); padding: 30px; border-radius: 15px;
    max-width: 90%; width: 400px; text-align: center; border: 3px solid var(--accent-color);
    transform: scale(0.9); transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-content h3 { font-family: var(--font-title); margin-top: 0; font-size: 1.4rem; }
.modal-button {
    display: inline-block; margin-top: 20px; font-size: 1rem; background-color: var(--accent-color);
    color: white; text-decoration: none; padding: 10px 25px; border-radius: 20px;
    border: none;
}

/* --- その他 --- */
#confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 9999; }
.confetti { position: absolute; width: 10px; height: 10px; opacity: 0; animation: fall 5s linear forwards; }
@keyframes fall { 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } }
.hidden { display: none !important; }
.visible { display: flex !important; }