/* abydema-box — モバイルファースト */
:root {
    --bg: #14151a;
    --surface: #1e2027;
    --border: #2c2f3a;
    --text: #e8e8ec;
    --text-dim: #9a9ca8;
    --accent: #7aa2f7;
    --nav-h: 56px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
    line-height: 1.6;
    min-height: 100dvh;
}

.main {
    padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
    max-width: 900px;
    margin: 0 auto;
}

.page-title { font-size: 1.2rem; margin-bottom: 12px; }
.empty-note { color: var(--text-dim); padding: 32px 0; text-align: center; }

.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
}
.nav-item.active { color: var(--accent); }

/* フォーム */
.form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.form-logout { margin-top: 32px; }
.label { display: flex; flex-direction: column; gap: 4px; color: var(--text-dim); font-size: 0.9rem; }
.input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    padding: 12px;
}
.input:focus { border-color: var(--accent); outline: none; }
.btn {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    padding: 12px;
}
.btn-primary { background: var(--accent); color: #10121a; font-weight: 600; }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); }

/* フラッシュメッセージ */
.flash { border-radius: 8px; margin-bottom: 12px; padding: 10px 12px; font-size: 0.9rem; }
.flash-error { background: #3a1f24; color: #f38b8b; }
.flash-success { background: #1e3327; color: #7fd8a2; }

/* ギャラリー */
.tag-current { color: var(--accent); font-size: 0.95rem; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 4px 12px;
    text-decoration: none;
}
.chip-active { border-color: var(--accent); color: var(--accent); }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
}
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.card-badge {
    position: absolute;
    right: 6px; bottom: 6px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 2px 8px;
}
.pager { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.pager .btn { text-decoration: none; text-align: center; }
.file-count { color: var(--text-dim); font-size: 0.85rem; }

/* 詳細ページ */
.back-link { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; }
.detail-head { margin-bottom: 12px; }
.detail-img-wrap { border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: var(--surface); }
.detail-img { width: 100%; height: auto; display: block; }
.section { margin-top: 24px; }
.section-title { font-size: 1rem; color: var(--text-dim); margin-bottom: 8px; }
.section-danger { border-top: 1px solid var(--border); padding-top: 16px; }
.btn-danger { background: #4a2328; color: #f38b8b; }
.btn-small { font-size: 0.85rem; padding: 8px; }
.input-small { font-size: 0.85rem; padding: 8px; }

/* ネタ */
.idea {
    background: var(--surface);
    border-left: 3px solid var(--border);
    border-radius: 0 8px 8px 0;
    margin-bottom: 10px;
    padding: 10px 12px;
}
.idea-ai { border-left-color: var(--accent); }
.idea-author { font-size: 0.75rem; font-weight: 600; color: var(--accent); margin-right: 8px; }
.idea-user .idea-author, .idea .idea-author { color: var(--text-dim); }
.idea-ai .idea-author { color: var(--accent); }
.idea-date { font-size: 0.75rem; color: var(--text-dim); }
.idea-body { margin-top: 4px; white-space: pre-wrap; }
.idea-link-form { display: flex; gap: 8px; margin-top: 8px; }
.idea-link-form .input-small { flex: 1; min-width: 0; }

/* ログイン */
.login-wrap { display: flex; flex-direction: column; gap: 16px; margin-top: 20dvh; align-items: center; }
.login-wrap .form { width: 100%; }
