/* ============================================
   style.css - デジタルおみくじ（E-LOTs）本番版
   固定ヘッダー + 16枚札 + ポップアップ統合
   枠線のみの札・グレー薄影・抽選中横書き
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #e2e8f0;
    --muted-text: #64748b;
    --accent-color: #ad241f;
    --card-shadow: rgba(105, 105, 105, 0.08);
}

body {
    font-family: '游明朝', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    font-weight: 400;
    padding-top: 5rem;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ----- 固定ヘッダー ----- */
.site-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--bg-color);
    border-bottom: 3px solid var(--accent-color);
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title-wrapper {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.site-title {
    font-family: '游明朝', 'Yu Mincho', serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #0f172a;
    text-decoration: none;
}

.site-title:hover {
    color: var(--accent-color);
}

.site-subtitle {
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--muted-text);
    font-weight: 400;
}

/* ハンバーガーボタン */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    transition: all 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
}

/* ナビメニュー */
.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin: 0;
    list-style: none;
    z-index: 999;
}

.nav-menu.show {
    display: block;
}

.nav-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-menu li {
    list-style: none;
}

.nav-menu a {
    font-family: '游明朝', 'Yu Mincho', serif;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.2rem 0;
    display: inline-block;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.nav-menu a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* ----- メインコンテンツ ----- */
.app-main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subtitle {
    font-family: '游明朝', 'Yu Mincho', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent-color);
    margin: 0 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

/* ----- 遊び方セクション ----- */
.guide-section {
    margin: 0.5rem 0 1.5rem;
    display: inline-block;
    text-align: left;
}

.guide-text {
    font-size: 1rem;
    color: var(--text-color);
    background: none;
    padding: 0.5rem 0;
}

/* ----- おみくじ札（枠線のみ・グレー薄影） ----- */
.cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px 30px;
    margin: 0 0 1.5rem;
    max-width: 1000px;
}

.omikuji-card {
    width: 90px;
    height: 140px;
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--accent-color);
    border-radius: 0;
    box-shadow: 4px 4px 0 var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: '游明朝', 'Yu Mincho', serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 2px;
    user-select: none;
}

.omikuji-card:hover {
    transform: translateY(-4px);
    box-shadow: 6px 6px 0 rgba(105, 105, 105, 0.12);
}

.omikuji-card.disabled {
    opacity: 0.4;
    pointer-events: none;
    transform: translateY(2px);
    box-shadow: 2px 2px 0 var(--card-shadow);
}

/* ----- ポップアップ（モーダル） ----- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border: none;
    border-radius: 40px;
    padding: 2rem 2rem 2.5rem;
    max-width: 550px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 36px;
    font-weight: 300;
    color: var(--text-color);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    z-index: 10;
}

.modal-close:hover {
    color: var(--accent-color);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--accent-color);
    letter-spacing: 4px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.modal-number {
    font-family: '游明朝', 'Yu Mincho', serif;
    font-size: 120px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    margin: 0.5rem 0 0.25rem;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
    display: inline-block;
}

/* 抽選中の横書き */
.modal-number.horizontal {
    writing-mode: horizontal-tb;
    font-size: 2.5rem;
    letter-spacing: 0.1em;
}

.modal-unit {
    font-size: 1.5rem;
    color: var(--muted-text);
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.modal-guide {
    font-size: 1rem;
    color: var(--text-color);
    background: none;
    padding: 0.5rem 0;
    display: inline-block;
    text-align: left;
    margin-top: 0.5rem;
}

/* ----- フッター ----- */
.app-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--muted-text);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    width: 100%;
}

/* レスポンシブ */
@media (max-width: 800px) {
    .omikuji-card {
        width: 70px;
        height: 110px;
        font-size: 18px;
    }
    .site-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    .modal-content {
        padding: 1.5rem 1rem;
        border-radius: 30px;
    }
    .modal-number {
        font-size: 80px;
    }
    .modal-number.horizontal {
        font-size: 2rem;
    }
    .modal-title {
        font-size: 1.2rem;
    }
    .modal-unit {
        font-size: 1.2rem;
    }
}

@media (max-width: 500px) {
    .cards-grid {
        gap: 12px;
    }
    .subtitle {
        font-size: 1.5rem;
    }
}
