/* ========== トーストコンテナ（画面右上に縦並び） ========== */
#toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100% - 32px);
    pointer-events: none;   /* コンテナ自体はクリックを透過 */
}

/* ========== 個別トースト ========== */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    word-break: break-word;
    pointer-events: all;
    /* 初期状態：右にオフセットして透明 */
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-hide {
    opacity: 0;
    transform: translateX(60px);
}

/* ========== 種別ごとの色 ========== */
.toast-success      { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.toast-error        { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.toast-info         { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.toast-notification { background: #fff8e1; color: #6d4c00; border: 1px solid #ffe082; }
.toast-fortune      { background: linear-gradient(135deg, #fce4ec 0%, #fff5f8 100%); color: #880e4f; border: 1px solid #f8bbd0; font-weight: 600; }

/* ========== 内部要素 ========== */
.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }

.toast-text { flex: 1; }

.toast-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }

/* ========== 旧 .flash-message を非表示（後方互換） ========== */
.flash-message { display: none !important; }

/* ========== モバイル ========== */
@media (max-width: 480px) {
    #toast-container {
        top: calc(var(--header-height) + 8px);
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }
}
