/* ============================================
   街歩きカード収集システム - メインCSS
   モバイルファースト設計
   ============================================ */

:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --accent: #F5A623;
    --success: #27AE60;
    --danger: #E74C3C;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #333333;
    --text-light: #888888;
    --border: #E0E0E0;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-bottom: 80px;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ===== ヘッダー ===== */
.header {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.header-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.header-title a {
    color: #fff;
    text-decoration: none;
}

/* ===== 下部ナビゲーション ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-light);
    text-decoration: none;
    padding: 4px 8px;
    transition: color 0.2s;
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--primary);
}

.bottom-nav .nav-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* ===== メインコンテンツ ===== */
.main {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== カード型コンポーネント ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

/* ===== 統計カード ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== プログレスバー ===== */
.progress-bar {
    background: var(--border);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ===== スポット一覧 ===== */
.spot-list {
    list-style: none;
}

.spot-item {
    display: flex;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.spot-item:active {
    transform: scale(0.98);
}

.spot-item a {
    display: flex;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    width: 100%;
}

.spot-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--border);
    flex-shrink: 0;
}

.spot-info {
    flex: 1;
    min-width: 0;
}

.spot-name {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.spot-area {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.spot-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 取得状況バッジ ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
}

.badge-acquired {
    background: var(--success);
    color: #fff;
}

.badge-unacquired {
    background: var(--border);
    color: var(--text-light);
}

/* ===== レアリティバッジ ===== */
.rarity-common { color: #888; }
.rarity-uncommon { color: var(--success); }
.rarity-rare { color: var(--primary); }
.rarity-legendary { color: var(--accent); }

/* ===== カード帳グリッド ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.card-grid-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
}

.card-grid-item:active {
    transform: scale(0.96);
}

.card-grid-item a {
    display: block;
    text-decoration: none;
    color: var(--text);
}

.card-grid-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: var(--border);
    display: block;
}

.card-grid-image.silhouette {
    filter: brightness(0) opacity(0.2);
}

.card-grid-item .unacquired-badge {
    display: block;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-light);
    padding: 0 4px 2px;
}

.card-grid-name {
    padding: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== カード詳細 ===== */
.card-detail-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    display: block;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-detail-title {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
}

.card-detail-meta {
    text-align: center;
    margin-bottom: 16px;
}

.card-detail-desc {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text);
}

/* ===== スポット詳細 ===== */
.spot-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 16px;
    background: var(--border);
}

.spot-detail-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.spot-detail-area {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.spot-detail-desc {
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* ===== ボタン ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: #fff;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* ===== フォーム ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

/* ===== アラート ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: #FDE8E8;
    color: var(--danger);
    border: 1px solid #F9CECE;
}

.alert-success {
    background: #E8F5E9;
    color: var(--success);
    border: 1px solid #C8E6C9;
}

/* ===== セクションタイトル ===== */
.section-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

/* ===== フィルター ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.filter-count {
    font-size: 0.65rem;
    opacity: 0.7;
}

.filter-complete-badge {
    color: var(--success);
    font-size: 0.7rem;
}

.filter-btn.active .filter-complete-badge {
    color: #fff;
}

/* ===== 空状態 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ===== 認証ページ ===== */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 0 16px;
}

.auth-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== 画像プレースホルダ ===== */
.img-placeholder {
    background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2rem;
}

/* ===== ユーティリティ ===== */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
