/* --- 共通変数・基本設定 --- */
:root {
    --tsuno-green: #2d5a27;
    --tsuno-dark-green: #006633;
    --bg-color: #ffcc66;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
}

/* --- ヘッダー --- */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 10px; }
.logo { width: 120px; height: 48px; border-radius: 3px; object-fit: contain; cursor: pointer; }
.debug-label { color: white; background-color: #ff4444; padding: 2px 6px; border-radius: 4px; font-weight: bold; font-size: 0.7rem; }

.lang-switch button {
    padding: 5px 10px;
    border: 1px solid var(--tsuno-green);
    background: white;
    color: var(--tsuno-green);
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: bold;
}

/* --- レイアウト --- */
.container { padding: 15px; max-width: 600px; margin: 0 auto; }

/* --- 上部メニュー --- */
.intro-section { text-align: center; margin-bottom: 20px; }
.intro-section h1 { cursor: pointer; margin: 0; }
.intro-section h1 img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.intro-text-transparent {
    font-size: 0.9rem;
    text-align: left;
    background: transparent;
    padding: 15px 0;
    border: none;
    box-shadow: none;
    margin-top: 15px;
    color: #333;
}

/* 利用規約エリアのクリックを確実にするためのスタイル */
.terms-link {
    color: #006633 !important;
    text-decoration: underline !important;
    font-weight: bold;
    display: inline-block;
    padding: 2px 5px;
    cursor: pointer;
    position: relative;
    z-index: 300; /* 最前面に */
}

/* 登録フォームが他の要素に隠されないようにする */
#onboarding-ui {
    position: relative;
    z-index: 200;
}

.onboarding-box {
    background: rgba(255, 255, 255, 0.95) !important; /* 確実に不透明に */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 2px solid #ffcc66 !important;
}

/* --- 3D / ARビューワー --- */
.section-hero {
    background-color: var(--tsuno-dark-green);
    padding: 15px;
    border-radius: 15px;
    color: white;
    margin-bottom: 45px;
}
.viewer-container {
    position: relative;
    width: 100%;
    height: 380px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}
model-viewer { width: 100%; height: 100%; --poster-color: transparent; }

/* ---名前ラベル--- */
.char-name {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 5;
}

/* ---フキダシ--- */
.speech-bubble {
    position: absolute;
    top: 60px;
    right: 15px;
    background: white;
    border: 3px solid #63b32e;
    border-radius: 15px;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 0.8rem;
    color: #333;
    z-index: 10;
    max-width: 60%;
    animation: float 3s ease-in-out infinite;
}

.speech-bubble::after {
    content: ''; position: absolute; bottom: -12px; left: 20px;
    border-width: 12px 10px 0; border-style: solid; border-color: #63b32e transparent transparent;
}
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-8px); } }

#ar-button {
    position: absolute; top: 10px; left: 10px;
    background: white; border: none; padding: 8px 12px; border-radius: 4px; font-weight: bold;
}

/* --- テキストボックスとページ送り --- */
.info-box {
    background: white;
    color: #333;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    position: relative;
    min-height: 5em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.pagination-controls { display: flex; justify-content: flex-end; gap: 10px; position: absolute; bottom: -36px; left: 0; right: 0; }
.nav-arrow { width: 64px; height: 32px; cursor: pointer; transition: opacity 0.2s; }
.nav-arrow.hidden { visibility: hidden; }
#typing-text { font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; }

/* --- 地図ボタン専用スタイル --- */
.menu-btn {
    display: block !important;
    background-color: var(--tsuno-green) !important;
    color: white !important;
    text-decoration: none !important;
    padding: 15px !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-weight: bold !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
}

/* --- イベントカード --- */
.event-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}
.event-title-graphic { max-width: 100%; height: auto; display: block; margin: 0 auto 15px; }

.event-description-container {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #fff;
    color: #000;
}

/* 点滅アニメーション */
.effect-blink {
    animation: blink-animation infinite;
}

@keyframes blink-animation {
    0%, 100% { background-color: #fff; color: #000; }
    50% { background-color: #000; color: #fff; }
}

.btn-event-start {
    display: inline-block;
    background: gold;
    color: #333;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 4px 0 #ccaa00;
}

/* --- フッター --- */
.common-footer {
    background-color: var(--tsuno-dark-green);
    color: white;
    padding: 20px 15px;
    margin-top: 50px;
    font-size: 0.8rem;
    border-top: 4px solid var(--tsuno-green);
}
.footer-container { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#footer-credits { font-weight: 500; text-align: center; }

.hidden { display: none !important; }