/* ==========================================================================
   ガチャ交換募集メーカー v1.0.1
   ========================================================================== */

/* --------------------------------------------------------------------------
   固定「交換テンプレ作成」ボタン
   -------------------------------------------------------------------------- */
.gacha-fixed-exchange-wrap {
    position: fixed;
    bottom: 140px;
    left: 20px;
    z-index: 1000;
}

/* テーマのボタンスタイル上書き対策に詳細セレクタを使用 */
.gacha-fixed-exchange-wrap button.gacha-fixed-exchange-btn,
.gacha-fixed-exchange-btn {
    display: inline-flex !important;
    flex-direction: row !important;      /* column 上書き防止 */
    flex-wrap: nowrap !important;        /* 改行防止 */
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 10px 18px !important;
    background: #e6faf9 !important;
    border: 2px solid #4ecdc4 !important;
    border-radius: 25px !important;
    color: #1a9e96 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    /* 正円になるのを防ぐ */
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    aspect-ratio: unset !important;
    box-sizing: content-box !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

/* SVG アイコンの色を確実に上書き */
.gacha-fixed-exchange-btn .gacha-fixed-exchange-icon,
.gacha-fixed-exchange-btn .gacha-fixed-exchange-icon svg,
.gacha-fixed-exchange-btn .gacha-fixed-exchange-icon svg path {
    color: #1a9e96 !important;
    fill: #1a9e96 !important;
    display: flex !important;
    flex-shrink: 0 !important;
}

.gacha-fixed-exchange-wrap button.gacha-fixed-exchange-btn:hover,
.gacha-fixed-exchange-btn:hover {
    background: #c9f3f1 !important;
    border-color: #3db8b0 !important;
    color: #1a9e96 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.gacha-fixed-exchange-wrap button.gacha-fixed-exchange-btn:active,
.gacha-fixed-exchange-btn:active {
    transform: translateY(0) !important;
}

.gacha-fixed-exchange-icon {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

@media (max-width: 768px) {
    .gacha-fixed-exchange-wrap {
        bottom: 112px;
        left: 15px;
    }

    .gacha-fixed-exchange-wrap button.gacha-fixed-exchange-btn,
    .gacha-fixed-exchange-btn {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
}

/* --------------------------------------------------------------------------
   モーダル全体
   -------------------------------------------------------------------------- */
.gacha-trade-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.gacha-trade-modal[hidden] {
    display: none;
}

.gacha-trade-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.gacha-trade-modal-inner {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   閉じるボタン
   -------------------------------------------------------------------------- */
.gacha-trade-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #888;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.gacha-trade-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* --------------------------------------------------------------------------
   モーダルヘッダー
   -------------------------------------------------------------------------- */
.gacha-trade-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding-right: 36px;
}

.gacha-trade-modal-x-icon {
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
}

.gacha-trade-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
}

.gacha-trade-modal-desc {
    font-size: 13px;
    color: #777;
    margin: 0 0 18px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   フォーム全体
   -------------------------------------------------------------------------- */
.gacha-trade-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gacha-trade-field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.gacha-trade-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gacha-trade-field-note {
    font-size: 11px;
    font-weight: 400;
    color: #999;
}

/* --------------------------------------------------------------------------
   プルダウン（セレクト）
   -------------------------------------------------------------------------- */
.gacha-trade-select-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gacha-trade-select {
    flex: 1;
    padding: 8px 32px 8px 10px;
    border: 1.5px solid #dde1e7;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}

.gacha-trade-select:focus {
    outline: none;
    border-color: #90cdf4;
    box-shadow: 0 0 0 3px rgba(144, 205, 244, 0.25);
}

/* --------------------------------------------------------------------------
   タグチップ
   -------------------------------------------------------------------------- */
.gacha-trade-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.gacha-trade-tags:empty {
    display: none;
}

.gacha-trade-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 10px;
    background: #2b6cb0;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.4;
}

.gacha-trade-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 12px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s;
}

.gacha-trade-tag-remove:hover {
    background: rgba(255, 255, 255, 0.45);
}

/* --------------------------------------------------------------------------
   テキスト入力・テキストエリア
   -------------------------------------------------------------------------- */
.gacha-trade-text-input,
.gacha-trade-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #dde1e7;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.5;
}

.gacha-trade-text-input:focus,
.gacha-trade-textarea:focus {
    outline: none;
    border-color: #90cdf4;
    box-shadow: 0 0 0 3px rgba(144, 205, 244, 0.25);
}

.gacha-trade-textarea {
    resize: vertical;
    min-height: 58px;
}

/* --------------------------------------------------------------------------
   ゲスト専用フィールド（ログイン時はJSで非表示）
   -------------------------------------------------------------------------- */
body.gacha-logged-in .gacha-trade-guest-only {
    display: none;
}

/* --------------------------------------------------------------------------
   投稿プレビューボックス
   -------------------------------------------------------------------------- */
.gacha-trade-preview-box {
    background: #f8f9fb;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
}

.gacha-trade-preview-label {
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.gacha-trade-preview-text {
    font-size: 13px;
    color: #333;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0 0 8px;
    font-family: inherit;
    min-height: 50px;
}

.gacha-trade-char-count {
    text-align: right;
    font-size: 12px;
    color: #aaa;
}

.gacha-trade-char-num {
    font-weight: 700;
    color: #666;
}

.gacha-trade-char-num.is-over {
    color: #e53e3e;
}

/* --------------------------------------------------------------------------
   Xに投稿するボタン
   -------------------------------------------------------------------------- */
.gacha-trade-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    line-height: 1;
    font-family: inherit;
}

.gacha-trade-submit-btn:hover {
    background: #222;
    transform: translateY(-1px);
}

.gacha-trade-submit-btn:active {
    transform: translateY(0);
}

.gacha-trade-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* --------------------------------------------------------------------------
   注記テキスト
   -------------------------------------------------------------------------- */
.gacha-trade-note {
    font-size: 11.5px;
    color: #999;
    line-height: 1.65;
    margin: 0;
    text-align: center;
}

/* --------------------------------------------------------------------------
   トースト通知
   -------------------------------------------------------------------------- */
.gacha-trade-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #276749;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
    pointer-events: none;
}

.gacha-trade-toast[hidden] {
    display: none;
}

.gacha-trade-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   モーダル開放時スクロール禁止
   -------------------------------------------------------------------------- */
body.gacha-modal-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   レスポンシブ（モバイル：ボトムシート風）
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .gacha-trade-modal {
        padding: 0;
        align-items: flex-end;
    }

    .gacha-trade-modal-inner {
        border-radius: 20px 20px 0 0;
        max-height: 88vh;
        max-width: 100%;
        padding: 22px 18px 28px;
    }
}
