:root {
    color-scheme: dark;
    --v2-bg: #111111;
    --v2-bg-start: #171717;
    --v2-surface: #1b1b1b;
    --v2-surface-2: #242424;
    --v2-surface-3: #303030;
    --v2-panel-bg: rgba(27, 27, 27, .96);
    --v2-soft-bg: rgba(255, 255, 255, .03);
    --v2-soft-bg-2: rgba(255, 255, 255, .025);
    --v2-line: #3b3b3b;
    --v2-text: #f4f1ea;
    --v2-muted: #b8b0a4;
    --v2-faint: #857d73;
    --v2-accent: #e0b45b;
    --v2-teal: #5bbeb0;
    --v2-red: #d96969;
    --v2-purple: #b989d6;
    --v2-control-scheme: dark;
}

:root[data-theme="light"] {
    color-scheme: light;
    --v2-bg: #f4efe4;
    --v2-bg-start: #fff8ec;
    --v2-surface: #fffaf2;
    --v2-surface-2: #f0e7d8;
    --v2-surface-3: #e3d7c6;
    --v2-panel-bg: rgba(255, 250, 242, .94);
    --v2-soft-bg: rgba(32, 36, 43, .045);
    --v2-soft-bg-2: rgba(32, 36, 43, .035);
    --v2-line: #d3c5b1;
    --v2-text: #241f19;
    --v2-muted: #685d4d;
    --v2-faint: #9b8f7d;
    --v2-accent: #b97917;
    --v2-teal: #247d73;
    --v2-red: #b24141;
    --v2-purple: #8052a4;
    --v2-control-scheme: light;
    --v2-list-card-gradient: linear-gradient(105deg, rgba(255, 250, 242, .98) 0%, rgba(255, 250, 242, .94) 58%, rgba(224, 180, 91, .18) 100%);
    --v2-tournament-card-gradient: linear-gradient(125deg, rgba(255, 250, 242, .98), rgba(255, 250, 242, .93) 62%, rgba(91, 190, 176, .16));
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--v2-text);
    background:
        linear-gradient(180deg, var(--v2-bg-start) 0, var(--v2-bg) 260px),
        var(--v2-bg);
    font-family: "Pretendard Variable", "Noto Sans KR", sans-serif;
    font-weight: 500;
    word-break: keep-all;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    margin: 0;
}

img {
    display: block;
}

.v2-shell {
    width: min(1320px, calc(100% - 32px));
    margin-right: auto;
    margin-left: auto;
}

.v2-header {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 76px;
    padding: 16px 0;
}

.v2-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 172px;
}

.v2-brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(224, 180, 91, .7);
    border-radius: 8px;
    color: #111;
    background: var(--v2-accent);
    font-weight: 900;
}

.v2-brand strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1;
}

.v2-brand small {
    color: var(--v2-muted);
    font-size: .75rem;
}

.v2-header-menu {
    display: flex;
    flex: 1;
    gap: 20px;
    align-items: center;
    min-width: 0;
}

.v2-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-soft-bg);
}

.v2-menu-toggle > span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .16s ease, opacity .16s ease;
}

.v2-menu-toggle[aria-expanded="true"] > span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.v2-menu-toggle[aria-expanded="true"] > span:nth-child(2) {
    opacity: 0;
}

.v2-menu-toggle[aria-expanded="true"] > span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.v2-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.v2-nav a,
.v2-account a,
.v2-theme-toggle,
.v2-language-select,
.v2-button,
.v2-soft-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-soft-bg);
    font-size: .92rem;
}

.v2-nav a:hover,
.v2-account a:hover,
.v2-theme-toggle:hover,
.v2-language-select:hover,
.v2-button:hover,
.v2-soft-link:hover {
    border-color: var(--v2-accent);
    color: var(--v2-accent);
}

.v2-account {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v2-theme-toggle {
    cursor: pointer;
    font: inherit;
}

.v2-language-form {
    margin: 0;
}

.v2-language-select {
    min-width: 96px;
    cursor: pointer;
    font: inherit;
    appearance: none;
}

.v2-language-select option {
    color: #1e1b16;
    background: #fffaf0;
}

.v2-content {
    padding: 20px 0 56px;
}

.v2-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0 32px;
    border-top: 1px solid var(--v2-line);
    color: var(--v2-faint);
    font-size: .86rem;
}

.v2-page-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 18px;
}

.v2-kicker {
    color: var(--v2-accent);
    font-size: .82rem;
    font-weight: 800;
}

.v2-title {
    margin: 4px 0 0;
    color: var(--v2-text);
    font-size: 2rem;
    font-weight: 900;
}

.v2-subtitle {
    max-width: 680px;
    margin-top: 8px;
    color: var(--v2-muted);
    font-size: .98rem;
}

.v2-panel {
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-panel-bg);
}

.v2-error-wrap {
    display: grid;
    grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    max-width: 860px;
    margin: clamp(32px, 8vh, 88px) auto;
}

.v2-error-code {
    display: grid;
    place-items: center;
    min-height: 220px;
    border: 1px solid rgba(224, 180, 91, .46);
    border-radius: 8px;
    color: var(--v2-accent);
    background:
        linear-gradient(150deg, rgba(224, 180, 91, .12), rgba(91, 190, 176, .08)),
        var(--v2-surface);
    font-size: clamp(2.4rem, 8vw, 5.4rem);
    font-weight: 900;
    line-height: 1;
}

.v2-error-panel {
    display: grid;
    align-content: center;
    gap: 14px;
    padding: clamp(18px, 4vw, 32px);
}

.v2-error-panel .v2-title {
    font-size: clamp(1.45rem, 4vw, 2.25rem);
}

.v2-error-actions,
.v2-error-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-error-suggestions {
    padding-top: 2px;
}

.v2-error-suggestions a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    font-size: .9rem;
    font-weight: 800;
}

.v2-error-suggestions a:hover {
    border-color: var(--v2-accent);
    color: var(--v2-accent);
}

.v2-search-panel {
    padding: 14px;
    margin-bottom: 18px;
}

.v2-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
}

.v2-search-row input[type="text"],
.v2-search-row input[type="number"],
.v2-filter-grid input[type="number"],
.v2-filter-grid select,
.v2-search-row select,
.v2-collection-filter-grid select,
.v2-tag-form input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    color-scheme: var(--v2-control-scheme);
}

.v2-search-row select option,
.v2-filter-grid select option,
.v2-collection-filter-grid select option {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-search-row select option:checked,
.v2-filter-grid select option:checked,
.v2-collection-filter-grid select option:checked {
    color: #111;
    background: var(--v2-accent);
}

.v2-search-row input::placeholder,
.v2-tag-form input::placeholder {
    color: var(--v2-faint);
}

.v2-button {
    cursor: pointer;
}

.v2-button:disabled,
.v2-button[disabled],
.v2-button[aria-busy="true"] {
    border-color: rgba(133, 125, 115, .35);
    color: var(--v2-faint);
    background: rgba(255, 255, 255, .035);
    cursor: wait;
    opacity: .72;
}

.v2-button:disabled:hover,
.v2-button[disabled]:hover,
.v2-button[aria-busy="true"]:hover {
    border-color: rgba(133, 125, 115, .35);
    color: var(--v2-faint);
    background: rgba(255, 255, 255, .035);
}

.v2-button-primary {
    border-color: rgba(224, 180, 91, .8);
    color: #111;
    background: var(--v2-accent);
    font-weight: 800;
}

.v2-button-primary:hover {
    color: #111;
    background: #efc978;
}

.v2-filter-grid {
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.v2-filter-grid.is-open {
    display: grid;
}

.v2-filter-box {
    min-height: 100%;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-filter-wide {
    grid-column: span 2;
}

.v2-filter-box > label,
.v2-filter-label {
    display: block;
    margin-bottom: 8px;
    color: var(--v2-muted);
    font-size: .84rem;
    font-weight: 800;
}

.검색체크 {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

input.검색체크 {
    display: none;
}

.검색체크 > div > label,
.v2-check-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
    cursor: pointer;
    font-size: .86rem;
}

label:has(> input.검색체크:checked) {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.v2-card-tile {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-card-tile:hover {
    border-color: rgba(224, 180, 91, .75);
    transform: translateY(-1px);
}

.v2-card-img {
    position: relative;
    background: var(--v2-surface-3);
}

.v2-card-img::after,
.v2-detail-image::after,
.v2-related-image::after,
.v2-qna-related-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 2px var(--v2-surface);
}

.v2-card-img img {
    width: 100%;
    height: auto;
}

.v2-unreleased {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 4px 8px;
    border-radius: 8px;
    color: #fff;
    background: var(--v2-red);
    font-size: .78rem;
    font-weight: 800;
}

.v2-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 12px;
}

.v2-card-character {
    color: var(--v2-muted);
    font-size: .86rem;
    line-height: 1.25;
}

.v2-card-name {
    margin: 0;
    color: var(--v2-text);
    font-size: 1.14rem;
    font-weight: 900;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-chip-row,
.v2-metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-chip,
.v2-metric {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
    font-size: .82rem;
}

.v2-metric strong {
    margin-left: 5px;
    color: var(--v2-text);
}

.v2-type-공격 {
    border-color: rgba(217, 105, 105, .55);
    color: #ffd2d2;
}

.v2-type-수비 {
    border-color: rgba(91, 190, 176, .55);
    color: #c5fff6;
}

.v2-type-특수,
.v2-type-특성 {
    border-color: rgba(185, 137, 214, .55);
    color: #efd9ff;
}

:root[data-theme="light"] .v2-type-공격 {
    border-color: rgba(178, 65, 65, .5);
    color: #872424;
    background: rgba(217, 105, 105, .16);
}

:root[data-theme="light"] .v2-type-수비 {
    border-color: rgba(36, 125, 115, .5);
    color: #145f58;
    background: rgba(91, 190, 176, .16);
}

:root[data-theme="light"] .v2-type-특수,
:root[data-theme="light"] .v2-type-특성 {
    border-color: rgba(128, 82, 164, .5);
    color: #5f367e;
    background: rgba(185, 137, 214, .16);
}

.v2-card-text {
    display: -webkit-box;
    overflow: hidden;
    color: var(--v2-muted);
    font-size: .88rem;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.v2-tagline {
    display: -webkit-box;
    overflow: hidden;
    margin-top: auto;
    color: var(--v2-faint);
    font-size: .8rem;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.v2-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.v2-pagination a {
    display: grid;
    place-items: center;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface);
}

.v2-pagination .active a,
.v2-pagination a:hover {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-detail-grid {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.v2-detail-card {
    overflow: hidden;
}

.v2-detail-image {
    position: relative;
    background: var(--v2-surface-2);
}

.v2-detail-image img {
    width: 100%;
    transition: opacity .16s ease;
}

.v2-detail-image img.is-switching {
    opacity: .45;
}

.v2-image-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    font-size: .82rem;
    font-weight: 800;
    gap: 6px;
    max-width: min(100%, 220px);
}

.v2-image-action [data-card-edition-label] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-image-action:hover {
    border-color: var(--v2-accent);
    color: var(--v2-accent);
}

.v2-detail-summary {
    padding: 14px;
}

.v2-detail-summary .v2-chip-row {
    align-items: center;
}

.v2-adoption-chip {
    margin-left: auto;
    border-color: rgba(224, 180, 91, .58);
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
    font-weight: 900;
}

.v2-section {
    margin-top: 18px;
}

.v2-section-title {
    margin: 0 0 10px;
    color: var(--v2-text);
    font-size: 1.12rem;
    font-weight: 900;
}

.v2-section-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.v2-section-title-row .v2-section-title {
    margin-bottom: 0;
}

.v2-card-info-toggle {
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-soft-bg);
    cursor: pointer;
}

.v2-card-info-toggle.is-active {
    border-color: rgba(224, 180, 91, .72);
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .1);
}

.v2-card-detail-panel {
    margin-top: 10px;
}

.v2-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.v2-stat {
    min-height: 74px;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-stat span {
    display: block;
    color: var(--v2-muted);
    font-size: .78rem;
}

.v2-stat strong {
    display: block;
    margin-top: 6px;
    color: var(--v2-text);
    font-size: 1.2rem;
}

.v2-text-panel {
    padding: 14px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface);
    line-height: 1.7;
}

.v2-guide-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.v2-guide-toc {
    position: sticky;
    top: 16px;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.v2-guide-toc strong {
    color: var(--v2-text);
    font-size: .96rem;
    font-weight: 900;
}

.v2-guide-toc a {
    display: block;
    padding: 8px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-soft-bg);
    font-size: .88rem;
    font-weight: 800;
}

.v2-guide-toc a:hover {
    border-color: var(--v2-accent);
    color: var(--v2-accent);
}

.v2-guide-content {
    display: grid;
    gap: 14px;
}

.v2-guide-section {
    display: grid;
    gap: 12px;
    padding: 20px;
    scroll-margin-top: 18px;
}

.v2-guide-section h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 1.35rem;
    font-weight: 900;
}

.v2-guide-section p {
    color: var(--v2-muted);
    line-height: 1.75;
}

.v2-guide-image-slot {
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 180px;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--v2-line) 82%, var(--v2-accent));
    border-radius: 8px;
    color: var(--v2-faint);
    background: var(--v2-soft-bg-2);
    font-weight: 800;
}

.v2-guide-image-slot img {
    display: block;
    width: 100%;
    height: auto;
}

.v2-rulebook-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.v2-rulebook-hub-card {
    display: grid;
    gap: 10px;
    padding: 20px;
    color: inherit;
}

.v2-rulebook-hub-card strong {
    color: var(--v2-text);
    font-size: 1.35rem;
    font-weight: 900;
}

.v2-rulebook-hub-card span:not(.v2-kicker),
.v2-rulebook-hub-card small {
    color: var(--v2-muted);
    line-height: 1.6;
}

.v2-rulebook-hub-card:hover {
    border-color: var(--v2-accent);
    transform: translateY(-1px);
}

.v2-rulebook-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.v2-rulebook-updated {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin: -6px 0 10px;
    color: var(--v2-faint);
    font-size: .72rem;
    line-height: 1.3;
}

.v2-rulebook-translation-notice {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: -2px 0 14px;
    padding: 9px 12px;
    border-left: 3px solid var(--v2-accent);
    background: color-mix(in srgb, var(--v2-accent) 10%, transparent);
    color: var(--v2-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.v2-rulebook-translation-notice strong {
    flex: 0 0 auto;
    color: var(--v2-text);
}

@media (max-width: 680px) {
    .v2-rulebook-translation-notice {
        display: block;
    }

    .v2-rulebook-translation-notice strong {
        display: block;
        margin-bottom: 2px;
    }
}

.v2-rulebook-visual {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
    padding: 20px;
}

.v2-rulebook-visual-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.v2-rulebook-visual-head h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 1.45rem;
    font-weight: 900;
}

.v2-rulebook-visual-head p {
    margin: 6px 0 0;
    color: var(--v2-muted);
}

.v2-rulebook-visual-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.v2-rulebook-visual-tabs button {
    max-width: min(100%, 220px);
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-soft-bg);
    font-size: .84rem;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.v2-rulebook-visual-tabs button.is-active {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-rulebook-visual-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: stretch;
    min-height: 440px;
}

.v2-rulebook-visual-stage,
.v2-rulebook-visual-info {
    min-width: 0;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft-bg);
}

.v2-rulebook-visual-stage {
    display: grid;
    padding: 16px;
}

.v2-rulebook-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: 22px repeat(4, minmax(52px, 1fr));
    grid-template-areas:
        "fp fp fp fp fp fp fp fp"
        "lumen lumen lumen character trait battle battle battle"
        "ultimate list list list list list list side"
        "break list list list list list list side"
        "break hand hand hand hand hand hand side";
    gap: 8px;
    min-height: 420px;
}

.v2-rulebook-zone,
.v2-rulebook-sample-card,
.v2-rulebook-phase {
    position: relative;
    min-width: 0;
    border: 1px solid color-mix(in srgb, var(--v2-line) 82%, var(--v2-accent));
    border-radius: 8px;
    color: var(--v2-text);
    background:
        linear-gradient(135deg, rgba(78, 185, 166, .16), rgba(224, 180, 91, .08)),
        var(--v2-surface);
    font-weight: 900;
    overflow: hidden;
    transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.v2-rulebook-zone:hover,
.v2-rulebook-sample-card:hover,
.v2-rulebook-phase:hover,
.v2-rulebook-zone.is-active,
.v2-rulebook-sample-card.is-active,
.v2-rulebook-phase.is-active {
    border-color: var(--v2-accent);
    transform: translateY(-1px);
    background:
        linear-gradient(135deg, rgba(224, 180, 91, .26), rgba(78, 185, 166, .16)),
        var(--v2-surface);
}

.v2-rulebook-zone span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 8px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.v2-rulebook-zone small {
    position: absolute;
    z-index: 2;
    right: 7px;
    bottom: 6px;
    left: 7px;
    display: block;
    overflow: hidden;
    color: var(--v2-muted);
    font-size: clamp(.58rem, 1vw, .73rem);
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-rulebook-zone::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(255, 255, 255, .13);
    border-radius: 6px;
    pointer-events: none;
}

.v2-rulebook-zone.is-fp span {
    padding: 0 8px;
    min-height: 0;
}

.v2-rulebook-zone.is-fp::before {
    inset: 4px 10px;
    border-radius: 999px;
}

.v2-rulebook-zone.is-list {
    grid-area: list;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 1px, transparent 1px 17px),
        linear-gradient(135deg, rgba(78, 185, 166, .2), rgba(68, 96, 143, .1)),
        var(--v2-surface);
}

.v2-rulebook-zone.is-side {
    grid-area: side;
    background:
        linear-gradient(180deg, rgba(142, 117, 255, .2), rgba(78, 185, 166, .08)),
        var(--v2-surface);
}

.v2-rulebook-zone.is-break {
    grid-area: break;
    background:
        linear-gradient(180deg, rgba(220, 88, 95, .2), rgba(224, 180, 91, .08)),
        var(--v2-surface);
}

.v2-rulebook-zone.is-hand {
    grid-area: hand;
    background:
        repeating-linear-gradient(90deg, rgba(224, 180, 91, .18) 0 2px, transparent 2px 24px),
        linear-gradient(135deg, rgba(224, 180, 91, .16), rgba(78, 185, 166, .06)),
        var(--v2-surface);
}

.v2-rulebook-zone.is-character {
    grid-area: character;
    font-size: .82rem;
}

.v2-rulebook-zone.is-trait {
    grid-area: trait;
}

.v2-rulebook-zone.is-battle {
    grid-area: battle;
    background:
        linear-gradient(90deg, rgba(220, 88, 95, .16), rgba(78, 185, 166, .14), rgba(224, 180, 91, .12)),
        var(--v2-surface);
}

.v2-rulebook-zone.is-lumen {
    grid-area: lumen;
}

.v2-rulebook-zone.is-fp {
    grid-area: fp;
    border-radius: 999px;
    background:
        repeating-linear-gradient(90deg, rgba(224, 180, 91, .45) 0 2px, transparent 2px 12.5%),
        linear-gradient(90deg, rgba(220, 88, 95, .18), rgba(78, 185, 166, .2)),
        var(--v2-surface);
}

.v2-rulebook-zone.is-ultimate {
    grid-area: ultimate;
    background:
        linear-gradient(160deg, rgba(224, 180, 91, .28), rgba(142, 117, 255, .14)),
        var(--v2-surface);
}

.v2-rulebook-card-anatomy {
    display: grid;
    grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
    gap: 18px;
    width: 100%;
    min-height: 420px;
}

.v2-rulebook-card-type-list {
    display: grid;
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: 8px;
    min-height: 420px;
}

.v2-rulebook-card-type-button {
    display: grid;
    place-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--v2-line) 82%, var(--v2-accent));
    border-radius: 8px;
    color: var(--v2-text);
    background:
        linear-gradient(135deg, rgba(78, 185, 166, .14), rgba(224, 180, 91, .07)),
        var(--v2-surface);
    text-align: left;
    transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.v2-rulebook-card-type-button:hover,
.v2-rulebook-card-type-button.is-active {
    border-color: var(--v2-accent);
    transform: translateY(-1px);
    background:
        linear-gradient(135deg, rgba(224, 180, 91, .24), rgba(78, 185, 166, .13)),
        var(--v2-surface);
}

.v2-rulebook-card-type-button span {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 4px;
    border-radius: 8px;
    color: #111;
    background: var(--v2-accent);
    font-size: .78rem;
    font-weight: 900;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.v2-rulebook-card-type-button strong {
    grid-area: title;
    overflow: hidden;
    color: var(--v2-text);
    font-size: .94rem;
    font-weight: 900;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-rulebook-card-type-button small {
    grid-area: hint;
    overflow: hidden;
    color: var(--v2-muted);
    font-size: .72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-rulebook-anatomy-stage {
    display: grid;
    place-items: center;
    min-width: 0;
    overflow: visible;
    padding: 58px 122px 68px;
}

.v2-rulebook-example-card {
    position: relative;
    width: min(100%, 350px);
    aspect-ratio: 821 / 1118;
    overflow: visible;
}

.v2-rulebook-example-card-image {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4.4% / 3.2%;
    object-fit: cover;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .34);
}

.v2-rulebook-card-marker-set:not([hidden]) {
    display: contents;
}

.v2-rulebook-card-marker-set[hidden] {
    display: none;
}

.v2-rulebook-card-marker {
    position: absolute;
    z-index: 3;
    padding: 0;
    border: 0;
    color: var(--v2-text);
    background: transparent;
    font: inherit;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
}

.v2-rulebook-card-marker > span {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border: 2px solid var(--v2-accent);
    border-radius: 999px;
    background: rgba(14, 17, 20, .18);
    box-shadow:
        0 0 0 3px rgba(0, 0, 0, .32),
        0 0 18px color-mix(in srgb, var(--v2-accent) 58%, transparent);
}

.v2-rulebook-card-marker > span::after {
    content: "";
    position: absolute;
    top: calc(50% - 1px);
    left: 100%;
    width: calc(var(--rulebook-label-gap, 46px) - 8px);
    height: 2px;
    border-radius: 999px;
    background: var(--v2-accent);
}

.v2-rulebook-card-marker > strong {
    position: absolute;
    z-index: 1;
    display: block;
    max-width: 106px;
    overflow: hidden;
    padding: 5px 7px;
    border: 1px solid color-mix(in srgb, var(--v2-accent) 52%, var(--v2-line));
    border-radius: 8px;
    color: var(--v2-text);
    background: color-mix(in srgb, var(--v2-surface) 86%, transparent);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.v2-rulebook-card-marker.is-label-right > strong {
    top: 50%;
    left: calc(100% + var(--rulebook-label-gap, 46px));
    transform: translateY(-50%);
}

.v2-rulebook-card-marker.is-label-left > strong {
    top: 50%;
    right: calc(100% + var(--rulebook-label-gap, 46px));
    transform: translateY(-50%);
}

.v2-rulebook-card-marker.is-label-top > strong {
    bottom: calc(100% + var(--rulebook-label-gap, 34px));
    left: 50%;
    transform: translateX(-50%);
}

.v2-rulebook-card-marker.is-label-top > span::after {
    top: auto;
    bottom: 100%;
    left: calc(50% - 1px);
    width: 2px;
    height: calc(var(--rulebook-label-gap, 34px) - 6px);
}

.v2-rulebook-card-marker.is-label-bottom > strong {
    top: calc(100% + var(--rulebook-label-gap, 34px));
    left: 50%;
    transform: translateX(-50%);
}

.v2-rulebook-card-marker.is-label-bottom > span::after {
    top: 100%;
    left: calc(50% - 1px);
    width: 2px;
    height: calc(var(--rulebook-label-gap, 34px) - 6px);
}

.v2-rulebook-card-marker.is-rect > span {
    border-radius: 7px;
}

.v2-rulebook-card-marker.is-pill > span {
    border-radius: 999px;
}

.v2-rulebook-card-marker:hover > span,
.v2-rulebook-card-marker.is-active > span {
    background: color-mix(in srgb, var(--v2-accent) 42%, transparent);
    transform: scale(1.08);
}

.v2-rulebook-card-marker:hover > strong,
.v2-rulebook-card-marker.is-active > strong {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-rulebook-card-marker.is-label-left > span::after {
    right: 100%;
    left: auto;
}

.v2-rulebook-card-map {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    min-height: 420px;
    align-items: stretch;
}

.v2-rulebook-sample-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    min-height: 300px;
    padding: 14px;
    text-align: left;
}

.v2-rulebook-sample-card span {
    justify-self: start;
    padding: 3px 7px;
    border-radius: 999px;
    color: #111;
    background: var(--v2-accent);
    font-size: .78rem;
}

.v2-rulebook-sample-card strong {
    align-self: end;
    color: var(--v2-text);
    font-size: 1rem;
    line-height: 1.35;
}

.v2-rulebook-sample-card em,
.v2-rulebook-phase em {
    color: var(--v2-muted);
    font-size: .78rem;
    font-style: normal;
    font-weight: 800;
    text-align: center;
}

.v2-rulebook-sample-card i {
    position: relative;
    display: block;
    height: 70px;
    border-radius: 6px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .18), transparent 36%),
        rgba(255, 255, 255, .06);
}

.v2-rulebook-sample-card i::before,
.v2-rulebook-sample-card i::after {
    content: "";
    position: absolute;
    right: 8px;
    left: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
}

.v2-rulebook-sample-card i::before {
    top: 12px;
}

.v2-rulebook-sample-card i::after {
    bottom: 12px;
    width: 52%;
}

.v2-rulebook-sample-card.is-character-card i {
    background: linear-gradient(135deg, rgba(78, 185, 166, .34), rgba(224, 180, 91, .12));
}

.v2-rulebook-sample-card.is-trait-card i {
    background: linear-gradient(135deg, rgba(142, 117, 255, .32), rgba(78, 185, 166, .1));
}

.v2-rulebook-sample-card.is-attack-card i {
    background: linear-gradient(135deg, rgba(220, 88, 95, .32), rgba(224, 180, 91, .14));
}

.v2-rulebook-sample-card.is-defense-card i {
    background: linear-gradient(135deg, rgba(68, 132, 214, .32), rgba(78, 185, 166, .14));
}

.v2-rulebook-sample-card.is-ultimate-card i {
    background: linear-gradient(135deg, rgba(224, 180, 91, .36), rgba(142, 117, 255, .18));
}

.v2-rulebook-phase-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    min-height: 360px;
    align-items: center;
}

.v2-rulebook-phase {
    display: grid;
    gap: 8px;
    min-height: 180px;
    overflow: visible;
    padding: 16px 10px;
    place-items: center;
}

.v2-rulebook-visual-panel.is-phases .v2-rulebook-phase:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -14px;
    z-index: 2;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: var(--v2-accent);
    box-shadow: 0 0 0 4px var(--v2-soft-bg);
}

.v2-rulebook-visual-panel.is-phases .v2-rulebook-phase:not(:last-child)::before {
    content: "";
    position: absolute;
    top: calc(50% - 4px);
    right: -16px;
    z-index: 3;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--v2-accent);
    border-right: 2px solid var(--v2-accent);
    transform: rotate(45deg);
}

.v2-rulebook-phase span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: #111;
    background: var(--v2-accent);
    font-size: 1.05rem;
}

.v2-rulebook-phase strong {
    max-width: 100%;
    color: var(--v2-text);
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.v2-rulebook-visual-info {
    display: grid;
    gap: 12px;
    align-content: center;
    padding: 20px;
}

.v2-rulebook-visual-info > span {
    color: var(--v2-accent);
    font-size: .78rem;
    font-weight: 900;
}

.v2-rulebook-visual-info strong {
    min-width: 0;
    color: var(--v2-text);
    font-size: 1.5rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.v2-rulebook-visual-info small {
    justify-self: start;
    max-width: 100%;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--v2-accent) 52%, var(--v2-line));
    border-radius: 999px;
    color: var(--v2-accent);
    background: color-mix(in srgb, var(--v2-accent) 10%, transparent);
    font-size: .78rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.v2-rulebook-visual-info p {
    color: var(--v2-muted);
    line-height: 1.65;
}

.v2-rulebook-layout {
    align-items: start;
}

.v2-rulebook-toc {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-color: rgba(224, 180, 91, .55) rgba(255, 255, 255, .08);
}

.v2-rulebook-toc a.is-level-1 {
    color: var(--v2-text);
    background: color-mix(in srgb, var(--v2-soft-bg) 75%, var(--v2-accent));
}

.v2-rulebook-toc a.is-level-3,
.v2-rulebook-toc a.is-level-4 {
    padding-left: 18px;
    font-size: .78rem;
}

.v2-rulebook-search {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.v2-rulebook-search label {
    color: var(--v2-text);
    font-weight: 900;
}

.v2-rulebook-search input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface);
}

.v2-rulebook-search-results {
    display: none;
    gap: 8px;
}

.v2-rulebook-search.has-results .v2-rulebook-search-results {
    display: grid;
}

.v2-rulebook-search-result {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-soft-bg);
}

.v2-rulebook-search-result strong {
    color: var(--v2-accent);
    font-weight: 900;
}

.v2-rulebook-search-empty {
    margin: 0;
    color: var(--v2-muted);
}

.v2-rulebook-content {
    min-width: 0;
    padding: 28px;
    color: var(--v2-text);
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.v2-rulebook-content a[id] {
    display: block;
    scroll-margin-top: 18px;
}

.v2-rulebook-content h1,
.v2-rulebook-content h2,
.v2-rulebook-content h3,
.v2-rulebook-content h4,
.v2-rulebook-content h5,
.v2-rulebook-content h6 {
    color: var(--v2-text);
    font-weight: 900;
    line-height: 1.35;
}

.v2-rulebook-content h1 {
    margin: 1.8rem 0 1rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--v2-line);
    font-size: 1.75rem;
}

.v2-rulebook-content h1:first-child,
.v2-rulebook-content a:first-child + h1 {
    margin-top: 0;
}

.v2-rulebook-content h2 {
    margin: 1.4rem 0 .75rem;
    font-size: 1.45rem;
}

.v2-rulebook-content h3 {
    margin: 1.1rem 0 .55rem;
    font-size: 1.22rem;
}

.v2-rulebook-content h4 {
    margin: .95rem 0 .5rem;
    font-size: 1.06rem;
}

.v2-rulebook-content h5 {
    margin: .85rem 0 .45rem;
    font-size: .98rem;
}

.v2-rulebook-content h6 {
    margin: .8rem 0 .4rem;
    font-size: .92rem;
}

.v2-rulebook-content p,
.v2-rulebook-content li,
.v2-rulebook-content dd {
    color: var(--v2-muted);
}

.v2-rulebook-content blockquote {
    margin: 1rem 0;
    padding: 12px 14px;
    border-left: 3px solid var(--v2-accent);
    border-radius: 0 8px 8px 0;
    background: var(--v2-soft-bg);
}

.v2-rulebook-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    scrollbar-color: rgba(224, 180, 91, .55) rgba(255, 255, 255, .08);
}

.v2-rulebook-content th,
.v2-rulebook-content td {
    min-width: 120px;
    padding: 9px 10px;
    border: 1px solid var(--v2-line);
    color: var(--v2-muted);
    vertical-align: top;
}

.v2-rulebook-content th {
    color: var(--v2-text);
    background: var(--v2-soft-bg);
    font-weight: 900;
}

.v2-rulebook-content code {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-rule-inline-visual {
    margin: 10px 0 18px;
    border: 1px solid color-mix(in srgb, var(--v2-accent) 38%, var(--v2-line));
    background: color-mix(in srgb, var(--v2-soft-bg) 88%, transparent);
}

.v2-rule-inline-visual-head {
    align-items: center;
    border-bottom: 1px solid var(--v2-line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
    padding: 8px 10px;
}

.v2-rule-inline-visual-head > span {
    color: var(--v2-faint);
    flex: none;
    font-size: .68rem;
    font-weight: 900;
}

.v2-rule-inline-visual-title {
    color: var(--v2-text);
    font-size: .88rem;
}

.v2-rule-inline-visual-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
    min-width: 0;
}

.v2-rule-inline-visual-tabs button {
    background: transparent;
    border: 1px solid var(--v2-line);
    color: var(--v2-muted);
    cursor: pointer;
    min-height: 32px;
    padding: 5px 10px;
}

.v2-rule-inline-visual-tabs button.is-active {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
    font-weight: 800;
}

.v2-rule-inline-visual-panel[hidden] {
    display: none;
}

.v2-rule-inline-visual-content {
    min-width: 0;
    overflow: auto;
    padding: 12px;
}

.v2-rule-inline-visual-content > :first-child {
    margin-top: 0;
}

.v2-rule-inline-visual-content > :last-child {
    margin-bottom: 0;
}

.v2-rulebook-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 7px;
    border: 1px solid color-mix(in srgb, var(--v2-accent) 60%, var(--v2-line));
    border-radius: 999px;
    color: var(--v2-accent);
    background: color-mix(in srgb, var(--v2-accent) 12%, transparent);
    font-size: .75rem;
    font-weight: 900;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .v2-rulebook-visual-head,
    .v2-rulebook-visual-panel {
        grid-template-columns: 1fr;
    }

    .v2-rulebook-visual {
        padding: 14px;
    }

    .v2-rulebook-visual-panel {
        min-height: auto;
    }

    .v2-rulebook-visual-stage {
        padding: 10px;
    }

    .v2-rulebook-visual-tabs {
        justify-content: flex-start;
    }

    .v2-rulebook-board {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: 18px repeat(4, minmax(42px, auto));
        min-height: auto;
        gap: 5px;
    }

    .v2-rulebook-board .v2-rulebook-zone {
        min-height: 42px;
        font-size: clamp(.65rem, 2vw, .8rem);
    }

    .v2-rulebook-board .v2-rulebook-zone.is-fp {
        min-height: 18px;
    }

    .v2-rulebook-board .v2-rulebook-zone span {
        padding: 5px;
    }

    .v2-rulebook-board .v2-rulebook-zone.is-fp span {
        padding: 0 6px;
    }

    .v2-rulebook-board .v2-rulebook-zone::before {
        inset: 5px;
    }

    .v2-rulebook-board .v2-rulebook-zone.is-fp::before {
        inset: 3px 8px;
    }

    .v2-rulebook-card-map {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: auto;
    }

    .v2-rulebook-card-anatomy {
        grid-template-columns: minmax(118px, 160px) minmax(0, 1fr);
        gap: 10px;
        min-height: auto;
    }

    .v2-rulebook-card-type-list {
        min-height: 340px;
        gap: 6px;
    }

    .v2-rulebook-card-type-button {
        padding: 8px;
    }

    .v2-rulebook-card-type-button span {
        min-width: 34px;
        min-height: 28px;
        font-size: .7rem;
    }

    .v2-rulebook-card-type-button strong {
        font-size: .8rem;
    }

    .v2-rulebook-card-type-button small {
        font-size: .66rem;
    }

    .v2-rulebook-anatomy-stage {
        padding: 50px 82px 58px;
    }

    .v2-rulebook-example-card {
        width: min(100%, 300px);
    }

    .v2-rulebook-card-marker {
        gap: 5px;
        font-size: .64rem;
    }

    .v2-rulebook-card-marker > span {
        width: 100%;
        height: 100%;
    }

    .v2-rulebook-card-marker > span::after {
        width: calc(var(--rulebook-label-gap, 30px) - 6px);
    }

    .v2-rulebook-card-marker.is-rect > span {
        border-radius: 6px;
    }

    .v2-rulebook-card-marker.is-pill > span {
        border-radius: 999px;
    }

    .v2-rulebook-card-marker > strong {
        max-width: 72px;
        padding: 4px 5px;
    }

    .v2-rulebook-card-marker.is-label-right > strong {
        left: calc(100% + var(--rulebook-label-gap, 30px));
    }

    .v2-rulebook-card-marker.is-label-left > strong {
        right: calc(100% + var(--rulebook-label-gap, 30px));
    }

    .v2-rulebook-card-marker.is-label-top > strong {
        bottom: calc(100% + var(--rulebook-label-gap, 28px));
    }

    .v2-rulebook-card-marker.is-label-top > span::after {
        height: calc(var(--rulebook-label-gap, 28px) - 4px);
    }

    .v2-rulebook-sample-card {
        min-height: 220px;
    }

    .v2-rulebook-phase-track {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .v2-rulebook-phase {
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 68px;
        justify-items: start;
    }

    .v2-rulebook-visual-panel.is-phases .v2-rulebook-phase:not(:last-child)::before,
    .v2-rulebook-visual-panel.is-phases .v2-rulebook-phase:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 620px) {
    .v2-rulebook-zone small,
    .v2-rulebook-card-type-button small,
    .v2-rulebook-phase em {
        display: none;
    }

    .v2-rulebook-board .v2-rulebook-zone {
        padding: 0;
    }

    .v2-rulebook-board .v2-rulebook-zone span {
        padding: 2px 1px;
        line-height: 1.1;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .v2-rulebook-zone.is-character,
    .v2-rulebook-zone.is-trait,
    .v2-rulebook-zone.is-ultimate,
    .v2-rulebook-zone.is-break,
    .v2-rulebook-zone.is-side {
        font-size: .58rem;
    }

    .v2-rulebook-card-anatomy {
        grid-template-columns: 1fr;
    }

    .v2-rulebook-card-type-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        grid-template-rows: none;
        min-height: auto;
    }

    .v2-rulebook-card-type-button {
        min-height: 58px;
        padding: 4px;
    }

    .v2-rulebook-anatomy-stage {
        padding: 44px 56px 54px;
    }

    .v2-rulebook-card-marker > strong {
        max-width: 64px;
    }

    .v2-rulebook-card-marker.is-label-right > strong {
        left: calc(100% + var(--rulebook-label-gap, 22px));
    }

    .v2-rulebook-card-marker.is-label-left > strong {
        right: calc(100% + var(--rulebook-label-gap, 22px));
    }
}

.v2-release-list {
    display: grid;
    gap: 8px;
}

.v2-release-row {
    display: grid;
    grid-template-columns: 108px 120px minmax(0, 1fr) minmax(76px, auto);
    grid-template-areas: "date code pack rare";
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
    width: 100%;
    color: var(--v2-muted);
    font: inherit;
    text-align: left;
    appearance: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

button.v2-release-row:not(:disabled) {
    cursor: pointer;
}

button.v2-release-row:not(:disabled):hover,
button.v2-release-row.is-selected {
    border-color: var(--v2-accent);
    background: color-mix(in srgb, var(--v2-accent) 8%, var(--v2-surface));
}

button.v2-release-row:not(:disabled):hover {
    transform: translateY(-1px);
}

button.v2-release-row:disabled {
    opacity: .62;
}

.v2-release-date {
    grid-area: date;
}

.v2-release-code {
    grid-area: code;
}

.v2-release-pack {
    grid-area: pack;
    min-width: 0;
}

.v2-rare-list {
    display: flex;
    grid-area: rare;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.v2-release-row strong {
    color: var(--v2-text);
}

.v2-card-edition-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    border: 0;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(3px);
}

.v2-card-edition-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 91;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(calc(100vw - 32px), 760px);
    max-height: min(82vh, 760px);
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .52);
    transform: translate(-50%, -50%);
}

.v2-card-edition-backdrop[hidden],
.v2-card-edition-modal[hidden] {
    display: none;
}

body.v2-card-edition-open {
    overflow: hidden;
}

.v2-card-edition-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--v2-line);
}

.v2-card-edition-head h2 {
    margin: 2px 0 0;
    color: var(--v2-text);
    font-size: 1.15rem;
}

.v2-card-edition-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-soft-bg);
    font-size: 1.45rem;
    line-height: 1;
}

.v2-card-edition-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-y: auto;
    padding: 12px;
    scrollbar-color: color-mix(in srgb, var(--v2-accent) 58%, var(--v2-line)) var(--v2-soft-bg);
    scrollbar-width: thin;
}

.v2-card-edition-option {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 92px;
    padding: 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-soft-bg);
    text-align: left;
}

.v2-card-edition-option:hover,
.v2-card-edition-option.is-selected {
    border-color: var(--v2-accent);
    background: color-mix(in srgb, var(--v2-accent) 9%, var(--v2-soft-bg));
}

.v2-card-edition-thumb {
    display: block;
    width: 64px;
    aspect-ratio: 821 / 1118;
    overflow: hidden;
    border-radius: 4px;
    background: var(--v2-surface-2);
}

.v2-card-edition-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v2-card-edition-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.v2-card-edition-copy strong,
.v2-card-edition-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-card-edition-copy small {
    color: var(--v2-muted);
}

.v2-card-edition-state {
    padding: 3px 6px;
    border-radius: 999px;
    color: #fff;
    background: var(--v2-red);
    font-size: .7rem;
    font-weight: 900;
    white-space: nowrap;
}

.v2-rare {
    display: inline-flex;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 8px;
    color: #111;
    background: var(--v2-accent);
    font-weight: 900;
    white-space: nowrap;
}

.v2-rare.N { background: #b8b0a4; }
.v2-rare.SR { background: var(--v2-teal); }
.v2-rare.EXR { background: var(--v2-purple); color: #111; }
.v2-rare.AN { background: #494949; color: #fff; }
.v2-rare.AEX,
.v2-rare.SAEX,
.v2-rare.SAR { background: #7f5aa0; color: #fff; }
.v2-rare.SP,
.v2-rare.SKR { background: var(--v2-red); color: #fff; }

.v2-related-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.v2-related-card {
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-related-image {
    position: relative;
}

.v2-related-image img {
    width: 100%;
}

.v2-related-body {
    padding: 8px;
}

.v2-qna-list {
    display: grid;
    gap: 8px;
}

.v2-qna-item {
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-qna-item h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 900;
}

.v2-tag-form {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.v2-tag-form label {
    margin-bottom: 5px;
    color: var(--v2-muted);
    font-size: .84rem;
    font-weight: 800;
}

.v2-deck-search-row {
    grid-template-columns: minmax(0, 1fr) 132px auto auto auto;
}

.v2-deck-filter-grid {
    grid-template-columns: 1fr;
}

.v2-deck-filter-grid .v2-filter-wide {
    grid-column: 1 / -1;
}

.v2-deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
}

.v2-deck-card {
    position: relative;
    display: flex;
    min-height: 196px;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background:
        var(--v2-list-card-gradient, linear-gradient(105deg, rgba(27, 27, 27, .98) 0%, rgba(27, 27, 27, .94) 56%, rgba(36, 36, 36, .74) 100%)),
        var(--v2-surface);
}

.v2-deck-card:hover {
    border-color: rgba(224, 180, 91, .75);
    transform: translateY(-1px);
}

.v2-clickable-card {
    cursor: pointer;
}

.v2-clickable-card:focus-visible {
    outline: 2px solid var(--v2-accent);
    outline-offset: 3px;
}

.v2-deck-bg {
    position: absolute;
    top: 50%;
    right: -18px;
    width: min(42%, 184px);
    max-height: 118%;
    opacity: .16;
    object-fit: contain;
    pointer-events: none;
    transform: translateY(-50%);
    filter: saturate(.9) contrast(1.08);
}

.v2-deck-author,
.v2-deck-main,
.v2-deck-bottom {
    position: relative;
    z-index: 1;
}

.v2-deck-author {
    position: absolute;
    top: 14px;
    right: 16px;
    max-width: 38%;
    overflow: hidden;
    color: var(--v2-muted);
    font-size: .82rem;
    font-weight: 800;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-deck-author a:hover,
.v2-deck-kicker-line a:hover,
.v2-deck-title:hover {
    color: var(--v2-accent);
}

.v2-deck-main {
    min-width: 0;
    padding-right: 96px;
}

.v2-deck-kicker-line {
    display: flex;
    overflow: hidden;
    align-items: center;
    gap: 5px;
    color: var(--v2-muted);
    font-size: .82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-deck-dot {
    color: var(--v2-faint);
}

.v2-deck-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    margin-top: 8px;
}

.v2-deck-title {
    min-width: 0;
    color: var(--v2-text);
    font-size: 1.28rem;
    font-weight: 900;
    line-height: 1.28;
}

:root[data-theme="light"] .v2-deck-title,
:root[data-theme="light"] .v2-tournament-card h2 {
    color: #1d1710;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}

.v2-deck-version {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 7px;
    border: 1px solid rgba(224, 180, 91, .55);
    border-radius: 8px;
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
    font-size: .76rem;
    font-weight: 900;
}

.v2-deck-tags {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 10px;
    color: var(--v2-muted);
    font-size: .86rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.v2-deck-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
}

.v2-deck-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v2-deck-metric {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: rgba(255, 255, 255, .035);
    font-size: .82rem;
}

.v2-deck-metric strong {
    margin-left: 5px;
    color: var(--v2-text);
}

.v2-deck-date {
    flex: none;
    color: var(--v2-faint);
    font-size: .82rem;
    font-weight: 800;
}

.v2-danger-button {
    border-color: rgba(217, 105, 105, .55);
    color: #ffd2d2;
}

.v2-danger-button:hover {
    border-color: var(--v2-red);
    color: #fff;
    background: rgba(217, 105, 105, .18);
}

:root[data-theme="light"] .v2-danger-button {
    border-color: rgba(178, 65, 65, .5);
    color: #8f2424;
    background: rgba(178, 65, 65, .08);
}

:root[data-theme="light"] .v2-danger-button:hover {
    border-color: #8f2424;
    color: #fff;
    background: var(--v2-red);
}

/* Rulebook database editor */
.v2-rule-manager,
.v2-rule-editor {
    display: grid;
    gap: 20px;
}

.v2-rule-manager-book > header {
    align-items: end;
    border-bottom: 1px solid var(--v2-line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 0 12px;
}

.v2-rule-manager-book h2 {
    font-size: 1.15rem;
    margin: 3px 0 0;
}

.v2-rule-manager-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v2-rule-manager-book-choice {
    align-items: center;
    background: color-mix(in srgb, var(--v2-panel-bg) 90%, transparent);
    border: 1px solid var(--v2-line);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    min-width: 0;
    padding: 16px;
}

.v2-rule-manager-counts,
.v2-rule-manager-breadcrumb {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v2-rule-manager-counts {
    color: var(--v2-muted);
    font-size: .76rem;
    margin-top: 8px;
}

.v2-rule-manager-counts span,
.v2-rule-manager-count {
    border: 1px solid var(--v2-line);
    color: var(--v2-muted);
    padding: 3px 7px;
}

.v2-rule-manager-breadcrumb {
    color: var(--v2-faint);
    font-size: .76rem;
    margin-bottom: 7px;
}

.v2-rule-manager-breadcrumb a {
    color: var(--v2-muted);
}

.v2-rule-manager-breadcrumb strong {
    color: var(--v2-text);
}

.v2-rule-manager-section-head {
    align-items: center !important;
}

.v2-rule-focus {
    align-items: center;
    background: color-mix(in srgb, var(--v2-accent) 8%, var(--v2-panel-bg));
    border: 1px solid color-mix(in srgb, var(--v2-accent) 48%, var(--v2-line));
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-width: 0;
    padding: 14px 16px;
}

.v2-rule-focus strong,
.v2-rule-focus code {
    display: block;
    overflow-wrap: anywhere;
}

.v2-rule-focus code {
    color: var(--v2-muted);
    font-size: .72rem;
    margin-top: 3px;
}

.v2-rule-manager-children {
    margin-top: 18px;
}

.v2-rule-visual-manager {
    margin-top: 18px;
}

.v2-rule-visual-list {
    display: grid;
    gap: 5px;
}

.v2-rule-visual-row {
    align-items: center;
    background: color-mix(in srgb, var(--v2-panel-bg) 88%, transparent);
    border: 1px solid var(--v2-line);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 52px;
    padding: 7px 9px;
}

.v2-rule-visual-row strong,
.v2-rule-visual-row small {
    display: block;
}

.v2-rule-visual-row small {
    color: var(--v2-muted);
    font-size: .72rem;
    margin-top: 2px;
}

.v2-rule-visual-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.v2-rule-visual-badges span {
    border: 1px solid var(--v2-line);
    color: var(--v2-muted);
    font-size: .68rem;
    font-weight: 800;
    padding: 3px 6px;
}

.v2-rule-visual-badges span.is-private {
    color: var(--v2-red);
}

.v2-rule-script-warning {
    border: 1px solid rgba(217, 105, 105, .55);
    color: var(--v2-red);
    background: rgba(217, 105, 105, .08);
    font-size: .82rem;
    font-weight: 800;
    margin-bottom: 14px;
    padding: 10px 12px;
}

.v2-rule-code-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v2-rule-code-grid > .v2-field {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 14px;
}

.v2-rule-code-grid > .v2-field > span {
    color: var(--v2-muted);
    font-size: .78rem;
    font-weight: 800;
}

.v2-rule-code-editor {
    background: #111517;
    border: 1px solid var(--v2-line);
    color: #e7ecee;
    font-family: Consolas, "Courier New", monospace;
    font-size: .78rem;
    line-height: 1.55;
    min-height: 220px;
    padding: 10px;
    resize: vertical;
    tab-size: 4;
    width: 100%;
}

.v2-rule-manager-book-actions,
.v2-rule-tree-actions,
.v2-rule-editor-submit,
.v2-rule-delete-panel form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-rule-tree {
    display: grid;
    gap: 5px;
}

.v2-rule-tree-row {
    align-items: center;
    background: color-mix(in srgb, var(--v2-panel-bg) 88%, transparent);
    border: 1px solid var(--v2-line);
    border-left: 3px solid color-mix(in srgb, var(--v2-accent) 50%, var(--v2-line));
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    margin-left: 0;
    min-height: 54px;
    padding: 7px 9px;
}

.v2-rule-tree-main {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(56px, auto) minmax(0, 1fr);
    min-width: 0;
}

.v2-rule-tree-main strong,
.v2-rule-tree-main code {
    display: block;
    overflow-wrap: anywhere;
}

.v2-rule-tree-link {
    color: var(--v2-text);
    text-decoration: none;
}

.v2-rule-tree-link:hover strong {
    color: var(--v2-accent);
}

.v2-rule-tree-main code {
    color: var(--v2-muted);
    font-size: .72rem;
    margin-top: 2px;
}

.v2-rule-tree-number {
    color: var(--v2-accent);
    font-weight: 800;
}

.v2-rule-tree-status span {
    color: var(--v2-red);
    font-size: .74rem;
    font-weight: 700;
}

.v2-rule-tree-status span.is-neutral {
    color: var(--v2-muted);
}

.v2-rule-order-actions {
    align-items: center;
    display: flex;
    gap: 4px;
}

.v2-rule-order-actions form {
    margin: 0;
}

.v2-rule-order-actions button {
    align-items: center;
    background: var(--v2-soft-bg);
    border: 1px solid var(--v2-line);
    color: var(--v2-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    padding: 0;
    width: 34px;
}

.v2-rule-order-actions button:hover:not(:disabled) {
    border-color: var(--v2-accent);
    color: var(--v2-accent);
}

.v2-rule-order-actions button:disabled {
    color: var(--v2-faint);
    cursor: not-allowed;
    opacity: .4;
}

.v2-rule-editor-settings,
.v2-rule-language-panel,
.v2-rule-delete-panel {
    padding: 16px;
}

.v2-rule-editor-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v2-rule-editor .v2-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.v2-rule-editor .v2-field > span {
    color: var(--v2-muted);
    font-size: .78rem;
    font-weight: 700;
}

.v2-rule-editor .v2-field small {
    color: var(--v2-muted);
    font-size: .72rem;
}

.v2-rule-editor input[type="text"],
.v2-rule-editor input[type="number"],
.v2-rule-editor select {
    background: var(--v2-surface);
    border: 1px solid var(--v2-line);
    color: var(--v2-text);
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.v2-rule-editor .v2-field.is-compact {
    align-content: center;
    grid-template-columns: auto auto;
    justify-content: start;
}

.v2-rule-editor .errorlist {
    color: var(--v2-red);
    font-size: .75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.v2-rule-editor-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}

.v2-rule-editor-tabs button {
    background: transparent;
    border: 1px solid var(--v2-line);
    color: var(--v2-muted);
    cursor: pointer;
    min-height: 38px;
    padding: 7px 14px;
}

.v2-rule-editor-tabs button.is-active {
    background: var(--v2-accent);
    border-color: var(--v2-accent);
    color: #111;
    font-weight: 800;
}

.v2-rule-language-panel {
    display: grid;
    gap: 14px;
}

.v2-rule-language-panel[hidden] {
    display: none;
}

.v2-rule-editor-submit {
    justify-content: flex-end;
}

.v2-rule-reference {
    color: var(--v2-accent);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--v2-accent) 45%, transparent);
    text-underline-offset: 3px;
}

.v2-rule-reference-missing {
    color: var(--v2-red);
    text-decoration: underline wavy;
}

.v2-rule-section {
    scroll-margin-top: 82px;
}

.v2-rule-anchor-alias {
    display: block;
    height: 0;
    scroll-margin-top: 82px;
    visibility: hidden;
}

.v2-rule-number {
    color: var(--v2-accent);
    font-variant-numeric: tabular-nums;
}

.v2-rule-clause-number {
    font-weight: 800;
    margin: 1.35rem 0 0.35rem;
}

.v2-rule-clause-number + p {
  margin-top: 0;
}

.v2-rule-contract {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem 0.72rem;
  margin: 0.34rem 0 0.7rem;
  padding: 0.5rem 0.62rem;
  border: 1px solid var(--v2-line, rgba(15, 23, 42, 0.12));
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--v2-surface, #fff) 88%, var(--v2-accent, #6d5dfc) 12%);
  font-size: 0.76rem;
  line-height: 1.45;
}

.v2-rule-contract a {
  text-decoration: none;
}

.v2-rule-contract-key,
.v2-rule-contract-relation {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.v2-rule-contract-key span,
.v2-rule-contract-relation b {
  color: var(--v2-text-muted, #64748b);
  font-size: 0.68rem;
  font-weight: 700;
}

.v2-rule-contract-key code {
  padding: 0.08rem 0.3rem;
  border-radius: 0.3rem;
  background: rgba(15, 23, 42, 0.08);
  color: var(--v2-text, #172033);
  font-size: 0.72rem;
}

.v2-rule-contract-relation a {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.08rem 0.28rem;
  border-radius: 999px;
  background: rgba(109, 93, 252, 0.1);
  color: var(--v2-accent-strong, #5143c8);
}

.v2-rule-contract-relation a code {
  color: inherit;
  font-size: 0.66rem;
  opacity: 0.76;
}

.v2-rule-contract-relation.is-dependency a + a::before {
  content: "·";
  margin-right: 0.28rem;
  color: var(--v2-text-muted, #64748b);
}

@media (max-width: 720px) {
    .v2-rule-inline-visual-head {
        align-items: stretch;
        display: grid;
    }

    .v2-rule-inline-visual-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-rule-inline-visual-tabs button {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .v2-rule-manager-index {
        grid-template-columns: 1fr;
    }

    .v2-rule-manager-book-choice {
        align-items: stretch;
        display: grid;
    }

    .v2-rule-manager-book > header {
        align-items: stretch;
        display: grid;
    }

    .v2-rule-tree-row {
        gap: 7px;
        grid-template-columns: minmax(0, 1fr) auto;
        margin-left: 0;
    }

    .v2-rule-tree-status {
        grid-column: 2;
        grid-row: 1;
    }

    .v2-rule-order-actions {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .v2-rule-tree-actions {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-end;
    }

    .v2-rule-focus {
        gap: 8px;
        grid-template-columns: auto minmax(0, 1fr);
        padding: 11px;
    }

    .v2-rule-focus .v2-rule-tree-status {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .v2-rule-visual-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .v2-rule-visual-row .v2-rule-tree-actions {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-content: flex-end;
    }

    .v2-rule-code-grid {
        grid-template-columns: 1fr;
    }

    .v2-rule-editor-grid {
        grid-template-columns: 1fr;
    }

    .v2-rule-editor-tabs button {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 6px;
    }
}

.v2-deck-capture-area {
    background: var(--v2-bg);
    color: var(--v2-text);
}

.v2-deck-capture-area > .v2-section {
    margin-top: 18px;
}

.v2-deck-detail-head {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    align-items: stretch;
    gap: 18px;
    min-height: 190px;
    padding: 20px;
}

.v2-deck-detail-head.has-ultimate {
    grid-template-columns: minmax(0, 1fr) 240px;
}

.v2-deck-detail-bg {
    position: absolute;
    top: 50%;
    right: 24px;
    width: min(260px, 32%);
    opacity: .14;
    object-fit: contain;
    pointer-events: none;
    transform: translateY(-50%);
}

.v2-deck-detail-head.has-ultimate .v2-deck-detail-bg {
    right: 282px;
    width: min(220px, 24%);
}

.v2-deck-detail-title,
.v2-deck-detail-info,
.v2-deck-detail-ultimate,
.v2-deck-detail-actions {
    position: relative;
    z-index: 1;
}

.v2-deck-detail-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.v2-deck-detail-title {
    min-width: 0;
}

.v2-deck-detail-bottom {
    display: grid;
    gap: 9px;
    margin-top: auto;
}

.v2-deck-detail-tags {
    color: var(--v2-muted);
    font-size: .92rem;
    line-height: 1.5;
}

.v2-deck-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.v2-deck-detail-actions form {
    display: inline-flex;
    margin: 0;
}

.v2-deck-detail-ultimate {
    display: grid;
    align-content: start;
    gap: 10px;
}

.v2-deck-detail-ultimate h2 {
    margin: 0;
    color: var(--v2-accent);
    font-size: .9rem;
    font-weight: 900;
}

.v2-deck-ultimate-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.v2-deck-ultimate-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-deck-detail-ultimate .v2-deck-ultimate-card {
    grid-template-columns: 1fr;
}

.v2-deck-ultimate-card strong,
.v2-deck-ultimate-card span {
    display: block;
    min-width: 0;
}

.v2-deck-ultimate-card strong {
    overflow: hidden;
    color: var(--v2-text);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-deck-ultimate-card span {
    margin-top: 5px;
    color: var(--v2-muted);
    font-size: .84rem;
}

.v2-deck-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    grid-template-areas:
        "list side"
        "hand side";
    gap: 12px;
    align-items: stretch;
}

.v2-deck-zone {
    min-width: 0;
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-deck-zone-list { grid-area: list; }
.v2-deck-zone-hand { grid-area: hand; }
.v2-deck-zone-side {
    display: flex;
    grid-area: side;
    overflow: hidden;
    flex-direction: column;
}

.v2-deck-zone-head,
.v2-deck-builder-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.v2-deck-zone-head h2,
.v2-deck-builder-section-head h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 1rem;
    font-weight: 900;
}

.v2-deck-zone-head span,
.v2-deck-builder-section-head span {
    color: var(--v2-faint);
    font-size: .82rem;
    font-weight: 800;
}

.v2-deck-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.v2-deck-hand-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.v2-deck-side-grid {
    display: flex;
    overflow-y: auto;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding-right: 3px;
    scrollbar-color: rgba(224, 180, 91, .55) var(--v2-surface-2);
    scrollbar-width: thin;
}

.v2-deck-side-grid::-webkit-scrollbar {
    width: 8px;
}

.v2-deck-side-grid::-webkit-scrollbar-track {
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-deck-side-grid::-webkit-scrollbar-thumb {
    border: 2px solid var(--v2-surface-2);
    border-radius: 8px;
    background: rgba(224, 180, 91, .62);
}

.v2-deck-side-grid::-webkit-scrollbar-thumb:hover {
    background: var(--v2-accent);
}

.v2-deck-side-item {
    flex: none;
    max-height: 72px;
    transition: max-height .18s ease;
}

.v2-deck-side-item img {
    object-position: top;
}

.v2-deck-side-item:hover,
.v2-deck-side-item:focus-within,
.v2-deck-side-item:last-child {
    max-height: 420px;
}

.v2-deck-image-tile {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-deck-image-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 2px var(--v2-surface);
}

.v2-deck-image-tile img {
    width: 100%;
}

.v2-deck-text-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .6fr);
    gap: 12px;
}

.v2-deck-text-side {
    display: grid;
    gap: 12px;
}

.v2-deck-text-table {
    width: 100%;
    color: var(--v2-text);
}

.v2-deck-text-table th {
    padding: 5px 0;
    color: var(--v2-muted);
    font-weight: 700;
}

.v2-deck-description {
    min-height: 90px;
}

.v2-deck-description a {
    color: var(--v2-accent);
}

.v2-deck-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.v2-deck-social-button {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border: 1px solid var(--v2-line);
    border-radius: 50%;
    color: var(--v2-text);
    background: var(--v2-surface);
}

.v2-deck-social-button img {
    width: 34px;
}

.v2-deck-social-button.is-pressed img {
    filter: invert(73%) sepia(31%) saturate(6009%) hue-rotate(0deg) brightness(105%) contrast(105%);
}

.v2-admin-grid-deck-meta {
    grid-template-columns: minmax(0, 1fr) 150px;
}

.v2-admin-grid-deck-meta .v2-admin-wide {
    grid-column: 1 / -1;
}

.v2-deck-builder-form .검색체크 {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-deck-builder-form input.검색체크 {
    display: none;
}

.v2-deck-builder-form .검색체크 > div > label {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
    cursor: pointer;
    font-size: .86rem;
    font-weight: 800;
}

.v2-deck-builder-form .검색체크 > div > label:has(> input.검색체크:checked) {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-deck-private-field {
    justify-content: end;
}

.v2-deck-private-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    width: 100%;
    margin-top: auto;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
    cursor: pointer;
    font-weight: 900;
}

.v2-deck-private-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    opacity: 0;
    pointer-events: none;
}

.v2-deck-private-toggle:has(input:checked) {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-deck-description-input.is-hidden {
    display: none;
}

.v2-deck-description-input .note-editor {
    border-color: var(--v2-line);
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-deck-description-input .note-editable {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-deck-builder-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 16px;
}

.v2-deck-search-panel {
    position: sticky;
    top: 12px;
    padding: 14px;
}

.v2-deck-card-search {
    display: grid;
    grid-template-columns: auto 92px;
    gap: 10px;
    align-items: end;
}

.v2-deck-card-search input[type="text"],
.v2-deck-card-search input[type="number"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-deck-frame-mode,
.v2-deck-search-keyword {
    grid-column: 1 / -1;
}

.v2-deck-frame-field input[type="number"] {
    text-align: center;
}

.v2-deck-search-keyword input[type="text"] {
    min-height: 46px;
    border-color: rgba(224, 180, 91, .5);
}

.v2-deck-frame-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-deck-search-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 720px;
    margin-top: 12px;
    overflow-y: auto;
    padding-right: 2px;
}

.v2-search-card,
.v2-builder-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-search-card {
    cursor: pointer;
}

.v2-search-card:hover,
.v2-builder-card:hover {
    border-color: rgba(224, 180, 91, .75);
}

.v2-search-card img,
.v2-builder-card img {
    width: 100%;
}

.v2-search-card div {
    display: grid;
    gap: 2px;
    padding: 7px;
}

.v2-search-card strong {
    overflow: hidden;
    color: var(--v2-text);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-search-card span {
    color: var(--v2-faint);
    font-size: .72rem;
}

.v2-deck-builder-main {
    display: grid;
    gap: 12px;
}

.v2-deck-builder-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
}

.v2-deck-builder-status span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
}

.v2-deck-builder-status strong {
    color: var(--v2-text);
}

.v2-deck-builder-zones {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "list list"
        "hand side";
    gap: 12px;
}

.v2-deck-builder-zone {
    min-height: 220px;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-deck-builder-zone[data-zone="list"] { grid-area: list; }
.v2-deck-builder-zone[data-zone="hand"] { grid-area: hand; }
.v2-deck-builder-zone[data-zone="side"] { grid-area: side; }

.v2-deck-builder-zone.is-drag-over {
    border-color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
}

.v2-deck-builder-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.v2-builder-card {
    cursor: grab;
}

.v2-builder-card.is-ultimate {
    border-color: rgba(224, 180, 91, .75);
}

.v2-builder-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(17, 17, 17, .35);
    border-radius: 8px;
    color: #fff;
    background: rgba(17, 17, 17, .72);
    font-weight: 900;
}

.v2-builder-card-actions {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    background: linear-gradient(180deg, rgba(17, 17, 17, .15), rgba(17, 17, 17, .9));
}

.v2-builder-card-actions button {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 30px;
    padding: 0 4px;
    border: 1px solid rgba(244, 241, 234, .28);
    border-radius: 8px;
    color: #f4f1ea;
    background: rgba(27, 27, 27, .86);
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.v2-builder-ultimate-badge,
.v2-builder-zone-badge {
    display: inline-flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border: 1px solid rgba(224, 180, 91, .6);
    border-radius: 8px;
    color: #111;
    background: var(--v2-accent);
    font-size: .78rem;
    font-weight: 900;
}

.v2-builder-zone-badge {
    border-color: rgba(91, 190, 176, .66);
    color: #d7fff8;
    background: rgba(13, 65, 63, .9);
}

.v2-builder-card-actions button:hover {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-collection-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.v2-collection-hidden-sort {
    display: none;
}

.v2-collection-pack-filter {
    grid-column: 1 / 4;
}

.v2-collection-pack-filter-full {
    grid-column: 1 / -1;
}

.v2-collection-toggle-box {
    grid-column: 4 / 5;
    align-items: center;
    justify-content: space-between;
    justify-self: end;
    width: min(190px, 100%);
    padding: 0;
}

.v2-collection-zero-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 62px;
    margin: 0;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface);
    cursor: pointer;
    font-size: .92rem;
    font-weight: 900;
    text-align: center;
    transition: color .15s ease, background-color .15s ease;
}

.v2-collection-zero-toggle::before {
    content: "";
    display: block;
    flex: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--v2-line);
    border-radius: 7px;
    background: var(--v2-surface-2);
}

.v2-collection-zero-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.v2-collection-zero-toggle:has(input:checked) {
    color: #111;
    background: var(--v2-accent);
}

.v2-collection-zero-toggle:has(input:checked)::before {
    border-color: #111;
    background:
        linear-gradient(135deg, transparent 0 36%, #111 37% 47%, transparent 48%),
        linear-gradient(45deg, transparent 0 48%, #111 49% 59%, transparent 60%);
    background-color: rgba(255, 255, 255, .22);
}

.v2-collection-zero-toggle:focus-within {
    outline: 2px solid var(--v2-accent);
    outline-offset: 3px;
}

.v2-collection-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.v2-collection-notice {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: rgba(255, 255, 255, .03);
    font-size: .9rem;
}

.v2-collection-table {
    display: grid;
    gap: 8px;
}

.v2-collection-header,
.v2-collection-row {
    display: grid;
    grid-template-columns: 88px minmax(180px, 1.5fr) 128px minmax(150px, 1fr) minmax(170px, auto);
    gap: 10px;
    align-items: center;
}

.v2-collection-table.is-login .v2-collection-header,
.v2-collection-table.is-login .v2-collection-row {
    grid-template-columns: 88px minmax(180px, 1.5fr) 128px minmax(150px, 1fr) minmax(270px, auto);
}

.v2-collection-header {
    padding: 0 12px;
    color: var(--v2-faint);
    font-size: .78rem;
    font-weight: 800;
}

.v2-collection-header button {
    width: fit-content;
    padding: 0;
    border: 0;
    color: var(--v2-faint);
    background: transparent;
    font: inherit;
}

.v2-collection-header button:hover,
.v2-collection-header button.is-active {
    color: var(--v2-accent);
}

.v2-collection-row {
    min-height: 122px;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-collection-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-collection-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 2px var(--v2-surface);
}

.v2-collection-image img {
    width: 100%;
}

.v2-collection-name {
    min-width: 0;
}

.v2-collection-name a,
.v2-collection-name span {
    display: block;
    overflow: hidden;
    color: var(--v2-text);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-collection-name small {
    display: block;
    margin-top: 4px;
    color: var(--v2-muted);
}

.v2-collection-code,
.v2-collection-pack {
    min-width: 0;
    overflow: hidden;
    color: var(--v2-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-collection-prints {
    display: grid;
    gap: 6px;
    justify-content: stretch;
}

.v2-collection-print {
    display: grid;
    grid-template-columns: 76px;
    justify-content: end;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.v2-collection-table.is-login .v2-collection-print {
    grid-template-columns: 76px 150px;
}

.v2-collection-print .v2-rare {
    min-width: 64px;
}

.v2-collection-count {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    gap: 6px;
    align-items: center;
}

.v2-count-button,
.v2-collection-count input {
    min-height: 36px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-count-button {
    display: grid;
    place-items: center;
    color: var(--v2-accent);
    font-weight: 900;
}

.v2-collection-count input {
    width: 100%;
    text-align: center;
}

.v2-collection-savebar {
    position: sticky;
    bottom: 14px;
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    pointer-events: none;
}

.v2-collection-savebar .v2-button {
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.v2-qna-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.v2-qna-search-row input[type="text"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-qna-faq-toggle,
.v2-qna-faq-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid rgba(224, 180, 91, .65);
    border-radius: 8px;
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
    font-size: .84rem;
    font-weight: 900;
}

.v2-qna-faq-toggle {
    gap: 7px;
    cursor: pointer;
}

.v2-qna-faq-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--v2-accent);
}

.v2-qna-list-page {
    display: grid;
    gap: 10px;
}

.v2-qna-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 160px;
    gap: 12px;
    align-items: center;
    min-height: 92px;
    padding: 14px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-qna-row:hover {
    border-color: rgba(224, 180, 91, .75);
}

.v2-qna-row-number {
    color: var(--v2-faint);
    font-weight: 900;
}

.v2-qna-row-main {
    min-width: 0;
}

.v2-qna-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.v2-qna-row-title h2 {
    overflow: hidden;
    margin: 0;
    color: var(--v2-text);
    font-size: 1.08rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-qna-row-main p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 6px;
    color: var(--v2-muted);
    font-size: .86rem;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.v2-qna-row-meta {
    display: grid;
    gap: 4px;
    justify-items: end;
    color: var(--v2-faint);
    font-size: .82rem;
}

.v2-qna-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.v2-qna-content {
    display: grid;
    gap: 12px;
}

.v2-qna-block {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-qna-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: #111;
    background: var(--v2-accent);
    font-size: 1.25rem;
    font-weight: 900;
}

.v2-qna-markdown {
    min-width: 0;
    color: var(--v2-text);
    line-height: 1.75;
}

.v2-qna-markdown p {
    margin-bottom: .75rem;
}

.v2-qna-markdown p:last-child {
    margin-bottom: 0;
}

.v2-qna-markdown pre,
.v2-qna-markdown code {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-qna-side {
    position: sticky;
    top: 12px;
}

.v2-qna-related-grid {
    display: grid;
    gap: 10px;
}

.v2-qna-related-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-qna-related-image {
    position: relative;
    background: var(--v2-surface-2);
}

.v2-qna-related-image img {
    width: 100%;
}

.v2-qna-related-body {
    min-width: 0;
    padding: 10px;
}

.v2-qna-related-body p {
    color: var(--v2-muted);
    font-size: .8rem;
}

.v2-qna-related-body strong {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--v2-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-admin-form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.v2-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.v2-admin-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v2-admin-grid-tag-faq {
    grid-template-columns: minmax(0, 1fr) 140px;
}

.v2-admin-grid-collection-create {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.v2-admin-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.v2-admin-field label {
    color: var(--v2-muted);
    font-size: .86rem;
    font-weight: 900;
}

.v2-admin-combo {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.v2-admin-combo-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v2-admin-combo-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.v2-admin-combo-type {
    grid-template-columns: minmax(0, 1fr) 92px;
}

.v2-admin-combo > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.v2-admin-wide {
    grid-column: span 2;
}

.v2-admin-collection-release {
    grid-column: 1 / -1;
}

.v2-admin-compact-check {
    align-items: center;
    min-height: 84px;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.v2-admin-inline-check {
    align-items: center;
    justify-content: center;
}

.v2-admin-field input,
.v2-admin-field select,
.v2-admin-field textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    color-scheme: var(--v2-control-scheme);
}

.v2-admin-field textarea {
    min-height: 170px;
    padding: 10px;
    line-height: 1.6;
}

.v2-admin-field input[type="text"],
.v2-admin-field input[type="number"],
.v2-admin-field input[type="url"],
.v2-admin-field input[type="email"],
.v2-admin-field input[type="password"],
.v2-admin-field select {
    padding: 0 10px;
}

.v2-admin-field input[type="file"] {
    padding: 8px;
}

.v2-admin-field select option {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-admin-checkbox {
    justify-content: center;
}

.v2-admin-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-height: 24px;
    accent-color: var(--v2-accent);
}

.v2-admin-field .rare {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-admin-field .rare > div > label,
.v2-admin-field .rare label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
}

.v2-admin-field .rare input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: var(--v2-accent);
}

.v2-admin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.v2-admin-form .errorlist {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(217, 105, 105, .55);
    border-radius: 8px;
    color: #ffd2d2;
    background: rgba(217, 105, 105, .08);
    list-style: none;
}

.v2-detail-import-form {
    display: grid;
    gap: 12px;
}

.v2-detail-import-preview {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
}

.v2-import-head {
    display: grid;
    gap: 12px;
}

.v2-import-head h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 1.25rem;
    font-weight: 900;
}

.v2-import-table td {
    vertical-align: top;
}

.v2-import-table small {
    display: block;
    margin-top: 4px;
    color: var(--v2-muted);
}

.v2-import-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    font-size: .82rem;
    font-weight: 900;
}

.v2-import-status.accent {
    border-color: rgba(255, 195, 96, .55);
    color: var(--v2-accent);
    background: rgba(255, 195, 96, .1);
}

.v2-import-status.success {
    border-color: rgba(91, 190, 176, .55);
    color: var(--v2-teal);
    background: rgba(91, 190, 176, .08);
}

.v2-import-status.warning {
    border-color: rgba(255, 195, 96, .55);
    color: var(--v2-accent);
    background: rgba(255, 195, 96, .1);
}

.v2-import-status.danger {
    border-color: rgba(217, 105, 105, .55);
    color: var(--v2-red);
    background: rgba(217, 105, 105, .08);
}

.v2-import-status.muted {
    color: var(--v2-muted);
}

.v2-import-warning {
    max-width: 280px;
    color: var(--v2-accent) !important;
    line-height: 1.45;
}

.v2-import-detail-text {
    min-width: 220px;
    max-width: 520px;
    color: var(--v2-muted) !important;
    white-space: normal;
    line-height: 1.55;
}

.v2-import-apply-form {
    display: flex;
    justify-content: flex-end;
}

.v2-qna-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.v2-qna-card-result {
    display: grid;
    gap: 8px;
}

.v2-qna-card-result .resultCardText {
    padding: 9px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    cursor: pointer;
}

.v2-qna-card-result .resultCardText:hover {
    border-color: var(--v2-accent);
    color: var(--v2-accent);
}

.v2-auth-wrap {
    display: grid;
    min-height: calc(100vh - 240px);
    place-items: center;
    padding: 28px 0;
}

.v2-auth-panel {
    width: min(100%, 480px);
    padding: 22px;
    display: grid;
    gap: 14px;
}

.v2-auth-inner-form {
    display: grid;
    gap: 14px;
}

.v2-auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    color: var(--v2-muted);
    font-size: .9rem;
}

.v2-auth-links a:hover {
    color: var(--v2-accent);
}

.v2-auth-note {
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: rgba(255, 255, 255, .03);
    line-height: 1.65;
}

.v2-auth-panel .errorlist {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(217, 105, 105, .55);
    border-radius: 8px;
    color: #ffd2d2;
    background: rgba(217, 105, 105, .08);
    list-style: none;
}

.v2-auth-panel .alert,
.v2-admin-form .alert {
    margin: 0;
    border-color: rgba(217, 105, 105, .55);
    color: #ffd2d2;
    background: rgba(217, 105, 105, .08);
}

.v2-profile-head {
    position: relative;
    display: flex;
    overflow: hidden;
    min-height: 188px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
}

.v2-profile-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}

.v2-profile-danger-zone p {
    margin: 6px 0 0;
    color: var(--v2-muted);
    line-height: 1.55;
}

.v2-profile-bg {
    position: absolute;
    right: 18px;
    bottom: -18px;
    width: min(300px, 34%);
    max-height: 118%;
    opacity: .16;
    object-fit: contain;
    pointer-events: none;
}

.v2-profile-title,
.v2-profile-edit {
    position: relative;
    z-index: 1;
}

.v2-profile-title {
    min-width: 0;
}

.v2-profile-edit {
    display: grid;
    width: min(260px, 100%);
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(17, 17, 17, .64);
}

.v2-profile-edit label {
    color: var(--v2-muted);
    font-size: .84rem;
    font-weight: 900;
}

.v2-profile-edit select {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    color-scheme: var(--v2-control-scheme);
}

.v2-profile-edit select option {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-section-head-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v2-profile-list {
    display: grid;
    gap: 8px;
}

.v2-profile-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 76px;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-profile-row:hover {
    border-color: rgba(224, 180, 91, .72);
}

.v2-profile-row strong,
.v2-profile-row span {
    display: block;
    min-width: 0;
}

.v2-profile-row strong {
    overflow: hidden;
    color: var(--v2-text);
    font-size: 1.02rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-profile-row span {
    color: var(--v2-muted);
    font-size: .86rem;
}

.v2-character-page {
    display: grid;
    gap: 14px;
}

.v2-character-shell {
    display: grid;
    gap: 14px;
}

.v2-character-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.v2-character-left {
    display: grid;
    gap: 10px;
}

.v2-character-card-frame {
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-character-card-frame img {
    width: 100%;
    aspect-ratio: 63 / 88;
    object-fit: cover;
}

.v2-character-control-box {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 88px 88px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-character-control-box .v2-button {
    width: 100%;
    min-width: 0;
}

.v2-character-control-box .v2-button:disabled {
    cursor: not-allowed;
    opacity: .38;
}

.v2-character-name-box {
    min-width: 0;
    text-align: center;
}

.v2-character-name-box strong,
.v2-character-name-box span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-character-name-box strong {
    color: var(--v2-text);
    font-size: 1.08rem;
    font-weight: 900;
}

.v2-character-name-box span {
    margin-top: 2px;
    color: var(--v2-muted);
    font-size: .82rem;
}

.v2-character-info-panel {
    display: grid;
    min-height: 100%;
    align-content: start;
    gap: 12px;
    padding: 16px;
}

.v2-character-page-switch {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: center;
}

.v2-character-page-switch strong {
    color: var(--v2-text);
    font-size: 1.1rem;
    font-weight: 900;
    text-align: center;
}

.v2-character-graph {
    display: flex;
    min-height: 360px;
    align-items: center;
    justify-content: center;
}

#캐릭터그래프 {
    max-width: 100%;
}

.v2-character-identity-grid {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.v2-character-identity-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
}

.v2-character-identity-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 2px var(--v2-surface);
}

.v2-character-identity-card img {
    width: 100%;
}

.v2-character-identity-card p {
    padding: 10px;
    color: var(--v2-muted);
    font-size: .86rem;
    font-weight: 800;
    text-align: center;
}

.v2-character-feature {
    color: var(--v2-muted);
    line-height: 1.7;
    text-align: center;
}

.v2-character-picker-wrap {
    overflow-x: auto;
    overflow-y: visible;
    padding: 8px 0 14px;
    scrollbar-color: rgba(224, 180, 91, .55) var(--v2-surface-2);
    scrollbar-width: thin;
}

.v2-character-picker-wrap::-webkit-scrollbar {
    height: 8px;
}

.v2-character-picker-wrap::-webkit-scrollbar-track {
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-character-picker-wrap::-webkit-scrollbar-thumb {
    border: 2px solid var(--v2-surface-2);
    border-radius: 8px;
    background: rgba(224, 180, 91, .62);
}

.v2-character-picker-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--v2-accent);
}

.v2-character-picker {
    --size: 50px;
    display: grid;
    grid-auto-rows: calc(var(--size) * 1.08);
    gap: 5px;
    min-width: max-content;
    place-items: start center;
    padding: 34px 0 58px;
    overflow: visible;
    white-space: nowrap;
}

.v2-character-picker div {
    width: calc(var(--size) * 1.4142);
    height: calc(var(--size) * 1.4142);
    grid-column: auto / span 2;
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
    transform: rotate(45deg);
}

.v2-character-picker .pickImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(52%);
    transition: filter .18s ease;
}

.v2-character-picker .pickImg:hover,
.v2-character-picker .pickImg.selected {
    cursor: pointer;
    filter: brightness(100%);
}

.v2-character-comment-form {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.v2-character-score-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.v2-character-score-grid > div {
    display: grid;
    gap: 6px;
}

.v2-character-score-grid label,
.v2-character-comment-form label {
    color: var(--v2-muted);
    font-size: .84rem;
    font-weight: 900;
}

.v2-character-score-grid select,
.v2-character-comment-form textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    color-scheme: var(--v2-control-scheme);
}

.v2-character-comment-form textarea {
    min-height: 104px;
    padding: 10px;
    line-height: 1.6;
}

.v2-character-comment-form #id_character {
    display: none;
}

.v2-character-comments {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    min-width: 0;
}

.v2-character-comment {
    min-width: 0;
    padding: 12px;
    overflow-wrap: anywhere;
}

.v2-character-comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin-bottom: 8px;
}

.v2-character-comment-head a {
    min-width: 0;
    max-width: 100%;
    color: var(--v2-text);
    font-weight: 900;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.v2-character-comment-head a:hover {
    color: var(--v2-accent);
}

.v2-character-comment-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.v2-character-comment-scores span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
    font-size: .82rem;
}

.v2-character-comment p {
    max-width: 100%;
    min-width: 0;
    margin-bottom: 0;
    color: var(--v2-muted);
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.v2-message-list {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.v2-message {
    padding: 10px 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface);
}

.v2-message.success {
    border-color: rgba(91, 190, 176, .55);
    color: #c5fff6;
    background: rgba(91, 190, 176, .08);
}

.v2-message.error {
    border-color: rgba(217, 105, 105, .55);
    color: #ffd2d2;
    background: rgba(217, 105, 105, .08);
}

.v2-tournament-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 240px) auto;
    gap: 10px;
    align-items: center;
}

.v2-tournament-code-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    gap: 14px;
    align-items: end;
    margin-bottom: 14px;
    padding: 14px;
}

.v2-tournament-code-panel strong,
.v2-tournament-tag-cloud strong {
    display: block;
    color: var(--v2-text);
    font-weight: 900;
}

.v2-tournament-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.v2-tournament-tag-cloud {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px;
}

.v2-tournament-tag-row {
    gap: 6px;
}

.v2-tournament-filter-row select,
.v2-tournament-input {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    color-scheme: var(--v2-control-scheme);
}

.v2-tournament-filter-row select option,
.v2-tournament-input option {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
}

.v2-tournament-card {
    display: grid;
    min-height: 220px;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background:
        var(--v2-tournament-card-gradient, linear-gradient(125deg, rgba(27, 27, 27, .98), rgba(27, 27, 27, .9) 62%, rgba(91, 190, 176, .12))),
        var(--v2-surface);
}

.v2-tournament-card:hover {
    border-color: rgba(224, 180, 91, .75);
    transform: translateY(-1px);
}

.v2-tournament-card h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 1.24rem;
    font-weight: 900;
    line-height: 1.32;
}

.v2-tournament-card p {
    color: var(--v2-muted);
    font-size: .92rem;
    line-height: 1.55;
}

.v2-tournament-card-top,
.v2-tournament-meta,
.v2-tournament-card-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v2-tournament-card-top span,
.v2-tournament-meta span,
.v2-tournament-card-bottom span,
.v2-tournament-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: rgba(255, 255, 255, .035);
    font-size: .82rem;
    font-weight: 800;
}

.v2-tournament-status.status-registration {
    border-color: rgba(91, 190, 176, .55);
    color: #c5fff6;
}

:root[data-theme="light"] .v2-tournament-status.status-registration {
    border-color: rgba(36, 125, 115, .55);
    color: #0e6259;
    background: rgba(36, 125, 115, .13);
}

.v2-tournament-status.status-running {
    border-color: rgba(224, 180, 91, .7);
    color: var(--v2-accent);
}

.v2-tournament-status.status-finished {
    border-color: rgba(133, 125, 115, .55);
    color: var(--v2-faint);
}

.v2-tournament-card-bottom {
    justify-content: space-between;
    margin-top: auto;
}

.v2-tournament-form {
    padding: 16px;
}

.v2-tournament-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v2-tournament-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-surface-2);
    cursor: pointer;
}

.v2-tournament-toggle input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: var(--v2-accent);
}

.v2-tournament-toggle:has(input:checked) {
    border-color: var(--v2-accent);
    color: #111;
    background: var(--v2-accent);
}

.v2-tournament-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
    padding: 20px;
}

.v2-tournament-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    max-width: 440px;
}

.v2-tournament-action-chip {
    border-color: rgba(224, 180, 91, .68);
    color: var(--v2-text);
    background:
        linear-gradient(135deg, rgba(224, 180, 91, .22), rgba(255, 255, 255, .05)),
        var(--v2-surface-2);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    text-decoration: none;
}

.v2-tournament-action-chip::before {
    content: "GO";
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    min-height: 18px;
    margin-right: 3px;
    border-radius: 6px;
    color: #12100b;
    background: var(--v2-accent);
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: 0;
}

.v2-tournament-action-chip.is-settings::before {
    content: "SET";
}

.v2-tournament-action-chip.is-board {
    border-color: rgba(91, 190, 176, .72);
    background:
        linear-gradient(135deg, rgba(91, 190, 176, .2), rgba(255, 255, 255, .05)),
        var(--v2-surface-2);
}

.v2-tournament-action-chip.is-board::before {
    content: "LIVE";
    color: #061b18;
    background: var(--v2-teal);
}

.v2-tournament-section-tabs {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    padding: 8px;
    overflow-x: auto;
    scrollbar-color: rgba(224, 180, 91, .55) rgba(255, 255, 255, .08);
}

.v2-tournament-section-tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-soft-bg);
    cursor: pointer;
    font-weight: 900;
    white-space: nowrap;
}

.v2-tournament-section-tabs button.is-active {
    border-color: rgba(224, 180, 91, .78);
    color: #111;
    background: var(--v2-accent);
}

.v2-round-switcher {
    display: flex;
    gap: 6px;
    align-items: center;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-color: rgba(224, 180, 91, .55) rgba(255, 255, 255, .08);
}

.v2-round-switcher button {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    background: var(--v2-soft-bg);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 900;
    white-space: nowrap;
}

.v2-round-switcher button.is-active {
    border-color: rgba(224, 180, 91, .78);
    color: #111;
    background: var(--v2-accent);
}

.v2-tournament-dashboard {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.v2-tournament-dashboard.v2-tournament-tabbed {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.v2-tournament-tabbed [data-tournament-panel][hidden] {
    display: none !important;
}

.v2-tournament-side {
    display: grid;
    position: sticky;
    top: 14px;
    gap: 10px;
}

.v2-tournament-tabbed .v2-tournament-side {
    position: sticky;
    top: 14px;
}

.v2-tournament-join {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.v2-tournament-join h2,
.v2-tournament-timer-panel h2,
.v2-tournament-stat-panel h3 {
    margin: 0;
    color: var(--v2-text);
    font-size: 1rem;
    font-weight: 900;
}

.v2-tournament-join-fields {
    display: grid;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 12px;
}

.v2-tournament-join-fields[disabled] {
    opacity: .74;
}

.v2-admin-field input:disabled,
.v2-admin-field select:disabled,
.v2-admin-field textarea:disabled,
.v2-tournament-input:disabled {
    border-color: rgba(133, 125, 115, .28);
    color: var(--v2-faint);
    background: rgba(255, 255, 255, .025);
    cursor: not-allowed;
}

.v2-tournament-join-fields[disabled] .v2-tournament-selected-deck,
.v2-tournament-join-fields[disabled] .v2-tournament-deck-results {
    pointer-events: none;
}

.v2-tournament-note {
    color: var(--v2-muted);
    font-size: .9rem;
    line-height: 1.55;
}

.v2-tournament-round-rule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v2-tournament-drop-form {
    display: grid;
}

.v2-tournament-main {
    min-width: 0;
}

.v2-tournament-timer-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}

.v2-tournament-timer {
    display: grid;
    place-items: center;
    min-width: 128px;
    min-height: 58px;
    border: 1px solid rgba(224, 180, 91, .55);
    border-radius: 8px;
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
    font-size: 1.7rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.v2-tournament-timer-stack {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.v2-tournament-round-timeout-action {
    display: grid;
}

.v2-tournament-round-timeout-action[hidden] {
    display: none !important;
}

.v2-tournament-round-timeout-action .v2-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: .82rem;
    white-space: nowrap;
}

.v2-tournament-timer.is-over {
    border-color: rgba(217, 105, 105, .55);
    color: #ffd2d2;
    background: rgba(217, 105, 105, .1);
    font-size: 1.05rem;
}

.v2-tournament-table-wrap {
    overflow-x: auto;
}

.v2-tournament-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.v2-tournament-table th,
.v2-tournament-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--v2-line);
    text-align: left;
    vertical-align: middle;
}

.v2-tournament-table th {
    color: var(--v2-muted);
    font-size: .82rem;
    font-weight: 900;
}

.v2-tournament-table td {
    color: var(--v2-text);
    font-size: .92rem;
}

.v2-tournament-top-cut-row td {
    background: rgba(224, 180, 91, .045);
}

.v2-tournament-cut-line td {
    padding: 7px 12px;
    color: var(--v2-accent);
    background:
        linear-gradient(90deg, rgba(224, 180, 91, .28), rgba(224, 180, 91, .05));
    font-size: .8rem;
    font-weight: 900;
    text-align: center;
}

.v2-tournament-table td span {
    display: block;
    color: var(--v2-muted);
    font-size: .8rem;
}

.v2-tournament-deck-list {
    display: grid;
    gap: 2px;
}

.v2-tournament-deck-list a {
    overflow: hidden;
    color: var(--v2-text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-tournament-deck-list span {
    color: var(--v2-muted);
    font-size: .8rem;
}

.v2-tournament-table a:hover {
    color: var(--v2-accent);
}

.v2-tournament-round-list,
.v2-tournament-match-list {
    display: grid;
    gap: 10px;
}

.v2-tournament-round {
    padding: 14px;
}

.v2-tournament-round[hidden] {
    display: none !important;
}

.v2-tournament-round-result-form {
    display: grid;
    gap: 10px;
}

.v2-tournament-round-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.v2-tournament-round-head strong,
.v2-tournament-round-head span {
    display: block;
}

.v2-tournament-round-head strong {
    color: var(--v2-text);
    font-weight: 900;
}

.v2-tournament-round-head span {
    color: var(--v2-muted);
    font-size: .86rem;
}

.v2-tournament-match {
    display: grid;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    --tournament-p1-hp-color: var(--v2-surface-2);
    --tournament-p2-hp-color: var(--v2-surface-2);
    --tournament-p1-character-img: none;
    --tournament-p2-character-img: none;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
        "table players"
        "actions actions";
    gap: 8px 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--tournament-p1-hp-color) 22%, transparent) 0%,
            transparent 34%,
            transparent 66%,
            color-mix(in srgb, var(--tournament-p2-hp-color) 22%, transparent) 100%),
        var(--v2-surface-2);
}

.v2-tournament-match::before,
.v2-tournament-match::after {
    content: "";
    position: absolute;
    top: 50%;
    z-index: 0;
    width: min(138px, 24%);
    height: 118%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: .16;
    pointer-events: none;
}

.v2-tournament-match::before {
    left: calc(50% - 108px);
    background-image: var(--tournament-p1-character-img);
    transform: translate(-50%, -50%);
}

.v2-tournament-match::after {
    right: calc(50% - 108px);
    background-image: var(--tournament-p2-character-img);
    transform: translate(50%, -50%);
}

.v2-tournament-match > * {
    position: relative;
    z-index: 1;
}

.v2-table-board-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 18px;
}

.v2-table-board-head-side {
    display: grid;
    gap: 10px;
    justify-items: end;
    min-width: min(320px, 42vw);
}

.v2-table-board-clock {
    display: grid;
    min-width: min(300px, 42vw);
    padding: 12px 16px;
    border: 1px solid rgba(224, 180, 91, .56);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(224, 180, 91, .2), rgba(255, 255, 255, .04)),
        var(--v2-surface-2);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .18);
    text-align: right;
}

.v2-table-board-clock span {
    color: var(--v2-muted);
    font-size: .8rem;
    font-weight: 900;
}

.v2-table-board-clock strong {
    color: var(--v2-accent);
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 900;
    line-height: .95;
    font-variant-numeric: tabular-nums;
}

.v2-table-board-clock strong.is-over {
    color: var(--v2-red);
    font-size: clamp(1.85rem, 4.6vw, 3.6rem);
}

.v2-table-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.v2-table-board-card {
    display: grid;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    --tournament-p1-hp-color: var(--v2-surface-2);
    --tournament-p2-hp-color: var(--v2-surface-2);
    --tournament-p1-character-img: none;
    --tournament-p2-character-img: none;
    min-height: 172px;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--tournament-p1-hp-color) 24%, transparent) 0%,
            transparent 36%,
            transparent 64%,
            color-mix(in srgb, var(--tournament-p2-hp-color) 24%, transparent) 100%),
        var(--v2-surface-2);
}

.v2-table-board-card::before,
.v2-table-board-card::after {
    content: "";
    position: absolute;
    top: 50%;
    z-index: 0;
    width: min(44%, 170px);
    height: 108%;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: .18;
    pointer-events: none;
}

.v2-table-board-card::before {
    left: 4px;
    transform: translateY(-50%);
    background-image: var(--tournament-p1-character-img);
    background-position: left center;
}

.v2-table-board-card::after {
    right: 4px;
    transform: translateY(-50%);
    background-image: var(--tournament-p2-character-img);
    background-position: right center;
}

.v2-table-board-card > * {
    position: relative;
    z-index: 1;
}

.v2-table-board-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(224, 180, 91, .56);
    border-radius: 8px;
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
    font-weight: 900;
}

.v2-table-board-players {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 14px 0;
}

.v2-table-board-players > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.v2-table-board-players > div:last-child {
    text-align: right;
}

.v2-table-board-players strong {
    overflow: hidden;
    color: var(--v2-text);
    font-size: clamp(1rem, 2.2vw, 1.22rem);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-table-board-players span {
    color: var(--v2-muted);
    font-size: .82rem;
    font-weight: 800;
}

.v2-table-board-players em {
    color: var(--v2-accent);
    font-size: .82rem;
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.v2-table-board-players .is-winner strong {
    color: var(--v2-accent);
}

.v2-table-board-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: auto;
}

.v2-table-board-bottom .v2-button,
.v2-table-board-bottom .v2-chip {
    min-height: 30px;
    padding: 5px 8px;
    font-size: .8rem;
}

.v2-tournament-table-no {
    display: grid;
    grid-area: table;
    place-items: center;
    min-height: 38px;
    border-radius: 8px;
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
    font-weight: 900;
}

.v2-tournament-players {
    display: grid;
    grid-area: players;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.v2-tournament-players span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-tournament-players span:first-child {
    text-align: left;
}

.v2-tournament-players span:last-child {
    text-align: right;
}

.v2-tournament-players span strong,
.v2-tournament-players span small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-tournament-players span small {
    margin-top: 2px;
    color: var(--v2-muted);
    font-size: .76rem;
    font-weight: 700;
}

.v2-tournament-players em {
    color: var(--v2-faint);
    font-style: normal;
    text-align: center;
}

.v2-tournament-players .is-winner {
    color: var(--v2-accent);
    font-weight: 900;
}

.v2-tournament-result-form {
    display: grid;
    grid-template-columns: 48px 12px 48px minmax(110px, 1fr);
    gap: 6px;
    align-items: center;
}

.v2-tournament-result-form input,
.v2-tournament-result-form select {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface);
    color-scheme: var(--v2-control-scheme);
}

.v2-tournament-result-form input {
    text-align: center;
}

.v2-tournament-result-form select option {
    color: var(--v2-text);
    background: var(--v2-surface-2);
}

.v2-tournament-match-actions {
    display: grid;
    grid-area: actions;
    grid-template-columns: repeat(3, max-content) minmax(220px, 1fr);
    gap: 7px;
    align-items: center;
    align-content: center;
    justify-content: flex-end;
    min-width: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.v2-tournament-match-actions .v2-tournament-result-form {
    grid-column: 4;
    min-width: 0;
}

.v2-tournament-match-actions .v2-button,
.v2-tournament-match-actions .v2-chip {
    white-space: nowrap;
}

.v2-tournament-match-actions .v2-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: .86rem;
}

.v2-battle-match-sudden {
    border-color: rgba(217, 105, 105, .7);
    color: var(--v2-red);
}

.v2-battle-start {
    padding: 18px;
}

.v2-simulator-start-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 14px;
    align-items: start;
}

.v2-battle-start-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.v2-battle-start-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.v2-simulator-deck-search-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.v2-simulator-deck-search-head {
    display: grid;
    gap: 4px;
}

.v2-simulator-deck-search-head strong {
    color: var(--v2-text);
    font-size: 1rem;
    font-weight: 900;
}

.v2-simulator-deck-search-head span {
    color: var(--v2-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.v2-simulator-deck-search-results {
    display: grid;
    gap: 7px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: rgba(224, 180, 91, .55) var(--v2-surface-2);
    scrollbar-width: thin;
}

.v2-simulator-deck-search-results::-webkit-scrollbar {
    width: 8px;
}

.v2-simulator-deck-search-results::-webkit-scrollbar-track {
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-simulator-deck-search-results::-webkit-scrollbar-thumb {
    border: 2px solid var(--v2-surface-2);
    border-radius: 8px;
    background: rgba(224, 180, 91, .62);
}

.v2-simulator-deck-result,
.v2-simulator-deck-search-empty {
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-simulator-deck-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
}

.v2-simulator-deck-result-body {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.v2-simulator-deck-result-body strong {
    overflow: hidden;
    color: var(--v2-text);
    font-size: .9rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-simulator-deck-result-body span {
    overflow: hidden;
    color: var(--v2-muted);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-simulator-deck-result-actions {
    display: flex;
    gap: 5px;
}

.v2-simulator-deck-result-actions .v2-button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: .78rem;
    font-weight: 900;
}

.v2-simulator-deck-search-empty {
    padding: 12px;
    color: var(--v2-muted);
    font-size: .86rem;
}

.v2-battle-share,
.v2-battle-center-actions,
.v2-battle-report-actions,
.v2-battle-history-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.v2-battle-share:empty {
    display: none;
}

.v2-battle-presence {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.v2-battle-share-modal .v2-battle-presence {
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.v2-battle-presence span {
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--v2-line);
    border-radius: 999px;
    color: var(--v2-muted);
    background: rgba(255, 255, 255, .04);
    font-size: .75rem;
    font-weight: 800;
}

.v2-battle-presence strong {
    color: var(--v2-text);
}

.v2-battle-mode .v2-header,
.v2-battle-mode .v2-footer,
.v2-battle-mode .v2-page-head {
    display: none;
}

.v2-battle-mode .v2-shell {
    width: min(1240px, calc(100% - 16px));
}

.v2-battle-mode .v2-content {
    padding-top: 8px;
    padding-bottom: 8px;
}

.v2-battle-page {
    display: grid;
}

.v2-battle-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1.25fr) minmax(148px, 176px) minmax(320px, 1.25fr);
    gap: 8px;
    align-items: stretch;
}

.v2-battle-player,
.v2-battle-center {
    gap: 5px;
    padding: 8px;
}

.v2-battle-player {
    display: grid;
    position: relative;
    --battle-hp-color: var(--v2-teal);
    --battle-hp-strong-color: var(--v2-teal);
    grid-template-columns: minmax(0, 1fr) 64px;
    grid-auto-rows: max-content;
    align-content: start;
    overflow: hidden;
    isolation: isolate;
    border-color: color-mix(in srgb, var(--battle-hp-color) 42%, var(--v2-line));
    background:
        radial-gradient(circle at 0 0, color-mix(in srgb, var(--battle-hp-color) 24%, transparent), transparent 44%),
        linear-gradient(135deg, color-mix(in srgb, var(--battle-hp-color) 14%, transparent), transparent 60%),
        var(--v2-panel-bg);
    transition: border-color .35s ease, box-shadow .35s ease;
}

.v2-battle-player::before {
    content: "";
    position: absolute;
    top: 18px;
    right: -10px;
    bottom: 8px;
    z-index: 0;
    width: min(78%, 440px);
    background-image: var(--battle-character-bg, none);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: contain;
    opacity: .28;
    pointer-events: none;
}

.v2-battle-player-p2::before {
    right: auto;
    left: -10px;
    background-position: left center;
}

.v2-battle-player-p2 {
    grid-template-columns: 64px minmax(0, 1fr);
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--battle-hp-color) 24%, transparent), transparent 44%),
        linear-gradient(225deg, color-mix(in srgb, var(--battle-hp-color) 14%, transparent), transparent 60%),
        var(--v2-panel-bg);
}

.v2-battle-player > * {
    position: relative;
    z-index: 1;
}

.v2-battle-center {
    display: flex;
    flex-direction: column;
    justify-self: center;
    width: 100%;
    max-width: 176px;
}

.v2-battle-center .v2-battle-round-clock,
.v2-battle-center .v2-battle-timer-top,
.v2-battle-center .v2-battle-big-timer,
.v2-battle-center .v2-battle-center-actions,
.v2-battle-center .v2-battle-set-panel,
.v2-battle-center .v2-battle-extra-time,
.v2-battle-center .v2-battle-character-selectors {
    grid-column: 1;
}

.v2-battle-player-head,
.v2-battle-passives {
    grid-column: 1 / -1;
}

.v2-battle-player-p2 .v2-battle-player-head {
    flex-direction: row-reverse;
    text-align: right;
}

.v2-battle-player-p2 .v2-battle-player-head > strong {
    text-align: left;
}

.v2-battle-player-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.v2-battle-player-head h2 {
    margin: 2px 0 0;
    color: var(--v2-text);
    font-size: 1.35rem;
    font-weight: 900;
}

.v2-battle-player-head > strong {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-accent);
    background: rgba(224, 180, 91, .08);
    font-size: .84rem;
}

.v2-battle-character {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 124px;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-battle-character img {
    width: 96px;
    height: 104px;
    object-fit: contain;
}

.v2-battle-character strong,
.v2-battle-character span {
    display: block;
}

.v2-battle-character strong {
    color: var(--v2-text);
    font-size: 1.08rem;
    font-weight: 900;
}

.v2-battle-character span,
.v2-battle-empty {
    color: var(--v2-muted);
    font-size: .86rem;
}

.v2-battle-character-empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 88px;
    color: var(--v2-muted);
    font-weight: 800;
}

.v2-battle-hp {
    display: grid;
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

.v2-battle-player-p2 .v2-battle-hp {
    grid-column: 2;
}

.v2-battle-hp > div {
    display: grid;
    position: relative;
    grid-column: 1 / -1;
    grid-row: 1;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface);
    background: color-mix(in srgb, var(--v2-surface) 82%, transparent);
    backdrop-filter: blur(2px);
}

.v2-battle-hp span {
    color: var(--v2-muted);
    font-size: .8rem;
    font-weight: 900;
}

.v2-battle-hp strong {
    color: var(--v2-text);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 900;
    line-height: 1;
}

.v2-battle-hp-delta {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    color: var(--battle-hp-strong-color);
    font-size: clamp(1.15rem, 2.1vw, 1.55rem);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .38);
    pointer-events: none;
    animation: v2-battle-hp-delta-fade 1.1s ease-out forwards;
}

.v2-battle-hp-pending {
    position: absolute;
    top: 7px;
    right: 9px;
    z-index: 3;
    min-width: 54px;
    padding: 3px 7px;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--battle-hp-strong-color);
    background: color-mix(in srgb, var(--v2-panel-bg) 76%, transparent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
    font-size: clamp(.95rem, 1.8vw, 1.25rem);
    font-weight: 900;
    line-height: 1;
    text-align: center;
    pointer-events: none;
}

.v2-battle-hp-delta.is-damage {
    color: var(--v2-red);
}

.v2-battle-hp-delta.is-heal {
    color: var(--v2-teal);
}

.v2-battle-hp-pending.is-damage {
    color: var(--v2-red);
}

.v2-battle-hp-pending.is-heal {
    color: var(--v2-teal);
}

@keyframes v2-battle-hp-delta-fade {
    0% {
        opacity: 0;
        transform: translateY(4px) scale(.94);
    }

    14% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-14px) scale(.98);
    }
}

.v2-battle-hp-button {
    display: grid;
    place-items: center;
    grid-row: 2;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-soft-bg);
    background: color-mix(in srgb, var(--v2-soft-bg) 84%, transparent);
    backdrop-filter: blur(2px);
    font-size: 1.8rem;
    font-weight: 900;
}

.v2-battle-hp-button[data-hp-step="-500"] {
    grid-column: 1;
}

.v2-battle-hp-button[data-hp-step="-100"] {
    grid-column: 2;
}

.v2-battle-hp-button[data-hp-step="100"] {
    grid-column: 3;
}

.v2-battle-hp-button[data-hp-step="500"] {
    grid-column: 4;
}

.v2-battle-hp-button.is-damage {
    border-color: rgba(217, 105, 105, .55);
    color: var(--v2-red);
}

.v2-battle-hp-button.is-heal {
    border-color: rgba(91, 190, 176, .55);
    color: var(--v2-teal);
}

.v2-battle-hp-button:disabled {
    color: var(--v2-faint);
    cursor: not-allowed;
    opacity: .55;
}

.v2-battle-fp {
    display: grid;
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.v2-battle-player-p2 .v2-battle-fp {
    grid-column: 1;
}

.v2-battle-fp-button,
.v2-battle-fp-value {
    display: grid;
    place-items: center;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    background: color-mix(in srgb, var(--v2-surface-2) 84%, transparent);
    backdrop-filter: blur(2px);
    font-weight: 900;
}

.v2-battle-fp-button {
    font-size: 1.35rem;
}

.v2-battle-fp-button[data-fp-step="1"] {
    grid-row: 1;
}

.v2-battle-fp-value {
    grid-row: 2;
}

.v2-battle-fp-button[data-fp-step="-1"] {
    grid-row: 3;
}

.v2-battle-fp-value {
    color: var(--v2-muted);
}

.v2-battle-fp-value.is-positive {
    border-color: rgba(91, 190, 176, .64);
    color: var(--v2-teal);
    background: linear-gradient(135deg, rgba(91, 190, 176, .2), color-mix(in srgb, var(--v2-surface-2) 84%, transparent) 72%);
}

.v2-battle-fp-value.is-negative {
    border-color: rgba(217, 105, 105, .68);
    color: var(--v2-red);
    background: linear-gradient(135deg, rgba(217, 105, 105, .22), color-mix(in srgb, var(--v2-surface-2) 84%, transparent) 72%);
}

.v2-battle-fp-value.is-zero {
    color: var(--v2-purple);
}

.v2-battle-fp-value span,
.v2-battle-fp-value strong {
    display: block;
    line-height: 1;
}

.v2-battle-fp-value span {
    margin-bottom: 3px;
    color: var(--v2-muted);
    font-size: .7rem;
    font-weight: 800;
}

.v2-battle-fp-value strong {
    font-size: 1.08rem;
}

.v2-battle-fp-button:disabled,
.v2-battle-fp-value:disabled {
    color: var(--v2-faint);
    cursor: not-allowed;
    opacity: .55;
}

.v2-battle-passives {
    display: grid;
    gap: 8px;
}

.v2-battle-passive-custom {
    display: grid;
    gap: 8px;
}

.v2-battle-passive-custom button,
.v2-battle-passive-custom input,
.v2-battle-passive-custom select,
.v2-battle-passive-custom textarea {
    color: var(--v2-text);
    font: inherit;
}

.v2-battle-passive-row,
.v2-battle-passive-memo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft-bg);
    background: color-mix(in srgb, var(--v2-soft-bg) 84%, transparent);
    backdrop-filter: blur(2px);
}

.v2-battle-passive-row strong {
    overflow: hidden;
    color: var(--v2-text);
    font-size: .9rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-battle-passive-row > div {
    display: grid;
    grid-template-columns: 34px 30px 34px;
    gap: 4px;
    align-items: center;
    text-align: center;
}

.v2-battle-passive-row .v2-button {
    min-height: 30px;
    padding: 4px;
}

.v2-battle-passive-memo input,
.v2-battle-character-select select,
.v2-battle-start input,
.v2-battle-start select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    color-scheme: var(--v2-control-scheme);
}

.v2-battle-passive-memo input::placeholder {
    color: var(--v2-faint);
}

.v2-battle-center-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    justify-items: stretch;
}

.v2-battle-timer-top {
    display: flex;
    gap: 4px;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.v2-battle-top-spacer {
    display: block;
}

.v2-battle-report-actions {
    display: grid;
    grid-template-columns: 1fr;
}

.v2-battle-report-actions:has([data-report-set][hidden]) {
    display: none;
}

.v2-battle-report-actions .v2-button {
    width: 100%;
    min-height: 38px;
}

.v2-battle-center-actions .v2-button,
.v2-battle-timer-top .v2-button {
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 30px;
    min-height: 40px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    line-height: 1;
    white-space: nowrap;
}

.v2-battle-timer-top .v2-button {
    inline-size: 30px;
    block-size: 30px;
    min-inline-size: 0;
    min-block-size: 30px;
    max-inline-size: 30px;
}

.v2-battle-center-actions .v2-button::before,
.v2-battle-timer-top .v2-button::before {
    color: inherit;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.v2-battle-center-actions [data-battle-action="undo"]::before {
    content: "↶";
}

.v2-battle-center-actions [data-tournament-return]::before,
.v2-battle-timer-top [data-tournament-return]::before,
.v2-battle-timer-top [data-battle-back]::before {
    content: "←";
}

.v2-battle-center-actions [data-battle-action="sudden"]::before,
.v2-battle-timer-top [data-battle-action="sudden"]::before {
    content: "SD";
    font-size: .74rem;
}

.v2-battle-center-actions [data-history-toggle]::before {
    content: "≡";
}

.v2-battle-center-actions [data-share-toggle]::before {
    content: "↗";
}

.v2-battle-center-actions [data-fullscreen-toggle]::before {
    content: "⛶";
}

.v2-battle-center-actions [data-copy-kind="view"]::before {
    content: "V";
}

.v2-battle-center-actions [data-copy-kind="control"]::before {
    content: "C";
}

.v2-battle-center-actions [data-copy-link].is-copied::before {
    content: "✓";
    color: var(--v2-teal);
}

.v2-battle-center-actions .is-active,
.v2-battle-timer-top .is-active {
    border-color: rgba(217, 105, 105, .8);
    color: #fff;
    background: var(--v2-red);
}

.v2-battle-big-timer {
    display: grid;
    flex: 1 1 auto;
    gap: 4px;
    place-items: center;
    min-height: 128px;
    border: 1px solid rgba(224, 180, 91, .58);
    border-radius: 8px;
    color: var(--v2-text);
    background:
        linear-gradient(180deg, var(--battle-timer-danger-color, rgba(217, 105, 105, 0)), rgba(224, 180, 91, .14)),
        var(--v2-soft-bg);
    font-weight: 900;
}

.v2-battle-big-timer span {
    color: var(--v2-muted);
    font-size: .68rem;
}

.v2-battle-big-timer strong {
    color: var(--v2-accent);
    font-size: clamp(3rem, 7vw, 4.8rem);
    line-height: .9;
}

.v2-battle-big-timer.is-active {
    border-color: rgba(91, 190, 176, .75);
    background:
        linear-gradient(180deg, var(--battle-timer-danger-color, rgba(217, 105, 105, 0)), rgba(91, 190, 176, .18)),
        var(--v2-soft-bg);
}

.v2-battle-set-panel {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft-bg);
}

.v2-battle-set-panel span {
    color: var(--v2-muted);
    font-size: .82rem;
}

.v2-battle-set-panel strong {
    color: var(--v2-text);
    font-size: 1.25rem;
    font-weight: 900;
}

.v2-battle-round-clock {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    justify-self: stretch;
    flex-grow: 1;
    min-width: 0;
    min-height: 30px;
    padding: 0 4px;
    overflow: hidden;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
}

.v2-battle-round-clock span {
    flex: 0 1 auto;
    max-width: 100%;
    overflow: hidden;
    color: var(--v2-muted);
    font-size: .62rem;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-battle-round-clock strong {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    color: var(--v2-text);
    font-size: .86rem;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-battle-round-clock .is-danger {
    color: var(--v2-red);
}

.v2-battle-force-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.v2-battle-force-actions .v2-button {
    width: 100%;
    min-height: 38px;
    padding-right: 8px;
    padding-left: 8px;
    white-space: nowrap;
}

.v2-battle-extra-time {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.v2-battle-extra-time .v2-button {
    width: 100%;
}

:root[data-theme="light"] .v2-battle-center-actions .is-active {
    color: #fff;
}

:root[data-theme="light"] .v2-battle-timer-top .is-active {
    color: #fff;
}

.v2-battle-character-selectors {
    display: grid;
    gap: 8px;
}

.v2-battle-character-select {
    display: grid;
    gap: 5px;
    color: var(--v2-muted);
    font-size: .84rem;
    font-weight: 800;
}

.v2-battle-history-head {
    display: none;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: var(--v2-panel-bg);
}

.v2-battle-history {
    display: none;
    gap: 7px;
    max-height: 430px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 0 0 8px 8px;
    background: var(--v2-panel-bg);
    scrollbar-color: rgba(224, 180, 91, .55) rgba(255, 255, 255, .08);
}

.v2-battle-history-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    border: 0;
    background: rgba(0, 0, 0, .5);
}

.v2-battle-history-open .v2-battle-history-backdrop {
    display: block;
}

.v2-battle-history-open .v2-battle-history-head {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    z-index: 80;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: min(560px, calc(100vw - 24px));
    transform: translateX(-50%);
}

.v2-battle-history-head > strong {
    justify-self: start;
}

.v2-battle-history-head .v2-battle-reset-button {
    justify-self: center;
    min-height: 34px;
}

.v2-battle-history-head [data-history-toggle] {
    justify-self: end;
}

.v2-battle-history-open .v2-battle-history {
    position: fixed;
    top: calc(max(18px, env(safe-area-inset-top)) + 54px);
    left: 50%;
    z-index: 80;
    display: grid;
    width: min(560px, calc(100vw - 24px));
    max-height: min(72vh, 560px);
    transform: translateX(-50%);
}

.v2-battle-share-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    border: 0;
    background: rgba(0, 0, 0, .5);
}

.v2-battle-share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 82;
    display: none;
    width: min(320px, calc(100vw - 24px));
    gap: 8px;
    transform: translate(-50%, -50%);
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-panel-bg);
    box-shadow: var(--v2-shadow);
}

.v2-battle-share-open .v2-battle-share-backdrop,
.v2-battle-share-open .v2-battle-share-modal {
    display: grid;
}

.v2-battle-share-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.v2-battle-share-head strong {
    color: var(--v2-text);
    font-weight: 900;
}

.v2-battle-share-modal > .v2-button:not(.is-copied) {
    justify-content: center;
}

.v2-battle-share-modal > .v2-button.is-copied::after {
    content: "완료";
    margin-left: 6px;
    color: var(--v2-teal);
}

.v2-realtime-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 130;
    max-width: min(360px, calc(100vw - 32px));
    padding: 10px 12px;
    border: 1px solid rgba(217, 105, 105, .58);
    border-radius: 8px;
    color: var(--v2-text);
    background: rgba(27, 19, 20, .95);
    box-shadow: var(--v2-shadow);
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .16s ease, transform .16s ease;
}

.v2-realtime-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.v2-session-history {
    margin-top: 18px;
}

.v2-session-history[hidden] {
    display: none;
}

.v2-session-history header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.v2-session-history header strong {
    font-size: 1rem;
}

.v2-session-history header span {
    color: var(--v2-muted);
    font-size: .84rem;
}

.v2-session-history-list {
    display: grid;
    gap: 8px;
}

.v2-session-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft-bg);
    color: inherit;
    text-decoration: none;
}

.v2-session-history-row:hover {
    border-color: rgba(56, 114, 168, .42);
    background: var(--v2-soft-bg);
    box-shadow: inset 0 0 0 1px rgba(56, 114, 168, .18);
}

.v2-session-history-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-session-history-row small {
    flex: 0 0 auto;
    color: var(--v2-muted);
    font-size: .75rem;
}

.v2-battle-history-row {
    display: grid;
    gap: 2px;
    width: min(88%, 420px);
    padding: 8px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft-bg);
}

.v2-battle-history-row strong,
.v2-battle-history-row span {
    display: block;
}

.v2-battle-history-row strong {
    color: var(--v2-text);
    font-size: .88rem;
    font-weight: 900;
}

.v2-battle-history-row span {
    color: var(--v2-muted);
    font-size: .78rem;
}

.v2-battle-history-row.is-p1 {
    justify-self: start;
    text-align: left;
    border-color: color-mix(in srgb, var(--v2-teal) 46%, var(--v2-line));
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--v2-teal) 22%, transparent), transparent 72%),
        var(--v2-soft-bg);
}

.v2-battle-history-row.is-p2 {
    justify-self: end;
    text-align: right;
    border-color: color-mix(in srgb, var(--v2-red) 40%, var(--v2-line));
    background:
        linear-gradient(270deg, color-mix(in srgb, var(--v2-red) 20%, transparent), transparent 72%),
        var(--v2-soft-bg);
}

.v2-battle-history-row.is-global {
    justify-self: center;
    text-align: center;
    border-color: color-mix(in srgb, var(--v2-accent) 42%, var(--v2-line));
    background:
        linear-gradient(90deg, transparent, color-mix(in srgb, var(--v2-accent) 18%, transparent) 50%, transparent),
        var(--v2-soft-bg);
}

.v2-battle-history-row.is-undone {
    opacity: .58;
}

.v2-tournament-round-actions {
    display: flex;
    justify-content: flex-end;
}

.v2-tournament-stats-grid {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
}

.v2-tournament-stat-panel {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px;
}

.v2-tournament-stat-chip-row {
    gap: 7px;
}

.v2-tournament-stat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-tournament-stat-row span {
    min-width: 0;
    overflow: hidden;
    color: var(--v2-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-tournament-stat-row small {
    color: var(--v2-muted);
}

.v2-tournament-stat-row strong {
    color: var(--v2-accent);
    font-size: .88rem;
}

.v2-tournament-submission-panel {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.v2-tournament-submission-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-tournament-submission-row > strong {
    color: var(--v2-text);
    font-weight: 900;
}

.v2-tournament-round-stat {
    display: grid;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--v2-line);
}

.v2-tournament-round-stat:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.v2-tournament-round-stat > strong {
    color: var(--v2-muted);
    font-size: .86rem;
    font-weight: 900;
}

.v2-tournament-deck-picker {
    position: relative;
}

.v2-tournament-deck-picker input[type="hidden"] {
    display: none;
}

.v2-tournament-selected-deck {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.v2-tournament-selected-deck strong {
    overflow: hidden;
    color: var(--v2-text);
    font-size: .9rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-tournament-selected-deck span {
    color: var(--v2-muted);
    font-size: .8rem;
}

.v2-tournament-deck-results {
    display: grid;
    gap: 6px;
    max-height: 314px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: rgba(224, 180, 91, .55) var(--v2-surface-2);
    scrollbar-width: thin;
}

.v2-tournament-deck-results::-webkit-scrollbar {
    width: 8px;
}

.v2-tournament-deck-results::-webkit-scrollbar-track {
    border-radius: 8px;
    background: var(--v2-surface-2);
}

.v2-tournament-deck-results::-webkit-scrollbar-thumb {
    border: 2px solid var(--v2-surface-2);
    border-radius: 8px;
    background: rgba(224, 180, 91, .62);
}

.v2-tournament-deck-results::-webkit-scrollbar-thumb:hover {
    background: var(--v2-accent);
}

.v2-tournament-deck-result {
    display: grid;
    width: 100%;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-text);
    background: var(--v2-surface-2);
    text-align: left;
}

.v2-tournament-deck-result:hover {
    border-color: var(--v2-accent);
}

.v2-tournament-deck-result strong,
.v2-tournament-deck-result span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-tournament-deck-result strong {
    font-size: .9rem;
}

.v2-tournament-deck-result span,
.v2-tournament-deck-result.is-empty {
    color: var(--v2-muted);
    font-size: .8rem;
}

@media screen and (max-width: 980px) {
    .v2-page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .v2-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 40px;
        gap: 8px;
        align-items: center;
        min-height: 58px;
        padding: 8px 0;
    }

    .v2-brand {
        min-width: 0;
    }

    .v2-brand-mark {
        width: 34px;
        height: 34px;
    }

    .v2-brand strong {
        font-size: .98rem;
    }

    .v2-brand small {
        font-size: .68rem;
    }

    .v2-menu-toggle {
        display: grid;
        align-content: center;
        gap: 4px;
        cursor: pointer;
    }

    .v2-header-menu {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding: 8px 0 2px;
        border-top: 1px solid var(--v2-line);
    }

    .v2-header-menu.is-open {
        display: grid;
        gap: 8px;
    }

    .v2-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .v2-nav a {
        min-width: 0;
        min-height: 34px;
        padding: 6px 4px;
        font-size: .82rem;
    }

    .v2-account {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
        gap: 6px;
    }

    .v2-account > *,
    .v2-language-select {
        width: 100%;
    }

    .v2-account a,
    .v2-theme-toggle,
    .v2-language-select {
        min-height: 34px;
        padding: 6px 8px;
        font-size: .82rem;
    }

    .v2-search-row {
        grid-template-columns: 1fr;
    }

    .v2-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-error-wrap {
        grid-template-columns: 1fr;
    }

    .v2-error-code {
        min-height: 128px;
    }

    .v2-guide-layout {
        grid-template-columns: 1fr;
    }

    .v2-guide-toc {
        position: static;
    }

    .v2-collection-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-collection-pack-filter {
        grid-column: 1 / 2;
    }

    .v2-collection-pack-filter-full {
        grid-column: 1 / -1;
    }

    .v2-collection-toggle-box {
        grid-column: 2 / 3;
    }

    .v2-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v2-detail-grid {
        grid-template-columns: 1fr;
    }

    .v2-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v2-qna-detail-grid {
        grid-template-columns: 1fr;
    }

    .v2-qna-side {
        position: static;
    }

    .v2-qna-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-deck-detail-head {
        align-items: stretch;
    }

    .v2-deck-detail-head.has-ultimate {
        grid-template-columns: 1fr;
    }

    .v2-deck-detail-head.has-ultimate .v2-deck-detail-bg {
        right: 24px;
        width: min(260px, 32%);
    }

    .v2-deck-detail-actions {
        justify-content: flex-start;
    }

    .v2-deck-board,
    .v2-deck-text-grid,
    .v2-deck-builder-layout {
        grid-template-columns: 1fr;
    }

    .v2-deck-board {
        grid-template-areas:
            "list"
            "hand"
            "side";
    }

    .v2-deck-search-panel {
        position: static;
    }

    .v2-admin-grid,
    .v2-admin-grid-two,
    .v2-admin-grid-tag-faq,
    .v2-admin-grid-collection-create,
    .v2-admin-grid-deck-meta,
    .v2-qna-editor-grid {
        grid-template-columns: 1fr;
    }

    .v2-profile-head {
        align-items: stretch;
        flex-direction: column;
    }

    .v2-profile-bg {
        width: min(260px, 45%);
        opacity: .12;
    }

    .v2-character-layout {
        grid-template-columns: 1fr;
    }

    .v2-character-left {
        width: min(420px, 100%);
        margin-right: auto;
        margin-left: auto;
    }

    .v2-character-score-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v2-tournament-hero,
    .v2-tournament-code-panel,
    .v2-tournament-dashboard,
    .v2-tournament-dashboard.v2-tournament-tabbed,
    .v2-tournament-stats-grid,
    .v2-tournament-round-rule-grid {
        grid-template-columns: 1fr;
    }

    .v2-tournament-hero-meta {
        justify-content: flex-start;
        max-width: none;
    }

    .v2-tournament-side,
    .v2-tournament-tabbed .v2-tournament-side {
        position: static;
    }

    .v2-tournament-match-actions {
        justify-content: stretch;
    }

    .v2-tournament-submission-row {
        grid-template-columns: 1fr;
    }

    .v2-tournament-match > .v2-chip {
        grid-column: 1 / -1;
    }

    .v2-admin-wide {
        grid-column: auto;
    }
}

@media screen and (max-width: 640px) {
    .v2-shell {
        width: min(100% - 20px, 1320px);
    }

    .v2-content {
        padding: 8px 0 36px;
    }

    .v2-page-head {
        gap: 8px;
        margin-bottom: 12px;
    }

    .v2-kicker {
        font-size: .7rem;
    }

    .v2-title {
        margin-top: 2px;
        font-size: 1.45rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .v2-subtitle {
        margin-top: 4px;
        font-size: .84rem;
        line-height: 1.45;
    }

    .v2-page-head .v2-chip-row,
    .v2-page-head .v2-rulebook-page-actions {
        gap: 4px;
    }

    .v2-page-head .v2-button {
        min-height: 30px;
        padding: 4px 8px;
        font-size: .78rem;
    }

    .v2-page-head .v2-chip {
        min-height: 26px;
        padding: 3px 7px;
        font-size: .75rem;
    }

    .v2-filter-grid,
    .v2-stat-grid {
        grid-template-columns: 1fr;
    }

    .v2-collection-filter-grid {
        grid-template-columns: 1fr;
    }

    .v2-qna-search-row,
    .v2-qna-row {
        grid-template-columns: 1fr;
    }

    .v2-qna-row-meta {
        justify-items: start;
    }

    .v2-qna-block {
        grid-template-columns: 1fr;
    }

    .v2-auth-panel {
        padding: 16px;
    }

    .v2-profile-row {
        grid-template-columns: 1fr;
    }

    .v2-profile-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .v2-profile-danger-zone .v2-button {
        justify-content: center;
        width: 100%;
    }

    .v2-profile-bg {
        width: min(220px, 58%);
    }

    .v2-character-control-box {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v2-character-name-box {
        grid-column: 1 / -1;
        grid-row: auto;
        order: -1;
    }

    .v2-character-info-panel {
        padding: 12px;
    }

    .v2-character-graph {
        min-height: 280px;
    }

    .v2-character-identity-grid,
    .v2-character-score-grid {
        grid-template-columns: 1fr;
    }

    .v2-character-comment-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .v2-admin-combo-2,
    .v2-admin-combo-3,
    .v2-admin-combo-type {
        grid-template-columns: 1fr;
    }

    .v2-collection-pack-filter,
    .v2-collection-pack-filter-full,
    .v2-collection-toggle-box {
        grid-column: auto;
    }

    .v2-collection-toggle-box {
        justify-self: stretch;
        width: 100%;
    }

    .v2-filter-wide {
        grid-column: auto;
    }

    .v2-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-deck-card-grid,
    .v2-deck-hand-grid,
    .v2-deck-side-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-deck-side-grid {
        display: grid;
        overflow-y: visible;
        padding-right: 0;
    }

    .v2-deck-side-item {
        max-height: none;
    }

    .v2-deck-ultimate-card {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .v2-deck-builder-zones {
        grid-template-columns: 1fr;
        grid-template-areas:
            "list"
            "hand"
            "side";
    }

    .v2-deck-card-search {
        grid-template-columns: 1fr;
    }

    .v2-deck-search-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .v2-deck-builder-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-deck-grid {
        grid-template-columns: 1fr;
    }

    .v2-deck-card {
        min-height: 206px;
        padding: 14px;
    }

    .v2-deck-main {
        padding-right: 72px;
    }

    .v2-deck-author {
        right: 14px;
        max-width: 34%;
    }

    .v2-deck-bg {
        width: min(50%, 160px);
        opacity: .12;
    }

    .v2-card-body {
        padding: 10px;
    }

    .v2-card-name {
        font-size: 1rem;
    }

    .v2-release-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "date code"
            "pack rare";
        align-items: start;
    }

    .v2-rare-list {
        justify-self: end;
    }

    .v2-card-edition-modal {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 24px);
    }

    .v2-card-edition-options {
        grid-template-columns: 1fr;
        padding: 8px;
    }

    .v2-card-edition-option {
        grid-template-columns: 54px minmax(0, 1fr) auto;
        min-height: 78px;
    }

    .v2-card-edition-thumb {
        width: 54px;
    }

    .v2-collection-header {
        display: none;
    }

    .v2-collection-row,
    .v2-collection-table.is-login .v2-collection-row {
        grid-template-columns: 74px minmax(0, 1fr);
        grid-template-areas:
            "image name"
            "image code"
            "prints prints";
        min-height: 106px;
        align-items: start;
    }

    .v2-collection-image {
        grid-area: image;
    }

    .v2-collection-name {
        grid-area: name;
    }

    .v2-collection-code {
        grid-area: code;
        font-size: .86rem;
    }

    .v2-collection-pack {
        display: none;
    }

    .v2-collection-prints {
        grid-area: prints;
        justify-self: stretch;
        justify-content: stretch;
    }

    .v2-collection-count {
        width: 132px;
    }

    .v2-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-qna-related-grid {
        grid-template-columns: 1fr;
    }

    .v2-footer {
        flex-direction: column;
    }

    .v2-tournament-grid,
    .v2-tournament-create-grid {
        grid-template-columns: 1fr;
    }

    .v2-battle-layout,
    .v2-simulator-start-layout,
    .v2-battle-start-grid {
        grid-template-columns: 1fr;
    }

    .v2-battle-center {
        grid-template-columns: minmax(0, 1fr) 86px;
        order: -1;
        max-width: none;
    }

    .v2-battle-player {
        min-height: auto;
    }

    .v2-tournament-filter-row,
    .v2-tournament-timer-panel,
    .v2-tournament-round-head {
        align-items: stretch;
        flex-direction: column;
    }

    .v2-tournament-timer-stack {
        justify-items: stretch;
    }

    .v2-tournament-filter-row,
    .v2-tournament-code-row {
        grid-template-columns: 1fr;
    }

    .v2-table-board-head {
        display: grid;
        padding: 14px;
    }

    .v2-table-board-head-side,
    .v2-table-board-clock {
        justify-items: stretch;
        width: 100%;
        min-width: 0;
    }

    .v2-table-board-clock {
        text-align: left;
    }

    .v2-table-board-grid {
        grid-template-columns: 1fr;
    }

    .v2-tournament-players {
        grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
        gap: 5px;
    }

    .v2-tournament-players em {
        font-size: .78rem;
        text-align: center;
    }

    .v2-tournament-match-actions {
        grid-template-columns: repeat(3, max-content);
        justify-content: start;
    }

    .v2-tournament-match-actions .v2-tournament-result-form {
        grid-column: 1 / -1;
        width: 100%;
        grid-template-columns: 42px 10px 42px minmax(92px, 1fr);
    }

    .v2-tournament-result-form input,
    .v2-tournament-result-form select {
        min-height: 32px;
    }

    .v2-tournament-result-form span {
        display: block;
        text-align: center;
    }

    .v2-battle-hp-button,
    .v2-battle-hp > div {
        min-height: 76px;
    }

    .v2-battle-hp-button {
        min-height: 58px;
    }

    .v2-battle-character {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .v2-battle-character img {
        width: 72px;
        height: 86px;
    }

    .v2-battle-passive-memo {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 760px) {
    body.v2-battle-mode {
        min-height: auto;
    }

    .v2-battle-mode .v2-shell {
        width: calc(100% - 8px);
    }

    .v2-battle-mode .v2-content {
        padding-top: 4px;
        padding-bottom: 0;
    }

    .v2-battle-layout {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .v2-battle-center {
        order: -1;
        max-width: none;
        gap: 6px;
        align-items: stretch;
        padding: 8px 6px;
    }

    .v2-battle-timer-top {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 4px;
    }

    .v2-battle-timer-top .v2-button {
        min-height: 30px;
    }

    .v2-battle-round-clock span {
        font-size: .6rem;
    }

    .v2-battle-round-clock strong {
        font-size: .82rem;
    }

    .v2-battle-big-timer {
        width: 100%;
        min-height: 68px;
        padding: 4px;
    }

    .v2-battle-big-timer span {
        font-size: .62rem;
    }

    .v2-battle-big-timer strong {
        font-size: 2.6rem;
    }

    .v2-battle-set-panel,
    .v2-battle-extra-time,
    .v2-battle-character-selectors {
        grid-column: 1 / -1;
    }

    .v2-battle-center-actions {
        grid-column: 1;
        grid-row: auto;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow: visible;
        justify-content: stretch;
        gap: 5px;
    }

    .v2-battle-center-actions .v2-button {
        min-height: 34px;
    }

    .v2-battle-extra-time {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v2-battle-player {
        grid-template-columns: minmax(0, 1fr) 38px;
        gap: 4px;
        min-height: 0;
        padding: 8px 5px;
    }

    .v2-battle-player-p2 {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .v2-battle-player::before {
        top: 0;
        bottom: 0;
        width: min(70%, 240px);
        opacity: .18;
    }

    .v2-battle-player-head {
        gap: 6px;
        margin-bottom: 0;
    }

    .v2-battle-player-head h2 {
        font-size: .92rem;
    }

    .v2-battle-player-head .v2-kicker {
        display: none;
    }

    .v2-battle-player-head > strong {
        min-height: 22px;
        padding: 1px 6px;
        font-size: .68rem;
    }

    .v2-battle-player-head > div {
        display: flex;
        flex-direction: row;
    }

    .v2-battle-hp {
        gap: 4px;
    }

    .v2-battle-hp strong {
        font-size: clamp(1.7rem, 11vw, 2.5rem);
    }

    .v2-battle-hp > div {
        min-height: 38px;
    }

    .v2-battle-hp-button {
        min-height: 24px;
        font-size: 1rem;
    }

    .v2-battle-fp {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .v2-battle-fp-button,
    .v2-battle-fp-value {
        min-height: 22px;
        padding: 0;
    }

    .v2-battle-fp-button {
        font-size: 1rem;
    }

    .v2-battle-fp-value strong {
        font-size: .9rem;
    }

    .v2-battle-passives {
        gap: 4px;
    }

    .v2-battle-passive-custom,
    .config-passive-panel {
        gap: 5px;
    }

    .v2-battle-passive-row,
    .v2-battle-passive-memo {
        padding: 4px;
    }

    .v2-battle-passive-row strong {
        font-size: .76rem;
    }

    .v2-battle-passive-row .v2-button {
        min-height: 24px;
    }

    .v2-battle-history-open .v2-battle-history-head {
        top: max(8px, env(safe-area-inset-top));
        width: calc(100vw - 16px);
    }

    .v2-battle-history-open .v2-battle-history {
        top: calc(max(8px, env(safe-area-inset-top)) + 54px);
        width: calc(100vw - 16px);
        max-height: min(72vh, 520px);
    }
}
