@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Share+Tech+Mono&display=swap');

/* ==========================================
   ベースカラー・全体設定
========================================== */
:root {
    --bg-color: #0f172a;
    --panel-bg: #1e293b;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --accent-glow: rgba(6, 182, 212, 0.4);
    --border-line: #334155;
    --alert: #ef4444;
    --alert-bg: rgba(239, 68, 68, 0.05);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 15px 10px;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

.top-logo-wrap {
    text-align: center;
    margin-top: 10px;
}

.top-logo {
    width: 80px;
    height: auto;
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
    text-shadow: 0 0 10px var(--accent-glow);
}
.title-main {
    color: var(--accent);
    font-size: clamp(0.9rem, 4vw, 1.3rem); 
    font-weight: 700;
}
.title-sub {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
}

/* ==========================================
   共通レイアウト
========================================== */
.section {
    background: var(--panel-bg);
    margin-bottom: 24px;
    padding: 25px 15px;
    border-radius: 16px;
    border: 1px solid var(--border-line);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

h2 {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: 2px solid var(--border-line);
    padding-bottom: 12px;
    margin-top: 0;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==========================================
   プロフィールセクション
========================================== */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.icon-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--panel-bg);
    box-shadow: 0 0 15px var(--accent-glow);
}

.default-fa-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background-color: #0f172a;
    color: var(--accent);
    font-size: 3.5rem;
    border: 4px solid var(--border-line);
    box-shadow: 0 0 15px var(--accent-glow);
}

.user-shimei {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 15px;
    color: var(--text-main);
    letter-spacing: 1px;
}

.user-no {
    font-size: 0.95rem;
    color: var(--text-sub);
    margin-top: 4px;
    font-family: 'Share Tech Mono', monospace;
}

.profile-accordion summary {
    cursor: pointer;
    outline: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 2px solid var(--border-line);
    padding-bottom: 12px;
}

.profile-accordion summary::-webkit-details-marker {
    display: none; /* Safari用のデフォルト三角マークを消す */
}

.profile-accordion .summary-icon {
    color: var(--text-sub);
    transition: transform 0.3s ease;
    font-size: 1.1rem;
}

/* 開いている時はアイコンを180度回転させる */
.profile-accordion[open] .summary-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

/* ==========================================
   フォーム・ボタン類
========================================== */
label {
    display: block;
    color: var(--text-sub);
    font-weight: 500;
    font-size: 1.05rem;
    margin-top: 20px;
    margin-bottom: 8px;
}

input[type="text"], 
input[type="number"], 
input[type="date"], 
textarea, 
input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-line);
    color: var(--text-main);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #1e293b;
    box-shadow: 0 0 10px var(--accent-glow);
}

button {
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.15rem;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 24px;
}

button:hover {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ==========================================
   ポイント状況 (Stats)
========================================== */
.stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    background: var(--bg-color);
    border-radius: 12px;
    padding: 15px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stats small {
    color: var(--text-sub);
    font-size: 0.95rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.stats-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* ==========================================
   マイページ用：ナビゲーションボタン
========================================== */
.nav-buttons-wrap {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.nav-btn {
    flex: 1;
    display: inline-block;
    text-align: center;
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ==========================================
   ミッションボックス・チェックボックス
========================================== */
.mission-box {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid #fbbf24;
    border-radius: 16px;
}

/* ★ 複数ミッションが並んだ場合の区切り線設定 */
.mission-item:not(:last-child) {
    border-bottom: 1px dashed #fbbf24;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.mission-box h3 {
    color: #fbbf24;
    margin-top: 0;
    font-size: 1.1rem;
}

.mission-box h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #fbbf24;
}

.mission-check {
    margin: 25px 0 10px 0;
    padding: 15px;
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mission-check input[type="checkbox"] {
    width: 28px;
    height: 28px;
    accent-color: #f59e0b;
    cursor: pointer;
}

.mission-check label {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fcd34d;
    cursor: pointer;
    line-height: 1.4;
}

.cleared-form-box {
    background: rgba(16, 185, 129, 0.1);
    border-color: #34d399;
}
.cleared-form-box label {
    color: #10b981;
}

.cleared-badge {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 2px solid #34d399;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ==========================================
   ニュースセクション（新着システム対応版）
========================================== */
.mypage-news-box {
    max-height: 300px; /* スクロール領域を少し広めに確保 */
    overflow-y: auto;
    padding-right: 10px;
}

/* スクロールバーの装飾（スクロール領域が綺麗に見えます） */
.mypage-news-box::-webkit-scrollbar {
    width: 6px;
}
.mypage-news-box::-webkit-scrollbar-thumb {
    background-color: var(--border-line);
    border-radius: 10px;
}

.news-row {
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    border-bottom: 1px dashed var(--border-line);
    transition: background-color 0.2s ease;
}
.news-row:last-child {
    border-bottom: none;
}
.news-row:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.news-date i {
    font-size: 0.9rem;
}

.news-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tag-cyan { background-color: var(--accent); }
.tag-mission { background-color: var(--alert); }
.tag-accent { background-color: #475569; }
.tag-green { background-color: #10b981; }

.news-content {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
}
.news-content a {
    color: var(--text-main);
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: inline-block;
}
.news-content a:hover {
    opacity: 0.7;
    text-decoration: none;
}
.news-content-sub {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: normal;
    margin-top: 6px;
    line-height: 1.4;
}

/* ==========================================
   状態表示アラート (テスト・メンテナンス・終了)
========================================== */
.alert-box {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.alert-box i {
    margin-right: 5px;
    font-size: 1.1rem;
}
.test-mode {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid #34d399;
    color: #10b981;
}
.maintenance-mode {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid #fbbf24;
    color: #fcd34d;
}
.finished-mode {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #f87171;
    color: #fca5a5;
}

/* ==========================================
   投稿履歴
========================================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-line);
    border-radius: 12px;
    background: var(--bg-color);
    overflow: hidden;
}

.history-item {
    border-bottom: 1px solid var(--border-line);
    padding: 12px;
}
.history-item:last-child {
    border-bottom: none;
}

details.history-details summary {
    cursor: pointer;
    outline: none;
    list-style: none;
}
details.history-details summary::-webkit-details-marker {
    display: none;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.history-date {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-sub);
}

.history-info-group {
    display: flex;
    flex-direction: column; 
    gap: 6px;
    margin-right: auto;
}

.history-dist {
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 700;
    line-height: 1;
}

.history-mission {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.5px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid #f59e0b;
    width: fit-content;
}

@media screen and (min-width: 768px) {
    .history-info-group {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    /* ★ 距離部分の枠の幅を固定し、ミッションの位置を揃える */
    .history-dist {
        width: 85px; /* 「100.00 km」などでも収まる幅 */
    }
}

/* ★ 写真マーク用のクラスに変更 */
.history-photos {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.history-toggle-icon {
    margin-left: 8px;
    color: var(--text-sub);
    font-size: 1rem;
    transition: transform 0.3s ease;
}
details[open] .history-toggle-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

.history-comment {
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
    padding-left: 2px;
}

/* ★ 画像の表示を大画面・縦並びに変更 */
.history-images {
    margin-top: 15px;
    display: flex;
    flex-direction: column; /* 画像を縦に並べる */
    gap: 15px;
}

.history-images img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain; 
    cursor: zoom-in;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.no-image {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin: 0;
}

/* ==========================================
   画像拡大モーダル
========================================== */
.img-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    cursor: zoom-out;
}

.img-modal.show {
    display: flex;
}

.img-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* ==========================================
   ランキングページ専用スタイル (コンパクト・リスト型)
========================================== */
.search-section {
    padding: 12px 15px; 
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: var(--text-sub);
    font-size: 1rem; 
}

.search-box input {
    padding: 10px 10px 10px 40px; 
    margin: 0; 
    font-size: 1rem;
}

/* ★ リスト全体を1つの枠で囲い、間隔をゼロにする */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-line);
    border-radius: 12px;
    background: var(--bg-color);
    overflow: hidden;
}

.ranking-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-line);
    padding: 10px 12px; 
    transition: all 0.3s ease;
}
.ranking-item:last-child {
    border-bottom: none; /* 最後だけ線を消す */
}

/* 検索時のハイライト演出 */
.ranking-item.highlight {
    background: rgba(6, 182, 212, 0.05); /* うっすら青色に */
}

/* 今まさにフォーカスされている該当者の演出 */
.ranking-item.active-match {
    background: rgba(6, 182, 212, 0.2); 
    box-shadow: inset 4px 0 0 var(--accent); /* 左側にラインを表示して目立たせる */
}

.rank-num {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem; 
    font-weight: 700;
    color: var(--text-main);
    width: 35px; 
    text-align: center;
    flex-shrink: 0;
}

.rank-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-line);
    flex-shrink: 0;
}

.rank-default-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--panel-bg);
    color: var(--accent);
    font-size: 1.2rem;
    border: 1px solid var(--border-line);
    flex-shrink: 0;
}

.rank-info {
    display: flex;
    flex-direction: column;
    gap: 0; 
    margin-left: 10px;
    flex-grow: 1; 
    min-width: 0; 
}

.rank-name {
    font-size: 0.95rem; 
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}
.rank-name:hover {
    text-decoration: underline;
}

.rank-desc {
    font-size: 0.75rem;
    color: var(--text-sub);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ★ 右側のブロックを縦並びに設定 */
.rank-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* 右寄せ */
    gap: 4px; 
    margin-left: auto; 
    flex-shrink: 0;
}

.rank-actions-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-sns {
    color: #e1306c; 
    font-size: 1.3rem; 
    transition: transform 0.2s ease;
    text-decoration: none;
}
.rank-sns:hover {
    transform: scale(1.1); 
}

.rank-pt {
    font-size: 0.8rem; 
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
    white-space: nowrap;
}
.rank-pt span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem; 
    color: var(--accent);
}

.rank-cd {
    font-size: 0.75rem;
    color: var(--text-sub);
    font-family: 'Share Tech Mono', monospace;
}

/* ==========================================
   ユーザー詳細ページ (user_detail.php) 専用スタイル
========================================== */

/* インスタグラムリンク */
.detail-sns-link {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.detail-sns-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(220, 39, 67, 0.4);
    color: #fff;
}

/* 自己紹介パネル */
.detail-bio {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent);
    border-radius: 4px 12px 12px 4px;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.8;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

/* 履歴内の「いいね」フォーム */
.like-form {
    margin: 0 10px 0 0;
    padding: 0;
    display: flex;
    align-items: center;
}

/* 「いいね」ボタン（共通ボタンのスタイルを上書きして小型化） */
.like-btn {
    width: auto;
    margin-top: 0;
    padding: 4px 12px;
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border: 1px solid #f43f5e;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.like-btn:hover {
    background: #f43f5e;
    color: #fff;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.static-like {
    cursor: default; /* カーソルを指マークにしない */
    pointer-events: none; /* クリックやホバーを無効化 */
}