.duel-section {
    max-width: 780px;
    margin: 0 auto;
}

.lang-switch {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lang-btn {
    font: 600 11px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    letter-spacing: .06em;
    color: var(--text-dim, #a8adb5);
    background: var(--control-bg, rgba(238,238,238,.05));
    border: 1px solid var(--control-outline, rgba(238,238,238,.14));
    border-radius: var(--pill, 999px);
    padding: 4px 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.lang-btn:hover {
    color: var(--text, #e8e8e8);
    border-color: var(--stroke-strong, #4a5261);
}

.lang-btn.on {
    color: var(--text, #e8e8e8);
    border-color: var(--text, #e8e8e8);
    background: var(--card-hover, rgba(238,238,238,.07));
}

.duel-section .hidden {
    display: none !important;
}

.duel-intro {
    max-width: 680px;
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0 0 18px;
}

.duel-stage {
    position: relative;
}

.duel-arena {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: stretch;
}

.fighter {
    position: relative;
    background: var(--card, #22262e);
    border: 1px solid var(--stroke, #343a44);
    border-radius: var(--r-md, 14px);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    transition: border-color .3s ease;
}

.fighter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fighter-name {
    font-weight: 800;
    font-size: 15px;
}

.weapon-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-dim, #a8adb5);
}

.weapon-name {
    font-weight: 600;
    color: var(--text, #e8e8e8);
}

.weapon-atk {
    font: 600 11px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: var(--text-faint, #6b7280);
    white-space: nowrap;
}

.fx-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.fx-chip {
    font: 600 10px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    padding: 2px 8px;
    border-radius: var(--pill, 999px);
    border: 1px solid var(--stroke-strong, #4a5261);
    background: rgba(95, 127, 180, .16);
    color: #b7cbec;
    white-space: nowrap;
}

.fighter-player .fx-chip {
    background: rgba(255, 112, 67, .16);
    color: #ffc9b0;
}

.bar {
    position: relative;
    height: 22px;
    background: var(--bg-dark, #191d23);
    border: 1px solid var(--stroke, #343a44);
    border-radius: var(--pill, 999px);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    transition: width .45s cubic-bezier(.22, .68, .32, 1);
}

.bar-hp .bar-fill {
    background: linear-gradient(100deg, #ff5722, #ff7043 55%, #ff8a50);
}

.fighter-bot .bar-hp .bar-fill {
    background: linear-gradient(100deg, #3b537a, #5f7fb4);
}

.bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 600 11px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: var(--text, #e8e8e8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.vs-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 4px;
}

.vs {
    font: 800 20px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    background: var(--grad, linear-gradient(100deg, #ff7043, #edc850));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.round-chip {
    font-size: 12px;
    color: var(--text-dim, #a8adb5);
    background: var(--control-bg, rgba(238,238,238,.05));
    border: 1px solid var(--control-outline, rgba(238,238,238,.14));
    padding: 3px 10px;
    border-radius: var(--pill, 999px);
    white-space: nowrap;
}

.round-chip b {
    color: var(--text, #e8e8e8);
}

.timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 110px;
}

.timer-bar {
    width: 100%;
    height: 8px;
    border-radius: var(--pill, 999px);
    background: var(--bg-dark, #191d23);
    border: 1px solid var(--stroke, #343a44);
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(100deg, #d9a53f, #edc850);
    transition: width .25s linear;
}

.timer.urgent .timer-fill {
    background: linear-gradient(100deg, #c62828, #ef5350);
    animation: duel-urgent-pulse 1s ease-in-out infinite;
}

@keyframes duel-urgent-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

.timer-text {
    font: 600 11px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: var(--text-dim, #a8adb5);
    white-space: nowrap;
}

.break-banner {
    margin-top: 12px;
    padding: 10px 14px;
    text-align: center;
    font: 600 13px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: #edc850;
    background: rgba(217, 165, 63, .10);
    border: 1px dashed rgba(217, 165, 63, .45);
    border-radius: var(--r-sm, 10px);
}

.duel-log-wrap {
    margin-top: 14px;
    background: var(--card, #22262e);
    border: 1px solid var(--stroke, #343a44);
    border-radius: var(--r-sm, 10px);
    padding: 12px 14px;
}

.duel-log-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-faint, #6b7280);
    margin-bottom: 8px;
}

.duel-log {
    max-height: 170px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font: 12.5px/1.5 var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
}

.log-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 3px 9px;
    border-radius: 8px;
    background: rgba(238, 238, 238, .03);
}

.log-round {
    color: var(--text-faint, #6b7280);
    flex: none;
    width: 36px;
}

.log-actor {
    flex: none;
    font-weight: 700;
    width: 34px;
}

.log-row.side-player .log-actor { color: #ffb195; }
.log-row.side-bot .log-actor { color: #9db8e2; }

.log-action {
    font-weight: 600;
    color: var(--text, #e8e8e8);
}

.log-note {
    margin-left: auto;
    color: var(--text-dim, #a8adb5);
    text-align: right;
}

.duel-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offers-hint {
    font-size: 12.5px;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.offers-grid.hidden {
    visibility: hidden;
}

.offer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 13px 11px;
    background: var(--control-bg, rgba(238,238,238,.05));
    border: 1px solid var(--control-outline, rgba(238,238,238,.14));
    border-radius: var(--r-sm, 10px);
    cursor: pointer;
    font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    color: var(--text, #e8e8e8);
    text-align: left;
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), border-color .2s ease,
        background .2s ease, opacity .2s ease;
}

.offer-card:hover:not(:disabled) {
    transform: translateY(-2px);
    background: var(--card-hover, rgba(238,238,238,.07));
}

.offer-card.kind-attack:hover:not(:disabled) {
    border-color: rgba(255, 112, 67, .5);
}

.offer-card.kind-defense:hover:not(:disabled) {
    border-color: rgba(95, 127, 180, .55);
}

.offer-card.kind-buff:hover:not(:disabled) {
    border-color: rgba(237, 200, 80, .55);
}

.offer-card.kind-magic:hover:not(:disabled) {
    border-color: rgba(160, 110, 220, .55);
}

.offer-card.picked {
    border-color: var(--text, #e8e8e8);
    background: var(--card-hover, rgba(238,238,238,.07));
    transform: translateY(-2px);
}

.offer-card:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.offer-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.offer-name {
    font-weight: 700;
    font-size: 13.5px;
}

.offer-kind {
    font: 600 9.5px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint, #6b7280);
    white-space: nowrap;
}

.offer-desc {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-dim, #a8adb5);
}

.offer-key {
    position: absolute;
    top: 6px;
    right: 8px;
    font: 600 10px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: var(--text-faint, #6b7280);
    border: 1px solid var(--stroke, #343a44);
    border-radius: 6px;
    padding: 1px 5px;
}

.offer-badge {
    position: absolute;
    top: 5px;
    left: 7px;
    min-width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    font: 700 11px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: var(--bg-dark, #191d23);
    background: var(--text, #e8e8e8);
    border-radius: 50%;
}

.offer-card.picked .offer-badge {
    display: inline-flex;
}

.duel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.duel-rules {
    margin-top: 16px;
    background: var(--card, #22262e);
    border: 1px solid var(--stroke, #343a44);
    border-radius: var(--r-sm, 10px);
    padding: 10px 16px;
}

.duel-rules summary {
    cursor: pointer;
    font-size: 13px;
}

.duel-rules-body {
    padding-top: 8px;
}

.duel-rules-body ul {
    margin: 0;
    padding-left: 18px;
}

.duel-rules-body li {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.5;
}

.duel-rules-body b {
    color: var(--text, #e8e8e8);
}

.duel-overlay {
    position: absolute;
    inset: -8px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 24, 30, .74);
    backdrop-filter: blur(3px);
    border-radius: var(--r-md, 14px);
    transition: opacity .3s ease;
}

.duel-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.duel-overlay-card {
    width: min(560px, 100%);
    max-height: calc(100% + 8px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 26px;
    text-align: center;
    background: rgba(34, 40, 49, .96);
    border: 1px solid var(--stroke-strong, #4a5261);
    border-radius: var(--r-lg, 18px);
    box-shadow: var(--shadow-pop, 0 18px 60px rgba(0,0,0,.5));
}

.duel-overlay-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--text, #e8e8e8);
}

.duel-overlay-title.result-won {
    background: var(--grad, linear-gradient(100deg, #ff7043, #edc850));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.duel-overlay-title.result-lost {
    color: #e27272;
}

.duel-overlay-title.result-draw {
    color: var(--text-dim, #a8adb5);
}

.duel-overlay-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
}

.duel-cooldown {
    margin: 0;
    font: 600 13px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: #ffc9b0;
}

.weapon-picker {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.weapon-picker.hidden {
    display: none;
}

.picker-title {
    font: 700 12px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-dim, #a8adb5);
}

.picker-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    font: 600 11.5px var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    color: var(--text-dim, #a8adb5);
    background: var(--control-bg, rgba(238,238,238,.05));
    border: 1px solid var(--control-outline, rgba(238,238,238,.14));
    border-radius: var(--pill, 999px);
    padding: 4px 12px;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.filter-chip.on {
    color: var(--text, #e8e8e8);
    border-color: var(--text, #e8e8e8);
    background: var(--card-hover, rgba(238,238,238,.07));
}

.weapon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.wcard {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 10px;
    background: var(--control-bg, rgba(238,238,238,.05));
    border: 1px solid var(--control-outline, rgba(238,238,238,.14));
    border-radius: var(--r-sm, 10px);
    cursor: pointer;
    font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    color: var(--text, #e8e8e8);
    text-align: left;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.wcard:hover {
    background: var(--card-hover, rgba(238,238,238,.07));
}

.wcard.armed {
    border-color: var(--text, #e8e8e8);
    transform: translateY(-1px);
}

.wcard.r-legendary { border-left: 3px solid #edc850; }
.wcard.r-epic { border-left: 3px solid #b07fe0; }
.wcard.r-rare { border-left: 3px solid #5f7fb4; }
.wcard.r-common { border-left: 3px solid rgba(238, 238, 238, .35); }

.wcard-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.wcard-name {
    font-weight: 700;
    font-size: 12.5px;
    line-height: 1.3;
}

.wcard-atk {
    font: 700 12px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: #edc850;
    white-space: nowrap;
}

.wcard-tag {
    font: 600 9.5px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint, #6b7280);
}

.wcard-desc {
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--text-dim, #a8adb5);
}

.picker-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.picker-selected {
    font-size: 12px;
}

.fighter.hit {
    animation: duel-hit-shake .4s ease;
}

@keyframes duel-hit-shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
        border-color: rgba(255, 87, 34, .6);
    }

    75% {
        transform: translateX(4px);
        border-color: rgba(255, 87, 34, .6);
    }
}

.float-dmg {
    position: absolute;
    top: 14px;
    left: 50%;
    font: 700 16px var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    pointer-events: none;
    z-index: 20;
    animation: duel-float-up .9s ease-out forwards;
}

.float-dmg.damage {
    color: #ff6b57;
}

.float-dmg.heal {
    color: #6ee7a0;
}

@keyframes duel-float-up {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -28px);
    }
}

@media (max-width: 700px) {
    .duel-arena {
        grid-template-columns: 1fr;
    }

    .vs-block {
        flex-direction: row;
        justify-content: center;
        padding: 2px 0;
    }

    .offers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .weapon-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .duel-overlay {
        inset: -8px;
    }

    .duel-overlay-card {
        margin: 0 10px;
    }
}
