@charset "utf-8";

.char-dashboard {
    --bar-hp-start: #ff5f6d;
    --bar-hp-end: #ffc371;
    --bar-mp-start: #00b09b;
    --bar-mp-end: #96c93d;
    --bar-blue-start: #2193b0;
    --bar-blue-end: #6dd5ed;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    
    height: 650px;
    align-items: stretch;
}
.char-side,
.char-main {
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: inset 1px 1px 0 var(--window-highlight), 3px 4px 0 color-mix(in srgb, var(--border) 24%, transparent);
}
.char-side {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.char-portrait {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #1a1230;
}
.char-portrait-back {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: var(--radius);
    background: rgba(18, 12, 32, .55);
    box-shadow: 0 1px 4px rgba(0,0,0,.28);
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.char-portrait-back:hover {
    background: var(--rule-accent);
    border-color: var(--rule-accent);
    color: var(--brand-contrast);
}
.char-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}
.char-portrait-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.35);
}
.char-portrait-empty i { font-size: 42px; }
.char-portrait-veil {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 56px 16px 16px;
    background: linear-gradient(to top, rgba(12, 8, 24, .92) 0%, rgba(12, 8, 24, .55) 58%, transparent 100%);
    color: #fff;
}
.char-name-row {
    display: flex;
    align-items: baseline;
    min-width: 0;
}
.char-dashboard .char-name {
    flex: 0 1 auto;
    min-width: 0;
    color: #fff;
    font-family: "Mona12", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
    text-shadow: 0 1px 8px rgba(0,0,0,.45);
}
.char-dashboard .char-org-name {
    margin-top: 2px;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 600;
    white-space: normal;
}

.char-quote {
    margin: 4px 0 0;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-style: italic;
    line-height: 1.4;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
}
.char-rule-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}
.char-rule-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.9);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.char-rule-chip:hover {
    border-color: #fff;
    background: rgba(255,255,255,.22);
    color: #fff;
}
.char-rule-chip.active {
    border-color: var(--rule-accent);
    background: var(--rule-accent);
    color: var(--brand-contrast);
}

.char-rule-dropdown { position: relative; display: inline-flex; }
.char-rule-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--rule-accent);
    border-radius: 999px;
    background: var(--rule-accent);
    color: var(--brand-contrast, #fff);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .18s ease, opacity .18s ease;
}
.char-rule-toggle-btn i { font-size: 10px; transition: transform .18s ease; }
.char-rule-toggle-btn:hover {
    opacity: .9;
}
.char-rule-toggle-btn.active i { transform: rotate(180deg); }

.char-rule-panel {
    display: none;
    flex-direction: column;
    gap: 6px;
    position: fixed;
    transform: translateX(-50%);
    max-height: 256px;
    overflow-y: auto;
    min-width: 140px;
    background: rgba(18, 12, 32, .78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 10px;
    padding: 8px;
    z-index: 500;
    box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.char-rule-panel.open { display: flex; }
.char-rule-panel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.2);
    box-shadow: none;
    color: #fff;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.char-rule-panel-btn::before {
    content: '';
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rule-chip-color, var(--rule-accent));
    box-shadow: 0 0 5px var(--rule-chip-color, var(--rule-accent));
    transition: opacity .15s ease;
}
.char-rule-panel-btn:hover,
.char-rule-panel-btn.active {
    background: var(--rule-chip-color, var(--rule-accent));
    border-color: color-mix(in srgb, var(--rule-chip-color, var(--rule-accent)) 70%, white 20%);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--rule-chip-color, var(--rule-accent)) 40%, transparent);
}
.char-rule-panel-btn:hover::before,
.char-rule-panel-btn.active::before {
    opacity: 0;
}
.char-rule-panel-btn:focus,
.char-rule-toggle-btn:focus { outline: none; }

.char-portrait-source {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    bottom: auto;
    z-index: 3;
    max-width: 30%;
    color: rgba(255,255,255,.55);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    text-align: right;
    word-break: break-all;
}
.char-portrait-source a {
    color: rgba(255,255,255,.78);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.char-portrait-source a:hover { color: #fff; }

.char-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.char-tabs-row {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
.char-tabs {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 4px;
    padding: 10px 14px 0;
    background: none;
    border-bottom: 0;
    overflow-x: auto;
}
.char-tab {
    appearance: none;
    margin: 0;
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-subtle);
    font-family: "Mona12", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}
.char-tab:hover { color: var(--text); }
.char-tab.active { color: var(--rule-accent); border-bottom-color: var(--rule-accent); }
.char-tab.is-secret {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--secret-ink, #ff3b3b);
}
.char-tab-panel-btn.is-secret {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--secret-ink, #ff3b3b);
}
.char-tab.is-secret:hover { color: var(--secret-ink-soft, #ff7a7a); }
.char-tab.is-secret.active {
    color: var(--secret-ink-soft, #ff7a7a);
    border-bottom-color: var(--secret-ink, #ff3b3b);
}
.char-tab.is-secret i,
.char-tab-panel-btn.is-secret i { font-size: 11px; }
.char-tab-dropdown { display: none; }
.char-tab-secret-lock { display: none; }
.char-tab-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 10px 14px;
}
.char-tab-action-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .3);
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.char-tab-action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
#charScenarioModalBtn {
    background: linear-gradient(160deg, #f0c583, #c9a468);
}
.char-tab-action-btn.is-secret {
    background: var(--secret-ink, #ff3b3b);
}

.char-main-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    border-radius: 0 0 var(--radius) var(--radius);
}
.char-main-body::-webkit-scrollbar { width: 8px; }
.char-main-body::-webkit-scrollbar-track { background: transparent; }
.char-main-body::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--border) 55%, transparent); border-radius: 4px; }

.char-pane { display: none; }
.char-pane.active { display: block; }

.char-main:has(.char-secret) {
    --secret-bg: #0a0708;
    --secret-panel: #150d0e;
    --secret-ink: #ff3b3b;
    --secret-ink-soft: #ff7a7a;
    --secret-line: #ff2323;
    --secret-glow: rgba(255, 59, 59, .35);
    --secret-contrast: #fff5f0;
}
.char-secret {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    color: var(--secret-contrast);
    --surface: #131313;
    --surface-soft: #181818;
    --surface-raised: #1e1e1e;
    --card-bg: #0e0e0e;
    --text: #f2f2f2;
    --text-subtle: #b8b8b8;
    --border: var(--secret-line);
    --brand: var(--secret-ink);
    --brand-contrast: #ffffff;
    --rule-accent: var(--secret-ink-soft);
    --window-highlight: rgba(255, 59, 59, .16);
    --window-shadow: #1a0000;
}
.char-secret-content { display: none; flex: 1; height: 100%; min-height: 0; color: var(--text); }
.char-secret-gate.is-unlocked { display: none; }

.char-secret-gate.is-unlocked + .char-secret-content {
    display: block;
    padding: 16px;
    box-sizing: border-box;
    animation: char-secret-materialize .5s ease-out both;
}
.char-pane-pair .char-secret-gate.is-unlocked + .char-secret-content,
.char-pane-scenarios .char-secret-gate.is-unlocked + .char-secret-content { padding: 0; }

.char-main-body:has(.char-pane.active .char-secret) {
    background: var(--secret-bg, #0a0708);
    padding: 0;
}
.char-main:has(.char-pane.active .char-secret) .char-tabs-row {
    background: var(--secret-bg, #0a0708);
    border-bottom-color: #000;
}
.char-main-body:has(.char-pane.active .char-secret-gate:not(.is-unlocked)) {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.char-pane.active:has(.char-secret-gate:not(.is-unlocked)) {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}
.char-pane.active:has(.char-secret-gate:not(.is-unlocked)) .char-secret { flex: 1; position: relative; overflow: hidden; }
.char-secret-gate {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 280px;
    padding: 36px 18px;
    overflow: hidden;
    background:
        repeating-linear-gradient(0deg, rgba(255, 35, 35, .06) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(255, 35, 35, .035) 0 1px, transparent 1px 42px),
        radial-gradient(ellipse at 50% 42%, rgba(255, 35, 35, .24) 0%, transparent 62%),
        var(--secret-bg);
}

.char-secret-gate::before {
    content: '';
    position: absolute;
    inset: 14px;
    z-index: 1;
    pointer-events: none;
    opacity: .8;
    background:
        linear-gradient(var(--secret-line), var(--secret-line)) top left / 22px 2px no-repeat,
        linear-gradient(var(--secret-line), var(--secret-line)) top left / 2px 22px no-repeat,
        linear-gradient(var(--secret-line), var(--secret-line)) top right / 22px 2px no-repeat,
        linear-gradient(var(--secret-line), var(--secret-line)) top right / 2px 22px no-repeat,
        linear-gradient(var(--secret-line), var(--secret-line)) bottom left / 22px 2px no-repeat,
        linear-gradient(var(--secret-line), var(--secret-line)) bottom left / 2px 22px no-repeat,
        linear-gradient(var(--secret-line), var(--secret-line)) bottom right / 22px 2px no-repeat,
        linear-gradient(var(--secret-line), var(--secret-line)) bottom right / 2px 22px no-repeat;
}

.char-secret-gate::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -90px;
    height: 90px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(255, 59, 59, .16), transparent);
    animation: char-secret-sweep 3.4s linear infinite;
}

.char-secret-gate.is-unlocking { animation: char-secret-gate-out .55s ease-in both; }
.char-secret-gate.is-unlocking .char-secret-hud { animation: char-secret-decrypt .55s steps(2, end) both; }
.char-secret-gate.is-unlocking::before { animation: char-secret-bracket-flash .55s ease-out both; }

.char-secret-gate.is-unlocking .char-secret-title { color: transparent; }
.char-secret-gate.is-unlocking .char-secret-title::after {
    content: 'RESTRICTED RECORD';
    position: absolute;
    inset: 0;
    color: var(--secret-ink);
    animation: char-secret-scramble-title .55s steps(1, end) both;
}
.char-secret-gate.is-unlocking .char-secret-open span { color: transparent; }
.char-secret-gate.is-unlocking .char-secret-open span::after {
    content: '기록 열람 승인';
    position: absolute;
    inset: 0;
    color: var(--secret-contrast);
    animation: char-secret-scramble-btn .55s steps(1, end) both;
}

.char-secret-hud {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: min(100%, 420px);
}
.char-secret-hud-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    margin-bottom: 12px;
}
.char-secret-hud-body::before {
    content: '';
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--secret-ink);
    box-shadow: 0 0 8px 2px var(--secret-glow);
    animation: char-secret-blink 1.1s ease-in-out infinite;
}
.char-secret-hud-body::after {
    content: 'SEC-01';
    margin-left: auto;
    color: color-mix(in srgb, var(--secret-line) 65%, transparent);
    font-family: monospace;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}
.char-secret-title {
    position: relative;
    min-width: 0;
    color: var(--secret-contrast);
    font-family: "Mona12", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .14em;
    text-shadow: 0 0 12px rgba(255, 59, 59, .55);
}
.char-secret-details {
    padding: 18px 20px 20px;
    overflow: hidden;
    border: 1px solid var(--secret-line);
    border-radius: var(--radius);
    background: var(--secret-panel);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 26px rgba(255, 35, 35, .06);
    color: var(--secret-ink-soft);
    font-size: 13px;
    font-weight: 400;
}

.char-secret-details::before {
    content: '';
    display: block;
    height: 5px;
    margin: -18px -20px 18px;
    background: repeating-linear-gradient(-45deg, var(--secret-ink) 0 8px, #1a0000 8px 16px);
    opacity: .85;
}

.char-secret-kicker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    padding: 3px 9px 3px 7px;
    border: 1px solid var(--secret-ink);
    border-radius: 2px;
    background: color-mix(in srgb, var(--secret-ink) 16%, transparent);
    color: var(--secret-ink);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
}
.char-secret-gate-q {
    margin: 0 0 16px;
    color: var(--secret-ink-soft);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.char-secret-gate-q::before { content: '> '; color: var(--secret-ink); font-weight: 800; }
.char-secret-gate-q::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -2px;
    background: var(--secret-ink);
    animation: char-secret-caret 1s steps(1, end) infinite;
}
.char-secret-open {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--secret-line);
    border-radius: 3px;
    background: transparent;
    color: var(--secret-contrast);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    cursor: pointer;
    overflow: hidden;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
    animation: char-secret-pulse 2.2s ease-in-out infinite;
}
.char-secret-open span { position: relative; }

.char-secret-open::before {
    content: '';
    position: absolute;
    inset: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    transition: left .5s ease;
}
.char-secret-open:hover::before { left: 130%; }
.char-secret-open i { transition: transform .18s ease; }
.char-secret-open:hover i { transform: translateX(3px); }
.char-secret-open:hover,
.char-secret-open:focus-visible {
    background: var(--secret-ink);
    border-color: var(--secret-ink);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(255, 59, 59, .18);
}
@keyframes char-secret-blink {
    0%, 100% { opacity: .35; }
    50% { opacity: 1; }
}
@keyframes char-secret-sweep {
    0% { top: -90px; }
    100% { top: 100%; }
}
@keyframes char-secret-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, .25); }
    50% { box-shadow: 0 0 0 5px rgba(255, 59, 59, 0); }
}
@keyframes char-secret-caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
@keyframes char-secret-gate-out {
    0%, 65% { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes char-secret-decrypt {
    0% { filter: brightness(1); transform: translateX(0); }
    15% { filter: brightness(2.4) saturate(0); transform: translateX(-2px); }
    30% { filter: brightness(.6); transform: translateX(2px); }
    45% { filter: brightness(2) saturate(.4); transform: translateX(-1px); }
    60% { filter: brightness(.8); transform: translateX(1px); }
    100% { filter: brightness(1.6); transform: translateX(0); }
}
@keyframes char-secret-bracket-flash {
    0%, 100% { opacity: .8; }
    50% { opacity: 1; }
}
@keyframes char-secret-materialize {
    0% { clip-path: inset(0 0 100% 0); filter: brightness(2.2) contrast(1.2); opacity: .3; }
    45% { filter: brightness(1.5); opacity: 1; }
    100% { clip-path: inset(0 0 0% 0); filter: brightness(1) contrast(1); opacity: 1; }
}
@keyframes char-secret-scramble-title {
    0%   { content: 'RESTRICTED RECORD'; }
    20%  { content: 'R3$7R1C+3D R3C0RD'; }
    40%  { content: '#3STR1C#3D REC0R#'; }
    60%  { content: 'DEC0DING... DEC0D'; }
    80%  { content: 'ACCESS GRANTED'; }
    100% { content: ''; opacity: 0; }
}
@keyframes char-secret-scramble-btn {
    0%   { content: '기록 열람 승인'; }
    25%  { content: '기#록# #열#람#'; }
    50%  { content: '#/-# 중.../-#'; }
    75%  { content: '#!?#!?#록#'; }
    100% { content: ''; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .char-secret-hud-body::before,
    .char-secret-gate::after,
    .char-secret-open,
    .char-secret-gate-q::after,
    .char-secret-gate.is-unlocking,
    .char-secret-gate.is-unlocking .char-secret-hud,
    .char-secret-gate.is-unlocking::before,
    .char-secret-gate.is-unlocking .char-secret-title::after,
    .char-secret-gate.is-unlocking .char-secret-open span::after,
    .char-secret-gate.is-unlocked + .char-secret-content { animation: none; }
}

.char-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 18px 0 10px;
    padding: 0 0 1px;
    border-bottom: 1.5px solid color-mix(in srgb, var(--rule-accent) 45%, var(--border));
    color: var(--rule-accent);
    font-family: "Mona12", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}
.char-section-title::after { content: ""; flex: 1; }
.char-section-title:first-child { margin-top: 0; }

.char-gauge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.char-gauge {
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: inset 1px 1px 0 var(--window-highlight);
}
.char-gauge-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.char-gauge-name { color: var(--text); font-size: 13px; font-weight: 700; }
.char-gauge-val { color: var(--text-subtle); font-size: 12px; }
.char-gauge-val b { color: var(--text); }
.char-bar-track { width: 100%; height: 8px; overflow: hidden; border-radius: 4px; background: var(--surface-soft); }
.char-bar-fill { height: 100%; border-radius: 4px; }
.char-bar-hp { background: linear-gradient(to right, var(--bar-hp-start), var(--bar-hp-end)); }
.char-bar-mp { background: linear-gradient(to right, var(--bar-mp-start), var(--bar-mp-end)); }
.char-bar-blue { background: linear-gradient(to right, var(--bar-blue-start), var(--bar-blue-end)); }

.char-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.char-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: inset 1px 1px 0 var(--window-highlight);
}
.char-info-key {
    color: var(--text-subtle);
    font-family: "Mona12", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .03em;
}
.char-info-val { color: var(--text); font-size: 13px; }

.char-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.char-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: inset 1px 1px 0 var(--window-highlight);
    transition: border-color .18s ease;
}
.char-stat:hover { border-color: var(--rule-accent); }
.char-stat-label { margin-bottom: 4px; color: var(--text-subtle); font-size: 11px; text-align: center; }
.char-stat-value { color: var(--text); font-size: 18px; font-weight: 800; text-align: center; line-height: 1.2; }
.char-stat-heading {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.char-chart { width: min(320px, 100%); height: 280px; margin: 0 auto 20px; }
.char-ability-card {
    margin-bottom: 10px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: inset 1px 1px 0 var(--window-highlight);
}
.char-ability-head {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--rule-accent);
    font-size: 14px;
    font-weight: 800;
}

.char-ability-card-name-only .char-ability-head {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.char-ability-body { color: var(--text); font-size: 13px; line-height: 1.7; }

.char-ability-desc { color: var(--text-subtle); }
.char-attr ~ .char-ability-desc,
.char-ability-desc ~ .char-ability-desc { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.char-ability-desc-label {
    display: block;
    margin-bottom: 4px;
    color: var(--rule-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}
.char-attr {
    display: inline-flex;
    gap: 4px;
    margin: 0 6px 4px 0;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text-subtle);
    font-size: 12px;
}
.char-attr b { color: var(--rule-accent); }
.char-story {
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: inset 1px 1px 0 var(--window-highlight);
    color: var(--text);
    font-size: 13px;
    line-height: 1.8;
}
.char-empty {
    padding: 48px 16px;
    color: var(--text-subtle);
    font-size: 13px;
    text-align: center;
}

.char-main-body.is-pair,
.char-main-body:has(.char-pane-pair.active) {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.char-pane-pair.active {
    display: block;
    flex: 1;
    min-height: 0;
    height: auto;
}
.char-pane-pair .char-secret {
    flex: 1;
    min-height: 0;
}
@media (max-width: 900px) {
    
    .char-dashboard { grid-template-columns: 1fr; height: auto; }
    .char-portrait { height: 420px; flex: none; }
    .char-main { height: auto; overflow: visible; }
    .char-main:has(.char-pane.active .char-secret) {
        background: var(--secret-bg, #0a0708);
        border-color: var(--secret-line, #ff2323);
        box-shadow: 0 0 14px var(--secret-glow, rgba(255, 59, 59, .35)), inset 0 0 0 1px color-mix(in srgb, var(--secret-line, #ff2323) 25%, transparent);
    }
    .char-main-body { overflow: visible; }
    .char-gauge-grid, .char-info-grid { grid-template-columns: 1fr; }
    .char-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    
    .char-tabs { display: none; }
    .char-tab-dropdown {
        display: block;
        position: relative;
        flex: 1;
        min-width: 0;
        margin: 10px 0 10px 14px;
    }
    .char-tab-actions { padding: 10px 14px 10px 8px; }
    .char-tab-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface-soft);
        color: var(--text);
        font-family: "Mona12", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        font-size: 13px;
        font-weight: 800;
        letter-spacing: .04em;
        cursor: pointer;
    }
    .char-tab-toggle-btn:hover,
    .char-tab-toggle-btn.active { border-color: var(--rule-accent); color: var(--rule-accent); }
    .char-tab-toggle-current { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
    .char-tab-toggle-btn.is-secret {
        border-color: var(--secret-ink, #ff3b3b);
        background: var(--secret-bg, #0a0708);
        color: var(--secret-ink-soft, #ff7a7a);
    }
    .char-tab-toggle-btn.is-secret:hover,
    .char-tab-toggle-btn.is-secret.active { border-color: var(--secret-ink-soft, #ff7a7a); color: var(--secret-ink-soft, #ff7a7a); }
    .char-tab-toggle-btn.is-secret .char-tab-secret-lock { display: inline-flex; }
    .char-tab-panel {
        display: none;
        flex-direction: column;
        gap: 6px;
        position: fixed;
        max-height: 60vh;
        overflow-y: auto;
        background: var(--surface-raised);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 10px;
        z-index: 500;
        box-shadow: 0 8px 24px var(--shadow);
    }
    .char-tab-panel.open { display: flex; }
    .char-tab-panel-btn {
        background: var(--surface-soft);
        border: 1px solid var(--border);
        color: var(--text-subtle);
        padding: 10px 12px;
        border-radius: 6px;
        font-family: "Mona12", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        font-size: 13px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }
    .char-tab-panel-btn:hover { border-color: var(--rule-accent); color: var(--rule-accent); }
    .char-tab-panel-btn.active { background: var(--rule-accent); border-color: var(--rule-accent); color: var(--brand-contrast); }
    .char-tab-panel-btn.is-secret { border-color: var(--secret-ink, #ff3b3b); background: var(--secret-bg, #0a0708); color: var(--secret-ink-soft, #ff7a7a); }
    .char-tab-panel-btn.is-secret:hover { border-color: var(--secret-ink-soft, #ff7a7a); color: var(--secret-ink-soft, #ff7a7a); }
    .char-tab-panel-btn.is-secret.active { background: var(--secret-ink, #ff3b3b); border-color: var(--secret-ink, #ff3b3b); color: #fff; }
}

@media (max-width: 768px) {
    .char-secret-gate { min-height: 260px; padding: 28px 10px; }
    .char-secret-gate::before { display: none; }
    .char-secret-hud { width: min(100%, 360px); }
    .char-secret-hud-body { padding: 14px 16px; }
    .char-secret-title { font-size: 13px; }
}
