/* ==================================================
   MIYA PORTFOLIO SYSTEM — MOBILE RESPONSIVE CSS
   (768px以下のスマートフォン・タブレット向け最適化)
================================================== */

@media (max-width: 768px) {

    /* --- 1. タッチ操作最適化 & カーソル復元 --- */
    * {
        cursor: auto !important;
    }

    .cursor-dot,
    .cursor-follower {
        display: none !important;
    }

    /* --- 2. ヘッダー / ナビゲーション --- */
    .header {
        padding: 12px 16px;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        background: rgba(5, 5, 5, 0.95);
    }

    .brand {
        order: 1;
        font-size: 1.1rem;
    }

    .status-badge {
        order: 2;
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .mode-switcher {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 4px;
        padding: 3px;
        margin-top: 4px;
    }

    .mode-btn {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .mode-btn .num {
        font-size: 0.6rem;
        margin-right: 2px;
    }

    /* --- 3. ヒーローセクション --- */
    .hero {
        min-height: auto;
        padding: 140px 16px 40px 16px;
    }

    .top-tag {
        font-size: 0.68rem;
        letter-spacing: 2px;
    }

    .hero-title {
        font-size: clamp(3.2rem, 16vw, 6rem);
        margin-bottom: 15px;
    }

    .hero-title .char:hover {
        transform: none;
    }

    .mode-indicator {
        font-size: 0.75rem;
        letter-spacing: 1.5px;
        word-break: break-word;
    }

    .hero-subtext {
        font-size: 0.88rem;
        line-height: 1.6;
    }

    /* --- 4. マーカー・ティッカー --- */
    .ticker-wrapper {
        font-size: 0.78rem;
        padding: 8px 0;
    }

    /* --- 5. メインコンテンツ & カード --- */
    .main-content {
        padding: 40px 16px 30px 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 30px;
        padding-bottom: 12px;
    }

    .section-header h2 {
        font-size: 1.35rem;
        word-break: break-word;
    }

    .count {
        font-size: 0.78rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card {
        min-height: auto;
        padding: 24px 20px;
    }

    .card:hover {
        transform: none;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .card-desc {
        font-size: 0.82rem;
    }

    .card-code {
        font-size: 0.7rem;
        word-break: break-all;
    }

    .mini-gallery-preview img {
        height: 50px;
    }

    /* --- 6. モーダルダイアログ --- */
    .modal-overlay {
        padding: 12px;
    }

    .modal-wrapper {
        padding: 24px 16px;
        max-height: 88vh;
        width: 100%;
        border-radius: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .modal-close {
        top: 10px;
        right: 12px;
        font-size: 2rem;
        padding: 6px 12px;
        line-height: 1;
    }

    .modal-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }

    .modal-title {
        font-size: 1.35rem;
        padding-right: 30px;
    }

    .modal-body p {
        font-size: 0.88rem;
        line-height: 1.6;
    }

    /* オーディオプレイヤー (モーダル内) */
    .audio-player-box {
        padding: 14px;
    }

    .track-btn {
        padding: 10px;
        font-size: 0.78rem;
    }

    .audio-control-wrapper {
        padding: 10px;
    }

    /* ギャラリースライダー (モーダル内) */
    .gallery-slider-wrapper {
        padding: 10px;
    }

    .gallery-item {
        width: 190px;
    }

    .gallery-item img {
        height: 130px;
    }

    /* --- 7. ABOUT & ターミナルセクション --- */
    .about-section,
    .terminal-section {
        padding: 30px 16px 40px 16px;
    }

    .about-box {
        padding: 28px 18px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-text p.highlight {
        font-size: 1.1rem;
    }

    .terminal-body {
        padding: 20px 16px;
        font-size: 0.82rem;
        word-break: break-word;
    }

    .term-btn {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 0.85rem;
    }

    /* --- 8. フッター --- */
    .footer {
        padding: 40px 16px 30px 16px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 30px;
    }

    .footer-desc {
        font-size: 0.82rem;
    }
}

/* 超小型画面（380px以下）向け微調整 */
@media (max-width: 380px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .mode-btn {
        font-size: 0.65rem;
        padding: 6px 2px;
    }

    .mode-btn .num {
        display: none;
    }
}