.fate-battle-wrap {
    padding: 16px;
    color: #e5e7eb;
    max-width: 1100px;
    margin: 0 auto;
}

.fate-battle-header { margin-bottom: 12px; }
.fate-battle-title { font-size: 22px; font-weight: 700; color: #f5d76e; }
.fate-battle-sub { font-size: 13px; color: #9ca3af; }

.fate-battle-cols { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.fate-battle-col { flex: 1 1 340px; min-width: 300px; display: flex; flex-direction: column; gap: 12px; }

.fate-battle-card {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 12px;
}
.fate-battle-card-title { font-weight: 700; color: #cbd5e1; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.fate-battle-count { color: #9ca3af; font-weight: 500; margin-left: 6px; }
.fate-battle-count.invalid { color: #f87171; }

.fate-battle-field { margin-bottom: 8px; }
.fate-battle-field label { display: block; font-size: 12px; color: #9ca3af; margin-bottom: 3px; }
.fate-battle-field input, .fate-battle-field select {
    width: 100%; background: #0b1220; color: #e5e7eb;
    border: 1px solid #374151; border-radius: 6px; padding: 6px 8px; font-size: 13px;
}

.fate-battle-cardgrid {
    display: flex; flex-wrap: wrap; gap: 6px;
    max-height: 260px; overflow-y: auto; padding: 4px; margin-bottom: 8px;
    background: rgba(0,0,0,0.2); border-radius: 8px;
}
.fate-battle-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #0b1220; color: #e5e7eb;
    border: 1px solid #374151; border-radius: 14px;
    padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.fate-battle-chip.on { font-weight: 700; }

.fate-battle-actions { display: flex; gap: 8px; }
.fate-battle-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: #1f2937; color: #e5e7eb; border: 1px solid #374151;
    border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer;
    line-height: 1.2; vertical-align: middle;
    transition: background .14s ease, border-color .14s ease, color .14s ease, transform .1s ease, box-shadow .14s ease;
}
.fate-battle-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.fate-battle-btn:hover { background: #374151; }
.fate-battle-btn.primary { background: #b45309; border-color: #f59e0b; color: #fff; }
.fate-battle-btn.primary:hover { background: #d97706; }
.fate-battle-btn.danger { background: #7f1d1d; border-color: #ef4444; }
.fate-battle-btn.danger:hover { background: #991b1b; }
.fate-battle-btn.sm { padding: 4px 10px; font-size: 12px; gap: 5px; }
.fate-battle-btn.sm svg { width: 12px; height: 12px; flex-shrink: 0; }

.fate-battle-deckrow, .fate-battle-lbrow {
    display: flex; align-items: center; gap: 8px; padding: 6px 0;
    border-bottom: 1px solid #1f2937; font-size: 13px;
}
.fate-battle-lbrow { justify-content: space-between; }
.fate-battle-empty { color: #6b7280; font-size: 13px; padding: 10px; text-align: center; }

.fate-battle-arena { max-width: 100%; }
.fate-battle-arena-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fate-battle-arena-info { font-size: 14px; color: #cbd5e1; font-weight: 600; }

.fate-arena-board {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: stretch; gap: 12px;
    --fate-card-h: 190px;
}
.fate-arena-col {
    position: relative; border-radius: 14px; border: 1px solid #1f2937; padding: 14px;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(56,189,248,0.06), transparent 55%),
        linear-gradient(180deg, #111827 0%, #0b1220 100%);
    background-size: cover; background-position: center;
}
.fate-arena-col-side { display: flex; flex-direction: column; gap: 8px; }
.fate-arena-side-foe { background: radial-gradient(120% 90% at 50% 0%, rgba(239,68,68,0.06), transparent 55%), linear-gradient(180deg, #141018 0%, #0b1220 100%); }
.fate-arena-col-cards { display: flex; flex-direction: column; }
.fate-arena-col-cards .fate-battle-hand { align-content: start; }

.fate-fighter { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fate-fighter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fate-fighter-me .fate-fighter-head { flex-direction: row; }
.fate-fighter-foe .fate-fighter-head { flex-direction: row-reverse; }
.fate-fighter-name { font-size: 15px; font-weight: 800; color: var(--fighter, #e5e7eb); }
.fate-fighter-weapon { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }

.fate-hpbar {
    position: relative; height: 20px; border-radius: 10px; overflow: hidden;
    background: #1f2937; border: 1px solid #0f172a;
}
.fate-hpbar-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: #22c55e; transition: width .3s ease, background .3s ease; }
.fate-shieldbar { position: absolute; top: 0; left: 0; height: 5px; background: #38bdf8; opacity: .85; transition: width .3s ease; }
.fate-hpbar-txt {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #f8fafc; text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.fate-fighter-idn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fate-fighter-me .fate-fighter-idn { flex-direction: row; }
.fate-fighter-foe .fate-fighter-idn { flex-direction: row-reverse; }
.fate-fighter-realm {
    flex: 0 0 auto; font-size: 11px; font-weight: 800; line-height: 1.35; padding: 2px 9px;
    border: 1px solid; border-radius: 999px; white-space: nowrap;
    text-transform: uppercase; letter-spacing: .03em; color: #94a3b8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.55); transition: color .2s ease, background .2s ease;
}
.fate-fighter-realm:empty { display: none; }
.fate-fighter-realm.demote { filter: grayscale(0.7) brightness(0.7); opacity: .55; }
.fate-hud-realm { font-weight: 800; }

.fate-atkbar {
    position: relative; height: 13px; border-radius: 7px; overflow: hidden;
    background: #0f172a; border: 1px solid #1e293b;
}
.fate-atkbar-fill {
    position: absolute; inset: 0 auto 0 0; width: 0;
    background: color-mix(in srgb, var(--fighter, #64748b) 70%, #1e293b);
}
.fate-atkbar-lbl {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px;
    font-size: 9px; font-weight: 700; color: #e2e8f0; text-shadow: 0 1px 1px rgba(0,0,0,0.75);
}
.fate-atkbar-ico { display: block; opacity: 0.9; }

.fate-fighter-status { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; align-items: flex-start; }
.fate-fighter-foe .fate-fighter-status { justify-content: flex-end; }
.fate-status-chip {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    width: 54px; padding: 5px 5px 6px; border-radius: 10px; font-size: 9px; font-weight: 700;
    border: 1px solid #334155; color: #cbd5e1; background: #1e293b;
}
.fate-status-chip.stun { color: #fbbf24; }
.fate-status-icon {
    width: 38px; height: 38px; border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, currentColor 14%, #0b1220);
    border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
}
.fate-status-icon img { width: 100%; height: 100%; object-fit: cover; }
.fate-status-icon svg { width: 22px; height: 22px; }
.fate-status-icon-txt { text-transform: capitalize; font-size: 8px; padding: 0 3px; text-align: center; }
.fate-chip-stacks {
    position: absolute; top: -4px; right: -4px; z-index: 2; min-width: 15px; padding: 0 3px;
    height: 15px; line-height: 14px; text-align: center; border-radius: 8px; font-size: 9px; font-weight: 800;
    color: #f8fafc; background: #0b1220; border: 1px solid currentColor; box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.fate-chip-stacks:empty { display: none; }
.fate-chip-time { opacity: 0.85; font-weight: 600; line-height: 1; }
.fate-chip-bar { display: block; width: 100%; height: 3px; border-radius: 2px; background: rgba(0,0,0,0.4); overflow: hidden; }
.fate-chip-bar-fill { display: block; height: 100%; border-radius: 2px; width: 100%; }

.fate-fighter-casting { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; margin-top: 4px; }
.fate-fighter-casting.active { min-height: 92px; }
.fate-fighter-foe .fate-fighter-casting { justify-content: flex-end; }
.fate-cast-chip {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 6px 6px;
    border-radius: 10px; border: 1px solid color-mix(in srgb, var(--el, #64748b) 55%, #1e293b);
    background: linear-gradient(180deg, color-mix(in srgb, var(--el, #64748b) 24%, #0f172a), #0f172a);
    width: 104px;
    animation: fateCastIn 160ms ease-out;
}
.fate-cast-art {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 8px; overflow: hidden;
    background: #0b1220; border: 1px solid color-mix(in srgb, var(--el, #64748b) 45%, transparent);
    display: flex; align-items: center; justify-content: center;
}
.fate-cast-art img { width: 100%; height: 100%; object-fit: cover; }
.fate-cast-info { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-width: 0; }
.fate-cast-name {
    font-size: 11px; font-weight: 700; color: #e2e8f0; text-align: center; max-width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fate-cast-timer { font-size: 10px; color: color-mix(in srgb, var(--el, #94a3b8) 70%, #cbd5e1); font-weight: 600; }
.fate-cast-bar { display: block; width: 100%; height: 4px; border-radius: 3px; background: #1e293b; overflow: hidden; }
.fate-cast-bar-fill {
    display: block; height: 100%; border-radius: 3px;
    background: var(--el, #64748b);
}
@keyframes fateCastIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.fate-fighter-stage { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; min-height: 190px; }
.fate-fighter-body { position: relative; z-index: 2; width: 170px; height: 170px; display: flex; align-items: flex-end; justify-content: center; }
.fate-fighter-body svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
.fate-fighter-foe .fate-fighter-body { transform: scaleX(-1); }
.fate-fighter-plate {
    position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
    width: 130px; height: 26px; border-radius: 50%; z-index: 1;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--fighter, #64748b) 45%, transparent), transparent);
}

@media (max-width: 560px) {
    .fate-fighter-body { width: 130px; height: 130px; }
    .fate-fighter-stage { min-height: 150px; }
}

.fate-status-chip { animation: fbChipIn 220ms cubic-bezier(0.34,1.56,0.64,1); }
@keyframes fbChipIn { from { opacity: 0; transform: translateY(4px) scale(0.82); } to { opacity: 1; transform: none; } }

@keyframes fbSlash { to { stroke-dashoffset: 0; } }
@keyframes fbSlashFade { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fbCritPop {
    0%   { transform: translate(-50%, -50%) scale(0.5) rotate(-8deg); opacity: 0; }
    22%  { transform: translate(-50%, -62%) scale(1.3) rotate(-3deg); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(1) rotate(0deg); opacity: 0; }
}
.fb-crit-pop {
    pointer-events: none; font-weight: 900; font-size: 26px;
    color: #fbbf24; letter-spacing: 1px; white-space: nowrap;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.85), 0 2px 3px rgba(0, 0, 0, 0.9);
    will-change: transform, opacity;
    animation: fbCritPop 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fate-fighter-stage::after {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    border-radius: 12px; opacity: 0;
    background: radial-gradient(65% 55% at 50% 72%, rgba(239,68,68,0.4), transparent 72%);
}
.fate-fighter.low-hp .fate-fighter-stage::after { will-change: opacity; animation: fbLowHp 1.15s ease-in-out infinite; }
@keyframes fbLowHp { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

html[data-fx="off"] .fate-status-chip,
html[data-fx="off"] .fate-fighter.low-hp .fate-fighter-stage::after { animation: none !important; }

.fate-battle-hud { margin-top: 10px; }
.fate-battle-qi { font-size: 14px; color: #7ec8e3; margin-bottom: 6px; }

.fate-battle-hand {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: var(--fate-card-h); gap: 8px; align-content: start;
}
.fate-battle-hand .fate-battle-playcard { width: auto; height: 100%; }
.fate-battle-hand .fate-battle-playcard-art { height: 66px; flex: 0 0 66px; }
.fate-battle-hand .fate-battle-playcard-info { padding: 5px 6px 6px; gap: 2px; min-height: 0; overflow: hidden; }
.fate-battle-hand .fate-battle-playcard-name { font-size: 11px; }
.fate-battle-hand .fate-playcard-desc {
    font-size: 9px; line-height: 1.25; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.fate-battle-hand .fate-playcard-desc-status {
    font-size: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.fate-battle-foehand-label {
    font-size: 12px; color: #94a3b8; font-weight: 700; margin-bottom: 8px;
    text-align: center; text-transform: uppercase; letter-spacing: .04em;
}
.fate-battle-foehand-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: var(--fate-card-h); gap: 8px;
}
.fate-battle-cardback {
    width: 100%; height: 100%; border-radius: 12px; border: 2px solid #3f3a5a;
    background:
        repeating-linear-gradient(45deg, rgba(129,140,248,0.08) 0 6px, transparent 6px 12px),
        radial-gradient(120% 90% at 50% 0%, rgba(129,140,248,0.18), transparent 60%),
        linear-gradient(180deg, #1a1b34 0%, #0d0e1f 100%);
    display: flex; align-items: center; justify-content: center;
    color: #818cf8; box-shadow: inset 0 0 12px rgba(0,0,0,0.5);
}
.fate-battle-cardback-mark { opacity: .55; display: flex; }

.fate-battle-playcard {
    position: relative;
    display: flex; flex-direction: column; gap: 0; width: 148px;
    background: #0b1220; color: #e5e7eb; border: 2px solid #374151;
    border-radius: 12px; padding: 0; font-size: 13px; cursor: pointer;
    overflow: hidden; text-align: left;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.fate-battle-playcard:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.fate-battle-playcard.disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.fate-battle-playcard.disabled:hover { transform: none; box-shadow: none; }
.fate-battle-playcard.demote-warn { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245,158,11,0.35); }
.fate-battle-playcard.demote-warn .fate-battle-qicost { background: #7c2d12; color: #fed7aa; border-color: #f59e0b; }
.fate-battle-playcard.demote-warn::after {
    content: '\26A0'; position: absolute; top: 4px; left: 4px; z-index: 3;
    font-size: 12px; color: #fbbf24; text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.fate-battle-playcard-art {
    position: relative; width: 100%; height: 92px; overflow: hidden;
    background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--el, #334155) 35%, transparent), #0b1220 70%);
    display: flex; align-items: center; justify-content: center;
}
.fate-battle-playcard-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fate-battle-playcard-info { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px 8px; }
.fate-battle-playcard-name {
    font-size: 12px; font-weight: 700; line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fate-playcard-desc { font-size: 10px; line-height: 1.3; color: #cbd5e1; margin-top: 3px; }
.fate-playcard-desc-status { font-size: 9px; line-height: 1.25; margin-top: 2px; }
.fate-playcard-desc-status .fate-deck-status { font-weight: 700; }
.fate-playcard-desc-status .fate-deck-status-eff { color: #94a3b8; }
.fate-battle-playcard-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.fate-battle-el-badge.sm {
    font-size: 9px; padding: 0 5px; border-radius: 6px; border: 1px solid; line-height: 1.5;
    text-transform: uppercase; letter-spacing: .02em;
}
.fate-battle-qicost {
    position: absolute; top: 4px; right: 4px;
    background: #1e3a8a; color: #bfdbfe; border: 1px solid #3b82f6;
    border-radius: 8px; min-width: 18px; text-align: center; padding: 0 5px;
    font-size: 12px; font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.fate-battle-result-inner { text-align: center; padding: 16px; border-radius: 10px; border: 1px solid #374151; }
.fate-battle-result-inner.win { background: rgba(21, 128, 61, 0.25); border-color: #22c55e; }
.fate-battle-result-inner.lose { background: rgba(127, 29, 29, 0.25); border-color: #ef4444; }
.fate-battle-result-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.fate-battle-result-sub { color: #fbbf24; margin-bottom: 10px; }

.fate-lobby { max-width: 860px; }

.fate-lobby-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px;
}
.fate-lobby-stat {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 12px 8px; border-radius: 12px;
    background: rgba(17, 24, 39, 0.66); border: 1px solid #1f2937;
    border-top: 2px solid var(--pill, #374151);
}
.fate-lobby-stat.stat-floor  { --pill: #f5d76e; }
.fate-lobby-stat.stat-best   { --pill: #c084fc; }
.fate-lobby-stat.stat-record { --pill: #7ec8e3; }
.fate-lobby-stat.stat-wr     { --pill: #4ade80; }
.fate-lobby-stat-val { font-size: 20px; font-weight: 800; color: #f3f4f6; }
.fate-lobby-stat-lbl {
    font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: #8b97ad; margin-top: 3px;
}

.fate-battle-modes {
    display: flex; flex-direction: column; gap: 12px; margin-top: 8px;
}
.fate-battle-mode {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 16px; text-align: left;
    padding: 16px 18px;
    background: linear-gradient(180deg, #131c30 0%, #0e1524 100%);
    border: 1px solid #253146; border-radius: 14px;
    color: #e5e7eb; cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.fate-battle-mode::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; pointer-events: none;
    background: var(--accent, #f59e0b); opacity: 0.55; transition: opacity .14s ease;
}
.fate-battle-mode.mode-deck   { --accent: #7ec8e3; }
.fate-battle-mode.mode-tower  { --accent: #f5d76e; }
.fate-battle-mode.mode-ranked { --accent: #ef8fa0; }
.fate-battle-mode:hover { transform: translateY(-2px); border-color: var(--accent, #f59e0b); box-shadow: 0 10px 26px rgba(0,0,0,0.4); }
.fate-battle-mode:hover::before { opacity: 1; }
.fate-battle-mode.disabled { opacity: 0.55; cursor: default; }
.fate-battle-mode.disabled:hover { transform: none; border-color: #253146; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.fate-battle-mode.disabled:hover::before { opacity: 0.55; }

.fate-battle-mode-ico {
    position: relative; flex: 0 0 auto;
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    background: rgba(6, 11, 22, 0.66); border: 1px solid color-mix(in srgb, var(--accent) 45%, #253146);
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
}
.fate-battle-mode-ico svg { width: 30px; height: 30px; }
.fate-battle-mode-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fate-battle-mode-name { font-size: 18px; font-weight: 800; color: #f3f4f6; display: flex; align-items: center; gap: 8px; }
.fate-battle-mode-desc { font-size: 12.5px; color: #9ca3af; line-height: 1.4; }
.fate-battle-mode-tag {
    flex: 0 0 auto;
    font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 80%, #fff);
    background: rgba(6, 11, 22, 0.7); border: 1px solid color-mix(in srgb, var(--accent) 40%, #253146);
    border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.fate-battle-mode-cta {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
    color: color-mix(in srgb, var(--accent) 85%, #fff);
    background: color-mix(in srgb, var(--accent) 12%, rgba(6, 11, 22, 0.5));
    border: 1px solid color-mix(in srgb, var(--accent) 35%, #253146);
    transition: background .14s ease, border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.fate-battle-mode-cta svg.fate-btn-icon { width: 14px; height: 14px; flex-shrink: 0; }
.fate-battle-mode-cta svg.fate-btn-arrow { width: 13px; height: 13px; flex-shrink: 0; transition: transform .14s ease; }
.fate-battle-mode:hover .fate-battle-mode-cta {
    background: color-mix(in srgb, var(--accent) 24%, rgba(6, 11, 22, 0.5));
    border-color: color-mix(in srgb, var(--accent) 60%, #253146);
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 25%, transparent);
}
.fate-battle-mode:hover .fate-battle-mode-cta svg.fate-btn-arrow { transform: translateX(2px); }
.fate-battle-mode.disabled .fate-battle-mode-cta { color: #8b97ad; background: rgba(6, 11, 22, 0.4); border-color: #253146; box-shadow: none; }
.fate-battle-soon {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    background: #374151; color: #cbd5e1; border-radius: 8px; padding: 1px 6px;
}

@media (max-width: 640px) {
    .fate-lobby-stats { grid-template-columns: repeat(2, 1fr); }
    .fate-battle-mode { flex-wrap: wrap; }
    .fate-battle-mode-cta { margin-left: auto; }
}

.fate-modal-overlay {
    position: fixed; inset: 0; z-index: 4000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(3, 7, 18, 0.72); padding: 20px;
}
.fate-modal {
    background: #0e1526; border: 1px solid #2b3650; border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    width: 100%; max-width: 1240px; max-height: 92vh;
    display: flex; flex-direction: column; color: #e5e7eb;
}
.fate-deck-modal { height: 88vh; }

.fate-modal-overlay { animation: fbOverlayIn 200ms ease-out both; }
.fate-modal-overlay .fate-modal { animation: fbModalIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes fbOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fbModalIn {
    from { opacity: 0; transform: translateX(48px) scale(0.97); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.fate-modal-overlay.fate-modal-closing { animation: fbOverlayOut 240ms ease-in both; }
.fate-modal-overlay.fate-modal-closing .fate-modal { animation: fbModalOut 210ms cubic-bezier(0.55, 0, 1, 0.45) both; }
@keyframes fbOverlayOut { to { opacity: 0; } }
@keyframes fbModalOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(48px) scale(0.97); }
}

html[data-fx="off"] .fate-modal-overlay,
html[data-fx="off"] .fate-modal-overlay .fate-modal { animation: none !important; }
html[data-fx="reduced"] .fate-modal-overlay .fate-modal { animation: none !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
    .fate-modal-overlay, .fate-modal-overlay .fate-modal {
        animation-duration: 0.01ms !important; transform: none !important;
    }
}
.fate-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #1f2937;
}
.fate-modal-title { font-size: 18px; font-weight: 700; color: #f5d76e; }

.fate-deck-body { display: flex; gap: 0; min-height: 0; flex: 1; }
.fate-deck-collection {
    flex: 1 1 60%; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column;
    border-right: 1px solid #1f2937;
}
.fate-deck-side {
    flex: 0 0 420px; padding: 16px 18px; display: flex; flex-direction: column;
    background: rgba(0,0,0,0.18);
}
.fate-deck-colhead {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: #94a3b8; margin: 10px 0 6px; display: flex; align-items: center; gap: 8px;
}
.fate-deck-side .fate-deck-colhead:first-child { margin-top: 0; }

.fate-deck-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.fate-deck-search {
    width: 100%; background: #0b1220; color: #e5e7eb;
    border: 1px solid #374151; border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.fate-deck-filters { display: flex; flex-direction: column; gap: 6px; }
.fate-deck-chiprow { display: flex; flex-wrap: wrap; gap: 5px; }
.fate-deck-chip {
    background: #0b1220; color: #9ca3af; border: 1px solid #374151;
    border-radius: 12px; padding: 3px 10px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.fate-deck-chip:hover { background: #1a2338; color: #e5e7eb; }
.fate-deck-chip.on { background: #1f2937; color: #fde68a; border-color: #f59e0b; }

.fate-deck-pager {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-top: 8px; padding-top: 8px; border-top: 1px solid #1f2937;
}
.fate-deck-pager:empty { display: none; }
.fate-deck-pager-info { font-size: 12px; color: #94a3b8; }

.fate-deck-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
    gap: 12px; overflow-y: auto; padding: 8px; align-content: start;
    background: rgba(0,0,0,0.2); border-radius: 8px; flex: 1;
}
.fate-deck-tile {
    position: relative; text-align: left; cursor: default;
    background: #0b1220; color: #e5e7eb;
    border: 1px solid #374151; border-top: 3px solid var(--el, #888);
    border-radius: 10px; padding: 10px 10px 10px;
    display: flex; flex-direction: column; gap: 6px; transition: border-color .1s ease, box-shadow .1s ease;
}
.fate-deck-tile:hover { border-color: var(--el, #888); box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.fate-deck-tile.on { box-shadow: 0 0 0 2px var(--el, #888) inset; }
.fate-deck-tile.full { opacity: 0.55; }
.fate-deck-tile.full:hover { transform: none; }
.fate-deck-owned { font-size: 12px; font-weight: 700; color: #e2e8f0; }
.fate-deck-stars { display: flex; flex-wrap: wrap; gap: 6px; }
.fate-deck-starchip {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 14px; font-weight: 800; color: #fde68a; cursor: pointer;
    background: rgba(251,191,36,0.14); border: 1.5px solid rgba(251,191,36,0.55);
    border-radius: 8px; padding: 6px 11px; transition: transform .1s ease, background .1s ease, border-color .1s ease;
}
.fate-deck-starchip:hover { background: rgba(251,191,36,0.34); border-color: #fbbf24; transform: translateY(-1px); }
.fate-deck-starchip.on { background: rgba(134,239,172,0.16); border-color: #86efac; color: #bbf7d0; }
.fate-deck-starchip.on b { color: #86efac; font-size: 12px; }
.fate-deck-starchip.disabled { opacity: 0.4; cursor: not-allowed; }
.fate-deck-starchip.disabled:hover { background: rgba(251,191,36,0.14); border-color: rgba(251,191,36,0.55); transform: none; }
.fate-deck-starchip-plus { font-size: 16px; line-height: 1; color: #86efac; }
.fate-deck-starchip.disabled .fate-deck-starchip-plus { color: inherit; }
.fate-deck-starchip-own { font-size: 12px; font-weight: 700; opacity: 0.85; }

.fate-deck-row-art {
    flex: 0 0 auto; width: 42px; height: 56px; border-radius: 6px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3);
}
.fate-deck-row-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fate-deck-row-starbadge { font-size: 13px; color: #fbbf24; font-weight: 700; white-space: nowrap; }
.fate-deck-row-count { color: #e2e8f0; font-weight: 700; font-size: 14px; flex: 0 0 auto; }

.fate-battle-playcard-star { font-size: 11px; color: #fbbf24; font-weight: 700; margin-left: 4px; }
.fate-battle-playcard-cast { font-size: 10px; color: #94a3b8; font-weight: 600; margin-left: 4px; white-space: nowrap; }
.fate-deck-tile-art {
    width: 100%; height: 132px; border-radius: 8px; overflow: hidden;
    background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.06), rgba(0,0,0,0.35));
    display: flex; align-items: center; justify-content: center;
}
.fate-deck-tile-art img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.fate-deck-tile-name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.fate-deck-tile-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fate-deck-tile-star { font-size: 11px; color: #fbbf24; }
.fate-deck-tile-effect { font-size: 12px; font-weight: 600; color: #e2e8f0; line-height: 1.3; }
.fate-deck-tile-status-row { font-size: 11px; line-height: 1.3; }
.fate-deck-status { font-weight: 700; }
.fate-deck-status-eff { color: #94a3b8; }
.fate-deck-cost {
    font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; flex: 0 0 auto;
    color: #bfdbfe; background: #1e3a8a; border: 1px solid #3b82f6;
    border-radius: 8px; padding: 1px 7px;
}
.fate-deck-cost.sm { font-size: 11px; padding: 2px 8px; }
.fate-deck-cast {
    font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; flex: 0 0 auto;
    color: #cbd5e1; background: #1e293b; border: 1px solid #475569;
    border-radius: 8px; padding: 1px 7px;
}
.fate-deck-tile-check {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: #04160b; background: #86efac; border-radius: 8px; padding: 2px 7px;
}
.fate-deck-el-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    border: 1px solid; border-radius: 8px; padding: 1px 7px;
}
.fate-deck-el-badge.sm { font-size: 10px; padding: 1px 7px; white-space: nowrap; flex: 0 0 auto; }

.fate-deck-meta { flex: 0 0 auto; }
.fate-deck-cards {
    flex: 1 1 auto; overflow-y: auto; margin-bottom: 8px;
    display: flex; flex-direction: column; gap: 4px; min-height: 80px;
    background: rgba(0,0,0,0.2); border-radius: 8px; padding: 6px;
}
.fate-deck-row {
    display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left;
    background: #0b1220; color: #e5e7eb; border: 1px solid #1f2937;
    border-left: 4px solid #888; border-radius: 8px; padding: 8px 10px; font-size: 14px;
}
.fate-deck-row:hover { background: #1a2338; }
.fate-deck-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fate-deck-row-name {
    font-weight: 600; font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fate-deck-row-sub { display: flex; align-items: center; gap: 6px; }
.fate-deck-row-x { color: #ef4444; font-weight: 700; font-size: 16px; flex: 0 0 auto; }

.fate-decks-modal { max-width: 760px; height: 84vh; }
.fate-decks-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.fate-decks-new { align-self: flex-start; font-size: 14px; padding: 8px 14px; }
.fate-decks-list { display: flex; flex-direction: column; gap: 10px; }
.fate-decks-row {
    display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
    background: rgba(17,24,39,0.7); border: 1px solid #1f2937; border-radius: 10px;
}
.fate-decks-row-head { display: flex; align-items: center; gap: 10px; }
.fate-decks-name { flex: 1; font-weight: 700; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fate-decks-meta { color: #9ca3af; font-size: 12px; flex: 0 0 auto; }
.fate-decks-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.fate-decks-thumb {
    position: relative; width: 38px; height: 50px; border-radius: 6px; overflow: hidden;
    background: rgba(0,0,0,0.3); border: 1px solid #1f2937;
    display: flex; align-items: center; justify-content: center;
}
.fate-decks-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fate-decks-thumb-n {
    position: absolute; bottom: 0; right: 0; font-size: 9px; font-weight: 700;
    background: rgba(0,0,0,0.78); color: #e5e7eb; padding: 0 3px; border-top-left-radius: 4px;
}
.fate-decks-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.fate-decks-avg { font-weight: 700; color: #7ec8e3; margin-right: 4px; }

.fate-tower-modal { max-width: 820px; }
.fate-tower-body { padding: 14px 16px 16px; overflow-y: auto; }
.fate-tower-decks {
    display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px;
    max-height: 340px; overflow-y: auto; padding-right: 4px;
}
.fate-tower-leaderboard { max-height: 200px; overflow-y: auto; padding-right: 4px; }

.fate-tower-layout {
    display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start;
}
.fate-tower-left { min-width: 0; display: flex; flex-direction: column; }
.fate-tower-right { min-width: 0; }
@media (max-width: 720px) {
    .fate-tower-modal { max-width: 560px; }
    .fate-tower-layout { grid-template-columns: 1fr; }
    .fate-tower-right { order: -1; }
}

.fate-pvp-modal { max-width: 780px; }
.fate-pvp-body { padding: 14px 16px 16px; overflow-y: auto; }
.fate-pvp-lobby {
    display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start;
}
.fate-pvp-left { min-width: 0; display: flex; flex-direction: column; }
.fate-pvp-right { min-width: 0; }
@media (max-width: 720px) {
    .fate-pvp-modal { max-width: 560px; }
    .fate-pvp-lobby { grid-template-columns: 1fr; }
    .fate-pvp-right { order: -1; }
}
.fate-pvp-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.fate-pvp-join { display: flex; gap: 8px; align-items: stretch; }
.fate-pvp-join .fate-deck-search { flex: 1 1 auto; min-width: 0; }
.fate-pvp-status {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 34px 16px; text-align: center;
}
.fate-pvp-status-text { font-size: 15px; font-weight: 700; color: #e5e7eb; }
.fate-pvp-status-sub { font-size: 12px; color: #9ca3af; }
.fate-pvp-code {
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.35); border: 1px solid rgba(245,215,110,0.35);
    border-radius: 10px; padding: 10px 14px;
}
.fate-pvp-code-val {
    font-size: 20px; font-weight: 800; letter-spacing: .12em;
    color: #f5d76e; font-family: monospace; user-select: all;
}

.fate-tower-banner { text-align: center; margin-bottom: 12px; }
.fate-tower-banner-title {
    font-size: 24px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
    color: #f5d76e; text-shadow: 0 2px 10px rgba(245,215,110,0.35), 0 0 2px rgba(0,0,0,0.6);
}
.fate-tower-banner-sub {
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: #9ca3af; margin-top: 3px;
}

.fate-tower-stage {
    position: relative; display: flex; flex-direction: column; align-items: center;
    padding: 6px 0 4px; margin-bottom: 14px;
}
.fate-tower-col {
    display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; max-width: 340px;
}
.fate-tower-plinth {
    width: 96%; height: 12px; border-radius: 0 0 14px 14px;
    background: linear-gradient(180deg, #2b3650, #0b1120);
    border: 1px solid #1f2937; border-top: 0; box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.fate-tower-tile {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 8px 12px; border-radius: 12px;
    background: rgba(17,24,39,0.72);
    border: 1px solid #1f2937; border-left: 4px solid var(--rarity, #374151);
}
.fate-tower-tile.crown { border-radius: 16px 16px 12px 12px; }
.fate-tower-tile-portrait {
    width: 54px; height: 54px; flex: 0 0 54px; display: flex; align-items: center; justify-content: center;
    color: var(--rarity, #9ca3af); overflow: hidden; border-radius: 10px;
    background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rarity) 24%, transparent), transparent 70%);
}
.fate-tower-tile-portrait svg { width: 100%; height: 100%; }
.fate-tower-tile-info { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.fate-tower-tile-tier { font-size: 14px; font-weight: 800; color: #f3f4f6; }
.fate-tower-tile-rarity {
    font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--rarity, #9ca3af);
}
.fate-tower-tile-reward { font-size: 11px; font-weight: 700; color: #fbbf24; }
.fate-tower-tile-flag {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
}
.fate-tower-tile-flag.ok { background: rgba(74,222,128,0.16); color: #4ade80; font-weight: 900; font-size: 15px; }
.fate-tower-tile-flag.lock { color: #64748b; }
.fate-tower-tile-flag.lock svg { width: 14px; height: 14px; }

.fate-tower-tile.cleared { opacity: 0.9; border-left-color: #4ade80; box-shadow: inset 0 0 0 1px rgba(74,222,128,0.14); }
.fate-tower-tile.cleared .fate-tower-tile-tier { color: #d1fae5; }
.fate-tower-tile.locked { opacity: 0.42; filter: grayscale(0.55); }
.fate-tower-tile.next {
    border-color: var(--rarity, #f5d76e);
    box-shadow: 0 0 0 1px var(--rarity, #f5d76e), 0 0 18px color-mix(in srgb, var(--rarity) 45%, transparent);
    animation: fbTowerPulse 1.6s ease-in-out infinite;
}
@keyframes fbTowerPulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 0 1px var(--rarity, #f5d76e), 0 0 12px color-mix(in srgb, var(--rarity) 35%, transparent); }
    50% { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--rarity, #f5d76e), 0 0 26px color-mix(in srgb, var(--rarity) 65%, transparent); }
}
html[data-fx="off"] .fate-tower-tile.next,
html[data-fx="reduced"] .fate-tower-tile.next { animation: none; }
@media (prefers-reduced-motion: reduce) { .fate-tower-tile.next { animation: none; } }

.fate-tower-difficulty {
    margin-top: 10px; font-size: 13px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase;
    color: #f5d76e; text-shadow: 0 0 10px rgba(245,215,110,0.4);
}

.fate-tower-picker { margin-bottom: 8px; }
.fate-tower-picker-head { font-size: 13px; color: #cbd5e1; margin-bottom: 8px; }
.fate-tower-picker-head b { color: #f5d76e; }

/* Tower tile actions (eye + climb on the next challenger) */
.fate-tower-tile-actions {
    flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; align-items: stretch;
}
.fate-tower-eye {
    display: flex; align-items: center; justify-content: center; align-self: flex-end;
    width: 28px; height: 24px; padding: 0; cursor: pointer;
    color: #cbd5e1; background: rgba(15,23,42,0.7);
    border: 1px solid #334155; border-radius: 7px;
}
.fate-tower-eye:hover { color: #f5d76e; border-color: var(--rarity, #f5d76e); }
.fate-tower-eye .fate-btn-icon { margin: 0; }
.fate-tower-climb.disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }

/* Selected deck state in the picker */
.fate-decks-row.selected {
    border-color: #4ade80; box-shadow: inset 0 0 0 1px rgba(74,222,128,0.22), 0 0 12px rgba(74,222,128,0.12);
}
.fate-battle-btn.fate-deck-selected {
    color: #052e16; background: #4ade80; border-color: #22c55e; font-weight: 800;
}
.fate-battle-btn.fate-deck-selected:hover { background: #22c55e; }

/* Enemy inspect popup */
.fate-enemy-preview { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.fate-enemy-head { display: flex; gap: 14px; align-items: center; }
.fate-enemy-portrait {
    width: 84px; height: 84px; flex: 0 0 84px; display: flex; align-items: center; justify-content: center;
    color: var(--rarity, #9ca3af); overflow: hidden; border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--rarity) 45%, #1f2937);
    background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rarity) 26%, transparent), transparent 70%);
}
.fate-enemy-portrait svg { width: 100%; height: 100%; }
.fate-enemy-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fate-enemy-name { font-size: 17px; font-weight: 800; color: #f3f4f6; }
.fate-enemy-diff {
    font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--rarity, #f5d76e);
}
.fate-enemy-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.fate-enemy-tag {
    font-size: 11px; color: #cbd5e1; padding: 3px 8px; border-radius: 999px;
    background: rgba(17,24,39,0.7); border: 1px solid #273449;
}
.fate-enemy-tag b { color: #94a3b8; font-weight: 700; margin-right: 2px; }
.fate-enemy-tag i { font-style: normal; color: var(--tc, #94a3b8); font-weight: 700; }
.fate-enemy-decklabel {
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8b97ad;
}
.fate-enemy-deck {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
    max-height: 460px; overflow-y: auto; padding-right: 4px;
}
@media (max-width: 900px) {
    .fate-enemy-deck { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
.fate-enemy-card {
    display: flex; gap: 10px; align-items: flex-start; padding: 7px 9px; border-radius: 9px;
    background: rgba(17,24,39,0.66); border: 1px solid #1f2937; border-left: 3px solid var(--el, #888);
}
.fate-enemy-card-art {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 7px; overflow: hidden;
    background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center;
}
.fate-enemy-card-art img { width: 100%; height: 100%; object-fit: cover; }
.fate-enemy-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.fate-enemy-card-name { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.fate-enemy-card-count { color: #8b97ad; font-weight: 700; }
.fate-enemy-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fate-enemy-card-eff { font-size: 11.5px; color: #cbd5e1; line-height: 1.35; }
.fate-enemy-card-status { font-size: 11px; line-height: 1.3; }

.fate-handshake-overlay { z-index: 4200; }
.fate-handshake-modal { max-width: 720px; }
.fate-handshake-body-wrap { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.fate-handshake-grid {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 12px;
}
.fate-handshake-vs {
    align-self: center; font-size: 20px; font-weight: 900; letter-spacing: .05em; color: #64748b;
}
.fate-handshake-fighter {
    background: rgba(0,0,0,0.22); border: 1px solid #2b3650; border-top: 3px solid var(--fighter, #64748b);
    border-radius: 12px; padding: 12px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.fate-handshake-side {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--fighter, #94a3b8);
}
.fate-handshake-body { width: 150px; height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.fate-handshake-body svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
.fate-handshake-fighter:last-child .fate-handshake-body { transform: scaleX(-1); }
.fate-handshake-name { font-size: 16px; font-weight: 700; color: #f3f4f6; text-align: center; line-height: 1.2; }
.fate-handshake-sub { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: #94a3b8; text-align: center; }
.fate-handshake-arch { font-weight: 700; color: #cbd5e1; }
.fate-handshake-stats {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: 100%; margin-top: 4px;
}
.fate-handshake-stat {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    background: rgba(0,0,0,0.28); border: 1px solid #2b3650; border-radius: 7px; padding: 5px 2px;
}
.fate-handshake-stat-k { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.fate-handshake-stat-v { font-size: 12px; font-weight: 700; color: #f1f5f9; white-space: nowrap; }
.fate-handshake-deck {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px;
    max-height: 132px; overflow-y: auto; width: 100%;
}
.fate-handshake-card {
    position: relative; width: 42px; height: 56px; border-radius: 6px; overflow: hidden;
    border: 1px solid #374151; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center;
}
.fate-handshake-card-art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.fate-handshake-card-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fate-handshake-card-star { position: absolute; top: 1px; left: 2px; font-size: 9px; font-weight: 700; color: #fbbf24; text-shadow: 0 1px 2px #000; }
.fate-handshake-card-n { position: absolute; bottom: 1px; right: 2px; font-size: 10px; font-weight: 700; color: #e2e8f0; text-shadow: 0 1px 2px #000; }
.fate-handshake-count {
    height: 8px; border-radius: 6px; background: #1f2937; overflow: hidden; border: 1px solid #374151;
}
.fate-handshake-count-fill {
    display: block; height: 100%; width: 100%; border-radius: 6px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24); transition: width .1s linear;
}
.fate-handshake-actions { display: flex; justify-content: center; }
.fate-handshake-actions .fate-battle-btn { min-width: 200px; font-size: 15px; padding: 10px 18px; }
.fate-handshake-actions .fate-battle-btn.disabled { opacity: 0.6; pointer-events: none; }

.fate-handshake-loading { max-width: 420px; }
.fate-handshake-loading-inner {
    padding: 44px 30px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.fate-handshake-loading .loading-spinner {
    width: 48px; height: 48px; margin: 0;
    border: 4px solid rgba(251,191,36,0.18); border-top-color: #fbbf24;
}
.fate-handshake-loading-text { font-size: 15px; font-weight: 600; color: #e2e8f0; text-align: center; }

@media (max-width: 560px) {
    .fate-handshake-grid { grid-template-columns: 1fr; }
    .fate-handshake-vs { padding: 4px 0; }
    .fate-handshake-fighter:last-child .fate-handshake-body { transform: none; }
}

.fate-picker-field {
    display: flex; align-items: center; gap: 10px; width: 100%;
    background: #0b1220; color: #e5e7eb; border: 1px solid #374151;
    border-radius: 8px; padding: 6px 8px; cursor: pointer; text-align: left;
    transition: border-color 120ms ease, background 120ms ease;
}
.fate-picker-field:hover { border-color: #4b5f86; background: #101a2e; }
.fate-picker-field-art {
    flex: 0 0 auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.28); border-radius: 6px; overflow: hidden;
}
.fate-picker-field-art svg { width: 100%; height: 100%; }
.fate-picker-field-weapon svg { width: 88%; height: 88%; }
.fate-picker-field-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.fate-picker-field-name { font-size: 13px; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fate-picker-field-sub { font-size: 11px; color: #94a3b8; }
.fate-picker-field-caret { flex: 0 0 auto; color: #64748b; display: flex; }

.fate-picker-overlay { z-index: 4300; }
.fate-picker-modal { max-width: 900px; max-height: 86vh; }
.fate-picker-body { padding: 14px 18px 18px; overflow-y: auto; }
.fate-picker-hint { font-size: 12.5px; color: #94a3b8; margin-bottom: 12px; }
.fate-picker-toolbar { margin-bottom: 12px; }
.fate-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.fate-picker-empty { grid-column: 1 / -1; text-align: center; color: #94a3b8; font-size: 13px; padding: 24px 0; }
.fate-picker-card {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    background: #0b1220; border: 1px solid #273349; border-top: 3px solid var(--pick, #374151);
    border-radius: 12px; padding: 14px 12px 13px; cursor: pointer; color: #e5e7eb;
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.fate-picker-card:hover { transform: translateY(-2px); border-color: var(--pick, #4b5f86); box-shadow: 0 10px 26px rgba(0,0,0,0.45); }
.fate-picker-card.selected { box-shadow: 0 0 0 2px var(--pick, #60a5fa) inset; }
.fate-picker-card-art {
    width: 104px; height: 104px; display: flex; align-items: flex-end; justify-content: center;
    background: radial-gradient(ellipse at 50% 78%, rgba(255,255,255,0.06), transparent 62%); border-radius: 10px;
}
.fate-picker-card-weapon { align-items: center; }
.fate-picker-card-name { font-size: 13.5px; font-weight: 700; color: #f8fafc; text-align: center; }
.fate-picker-card-badge {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    border: 1px solid; border-radius: 10px; padding: 1px 8px; background: rgba(0,0,0,0.25);
}
.fate-picker-stats { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.fate-picker-stat {
    font-size: 10px; font-weight: 600; color: #cbd5e1;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 1px 5px; display: inline-flex; gap: 3px; align-items: center;
}
.fate-picker-stat b { font-size: 11px; }
.fate-picker-stat.hi  { color: #4ade80; border-color: rgba(74,222,128,0.35); }
.fate-picker-stat.mid { color: #94a3b8; }
.fate-picker-stat.lo  { color: #f87171; border-color: rgba(248,113,113,0.38); }
.fate-picker-stat-mod { font-style: normal; font-size: 9px; font-weight: 700; opacity: 0.9; }
.fate-picker-stat-mod.up { color: #4ade80; }
.fate-picker-stat-mod.down { color: #f87171; }
.fate-picker-card-desc { font-size: 11.5px; line-height: 1.4; color: #9fb0c6; text-align: center; }

@media (max-width: 560px) {
    .fate-picker-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.fate-picker-card-tag {
    font-size: 11px; font-weight: 700; color: #cbd5e1;
    letter-spacing: 0.02em; margin-top: 1px;
}
.fate-picker-effects {
    list-style: none; margin: 2px 0 0; padding: 0; width: 100%;
    display: flex; flex-direction: column; gap: 4px;
}
.fate-picker-effects li {
    position: relative; font-size: 11.5px; line-height: 1.35; color: #9fb0c6;
    padding-left: 13px; text-align: left;
}
.fate-picker-effects li::before {
    content: ''; position: absolute; left: 2px; top: 6px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--pick, #64748b);
}
