/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

/* マンガコンテナ */
.manga-container {
    max-width: 780px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    background-color: #000000;
}

/* マンガビューア */
.manga-viewer {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* マンガページ */
.manga-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
    padding: 40px 0;
}

.manga-page.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: none;
    z-index: 2;
}

.manga-page.prev {
    transform: translateX(100%);
    opacity: 0;
}

.manga-page.next {
    transform: translateX(-100%);
    opacity: 0;
}

/* マンガ画像 */
.manga-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    padding: 0 20px;
}

/* 遅延読み込み画像 */
.manga-image.lazy {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ナビゲーションガイド */
.navigation-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.navigation-guide.hidden {
    opacity: 0;
}

.nav-instruction {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.nav-left {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-center {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.tap-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.nav-instruction p {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

/* ページインジケーター */
.page-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 6;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.page-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.current-page {
    color: #ff6b35;
    font-size: 18px;
}

/* 設定ボタン */
.settings-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 6;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.settings-button.hidden {
    opacity: 0;
    pointer-events: none;
}

.settings-button:not(.hidden) {
    pointer-events: auto;
}

.settings-button button {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    border: 2px solid #ff6b35;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.settings-button button:hover {
    background: rgba(255, 107, 53, 0.2);
    transform: scale(1.05);
}

.settings-button button:active {
    transform: scale(0.95);
}

/* 設定パネル */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.settings-panel.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.settings-content {
    background: #2c3e50;
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.settings-content h3 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #ff6b35;
    text-align: center;
}

.setting-group {
    margin-bottom: 30px;
}

.setting-label {
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #ffffff;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.15);
}

.radio-label input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-label span {
    font-size: 16px;
}

.close-settings {
    width: 100%;
    background: #ff6b35;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.close-settings:hover {
    background: #ff8555;
    transform: translateY(-2px);
}

.close-settings:active {
    transform: translateY(0);
}

/* タップエリア */
.tap-area {
    position: absolute;
    top: 0;
    width: 33.333%;
    height: 100vh;
    cursor: pointer;
    z-index: 4;
}

.tap-area-left {
    left: 0;
}

.tap-area-center {
    left: 33.333%;
}

.tap-area-right {
    right: 0;
}

/* タップエフェクト */
.tap-area:active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    animation: tapEffect 0.3s ease;
}

@keyframes tapEffect {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* フッター */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 40px 20px;
    text-align: center;
    border-top: 4px solid #ff6b35;
}

.footer-content {
    max-width: 780px;
    margin: 0 auto;
}

/* 続きはHPボックス */
.continue-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8555 100%);
    padding: 24px 32px;
    border-radius: 16px;
    margin-bottom: 40px;
    text-decoration: none;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.continue-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 107, 53, 0.5);
}

.continue-box:active {
    transform: translateY(-2px);
}

/* 強調アニメーション（自動スクロール時） */
.continue-box.highlight {
    animation: pulseGlow 2s ease-in-out 3;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.9), 0 0 60px rgba(255, 107, 53, 0.6);
        transform: scale(1.05);
    }
}

.continue-icon {
    font-size: 48px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.continue-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.continue-title {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.continue-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.footer h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #ff6b35;
}

.footer p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.contact-info {
    margin: 24px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.contact-info p {
    margin: 8px 0;
    font-size: 16px;
}

.contact-info strong {
    color: #ff6b35;
    margin-right: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .page-indicator {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .current-page {
        font-size: 16px;
    }
    
    .settings-button {
        top: 10px;
        right: 10px;
    }
    
    .settings-button button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .nav-instruction p {
        font-size: 14px;
    }
    
    .tap-icon {
        font-size: 36px;
    }
    
    .settings-content {
        padding: 30px 20px;
    }
    
    .settings-content h3 {
        font-size: 20px;
    }
    
    .continue-box {
        flex-direction: column;
        gap: 12px;
        padding: 20px;
    }
    
    .continue-icon {
        font-size: 40px;
    }
    
    .continue-text {
        align-items: center;
        text-align: center;
    }
    
    .continue-title {
        font-size: 18px;
    }
    
    .continue-subtitle {
        font-size: 12px;
    }
    
    .footer {
        padding: 30px 16px;
    }
    
    .footer h3 {
        font-size: 20px;
    }
    
    .contact-info p {
        font-size: 14px;
    }
}

/* 横向き対応 */
@media (orientation: landscape) and (max-height: 600px) {
    .nav-instruction p {
        font-size: 12px;
    }
    
    .tap-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .page-indicator {
        top: 8px;
        left: 8px;
    }
    
    .settings-button {
        top: 8px;
        right: 8px;
    }
}

/* iOS Safari対応 */
@supports (-webkit-touch-callout: none) {
    .manga-viewer {
        height: -webkit-fill-available;
    }
    
    .tap-area {
        height: -webkit-fill-available;
    }
}
