.deck-card-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.deck-card-modal[hidden] {
    display: none;
}

.deck-card-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.deck-card-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: 95vw;
    max-width: 580px;
    height: 78vh;
    padding: 0 16px 0;
    border-radius: 15px;
    border: 2px solid gold;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
    overflow: hidden;
}

.deck-card-modal-close {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0;
    background: #c62828;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.deck-card-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.deck-card-modal-title {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    width: calc(100% + 32px);
    margin: 0 -16px 12px;
    min-height: 46px;
    padding: 5px 72px 5px 8px;
    background: #111111;
    color: #ffffff;
    text-align: left;
    box-sizing: border-box;
    border-radius: 0;
}

.deck-card-modal-title-badge {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border: 1px solid rgba(255, 214, 102, 0.72);
    border-radius: 999px;
    background: rgba(255, 214, 102, 0.14);
    color: #ffe08c;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.deck-card-modal-title-badge[hidden] {
    display: none;
}

.deck-card-modal-title-main {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.deck-card-modal-title-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.7rem;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 640px) {
    .deck-card-modal-title {
        min-height: 44px;
        padding-right: 64px;
    }
}

.deck-card-modal-header {
    display: flex;
    align-items: center;
    justify-content: stretch;
    gap: 0;
    width: calc(100% + 32px);
    margin: 0 -16px;
}

.deck-card-modal-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 0;
    padding: 0;
    border-radius: 0;
    background: #f1f1f1;
    flex: 1 1 auto;
}

.deck-card-modal-tab {
    min-width: 0;
    min-height: 40px;
    padding: 8px 14px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #444444;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.deck-card-modal-tab.is-active {
    background: #111111;
    color: #ffffff;
}

.deck-card-modal-close:hover {
    background: #b71c1c;
}

.deck-card-modal-close:focus-visible,
.deck-card-modal-tab:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.deck-card-modal-panel {
    display: none;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

.deck-card-modal-panel.is-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.deck-card-modal-image-face-button[hidden],
.deck-card-modal-footer-control[hidden] {
    display: none !important;
}

.deck-card-modal-image-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: min(100%, 340px, calc((78vh - 210px) * 63 / 88));
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
}

.deck-card-modal-face-switcher {
    display: inline-flex;
    align-items: stretch;
    gap: 6px;
    align-self: stretch;
    justify-content: flex-end;
    min-height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(7, 7, 7, 0.8);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
    overflow: hidden;
}

.deck-card-modal-image-face-button {
    min-width: 52px;
    min-height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.76);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.deck-card-modal-image-face-button.is-active {
    background: #f4f4f4;
    color: #111111;
}

.deck-card-modal-image-face-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.deck-card-modal-face-switcher .deck-card-modal-image-face-button:not(.is-active):hover {
    color: #ffffff;
}

.deck-card-modal-footer {
    display: grid;
    grid-template-columns: fit-content(12rem) minmax(12rem, 1.35fr) auto;
    align-items: end;
    gap: 12px;
    width: calc(100% + 32px);
    margin: 12px -16px 0;
    padding: 12px 16px 14px;
    border-top: 1px solid #292929;
    background: #050505;
    box-sizing: border-box;
}

.deck-card-modal-footer-control {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#deck-card-modal-language-control {
    width: min(100%, 11.5rem);
}

#deck-card-modal-version-control {
    min-width: min(100%, 14rem);
}

.deck-card-modal-footer-select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 36px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: #131313;
    color: #f4f4f4;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #f4f4f4 50%), linear-gradient(135deg, #f4f4f4 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

#deck-card-modal-version-control .deck-card-modal-footer-select {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 42px;
}

.deck-card-modal-version-dropdown {
    position: relative;
    width: 100%;
}

.deck-card-modal-version-trigger {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 36px 0 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background-color: #131313;
    background-image: linear-gradient(45deg, transparent 50%, #f4f4f4 50%), linear-gradient(135deg, #f4f4f4 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    color: #f4f4f4;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.deck-card-modal-version-trigger-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deck-card-modal-version-trigger:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.deck-card-modal-version-dropdown.is-open .deck-card-modal-version-trigger {
    border-color: rgba(236, 190, 110, 0.55);
}

.deck-card-modal-version-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: #111111;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.42);
}

.deck-card-modal-version-menu[hidden] {
    display: none !important;
}

.deck-card-modal-version-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.deck-card-modal-version-option + .deck-card-modal-version-option {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.deck-card-modal-version-option:hover {
    background: rgba(236, 190, 110, 0.12);
    color: #ffffff;
}

.deck-card-modal-version-option.is-active {
    background: rgba(236, 190, 110, 0.16);
    color: #ffffff;
}

.deck-card-modal-version-option:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
}

.deck-card-modal-version-option-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deck-card-modal-footer-mark {
    position: absolute;
    left: 12px;
    top: 50%;
    z-index: 1;
    display: inline-block;
    width: 18px;
    min-width: 18px;
    height: 20px;
    transform: translateY(-50%);
    pointer-events: none;
    background: transparent;
}

.deck-card-modal-footer-mark[hidden] {
    display: none !important;
}

.deck-card-modal-footer-mark::before,
.deck-card-modal-footer-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.deck-card-modal-footer-mark::before {
    background: #fff;
}

.deck-card-modal-footer-mark::after {
    inset: 2px;
    background: #000;
}

.deck-card-modal-footer-mark.is-cf::after {
    background: linear-gradient(135deg, #f6f7fb 0%, #d4d8e2 28%, #8f97a7 55%, #eef1f6 78%, #bcc3d1 100%);
}

.deck-card-modal-footer-mark.is-rf::after {
    background: linear-gradient(135deg, #ff4f8b 0%, #ff9a3c 18%, #ffe45c 34%, #71ff8d 50%, #4dd6ff 66%, #6f6bff 82%, #ff5fe3 100%);
}

.deck-card-modal-footer-mark.is-gf::after {
    background: linear-gradient(135deg, #fff4c4 0%, #f1d36a 24%, #bb8522 52%, #f6dd84 76%, #8a5a11 100%);
}

.deck-card-modal-footer-mark.is-nf::after {
    background: #000;
}

.deck-card-modal-footer-select:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.deck-card-modal-image {
    display: block;
    order: 1;
    width: 100%;
    aspect-ratio: 63 / 88;
    height: auto;
    max-height: calc(78vh - 210px);
    border-radius: 20px;
    object-fit: contain;
    background: #0b0b0b;
}

.deck-card-modal-image-status {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.78);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.deck-card-modal-image-status[hidden] {
    display: none !important;
}

.deck-card-modal-image[hidden],
.deck-card-modal-image-placeholder[hidden] {
    display: none !important;
}

.deck-card-modal-image-placeholder {
    display: flex;
    order: 1;
    width: 100%;
    aspect-ratio: 63 / 88;
    max-height: calc(78vh - 210px);
    min-height: 0;
    padding: 28px;
    border: 1px solid rgba(17, 17, 17, 0.14);
    border-radius: 18px;
    background: linear-gradient(180deg, #f6f4ef 0%, #ece7dc 100%);
    color: #3e3a34;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    box-sizing: border-box;
}

.deck-card-modal-image-placeholder-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.deck-card-modal-image-placeholder-text {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.deck-card-modal-text {
    order: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 0;
    border: 1px solid #292929;
    border-radius: 18px;
    background: #050505;
    color: #f3f3f3;
    box-sizing: border-box;
}

.deck-card-modal-recording {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding: 0;
    border: 1px solid #292929;
    border-radius: 18px;
    background: #050505;
    color: #f3f3f3;
    box-sizing: border-box;
}

.deck-card-modal-text-empty {
    padding: 18px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.7;
}

.deck-card-modal-cv-layout {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.deck-card-modal-cv-row {
    display: grid;
    grid-template-columns: minmax(84px, auto) minmax(0, 1fr) minmax(84px, auto);
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #292929;
    background: #101010;
}

.deck-card-modal-cv-row--secondary {
    grid-template-columns: 55px minmax(0, 1fr) 55px;
    min-height: auto;
    align-items: stretch;
}

.deck-card-modal-cv-row--secondary .deck-card-modal-cv-stat-group {
    width: 55px;
    justify-content: center;
}

.deck-card-modal-cv-row--secondary .deck-card-modal-cv-stat-group.is-right {
    justify-content: center;
}

.deck-card-modal-cv-row--secondary.is-split {
    position: relative;
}

.deck-card-modal-cv-row--secondary.is-split::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #292929;
    transform: translateX(-0.5px);
    pointer-events: none;
}

.deck-card-modal-cv-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px 14px;
    border-bottom: 1px solid #292929;
    background: #0b0b0b;
}

.deck-card-modal-cv-meta-row.is-split {
    position: relative;
}

.deck-card-modal-cv-meta-row.is-split::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #292929;
    transform: translateX(-0.5px);
    pointer-events: none;
}

.deck-card-modal-cv-rarity-badge {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.deck-card-modal-cv-rarity-badge.is-b,
.deck-card-modal-cv-rarity-badge.is-t,
.deck-card-modal-cv-rarity-badge.is-c {
    background: #8c8c8c;
}

.deck-card-modal-cv-rarity-badge.is-r {
    background: #2f69d8;
}

.deck-card-modal-cv-rarity-badge.is-s {
    background: #7d46c7;
}

.deck-card-modal-cv-rarity-badge.is-m {
    background: #cf3f38;
}

.deck-card-modal-cv-rarity-badge.is-l,
.deck-card-modal-cv-rarity-badge.is-f {
    background: #e6892e;
}

.deck-card-modal-cv-rarity-badge.is-p {
    background: #2f9a4b;
}

.deck-card-modal-cv-rarity-badge.is-mv {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 18px solid #7d46c7;
    border-radius: 0;
}

.deck-card-modal-cv-meta-line {
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: #f3f3f3;
    text-wrap: balance;
    word-break: break-word;
}

.deck-card-modal-cv-stat-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
}

.deck-card-modal-cv-stat-group.is-right {
    justify-content: flex-end;
}

.deck-card-modal-cv-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    color: #f5f5f5;
}

.deck-card-modal-cv-stat.is-trailing-icon {
    flex-direction: row;
}

.deck-card-modal-cv-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.65rem;
    font-weight: 600;
    overflow: hidden;
}

.deck-card-modal-cv-stat-icon.is-image-icon {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.deck-card-modal-cv-stat-icon-image {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.deck-card-modal-cv-stat-icon.is-pitch {
    background: linear-gradient(135deg, #3d4f24, #7c9b2f);
}

.deck-card-modal-cv-stat-icon.is-cost {
    background: linear-gradient(135deg, #49311a, #af6b1b);
}

.deck-card-modal-cv-stat-icon.is-image-icon.is-pitch,
.deck-card-modal-cv-stat-icon.is-image-icon.is-cost,
.deck-card-modal-cv-stat-icon.is-image-icon.is-intellect,
.deck-card-modal-cv-stat-icon.is-image-icon.is-life,
.deck-card-modal-cv-stat-icon.is-image-icon.is-power,
.deck-card-modal-cv-stat-icon.is-image-icon.is-defense {
    background: transparent;
    border: none;
    box-shadow: none;
}

.deck-card-modal-cv-stat-icon.is-intellect {
    background: linear-gradient(135deg, #2b375f, #4b73d1);
}

.deck-card-modal-cv-stat-icon.is-life {
    background: linear-gradient(135deg, #5b1e23, #cb4d57);
}

.deck-card-modal-cv-stat-icon.is-power {
    background: linear-gradient(135deg, #4a2812, #d06d2c);
}

.deck-card-modal-cv-stat-icon.is-defense {
    background: linear-gradient(135deg, #14382b, #2c9c7b);
}

.deck-card-modal-cv-stat-icon.is-quantity {
    background: linear-gradient(135deg, #3a2b4f, #8a62c5);
}

.deck-card-modal-cv-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.deck-card-modal-cv-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}

.deck-card-modal-cv-title {
    width: 100%;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-wrap: balance;
}

.deck-card-modal-cv-title-sub {
    width: 100%;
    font-size: 0.76rem;
    line-height: 1.25;
    text-align: center;
    color: rgba(255, 255, 255, 0.68);
}

.deck-card-modal-cv-body {
    flex: 1 1 auto;
    padding: 16px 16px 18px;
    border-bottom: 1px solid #292929;
    background: #0d0d0d;
}

.deck-card-modal-cv-body.is-split {
    position: relative;
    padding: 0;
}

.deck-card-modal-cv-body.is-split::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #292929;
    transform: translateX(-0.5px);
    pointer-events: none;
}

.deck-card-modal-cv-meld-row {
    padding: 10px 16px;
    border-bottom: 1px solid #292929;
    background: #141414;
}

.deck-card-modal-cv-meld-text {
    font-size: 0.82rem;
    line-height: 1.35;
    color: #f0f0f0;
}

.deck-card-modal-cv-meld-text strong {
    font-weight: 800;
}

.deck-card-modal-cv-text-panel[hidden] {
    display: none;
}

.deck-card-modal-cv-text-panel.is-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.deck-card-modal-cv-text-panel.is-split[hidden] {
    display: none;
}

.deck-card-modal-cv-split-column {
    min-width: 0;
    padding: 16px 16px 18px;
}

.deck-card-modal-cv-split-column.is-right {
    border-left: none;
}

.deck-card-modal-cv-text-paragraph {
    margin: 0;
    color: #f3f3f3;
    font-size: 0.9rem;
    line-height: 1.1;
    white-space: pre-wrap;
    word-break: break-word;
}

.deck-card-modal-cv-text-paragraph + .deck-card-modal-cv-text-paragraph {
    margin-top: 10px;
}

.deck-card-modal-cv-text-paragraph strong {
    font-weight: 800;
}

.deck-card-modal-inline-icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    margin: 0 0.08em;
    vertical-align: -0.16em;
    object-fit: contain;
}

.deck-card-modal-cv-type-line {
    min-width: 0;
    padding: 0 2px;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-wrap: balance;
    color: #f0f0f0;
}

.deck-card-modal-cv-type-line.is-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    align-items: stretch;
}

.deck-card-modal-cv-type-segment {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 14px;
    text-wrap: balance;
}

.deck-card-modal-cv-type-segment.is-left {
    justify-content: center;
    text-align: center;
}

.deck-card-modal-cv-type-segment.is-right {
    border-left: 1px solid #292929;
    justify-content: center;
    text-align: center;
}

.deck-card-modal-cv-row--secondary.is-split .deck-card-modal-cv-type-segment.is-right {
    border-left: none;
}

.deck-card-modal-cv-variant-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #292929;
    background: #000000;
}

.deck-card-modal-cv-variant-button {
    min-height: 48px;
    padding: 12px;
    border: none;
    background: #111111;
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.deck-card-modal-cv-variant-button + .deck-card-modal-cv-variant-button {
    border-left: 1px solid #292929;
}

.deck-card-modal-cv-variant-button.is-active {
    background: #000000;
    color: #ffffff;
}

.deck-card-modal-cv-variant-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
}

.deck-card-modal-recording-layout {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0 18px 18px;
    background: #0d0d0d;
    box-sizing: border-box;
}

.deck-card-modal-recording-language-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 0 10px;
    border-bottom: 1px solid #2a2a2a;
}

.deck-card-modal-recording-language-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 34px;
    padding: 0 0 6px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.deck-card-modal-recording-language-tab:hover {
    border-color: rgba(236, 190, 110, 0.45);
    color: #ffffff;
}

.deck-card-modal-recording-language-tab.is-active {
    border-color: rgba(236, 190, 110, 0.82);
    color: #ffffff;
}

.deck-card-modal-recording-language-tab:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.deck-card-modal-recording-list {
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding-bottom: 12px;
}

.deck-card-modal-recording-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 8px;
    border-top: 1px solid #462f1a;
    color: rgba(243, 243, 243, 0.82);
    transition: background 0.18s ease, color 0.18s ease;
}

.deck-card-modal-recording-item:hover {
    background: rgba(42, 35, 27, 0.72);
    color: #ffffff;
}

.deck-card-modal-recording-item-title {
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
    color: #f5f5f5;
    word-break: break-word;
}

.deck-card-modal-recording-item-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.deck-card-modal-recording-item-title-link:hover,
.deck-card-modal-recording-item-title-link:focus-visible {
    color: #ecbe6e;
}

.deck-card-modal-recording-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.deck-card-modal-recording-item-code {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.78);
    word-break: break-word;
    white-space: nowrap;
}

.deck-card-modal-recording-item-mark {
    position: relative;
    display: inline-block;
    width: 18px;
    min-width: 18px;
    height: 20px;
    background: transparent;
}

.deck-card-modal-recording-item-mark::before,
.deck-card-modal-recording-item-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.deck-card-modal-recording-item-mark::before {
    background: #fff;
}

.deck-card-modal-recording-item-mark::after {
    inset: 2px;
    background: #000;
}

.deck-card-modal-recording-item-mark.is-cf::after {
    background: linear-gradient(135deg, #f6f7fb 0%, #d4d8e2 28%, #8f97a7 55%, #eef1f6 78%, #bcc3d1 100%);
}

.deck-card-modal-recording-item-mark.is-rf::after {
    background: linear-gradient(135deg, #ff4f8b 0%, #ff9a3c 18%, #ffe45c 34%, #71ff8d 50%, #4dd6ff 66%, #6f6bff 82%, #ff5fe3 100%);
}

.deck-card-modal-recording-item-mark.is-gf::after {
    background: linear-gradient(135deg, #fff4c4 0%, #f1d36a 24%, #bb8522 52%, #f6dd84 76%, #8a5a11 100%);
}

.deck-card-modal-recording-item-mark.is-nf::after {
    background: #000;
}

@media (max-width: 640px) {
    .deck-card-modal-image-stage {
        width: min(100%, 300px, calc((78vh - 220px) * 63 / 88));
    }

    .deck-card-modal-face-switcher {
        gap: 4px;
        min-height: 38px;
    }

    .deck-card-modal-image,
    .deck-card-modal-image-placeholder {
        max-height: calc(78vh - 220px);
    }

    .deck-card-modal-image-face-button {
        min-width: 46px;
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .deck-card-modal-cv-row {
        grid-template-columns: minmax(56px, auto) minmax(0, 1fr) minmax(56px, auto);
        gap: 5px;
        padding: 5px 5px;
    }

    .deck-card-modal-cv-row--secondary {
        grid-template-columns: 55px minmax(0, 1fr) 55px;
    }

    .deck-card-modal-cv-stat-group {
        gap: 6px;
        flex-wrap: wrap;
    }

    .deck-card-modal-cv-stat {
        gap: 5px;
    }

    .deck-card-modal-cv-stat-icon {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }

    .deck-card-modal-cv-stat-icon-image {
        width: 18px;
        height: 18px;
    }

    .deck-card-modal-cv-stat-value {
        font-size: 0.8rem;
    }

    .deck-card-modal-cv-title {
        font-size: 0.95rem;
    }

    .deck-card-modal-cv-title-sub {
        font-size: 0.7rem;
    }

    .deck-card-modal-cv-type-line {
        font-size: 0.65rem;
        line-height: 1.3;
    }

    .deck-card-modal-recording-layout {
        padding: 0 12px 12px;
    }

    .deck-card-modal-footer {
        grid-template-columns: minmax(5.8rem, 0.9fr) minmax(7rem, 1.1fr) auto;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
        padding: 10px 12px 12px;
    }

    .deck-card-modal-footer-select {
        min-height: 36px;
        padding: 0 28px 0 10px;
        font-size: 0.76rem;
        background-position: calc(100% - 15px) calc(50% - 2px), calc(100% - 10px) calc(50% - 2px);
        background-size: 5px 5px, 5px 5px;
    }

    #deck-card-modal-language-control,
    #deck-card-modal-version-control {
        width: auto;
        min-width: 0;
    }

    #deck-card-modal-language-control {
        min-width: 5.8rem;
    }

    #deck-card-modal-version-control {
        min-width: 7rem;
    }

    .deck-card-modal-version-trigger {
        min-height: 36px;
        padding: 0 28px 0 32px;
        font-size: 0.76rem;
        background-position: calc(100% - 15px) calc(50% - 2px), calc(100% - 10px) calc(50% - 2px);
        background-size: 5px 5px, 5px 5px;
    }

    .deck-card-modal-footer-mark {
        left: 10px;
        top: 18px;
        width: 16px;
        min-width: 16px;
        height: 18px;
    }

    .deck-card-modal-version-menu {
        left: auto;
        right: 0;
        min-width: 100%;
    }

    .deck-card-modal-face-switcher {
        justify-content: flex-end;
        min-height: 36px;
        gap: 4px;
        justify-self: end;
    }

    .deck-card-modal-face-switcher .deck-card-modal-image-face-button {
        flex: 0 0 auto;
        min-width: 40px;
        min-height: 36px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .deck-card-modal-recording-item {
        align-items: flex-start;
        gap: 8px;
        padding: 12px 4px;
    }

    .deck-card-modal-recording-language-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 12px 0 10px;
    }

    .deck-card-modal-recording-language-tab {
        flex: 0 0 auto;
        min-height: 32px;
        font-size: 0.88rem;
    }

    .deck-card-modal-recording-item-meta {
        gap: 8px;
    }

    .deck-card-modal-recording-item-title {
        font-size: 0.89rem;
    }

    .deck-card-modal-recording-item-code {
        font-size: 0.76rem;
    }
}

body.is-modal-open {
    overflow: hidden;
}