/* ========================================
   Rekibura Global Styles (mystory配色と統一)
   ======================================== */

:root {
    --primary-color: #203354;  /* ネイビー（mystoryと同じ） */
    --secondary-color: #CA9B57; /* ゴールド（mystoryと同じ） */
    --bg-light: #D9E4EA;        /* 薄い青灰色（mystoryと同じ） */
    --bg-header: #F3F7F9;       /* ヘッダー背景（mystoryと同じ） */
    --text-color: #393939;      /* テキストカラー */
    --text-navy: #203354;       /* ネイビーテキスト */
    --border-color: #ddd;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable; /* モーダル表示時のスクロールバー消失によるずれ防止（Windows対策） */
}

body {
    font-family: 'Noto Sans', system-ui, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-header);
    margin: 0;
    text-align: center;
    /* ヘッダー分のスペース + PWA safe area対応 */
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
}

/* コンテナ (mystoryと同じ固定幅) */
.sitewrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-header);
}

main {
    flex: 1;
    overflow-x: hidden;
    padding-bottom: 64px;
}

.inner {
    max-width: 1280px;
    width: 373px;
    margin: 0 auto;
}

/* Bootstrapのrowのマージンをリセット */
.inner .row {
    margin-left: 0;
    margin-right: 0;
}

/* ========================================
   Daily Quiz Section
   ======================================== */

.daily-quiz .card {
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.daily-quiz .card-header {
    background-color: var(--primary-color);
    border-bottom: none;
}

.daily-quiz .btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.daily-quiz .btn-primary:hover {
    background-color: #b8894d;
    border-color: #b8894d;
}

/* ========================================
   Quest List Section
   ======================================== */

.quest-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quest-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quest-item figure {
    margin: 0 0 15px 0;
}

.quest-item figure img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.quest-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-navy);
    margin-bottom: 15px;
}

.quest-details {
    background-color: var(--bg-light);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.quest-details p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--text-navy);
}

.quest-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--text-color);
}

.quest-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quest-actions .btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    padding: 10px 20px;
    color: #fff;
}

.quest-actions .btn-primary:hover {
    background-color: #b8894d;
    border-color: #b8894d;
}

/* ========================================
   Button Styles
   ======================================== */

.button.type07 {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
}

.button.type07:hover {
    background-color: #b8894d;
}

.button.type07-purchased {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    cursor: not-allowed;
}

.button.type07-purchased::after {
    content: '購入済み';
}

/* ========================================
   Header Styles
   ======================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    /* PWA safe area対応: ヘッダー背景をノッチ領域まで拡張 */
    padding: 10px 0;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
}

.header-inner {
    max-width: 1280px;
    width: 373px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 0 20px;
}

.logo img {
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
}

.main-nav a {
    color: var(--text-navy);
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--secondary-color);
}

.nav-separator {
    color: var(--text-navy);
}

/* ========================================
   Hero Banner
   ======================================== */

.hero-banner {
    width: 100%;
    margin-bottom: 0;
    line-height: 0; /* 画像下の余白を削除 */
}

.hero-banner-img {
    width: 100%;
    height: auto; /* 比率を維持 */
    display: block;
}

/* ========================================
   Section Styles
   ======================================== */

.content-section {
    margin-bottom: 0;
    background: white;
}

.content-section:first-child {
    margin-top: 0;
}

.section-title-bar {
    background-image: url('../images/home_01.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 10px 15px;
    margin: 0;
    min-height: 40px;
}

.section-title-text {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-align: left;
}

.points-title-bar {
    text-align: center;
}

.points-title-bar .section-title-text {
    text-align: center;
}

.section-content {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
}

.section-content-center {
    text-align: center;
}

.section-text {
    text-align: left;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
}

/* ========================================
   News Section
   ======================================== */

.news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.news-item {
    text-align: left;
}

.news-date {
    color: #DE813C;
    font-weight: 700;
    display: inline;
}

.news-text {
    display: inline;
    margin: 0;
    color: var(--text-color);
}

/* 新着情報の箇条書きスタイル */
.news-item ul {
    margin: 0;
    padding-left: 20px;
    display: block; /* 日付の次の行に表示 */
}

.news-item li.news-text {
    display: list-item;
    list-style-type: disc;
    margin-left: 0;
}

/* ========================================
   Today Section
   ======================================== */

.today-content {
    text-align: left;
}

.today-date {
    font-weight: 700;
    color: var(--text-navy);
    margin-bottom: 10px;
}

.today-text {
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 10px;
}

.today-calender {
    line-height: 1.6;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.today-list {
    line-height: 1.6;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 10px;
    padding-left: 1.2rem;
    list-style-type: disc;
}

.today-list li {
    margin-bottom: 0.3rem;
}

.today-detail {
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 10px;
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.today-note {
    text-align: center;
    color: var(--text-color);
    margin: 10px 0;
}

.today-subscribe {
    font-size: 0.85rem;
    color: var(--text-color);
    line-height: 1.6;
}

.subscribe-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.subscribe-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.subscribe-checkbox span {
    font-size: 0.85rem;
    color: var(--text-color);
}

/* ========================================
   Points Section
   ======================================== */

.points-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--bg-light);
}

.points-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-navy);
    margin-bottom: 15px;
}

.quiz-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.quiz-button:hover {
    background-color: #b8894d;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* クイズボタン（画像版） */
.quiz-button-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
}

.quiz-button-img {
    flex: 0 0 auto;
    max-width: 65%;
    height: auto;
    filter: drop-shadow(0px 3px 3px rgba(0,0,0,0.4));
    cursor: pointer;
    transition: transform 0.2s ease;
}

.quiz-button-img:hover {
    transform: scale(1.03);
}

.quiz-shinobu-img {
    flex: 0 0 auto;
    max-width: 25%;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.quiz-shinobu-img:hover {
    transform: scale(1.1);
}

.about-point-link {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.about-point-link a {
    color: var(--primary-color);
    text-decoration: underline;
}

.about-point-link a:hover {
    color: var(--secondary-color);
}

/* ========================================
   Modal Styles (モーダル共通スタイル - mystoryと同じ)
   ======================================== */

.modal-content {
    background-color: #203354 !important;
    border-radius: 15px !important;
}

.modal-title {
    font-family: 'Noto Sans', system-ui, sans-serif;
    color: #FFF;
}

.modal-body {
    text-align: left;
    border-radius: 0 0 15px 15px;
    background-color: #D9E4EA;
    color: #203354;
    font-family: 'Noto Sans', system-ui, sans-serif;
    word-break: normal;
    overflow-wrap: break-word;
    line-break: auto;
}

.modal-footer {
    font-family: 'Noto Sans', system-ui, sans-serif;
}

.btn-close {
    filter: brightness(0) invert(1);
}

/* Auth Modal 固有スタイル */
.auth-modal-body .auth-view {
    max-width: 480px;
    margin: 0 auto;
}

/* タブボタンのスタイルを明示的に指定（.modal-bodyのcolor継承を防ぐ） */
.modal-body .btn-primary,
.modal-body .btn-secondary {
    color: #fff !important;
}

.modal-body .btn-outline-primary {
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary);
}

.modal-body .btn-outline-primary:hover,
.modal-body .btn-outline-primary:focus {
    color: #fff !important;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.modal-body .btn-outline-secondary {
    color: var(--bs-secondary) !important;
    border-color: var(--bs-secondary);
}

.modal-body .btn-outline-secondary:hover,
.modal-body .btn-outline-secondary:focus {
    color: #fff !important;
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

/* ========================================
   Quiz Modal Styles
   ======================================== */

.quiz-modal-content {
    border-radius: 15px;
    overflow: hidden;
}

.quiz-modal-header {
    background-color: #203354;
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.quiz-modal-header .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.quiz-modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.quiz-modal-body {
    padding: 1.5rem;
    background-color: #D9E4EA;
}

/* ========================================
   Signout Modal Styles
   ======================================== */

.signout-modal-content {
    border-radius: 15px !important;
    overflow: hidden;
    background-color: #D9E4EA !important;
}

.signout-modal-header {
    background-color: #203354;
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
    border-radius: 0 !important;
}

.signout-modal-header .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.signout-modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.signout-modal-body {
    padding: 1.5rem;
    background-color: #D9E4EA;
    color: #203354;
}

.signout-modal-footer {
    background-color: #D9E4EA;
    border-top: none;
    padding: 0.75rem 1.5rem 1.5rem;
}

/* チャットエリア */
#quiz-chat-area {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 15px;
    cursor: pointer;
}

/* メッセージコンテナ */
.quiz-message-container {
    display: flex;
    align-items: top;
    margin: 10px;
    gap: 12px;
}

.quiz-message-container.user {
    display: block;
    text-align: right;
}

/* アバター */
.quiz-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
}

.quiz-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 吹き出し */
.quiz-bubble {
    background-color: white;
    border-radius: 20px;
    padding: 10px 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    text-align: left;
    word-break: normal;
    overflow-wrap: break-word;
    line-break: auto;
    max-width: 100%;
}

/* システムメッセージの吹き出し */
.quiz-message-container:not(.user) .quiz-bubble {
    flex: 1;
}

.quiz-bubble::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 6px 0;
    border-color: transparent white transparent transparent;
}

/* ユーザーの吹き出し */
.quiz-message-container.user .quiz-bubble {
    margin: 0px 10px 10px 15%;
    text-align: right;
    display: inline-block;
    max-width: calc(85% - 10px);
    width: fit-content;
}

.quiz-message-container.user .quiz-bubble::before {
    left: auto;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent white;
}

/* クリック可能なリンクテキスト */
.quiz-clickable-link {
    color: #0d6efd !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}

.quiz-question-label {
    font-size: 1.1rem;
    color: #203354;
    margin-bottom: 8px;
}

.quiz-question-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #203354;
    margin-bottom: 10px;
    font-family: 'Noto Sans', system-ui, sans-serif;
}

.quiz-hint-label {
    font-size: 1rem;
    color: #203354;
    margin-top: 10px;
    margin-bottom: 5px;
    font-family: 'Noto Sans', system-ui, sans-serif;
}

.quiz-hint-text {
    font-size: 1rem;
    color: #203354;
    line-height: 1.6;
    font-family: 'Noto Sans', system-ui, sans-serif;
}

/* 回答エリア */
.quiz-answer-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.quiz-input {
    flex: 1;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.quiz-input:focus {
    border-color: #203354;
    outline: none;
    box-shadow: 0 0 0 3px rgba(32, 51, 84, 0.1);
}

.quiz-submit-btn {
    background-color: #203354;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

.quiz-submit-btn:hover {
    background-color: #152540;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(32, 51, 84, 0.3);
}

.quiz-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 結果吹き出し */
.quiz-result-bubble {
    background-color: white;
    color: #203354;
    font-size: 1rem;
    text-align: left;
}

.quiz-result-bubble::before {
    border-color: transparent white transparent transparent;
}

/* ローディング */
#quiz-loading {
    padding: 2rem 0;
}

/* エラー */
#quiz-error {
    margin: 0;
    border-radius: 10px;
}

/* ========================================
   Footer Styles
   ======================================== */

.site-footer {
    background-color: white;
    border-top: 1px solid #ddd;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-navy);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-navy);
}

.footer-copyright {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.version {
    color: #999;
}
