/* Lamplighters - アプリ固有スタイル */

/* --- ヘッダータイトル --- */
.kindness-body .nav {
    position: relative;
}

.app-header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'BIZ UDGothic', 'BIZ UDゴシック', sans-serif;
    font-style: italic;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fb923c;
    letter-spacing: 0.04em;
    white-space: nowrap;
    pointer-events: none;
}

/* --- 背景 --- */
.kindness-body {
    background-color: #2a2a2a;
    touch-action: manipulation; /* ダブルタップズーム無効 */
}

/* 炎背景オーバーレイ（2枚重ねてopacityでクロスフェード） */
.flame-bg {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.8s ease;
    z-index: -1;
    pointer-events: none;
}

/* --- タイムライン --- */
.timeline {
    display: flex;
    flex-direction: column;
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 1rem 5rem; /* 下部: フォームと重ならないよう確保 */
    min-height: calc(100vh - 60px);
}

/* --- 投稿カード --- */
.post {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 0.875rem 1rem;
    margin-bottom: 0.625rem;
}

.post-content {
    color: #f0f0f0;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.375rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-nice,
.btn-digest {
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full, 9999px);
    background: transparent;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-nice {
    color: #fb923c;
}

.btn-nice:hover {
    filter: brightness(1.2);
}

.btn-digest {
    color: #888;
    font-size: 0.7rem;
}

.btn-digest:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    border-color: rgba(255, 255, 255, 0.25);
}

/* 消火時の退場アニメーション */
.post--removing {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s, transform 0.3s;
}

.post-time {
    font-size: 0.75rem;
    color: #999;
    flex-shrink: 0;
}

/* --- 投稿フォーム --- */
.post-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.625rem 1rem;
}

.post-form-inner {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.post-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg, 0.75rem);
    background: rgba(255, 255, 255, 0.08);
    color: #f0f0f0;
    font-size: 16px;           /* iOS ズーム防止: 16px 未満だと自動ズームされる */
    transform: scale(0.9);     /* 見た目を少し小さく調整 */
    transform-origin: left bottom;
    margin-right: -10%;        /* scale(0.9) で生じる右側の余白を詰める */
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    resize: none;
    overflow-y: auto;
    max-height: 6rem;
    transition: border-color 0.2s;
}

.post-input::placeholder {
    color: #888;
}

.post-input:focus {
    border-color: var(--primary-color, #3b82f6);
}

.post-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--primary-color, #3b82f6);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.post-button svg {
    width: 1.2rem;
    height: 1.2rem;
}

.post-button:hover {
    background: var(--primary-dark, #2563eb);
}

/* --- ログインエリア --- */
.login-area {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nice-badge {
    display: none;
    font-size: 0.7rem;
    color: #fb923c;
    font-weight: 600;
    white-space: nowrap;
}

.nice-badge--visible {
    display: inline;
}

/* --- 情報アイコン --- */
.btn-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-info-icon:hover {
    color: #fb923c;
    border-color: #fb923c;
}

/* --- ログインアイコン --- */
.btn-login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-login-icon:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-login-icon--active {
    color: #fb923c;
    border-color: #fb923c;
}

.btn-login-icon--active:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* --- ログインモーダル --- */
.login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.login-overlay--visible {
    display: flex;
}

.login-modal {
    position: relative;
    width: 90%;
    max-width: 360px;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 2rem 1.5rem;
}

.login-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.login-close:hover {
    color: #fff;
}

.login-title {
    color: #f0f0f0;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    text-align: center;
}

.login-status {
    text-align: center;
    font-size: 0.8rem;
    min-height: 1.2rem;
    margin-bottom: 0.75rem;
}

.login-status--info {
    color: #888;
}

.login-status--error {
    color: #ef4444;
}

.login-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg, 0.75rem);
    background: rgba(255, 255, 255, 0.08);
    color: #f0f0f0;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-input::placeholder {
    color: #888;
}

.login-input:focus {
    border-color: var(--primary-color, #3b82f6);
}

.login-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.login-btn {
    flex: 1;
    padding: 0.625rem;
    border: none;
    border-radius: var(--radius-lg, 0.75rem);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn-primary {
    background: var(--primary-color, #3b82f6);
    color: #fff;
}

.login-btn-primary:hover {
    background: var(--primary-dark, #2563eb);
}

.login-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.login-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* --- 情報モーダル --- */
.info-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.info-overlay--visible {
    display: flex;
}

.info-modal {
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 2rem 1.5rem;
}

.info-section {
    margin-top: 1.25rem;
}

.info-section-title {
    color: #fb923c;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.5rem;
}

.info-section-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.toggle-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.info-section-toggle.open .toggle-arrow {
    transform: rotate(90deg);
}

.info-section-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

.info-section-body.open {
    max-height: 500px;
}

.info-text {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.7;
    margin: 0 0 0.6rem;
}

.info-rules {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-rules li {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-rules li::before {
    content: "✓";
    color: #fb923c;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* --- 確認ダイアログ --- */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.confirm-overlay--visible {
    display: flex;
}

.confirm-modal {
    width: 85%;
    max-width: 320px;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1.5rem;
    text-align: center;
}

.confirm-message {
    color: #f0f0f0;
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
}

.confirm-actions {
    display: flex;
    gap: 0.5rem;
}

.confirm-btn {
    flex: 1;
    padding: 0.625rem;
    border: none;
    border-radius: var(--radius-lg, 0.75rem);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-btn-ok {
    background: #ef4444;
    color: #fff;
}

.confirm-btn-ok:hover {
    background: #dc2626;
}

.confirm-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.confirm-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
