/* ========================================
   COMMON.CSS - 全ページ共通スタイル
   ======================================== */

/* リセット & ベース設定 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

input {
    font: inherit;
}

/* ========================================
   レイアウト - SP縦持ち特化
   ======================================== */

.app-container {
    width: min(100vw, calc(100vh * 9 / 16 * 1.2));
    height: 100%;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ========================================
   ヘッダー
   ======================================== */

.header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.header__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -0.5rem;
    margin-right: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.header__menu-btn:hover {
    opacity: 0.7;
}

.header__menu-btn:active {
    opacity: 0.5;
}

.header__title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    margin-right: -0.5rem;
}

.header__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: opacity 0.2s;
}

.header__action-btn:hover {
    opacity: 0.7;
}

.header__action-btn:active {
    opacity: 0.5;
}

/* ========================================
   メインコンテンツ
   ======================================== */

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* スクロールバー */
.main-content::-webkit-scrollbar {
    width: 4px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   フッター
   ======================================== */

.footer {
    flex-shrink: 0;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    font-size: 0.75rem;
    opacity: 0.5;
}

/* ========================================
   オーバーレイ（共通）
   ======================================== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    visibility: hidden;
    pointer-events: none;
}

.overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.is-open {
    visibility: visible;
    pointer-events: auto;
}

.overlay.is-open::before {
    opacity: 1;
}

/* オーバーレイパネル */
.overlay__panel {
    position: relative;
    width: min(90vw, calc(100vh * 9 / 16 * 1.1));
    max-height: 85vh;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 1;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow-y: auto;
}

.overlay.is-open .overlay__panel {
    transform: scale(1);
    opacity: 1;
}

/* オーバーレイ閉じるボタン */
.overlay__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.overlay__close:hover {
    opacity: 0.7;
}

.overlay__close:active {
    opacity: 0.5;
}

/* オーバーレイタイトル */
.overlay__title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 2.5rem;
}

/* オーバーレイコンテンツ */
.overlay__content {
    margin-top: 1.5rem;
}

/* ========================================
   メニューナビゲーション
   ======================================== */

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.menu-nav__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.menu-nav__item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-nav__item:active {
    background: rgba(255, 255, 255, 0.15);
}

.menu-nav__item span {
    font-size: 1rem;
    font-weight: 500;
}

/* ========================================
   検索ボックス
   ======================================== */

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
}

.search-box__input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    padding: 0.75rem 0;
    outline: none;
}

.search-box__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-box__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: opacity 0.2s;
}

.search-box__btn:hover {
    opacity: 0.7;
}

/* ========================================
   マイページメニュー
   ======================================== */

.mypage-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mypage-menu__item {
    display: block;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s, border-color 0.2s;
}

.mypage-menu__item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.mypage-menu__item:active {
    background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   コンテンツセクション
   ======================================== */

.content-section {
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
}

.content-section h2 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.content-section p {
    font-size: 0.875rem;
    line-height: 1.6;
    opacity: 0.8;
}

/* ========================================
   ユーティリティ
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ========================================
   リンクボタン共通アニメーション
   ======================================== */

a[data-press] {
    transition: transform 0.15s ease, background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

a[data-press]:active {
    transform: scale(0.95);
}
