.fate-duel-open { overflow: hidden; }
.fda { position: fixed; inset: 0; z-index: 1000006; overflow: hidden; background: #07110d; color: #e5e7eb; font-family: Inter, "Segoe UI", system-ui, sans-serif; --fda-line: rgba(142, 120, 72, .75); --fda-gold: #f0deb3; --fda-gold-2: #dfc58d; --fda-panel: linear-gradient(160deg, rgba(25, 51, 41, .95), rgba(13, 29, 24, .95)); user-select: none; -webkit-user-select: none; }
.fda [hidden] { display: none !important; }
.fda-stage { position: absolute; inset: 0; background: #050d0a; }
.fda--desktop { z-index: 1000002; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; background: rgba(3, 11, 8, .79); }
.fda-window { position: relative; width: min(1280px, 100%); height: min(820px, 100%); overflow: hidden; container-type: size; background: #0b1913; border: 1px solid #a08b5e; border-radius: 12px; box-shadow: 0 24px 80px #000a, inset 0 1px #e5d19924; }

.fds { overflow: hidden; }
.fds-cam { position: absolute; left: 0; top: 0; transform-origin: 50% 60%; will-change: transform; }
.fds-world { position: absolute; left: 0; top: 0; overflow: hidden; }
.fds-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fds-lay { position: absolute; inset: 0; pointer-events: none; }
.fds-lantern { position: absolute; border-radius: 50%; mix-blend-mode: screen; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 206, 130, .75), rgba(255, 170, 80, .22) 45%, transparent); }
.fds-emblem { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: 0; transform: translate(-50%, -50%); background: radial-gradient(closest-side, var(--c, #fff) 0, transparent 92%); }
.fds-ground { position: absolute; width: 0; height: 0; }
.fds-fighter { position: absolute; width: 0; height: 0; will-change: transform; }
.fds-body, .fds-sprite { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.fds-body { will-change: transform; }
.fds-mirror { transform: scaleX(-1); }
.fds-sprite svg, .fds-reflection svg { position: absolute; display: block; }
.fds-shadow { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(0, 0, 0, .72), rgba(0, 0, 0, .42) 55%, transparent); }
.fds-pool { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); mix-blend-mode: screen; opacity: .5; background: radial-gradient(closest-side, var(--tone, #fff), transparent); }
.fds-seal { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) scaleY(.42); opacity: .5; pointer-events: none; }
.fds-seal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fds-seal-cast { mix-blend-mode: screen; opacity: 1; }
.fds-reflection { position: absolute; overflow: hidden; transform-origin: 50% 100%; transform: scaleY(-.5); opacity: .34; -webkit-mask-image: linear-gradient(to top, #000 0, transparent 62%); mask-image: linear-gradient(to top, #000 0, transparent 62%); filter: blur(.6px); }
.fds-mist { opacity: .38; mix-blend-mode: screen; }
.fds-grade { mix-blend-mode: soft-light; opacity: .62; }
.fds-light { mix-blend-mode: screen; opacity: .2; }
.fds-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fds-vignette { background: radial-gradient(ellipse 72% 72% at 50% 58%, transparent 52%, rgba(3, 8, 6, .62) 100%); }
.fds-danger { background: radial-gradient(ellipse 72% 72% at 50% 55%, transparent 45%, rgba(190, 24, 24, .62) 100%); opacity: 0; }
.fds-flash { opacity: 0; mix-blend-mode: screen; }
.fds-ring { position: absolute; border-radius: 50%; box-sizing: border-box; mix-blend-mode: screen; pointer-events: none; }
.fds-pillar { position: absolute; transform-origin: 50% 100%; mix-blend-mode: screen; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent); }
.fds-slash { position: absolute; mix-blend-mode: screen; pointer-events: none; }
.fds-glyph { position: absolute; background: center / contain no-repeat; image-rendering: pixelated; pointer-events: none; }
.fds-orb { position: absolute; left: 0; top: 0; border-radius: 50%; mix-blend-mode: screen; pointer-events: none; }
.fds-stars { position: absolute; width: 0; height: 0; pointer-events: none; }
.fds-star { position: absolute; color: #fde047; line-height: 1; margin: -.5em 0 0 -.5em; text-shadow: 0 0 6px #f59e0b; }
.fds-defeat .fds-bg { filter: grayscale(.85) brightness(.62); transition: filter .9s ease-out; }
.fds-defeat .fds-grade { filter: grayscale(1); }
html[data-fx="off"] .fds-mist, html[data-fx="off"] .fds-light, html[data-fx="off"] .fds-grade { display: none; }

.fda-name { font: 600 16px/1.2 Georgia, serif; color: var(--fda-gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fda-realm { flex: 0 0 auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border: 1px solid #6b7f70; border-radius: 99px; background: rgba(13, 29, 24, .75); white-space: nowrap; }
.fda-weapon { flex: 0 0 auto; font-size: 11px; color: #b9c9bc; text-transform: uppercase; letter-spacing: .04em; }
.fda-plate-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fda .fda-hp { height: 18px; border-radius: 5px; background: #0a1712; border: 1px solid #456454; }
.fda .fate-hpbar-fill { transition: width .25s ease-out; }
.fda .fda-atk { height: 12px; margin-top: 3px; background: #0a1712; border-color: rgba(69, 100, 84, .7); }
.fda .fate-atkbar-lbl { font-size: 10px; }
.fda .fda-atk--stunned { border-color: #d9a441; }
.fda .fda-atk--stunned .fate-atkbar-fill { background: #8f6a1f; width: 100% !important; }
.fda-plate--foe .fate-hpbar-fill, .fda-plate--foe .fate-atkbar-fill, .fda-plate--foe .fate-shieldbar { left: auto; right: 0; }
.fda-chips { display: flex; gap: 4px; min-width: 0; }
.fda .fda-chip { flex-direction: row; width: auto; padding: 2px 5px 2px 2px; gap: 4px; border-radius: 6px; font-size: 11px; align-items: center; flex-wrap: nowrap; position: relative; overflow: visible; }
.fda .fda-chip .fate-status-icon { width: 20px; height: 20px; border-radius: 4px; flex: 0 0 auto; }
.fda .fda-chip .fate-status-icon svg { width: 15px; height: 15px; }
.fda .fda-chip .fate-chip-bar { position: absolute; left: 2px; right: 2px; bottom: 0; width: auto; height: 2px; }

.fda-casts { display: flex; flex: 1 1 0; gap: 6px; min-width: 0; }
.fda-casts--foe { justify-content: flex-end; }
.fda-cast { display: flex; align-items: center; gap: 6px; padding: 3px 7px 3px 3px; min-width: 0; border: 1px solid color-mix(in srgb, var(--el) 65%, #456454); border-radius: 6px; background: rgba(13, 29, 24, .92); }
.fda-cast-art { flex: 0 0 auto; width: 26px; height: 36px; display: block; }
.fda-cast-art img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.fda-cast-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.fda-cast-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.fda-cast-name { font-size: 12px; font-weight: 600; color: var(--fda-gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fda-cast-timer { flex: 0 0 auto; font-size: 12px; color: #e5e7eb; }
.fda-cast-bar { display: block; height: 4px; border-radius: 2px; background: #0a1712; overflow: hidden; }
.fda-cast-fill { display: block; height: 100%; width: 0; background: var(--el); }

.fda-qi { position: relative; display: flex; align-items: center; gap: 10px; }
.fda-qi-track { flex: 1 1 auto; display: flex; gap: 2px; min-width: 0; }
.fda-seg { position: relative; height: 22px; min-width: 0; overflow: hidden; background: #0a1712; border: 1px solid #456454; border-radius: 3px; }
.fda-seg.is-current { border-color: #7fd3f2; }
.fda-seg-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #4ec5ef, #2c6f8f); }
.fda-seg-trail { position: absolute; top: 0; bottom: 0; width: 0; }
.fda-seg-trail--loss { background: linear-gradient(180deg, #ff9b6b, #c2413a); }
.fda-seg-trail--gain { background: linear-gradient(180deg, #ffffff, #a8ecff); box-shadow: 0 0 8px #a8ecff; }
.fda-seg-loss { position: absolute; top: 0; bottom: 0; width: 0; background: linear-gradient(180deg, #ffc762, #c6841f); }
.fda-seg-name { position: relative; display: block; text-align: center; font: 600 11px/20px Georgia, serif; color: #e8efe6; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; }
.fda-qi-value { flex: 0 0 auto; font: 700 22px/1 Georgia, serif; color: #7fd3f2; min-width: 52px; text-align: right; }
.fda-qi.is-spend .fda-seg.is-current { border-color: #ff9b6b; }
.fda-qi.is-gain .fda-seg.is-current { border-color: #ffffff; }
.fda-qi.is-spend .fda-qi-value { color: #ff9b6b; }
.fda-qi.is-gain .fda-qi-value { color: #ffffff; }
.fda-qi-log { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; pointer-events: none; }
.fda-qi-entry { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 3px; box-sizing: border-box; border: 1px solid #456454; border-radius: 6px; background: rgba(13, 29, 24, .95); white-space: nowrap; }
.fda-qi-entry--spend { border-color: #c2654a; }
.fda-qi-entry--gain { border-color: #7fd3f2; }
.fda-qi-entry-art { display: block; width: 15px; height: 21px; object-fit: contain; image-rendering: pixelated; }
.fda-qi-entry-amount { font: 700 14px/1 Georgia, serif; }
.fda-qi-entry--spend .fda-qi-entry-amount { color: #ff9b6b; }
.fda-qi-entry--gain .fda-qi-entry-amount { color: #a8ecff; }
.fda-qi-entry-name { font-size: 12px; color: #dfc58d; }
.fda-qi-warn { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); padding: 1px 9px; border-radius: 99px; border: 1px solid #d9a441; background: rgba(39, 26, 7, .95); color: #ffc762; font: 600 12px/1.5 Georgia, serif; white-space: nowrap; pointer-events: none; }
.fda-qi-warn:empty { display: none; }

.fda-card { position: relative; display: flex; flex-direction: column; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; transition: transform .12s ease-out, filter .12s ease-out; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fda-card-art { position: relative; display: block; aspect-ratio: 5 / 7; width: 100%; }
.fda-card-art img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.fda-cost { position: absolute; top: 3%; right: 3%; min-width: 22px; height: 22px; padding: 0 3px; box-sizing: border-box; border-radius: 5px; background: #14315a; border: 1px solid #6d9fe0; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.fda-card.demote-warn .fda-cost { background: #5a3a0f; border-color: #e6a23c; }
.fda-card.disabled { cursor: not-allowed; filter: grayscale(.95) brightness(.62); }
.fda-card.disabled .fda-cost { background: #5a1414; border-color: #d96060; }
.fda-card.is-realm-locked::after { content: attr(data-realm-lock); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 2px 6px; border-radius: 4px; background: rgba(8, 20, 18, .9); border: 1px solid #d9b45a; color: #f5d76e; font-size: 10px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.fda-card-name { font-size: 12px; font-weight: 600; color: var(--fda-gold-2); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fda-detail { position: absolute; z-index: 6; width: min(300px, calc(100% - 24px)); box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--fda-gold-2); border-radius: 8px; background: rgba(13, 29, 24, .97); text-align: center; pointer-events: none; }
.fda-detail-name { font: 600 15px/1.2 Georgia, serif; color: var(--fda-gold); }
.fda-detail-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 5px 0; }
.fda-detail-tags span { padding: 0 7px; border: 1px solid #6b7f70; border-radius: 99px; font-size: 11px; color: #c9d3c5; }
.fda-detail-text { font-size: 12.5px; line-height: 1.35; color: #e5e7eb; }
.fda-detail-status { margin-top: 4px; font-size: 11.5px; line-height: 1.3; color: #b9c9bc; }

.fda-confirm, .fda-result { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 8, 6, .38); }
.fda-plaque { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: min(340px, 100%); box-sizing: border-box; padding: 20px 28px; background: var(--fda-panel); border: 1px solid var(--fda-gold-2); border-radius: 12px; box-shadow: 0 18px 60px rgba(0, 0, 0, .65); text-align: center; }
.fda-plaque-title { font: 700 44px/1.1 Georgia, serif; color: var(--fda-gold); }
.fda-plaque-title--small { font-size: 20px; }
.fda-plaque--win { border-color: #ffd98a; box-shadow: 0 0 44px rgba(255, 217, 138, .4), 0 18px 60px rgba(0, 0, 0, .65); }
.fda-plaque--win .fda-plaque-title { color: #ffd98a; }
.fda-plaque--lose { border-color: #7d6a5a; }
.fda-plaque--lose .fda-plaque-title { color: #c9534b; }
.fda-plaque-reward { font: 600 18px/1.3 Georgia, serif; color: var(--fda-gold-2); }
.fda-plaque-time { font-size: 13px; color: #b9c9bc; }
.fda-plaque-actions { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.fda-btn { min-height: 44px; min-width: 120px; padding: 0 18px; border-radius: 8px; border: 1px solid #78937d; background: #10241e; color: var(--fda-gold); font: 600 14px Georgia, serif; cursor: pointer; }
.fda-btn:hover { background: #1a3a2f; }
.fda-btn--primary { background: linear-gradient(180deg, #c99a3e, #8c6620); border-color: #f0deb3; color: #1a1205; }
.fda-btn--primary:hover { background: linear-gradient(180deg, #dcae52, #9b7226); }
.fda-btn--danger { background: #6b1f1f; border-color: #d96060; color: #ffe2e2; }
.fda-btn--danger:hover { background: #812727; }
.fda--ended .fda-hand, .fda--ended .fda-qi { filter: saturate(.5) brightness(.7); pointer-events: none; }

.fda--desktop .fda-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); align-items: start; gap: 12px; padding: 8px 56px 6px 14px; box-sizing: border-box; background: var(--fda-panel); border-bottom: 1px solid var(--fda-line); }
.fda--desktop .fda-plate { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fda--desktop .fda-plate--foe .fda-plate-line { flex-direction: row-reverse; }
.fda--desktop .fda-plate--foe .fda-chips { justify-content: flex-end; }
.fda--desktop .fda-chips { min-height: 26px; }
.fda--desktop .fda-center { display: flex; flex-direction: column; align-items: center; }
.fda--desktop .fda-clock { font: 700 34px/1.05 Georgia, serif; color: var(--fda-gold); }
.fda--desktop .fda-tier { font: 600 13px/1.2 Georgia, serif; color: var(--fda-gold-2); }
.fda--desktop .fda-foehand { display: flex; align-items: center; margin-right: auto; }
.fda-foehand-strip { display: flex; gap: 2px; }
.fda-foehand-strip .fate-battle-cardback { width: 11px; height: 16px; }
.fda--desktop .fda-flag { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid #78937d; border-radius: 7px; background: #10241e; color: var(--fda-gold-2); cursor: pointer; }
.fda--desktop .fda-flag:hover { background: #3b1b1b; border-color: #d96060; color: #ffd0d0; }
.fda--desktop .fda-lane { position: absolute; z-index: 2; left: 50%; bottom: calc(100% + 34px); width: min(460px, 38cqw); transform: translateX(-50%); display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.fda--desktop .fda-casts { flex-direction: column; align-items: stretch; justify-content: flex-end; }
.fda--desktop .fda-dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 8px 18px 12px; box-sizing: border-box; background: linear-gradient(180deg, rgba(13, 29, 24, .93), #0b1913 40%); border-top: 1px solid var(--fda-line); }
.fda--desktop .fda-hand-row { position: relative; display: flex; justify-content: center; }
.fda--desktop .fda-deck { position: absolute; left: 0; bottom: 2px; padding: 1px 9px; border: 1px solid #6b7f70; border-radius: 99px; font: 600 12px/1.5 Georgia, serif; color: var(--fda-gold-2); }
.fda--desktop .fda-hand { display: flex; justify-content: center; gap: 8px; min-height: calc(min(10cqw, 19cqh) * 1.4 + 24px); }
.fda--desktop .fda-card { width: min(10cqw, 19cqh); min-width: 72px; }
.fda--desktop .fda-card:not(.disabled):hover, .fda--desktop .fda-card:not(.disabled):focus-visible { transform: translateY(-10px); outline: none; filter: drop-shadow(0 0 7px #f0deb3); }
.fda--desktop .fda-key { position: absolute; top: 3%; left: 3%; width: 20px; height: 20px; border-radius: 4px; background: rgba(13, 29, 24, .92); border: 1px solid #8e7848; font-size: 11px; line-height: 18px; text-align: center; color: var(--fda-gold-2); }
.fda--desktop .fda-card-plate { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding-top: 3px; min-width: 0; }
.fda--desktop .fda-card-time { flex: 0 0 auto; font-size: 11px; color: #b9c9bc; }
.fda--desktop .fda-card-name { min-width: 0; }
