/* 暗号カフェ V2 (Sister Site Style: memori-tech.tech) */

/* === AdSense 空スロット対策 ===
   広告が表示されなかった場合（unfilled / ローカル表示）に
   白紙スペースが生まれるのを防ぐ
   ================================================ */
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}
/* adsbygoogleが一切処理されていない場合（ローカル・オフライン）も折りたたむ */
ins.adsbygoogle:not([data-ad-status]) {
    min-height: 0 !important;
}
/* 広告コンテナのラッパーが空の場合も余白ゼロに */
ins.adsbygoogle:empty {
    display: none !important;
}

:root {
    /* Color Palette (Soft Blue & Clean) */
    --bg-color: #fcfaf7;          /* Warm off-white */
    --card-bg: #ffffff;           /* Clean white */
    --text-primary: #4a3a33;      /* Soft dark brown for readability */
    --text-secondary: #7d6b63;    /* Muted brown for subtext */
    --accent-blue: #5599ff;       /* Sister site main soft blue */
    --accent-blue-hover: #3d84f0; /* Slightly darker for hover states */
    --accent-gold: #d4a373;       /* Muted gold for highlights */
    
    /* Layout Variables */
    --container-width: 1000px;
    --border-radius-card: 16px;
    --border-radius-btn: 30px;
    
    /* Shadows */
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 15px 40px rgba(85, 153, 255, 0.15); /* Soft blue shadow */
    
    /* Typography */
    --font-main: 'Noto Sans JP', 'Inter', sans-serif;
    --font-heading: 'Outfit', 'Noto Sans JP', sans-serif;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.8;
    overflow-x: hidden;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-blue-hover);
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* === Header / Navigation === */
header {
    background: rgba(252, 250, 247, 0.95);
    backdrop-filter: blur(12px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 9999;
    border-bottom: 2px solid var(--accent-blue);
    box-shadow: var(--shadow-sm);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 88px;
}

.logo-link {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-logo {
    height: 76px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.03);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

/* === Hamburger Menu === */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 12px;
    min-width: 48px;
    min-height: 48px;
    border: none;
    background: transparent;
    z-index: 10000;
    position: relative;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    border-radius: var(--border-radius-btn);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white !important;
    box-shadow: 0 6px 15px rgba(85, 153, 255, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(85, 153, 255, 0.4);
}

/* === Layout Blocks === */
.section-padding {
    padding: 100px 0;
}

.page-title {
    text-align: center;
    margin-bottom: 60px;
    /* padding-top: 140px; 削除：ヘッダーの余白はAdSense枠（margin-top）で確保されるため不要 */
}

.page-title h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 16px;
    color: var(--accent-blue);
}

.page-title p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* === Cards & Lists === */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-card);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
    transition: all 0.4s ease;
    display: block;
    color: inherit;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

.card-tag {
    display: inline-block;
    background: var(--bg-color);
    color: var(--accent-blue);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    border: 1px solid var(--accent-blue);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* === Article Layout === */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.article-content {
    background: var(--card-bg);
    padding: 60px;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-sm);
    font-size: 1.05rem;
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 48px 0 24px;
    padding-left: 16px;
    border-left: 6px solid var(--accent-blue);
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 24px;
}

.article-content ul, .article-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content a {
    color: var(--accent-blue);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: #3b7ce0;
    text-decoration: none;
}

/* === Mofuneko Companion Component === */
.mofuneko-bubble {
    background: #f4f8ff; /* Very light blue background matching reference */
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    padding: 24px 32px;
    margin: 48px 0;
    position: relative;
    display: flex;
    gap: 24px;
    align-items: center; /* Center vertically like reference */
}

.mofuneko-bubble::before {
    content: var(--bubble-label, "🐾 もふねこ");
    position: absolute;
    top: -20px;
    left: 20px;
    background: var(--accent-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 20px 20px 20px 0; /* Tab style like reference */
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 1; /* Ensure tab is above border */
}

.mofuneko-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    max-width: 64px;
    max-height: 64px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--accent-blue);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Ensure image stays inside circle */
    box-shadow: 0 4px 8px rgba(85, 153, 255, 0.2); /* Soft shadow like reference */
}

/* Use emoji as fallback if no image */
.mofuneko-avatar::after {
    content: '🐈‍⬛';
    position: absolute;
    z-index: 1;
}

.mofuneko-avatar img {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    display: block;
}

.mofuneko-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.7;
}

.mofuneko-text p:last-child {
    margin-bottom: 0;
}

/* === Footer === */
footer {
    background: white;
    padding: 60px 0 30px;
    border-top: 1px solid #eee;
    margin-top: 80px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.copyright {
    color: #999;
    font-size: 0.85rem;
}

/* === AdSense Container Safeties === */
.ad-container {
    margin: 40px 0;
    text-align: center;
    min-height: 100px;
    background: #fafafa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.8rem;
    border: 1px dashed #ddd; /* Development only, removes invisible clicking */
}
.ad-container::before {
    content: 'Advertisement';
}

/* === Utilities === */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }

/* === Speech Balloon Chat Component === */
.speech-wrap {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 40px 0;
    width: 100%;
}

.speech-wrap.sbp-r {
    flex-direction: row-reverse;
}

.speech-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    max-width: 80px;
    flex-shrink: 0;
}

.speech-icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    max-width: 80px;
    max-height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #fdf5e6; /* Soft cream background for the avatars to match reference */
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speech-icon-image {
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
    display: block;
}

.speech-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
}

.speech-balloon {
    position: relative;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 24px;
    max-width: calc(100% - 100px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    margin-top: 10px;
    color: var(--text-primary);
}

.speech-balloon p {
    margin: 0 !important;
    line-height: 1.6;
}

/* Left pointing tail (Mofuneko) */
.speech-wrap.sbp-l .speech-balloon::before,
.speech-wrap.sbp-l .speech-balloon::after {
    content: "";
    position: absolute;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
}

.speech-wrap.sbp-l .speech-balloon::before {
    left: -12px;
    border-width: 8px 12px 8px 0;
    border-color: transparent #e0e0e0 transparent transparent;
}

.speech-wrap.sbp-l .speech-balloon::after {
    left: -9px;
    border-width: 7px 10px 7px 0;
    border-color: transparent #ffffff transparent transparent;
}

/* Right pointing tail (Reader) */
.speech-wrap.sbp-r .speech-balloon::before,
.speech-wrap.sbp-r .speech-balloon::after {
    content: "";
    position: absolute;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
}

.speech-wrap.sbp-r .speech-balloon::before {
    right: -12px;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent #e0e0e0;
}

.speech-wrap.sbp-r .speech-balloon::after {
    right: -9px;
    border-width: 7px 0 7px 10px;
    border-color: transparent transparent transparent #ffffff;
}

/* === Crypto Playground === */
.playground-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.crypto-result-wrap {
    background: #eee;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

#encryptedText {
    margin: 0;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: bold;
    color: #333;
    letter-spacing: 2px;
    word-break: break-all;
    text-align: center;
    user-select: all;
    padding-right: 80px; /* Space for absolute button on desktop */
}

#copyBtn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    white-space: nowrap;
}

@media (max-width: 768px) {
    header nav {
        height: 60px;
        padding: 0;
        flex-direction: row;
        position: relative;
    }

    .hamburger {
        display: flex;
    }

    .header-logo {
        height: 48px;
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-color);
        flex-direction: column;
        gap: 0;
        padding: 100px 0 40px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.12);
        z-index: 9998;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    /* 背景オーバーレイ */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.35);
        z-index: 9997;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.open {
        display: block;
        opacity: 1;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        font-size: 1.05rem;
        font-weight: 600;
        padding: 18px 32px;
        border-bottom: 1px solid #f0ebe4;
        color: var(--text-primary);
        text-align: left;
        transition: background 0.2s ease;
    }

    .nav-links a:hover,
    .nav-links a:active {
        background: rgba(85, 153, 255, 0.06);
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    /* ヘッダーの重なり防止 */
    section:first-of-type {
        padding-top: 100px !important;
    }
    
    .section-padding {
        padding: 40px 0;
    }

    /* index.html intro section */
    .intro-section {
        padding: 24px 16px !important;
        margin-top: 30px !important;
    }

    /* crypto-playground */
    #crypto-playground {
        padding: 24px 16px !important;
        margin-top: 30px !important;
    }

    .page-title {
        margin-bottom: 40px;
    }

    .article-content {
        padding: 24px 16px;
    }
    
    /* mofuneko-bubble: モバイルでは横並びを維持してアイコンが大きくならないように */
    .mofuneko-bubble {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        padding: 40px 16px 20px;
        gap: 12px;
    }
    
    .mofuneko-avatar {
        margin-bottom: 0;
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        max-width: 56px;
        max-height: 56px;
        flex-shrink: 0;
    }

    .mofuneko-avatar img {
        width: 56px;
        height: 56px;
        max-width: 56px;
        max-height: 56px;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 12px 20px;
        justify-content: center;
    }

    .footer-links li {
        white-space: nowrap;
    }

    /* Crypto Playground Mobile */
    .crypto-result-wrap {
        flex-direction: column;
        padding-bottom: 20px;
        min-height: auto;
    }

    #encryptedText {
        padding-right: 0;
        margin-bottom: 10px;
    }

    #copyBtn {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        margin-top: 10px;
    }
    
    .playground-box {
        padding: 20px 15px;
    }

    .playground-form-row {
        flex-direction: column;
        gap: 10px;
    }

    .playground-form-row input {
        width: 100%;
    }

    .playground-form-row button {
        width: 100%;
    }

    /* パンくずリストのmargin-top調整 */
    nav[aria-label="パンくずリスト"] {
        margin-top: 20px !important;
    }

    /* === グローバルはみ出し防止 === */
    /* テーブルの横スクロール対応 */
    .article-content table,
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* 画像のはみ出し防止 */
    img {
        max-width: 100%;
        height: auto;
    }

    /* グリッドカード：全スタック */
    .grid-cards {
        grid-template-columns: 1fr !important;
    }

    /* article-content内の要素を制限 */
    .article-content {
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* speech-balloon幅制限 */
    .speech-balloon {
        max-width: calc(100% - 100px);
    }
}

/* === Playground Global Styles === */
.playground-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1.1rem;
    box-sizing: border-box;
    font-family: inherit;
}

.playground-range {
    width: 100%;
    cursor: pointer;
}

.btn-playground {
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: transform 0.2s;
}

.btn-accent {
    background-color: #d4a373;
    color: white;
}

.btn-secondary-outline {
    background-color: #fcfaf7;
    color: #555;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    transition: background 0.2s;
}

.playground-form-row {
    display: flex;
    gap: 10px;
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 1.8rem;
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* === Global Mobile-Safe Inputs === */
/* フォーム要素が画面からはみ出さないよう全体に適用 */
input, textarea, select {
    max-width: 100%;
}

/* === Anchor Scroll Offset (固定ヘッダー対策) === */
/* デスクトップ: ヘッダー高さ 120px + 余白 */
[id] {
    scroll-margin-top: 140px;
}

/* モバイル: ヘッダーが縦積みになるため大きめに */
@media (max-width: 768px) {
    [id] {
        scroll-margin-top: 180px;
    }
}

/* === Article Navigation === */
.article-navigation {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #eaeaea;
}

.article-navigation .btn {
    flex-shrink: 0;
}

/* === Contact Form === */
.contact-form-container input,
.contact-form-container textarea {
    width: 100%;
    box-sizing: border-box;
}

/* === Sister Site Banner === */
.sister-site-banner {
    word-break: break-word;
    max-width: 600px;
    margin: 60px auto 40px auto !important; /* 画面中央に配置 */
}

/* 画像全体を切り抜かずに綺麗に表示させる */
.sister-site-banner > img {
    max-height: none !important;
    width: 100% !important;
    object-fit: auto !important;
}

/* === Dict List Mobile === */
@media (max-width: 600px) {
    .dict-list {
        grid-template-columns: 1fr;
    }
}

/* === Speech Balloon Mobile Fix === */
@media (max-width: 600px) {
    .speech-wrap {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .speech-wrap.sbp-r {
        flex-direction: row-reverse;
        align-items: flex-start;
    }

    .speech-balloon {
        max-width: calc(100% - 76px);
        flex: 1;
    }

    .speech-person {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        flex-shrink: 0;
    }

    .speech-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
        max-width: 60px;
        max-height: 60px;
    }

    .speech-icon-image {
        width: 60px;
        height: 60px;
        max-width: 60px;
        max-height: 60px;
    }
}

/* ======================================== */
/* === Stamp Rally System === */
/* ======================================== */

/* --- 完了済みカードのスタイル --- */
.card-completed {
    background: linear-gradient(135deg, #f0faf0 0%, #e8f5e9 100%) !important;
    border-color: #a5d6a7 !important;
}

.card-completed:hover {
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.15) !important;
}

/* --- カード上のスタンプバッジ --- */
.stamp-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #d4a373, #c2915e);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(212, 163, 115, 0.4);
    z-index: 10;
    animation: stampPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampPop {
    0% { transform: scale(0) rotate(-20deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* --- 進捗バー --- */
.stamp-progress-container {
    background: white;
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 32px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #f0f0f0;
}

.stamp-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stamp-progress-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.stamp-progress-count {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-blue);
}

.stamp-progress-track {
    background: #eee;
    border-radius: 10px;
    height: 14px;
    overflow: hidden;
}

.stamp-progress-fill {
    background: linear-gradient(90deg, #5599ff, #77bbff);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stamp-progress-hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* --- 解説ページの完了ボタンエリア --- */
.stamp-rally-area {
    margin-top: 40px;
    padding: 32px;
    text-align: center;
    background: linear-gradient(135deg, #fff9f0, #fff3e0);
    border: 2px dashed #d4a373;
    border-radius: 12px;
}

.stamp-rally-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #d4a373, #c2915e);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(212, 163, 115, 0.4);
    font-family: var(--font-main);
}

.stamp-rally-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(212, 163, 115, 0.5);
}

.stamp-rally-btn:active {
    transform: scale(0.95);
}

/* --- 完了済み表示 --- */
.stamp-rally-done {
    text-align: center;
}

.stamp-icon-large {
    font-size: 3rem;
    animation: stampPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stamp-done-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-top: 8px;
}

/* --- スタンプアニメーション表示 --- */
.stamp-rally-animation {
    text-align: center;
}

.stamp-burst {
    font-size: 4rem;
    animation: stampBurst 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampBurst {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    50% { transform: scale(1.5) rotate(10deg); }
    70% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.stamp-congrats {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-top: 12px;
}

.stamp-progress {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.stamp-complete-msg {
    margin-top: 16px;
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 1.05rem;
}

/* --- コンプリート演出のモーダル --- */
.complete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.complete-overlay.complete-show {
    opacity: 1;
}

.complete-overlay.complete-fade-out {
    opacity: 0;
}

.complete-modal {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.complete-show .complete-modal {
    transform: scale(1);
}

.complete-badge {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: completeSpin 1s ease-in-out;
}

@keyframes completeSpin {
    0% { transform: rotateY(0deg) scale(0); }
    50% { transform: rotateY(180deg) scale(1.2); }
    100% { transform: rotateY(360deg) scale(1); }
}

.complete-title {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #d4a373, #b8860b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.complete-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
}

.complete-mofuneko {
    margin-bottom: 24px;
}

.complete-close-btn {
    margin-top: 8px;
}
