/**
 * SP専用レイアウト
 * このファイルは max-width: 900px でのみ読み込まれる
 * PC用CSSとは完全に分離されているため、詳細度競合は発生しない
 */

/* ============================================================
   SP SKELETON - 基本レイアウト構造
   ============================================================ */

/* ボディの基本設定 */
body {
    overflow: hidden;
    height: 100vh;
}

/* ------------------------------------------------------------
   ヘッダー: 上部固定バー
   ------------------------------------------------------------ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.header-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    padding: 0;
}

/* ロゴ: 横書きに変更 */
.logo {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    -webkit-text-stroke: 1px var(--text-main, #111);
    color: transparent;
    margin: 0;
}

/* HUDライン: SP版では非表示 */
.hud-line {
    display: none;
}

/* フッター情報: SP版では非表示 */
.hud-footer-info {
    display: none;
}

/* ------------------------------------------------------------
   フッター: 下部固定バー
   ------------------------------------------------------------ */
#footer-root {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.footer {
    padding: 0;
    border-top: none;
    width: 100%;
}

.footer-inner {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: 0.65rem;
    text-align: center;
}

.footer-copyright {
    letter-spacing: 1px;
}

/* ------------------------------------------------------------
   メインコンテンツ領域
   ------------------------------------------------------------ */
.main-content {
    position: fixed;
    top: 48px;
    bottom: 40px;
    left: 0;
    right: 0;
    height: auto;
    width: 100%;
    overflow: visible;
    z-index: 10;
}

.section {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: transparent;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.section.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 20;
}

/* ------------------------------------------------------------
   HUD / ステータスノード: SP版では非表示
   ------------------------------------------------------------ */
#hud-root {
    display: none;
}

.hud-status-node {
    display: none;
}

.node-top-left,
.node-bottom-right {
    display: none;
}

/* HUDデータボックス: SP版では非表示 */
.hud-data-box {
    display: none;
}

/* ------------------------------------------------------------
   テーマステーション: モダンFABスタイル
   ------------------------------------------------------------ */
#theme-station-root {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 2500;
}

.theme-station {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* メイントグルボタン（Note風） */
.theme-station-header {
    width: 50px;
    height: 50px;
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 4px;
    /* 円形から角丸四角形へ */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    /* 付箋のようなフラットな影 */
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.theme-station-header::before {
    display: none;
    /* 回転ボーダーを廃止 */
}

.theme-station-header:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.15);
}

.theme-station.open .theme-station-header {
    transform: rotate(90deg);
    /* 開閉時に90度回転 */
    background: #111111;
}

/* ステータスドット */
.theme-status-dot {
    width: 8px;
    height: 8px;
    background: #111111;
    border-radius: 50%;
    box-shadow: none;
    /* 光りを削除 */
    animation: none;
    /* 点滅を削除 */
}

.theme-station.open .theme-status-dot {
    background: #ffffff;
}

/* テーマ選択オプション */
.theme-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s ease;
    pointer-events: none;
}

.theme-station.open .theme-options {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 各テーマボタン */
.theme-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #111111;
    border-radius: 4px;
    /* カプセルから角丸四角形へ */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.05);
    min-width: 120px;
}

.theme-opt:hover {
    transform: translateX(-3px);
    box-shadow: 4px 2px 0px rgba(0, 0, 0, 0.1);
}

.theme-opt.active {
    background: #f0f0f0;
    border-width: 2px;
}

/* テーマプレビュードット */
.opt-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.note-grid-preview {
    background: linear-gradient(135deg, #0af 0%, #00ff88 100%);
}

.water-world-preview {
    background: linear-gradient(135deg, #87ceeb 0%, #5f9ea0 100%);
}

.story-preview {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.bead-preview {
    background: linear-gradient(135deg, #ffb3ba 0%, #bae1ff 100%);
}

.vitality-preview {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

.campus-preview {
    background: linear-gradient(135deg, #fdfdfd, #e0e0e0);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* テーマ名 */
.opt-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #111;
}

/* ラベル: SP版では非表示 */
.theme-label {
    display: none;
}

/* ------------------------------------------------------------
   モバイルナビゲーション: フルスクリーンメニュー
   ------------------------------------------------------------ */
.nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    z-index: 1050;
    padding: 40px;
    box-sizing: border-box;
}

.nav.open {
    transform: translateX(0);
    pointer-events: auto;
}

.nav-link {
    font-size: 2rem;
    writing-mode: horizontal-tb;
    transform: none;
    text-align: center;
    width: 100%;
    letter-spacing: 6px;
    font-weight: 900;
    color: #111;
    text-decoration: none;
    padding: 12px 0;
}

.nav-link::before,
.nav-link::after {
    display: none;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color, #0af);
    text-shadow: none;
}

/* ハンバーガーメニュー: 表示 */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--primary-color, #111);
    transition: all 0.3s ease;
}

.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(5px, -5px);
}

/* ------------------------------------------------------------
   背景エフェクト
   ------------------------------------------------------------ */
#bg-root {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* グリッドシステム: SP版（セクションの背後、main-contentの前面） */
.grid-system {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color, rgba(0, 0, 0, 0.15)) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color, rgba(0, 0, 0, 0.15)) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 15;
    opacity: 0.8;
    pointer-events: none;
}

/* パーティクルキャンバス */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* スキャンライン: SP版では非表示 */
.scanning-line-v {
    display: none;
}

/* スキャンライン（横）: SP版ではシンプル化 */
.scanning-line {
    position: fixed;
    width: 100%;
    height: 1px;
    background: rgba(0, 242, 255, 0.3);
    top: -10%;
    animation: scan 10s infinite linear;
    z-index: 0;
    pointer-events: none;
}

@keyframes scan {
    to {
        top: 110%;
    }
}

/* ------------------------------------------------------------
   共通コンテナのSP調整
   ------------------------------------------------------------ */
.container {
    padding: 0 24px;
    padding-left: 24px;
}