/* --- หน้าเลือกวีรยุทธ์ (cinematic) --- */
.screen-select {
    --select-gold: #d4af37;
    --select-gold-hi: #f0d78c;
    --select-green: #3d9e5f;
    --select-green-hi: #4fc47a;
    --select-panel: rgba(8, 10, 14, 0.72);
    --select-panel-border: rgba(212, 175, 55, 0.28);
    --select-radius: 12px;
    /* select.webp 1717×916 — จุดเท้าบนแท่น */
    --select-bg-w: 1717;
    --select-bg-h: 916;
    --select-foot-x: 860;
    --select-foot-y: 679;
    /* ชดเชยจุดเท้าใน canvas ที่ไม่ชิดขอบล่างเป๊ะ */
    --select-foot-nudge-y: 22px;
    /* จุดโคมไฟบนภาพ — เลื่อนขึ้นจากพิกัดฐานเล็กน้อยให้ตรงเปลว */
    --select-flame-left-x: 505;
    --select-flame-left-y: 610;
    --select-flame-right-x: 1162;
    --select-flame-right-y: 610;
    max-width: none;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #07060a;
    color: #f5f0e6;
    font-family: 'Kanit', 'Segoe UI', Tahoma, sans-serif;
    position: relative;
    gap: 0;
}

.screen-select a {
    user-select: text;
    -webkit-user-select: text;
}

/* --- พื้นหลัง + เอฟเฟกต์ (ล็อกกับพิกัดภาพ) --- */
.select-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ระนาบภาพแบบ cover — สัดส่วนเท่า select.webp เพื่อให้ % พิกัดตรง */
.select-bg-plane {
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, calc(100vh * 1717 / 916));
    height: max(100%, calc(100vw * 916 / 1717));
    transform: translate(-50%, -50%);
    transform-origin: calc(var(--select-foot-x) / var(--select-bg-w) * 100%)
        calc(var(--select-foot-y) / var(--select-bg-h) * 100%);
    animation: select-kenburns 56s ease-in-out infinite alternate;
    will-change: transform;
}

.select-bg {
    position: absolute;
    inset: 0;
    background: url('/assets/main/select.webp') center / 100% 100% no-repeat;
}

@keyframes select-kenburns {
    from {
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.select-godray {
    position: absolute;
    left: calc(var(--select-foot-x) / var(--select-bg-w) * 100%);
    top: calc(var(--select-foot-y) / var(--select-bg-h) * 100% - 58%);
    width: 42%;
    height: 70%;
    transform: translateX(-50%);
    background:
        radial-gradient(
            ellipse 42% 70% at 50% 0%,
            rgba(255, 240, 190, 0.38) 0%,
            rgba(255, 220, 150, 0.16) 32%,
            rgba(255, 200, 110, 0.05) 58%,
            transparent 78%
        ),
        radial-gradient(
            ellipse 28% 55% at 50% 8%,
            rgba(255, 248, 220, 0.28) 0%,
            transparent 70%
        );
    filter: blur(18px);
    animation: select-godray-pulse 4.5s ease-in-out infinite;
    mix-blend-mode: screen;
    opacity: 0.9;
    border-radius: 50%;
}

@keyframes select-godray-pulse {
    0%,
    100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.95;
        transform: translateX(-50%) scale(1.03);
    }
}

.select-flame {
    position: absolute;
    width: 3.2%;
    height: 8%;
    border-radius: 50% 50% 40% 40%;
    background: radial-gradient(
        ellipse at 50% 80%,
        rgba(255, 220, 120, 0.95) 0%,
        rgba(255, 120, 40, 0.55) 40%,
        rgba(255, 60, 0, 0.15) 70%,
        transparent 100%
    );
    filter: blur(4px);
    animation: select-flame-flicker 0.85s ease-in-out infinite alternate;
    mix-blend-mode: screen;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.select-flame--left {
    left: calc(var(--select-flame-left-x) / var(--select-bg-w) * 100%);
    top: calc(var(--select-flame-left-y) / var(--select-bg-h) * 100%);
    animation-delay: 0s;
}

.select-flame--right {
    left: calc(var(--select-flame-right-x) / var(--select-bg-w) * 100%);
    top: calc(var(--select-flame-right-y) / var(--select-bg-h) * 100%);
    animation-delay: 0.35s;
}

@keyframes select-flame-flicker {
    0% {
        transform: translate(-50%, -50%) scale(0.92, 0.88);
        opacity: 0.65;
        filter: blur(3px);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.08, 1.15);
        opacity: 1;
        filter: blur(5px);
    }
}

/* จุดเท้าบนแท่น (860, 679) ของภาพ 1717×916 */
.select-foot-anchor {
    position: absolute;
    left: calc(var(--select-foot-x) / var(--select-bg-w) * 100%);
    top: calc(var(--select-foot-y) / var(--select-bg-h) * 100%);
    transform: translate(-50%, calc(-100% + var(--select-foot-nudge-y)));
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.select-embers {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.select-ember {
    position: absolute;
    bottom: 12%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 200, 90, 0.85);
    box-shadow: 0 0 6px rgba(255, 160, 40, 0.7);
    animation: select-ember-rise linear infinite;
    opacity: 0;
}

@keyframes select-ember-rise {
    0% {
        transform: translate3d(0, 0, 0) scale(0.6);
        opacity: 0;
    }
    12% {
        opacity: 0.9;
    }
    100% {
        transform: translate3d(var(--ex, 0), -72vh, 0) scale(0.2);
        opacity: 0;
    }
}

.select-scene-veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(4, 6, 10, 0.55) 0%, transparent 22%, transparent 78%, rgba(4, 6, 10, 0.55) 100%),
        linear-gradient(180deg, rgba(4, 6, 10, 0.45) 0%, transparent 18%, transparent 72%, rgba(4, 6, 10, 0.7) 100%);
}

.select-scene-vignette {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 120px 40px rgba(0, 0, 0, 0.55);
}

/* --- โครงหลัก --- */
.select-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
        max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    gap: 10px;
}

.select-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.select-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
}

.select-brand-mark {
    display: inline-flex;
    color: var(--select-gold-hi);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.55));
}

.select-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    font-family: 'Cinzel', 'Times New Roman', serif;
    letter-spacing: 0.06em;
}

.select-brand-text strong {
    color: var(--select-gold-hi);
    font-size: 15px;
    font-weight: 700;
}

.select-brand-text span {
    color: rgba(245, 240, 230, 0.7);
    font-size: 10px;
    font-weight: 600;
}

.select-top-title {
    text-align: center;
}

.select-top-title h1 {
    margin: 0;
    font-size: clamp(16px, 2.2vw, 22px);
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.select-top-title p {
    margin: 2px 0 0;
    font-size: 12px;
    color: rgba(245, 240, 230, 0.62);
}

.select-top-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.select-guest-notice {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--select-radius);
    background: rgba(40, 28, 8, 0.72);
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.select-guest-notice strong {
    color: var(--select-gold-hi);
}

.select-guest-notice p {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(245, 240, 230, 0.75);
}

/* --- 3 คอลัมน์ --- */
.select-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 300px);
    gap: 14px;
    align-items: stretch;
}

.select-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px;
    border-radius: var(--select-radius);
    background: var(--select-panel);
    border: 1px solid var(--select-panel-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.select-panel-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--select-gold-hi);
    letter-spacing: 0.02em;
}

.select-panel--chars {
    overflow: visible;
}

.select-panel--chars .select-panel-title {
    position: relative;
    z-index: 0;
    flex-shrink: 0;
    margin-bottom: 10px;
    line-height: 1.35;
}

.select-char-list {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    /* เผื่อยกการ์ดตอน hover ไม่ให้โดน clip / จมใต้หัวข้อ */
    padding: 6px 4px 4px 0;
    margin-top: -2px;
}

.select-char-empty {
    margin: 8px 0 12px;
    text-align: center;
    font-size: 13px;
    color: rgba(245, 240, 230, 0.55);
}

/* --- การ์ดตัวละคร --- */
.select-char-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(12, 14, 18, 0.92);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.25s ease,
        transform 0.15s ease;
}

.select-char-card:hover {
    z-index: 10;
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(28, 24, 14, 0.98);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(212, 175, 55, 0.16);
    transform: translateY(-3px);
}

.select-char-card.is-selected {
    z-index: 3;
    border-color: var(--select-gold);
    background: linear-gradient(145deg, rgba(80, 60, 16, 0.92), rgba(24, 20, 10, 0.96));
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.35),
        0 0 22px rgba(212, 175, 55, 0.22);
}

.select-char-card.is-selected:hover {
    z-index: 12;
}

.select-char-card-preview {
    width: 56px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.35);
    image-rendering: pixelated;
}

.select-char-card-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.select-char-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-char-card-lv {
    font-size: 12px;
    color: var(--select-gold);
    font-weight: 600;
}

.select-char-card-loc {
    font-size: 11px;
    color: rgba(245, 240, 230, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-char-card-lock-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 107, 0.75);
    color: #ff8a80;
    vertical-align: middle;
}

.select-char-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.select-char-enter {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f4fff7;
    background: linear-gradient(135deg, #5ad48a 0%, #2f9a58 55%, #247a46 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 6px 16px rgba(47, 154, 88, 0.28);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.15s ease;
}

.select-char-card.is-selected .select-char-enter {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.select-char-enter:hover {
    filter: brightness(1.06);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.18) inset,
        0 8px 20px rgba(47, 154, 88, 0.38);
}

.select-char-enter:active {
    transform: scale(0.98);
}

.select-char-delete {
    appearance: none;
    border: 1px solid rgba(255, 140, 140, 0.22);
    border-radius: 999px;
    padding: 6px 10px;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 196, 196, 0.9);
    background: rgba(255, 80, 80, 0.08);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.select-char-delete:hover {
    background: rgba(255, 80, 80, 0.18);
    border-color: rgba(255, 140, 140, 0.45);
    color: #ffd4d4;
}

.select-char-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 72px;
    padding: 12px;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: rgba(245, 240, 230, 0.4);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.select-char-slot-ico {
    width: 14px;
    height: 16px;
    border: 1.5px solid rgba(245, 240, 230, 0.35);
    border-radius: 3px 3px 2px 2px;
    position: relative;
    opacity: 0.7;
}

.select-char-slot-ico::before {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    top: -6px;
    height: 8px;
    border: 1.5px solid rgba(245, 240, 230, 0.35);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.select-btn-create {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f4fff7;
    background: linear-gradient(135deg, #5ad48a 0%, #2f9a58 52%, #247a46 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14) inset,
        0 10px 28px rgba(47, 154, 88, 0.32);
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.15s ease;
}

.select-btn-create:hover {
    filter: brightness(1.05);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 12px 32px rgba(47, 154, 88, 0.42);
}

.select-btn-create:active {
    transform: scale(0.985);
}

.select-btn-create:disabled,
.select-btn-create[hidden] {
    display: none;
}

.select-btn-create-ico {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 15px;
    line-height: 1;
}

/* --- เวทีกลาง (คอลัมน์ว่าง — ตัวละครล็อกบนฉากหลัง) --- */
.select-stage {
    position: relative;
    min-height: 0;
    pointer-events: none;
}

.select-stage-figure {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.select-foot-anchor.is-empty {
    visibility: hidden;
}

.select-stage-canvas {
    width: clamp(110px, 9.5vw, 168px);
    height: auto;
    aspect-ratio: 160 / 192;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
    transform-origin: 50% 100%;
    animation: select-idle-breathe 2.8s ease-in-out infinite;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.select-stage-figure.is-switching .select-stage-canvas {
    opacity: 0;
    transform: scale(0.94);
    animation: none;
}

.select-stage-figure.is-switching .select-stage-name {
    opacity: 0;
}

.select-stage-name {
    z-index: 3;
    font-family: 'Kanit', 'Segoe UI', Tahoma, sans-serif;
    pointer-events: none;
}

@keyframes select-idle-breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

.select-stage-shadow {
    width: 52%;
    height: 12px;
    margin-top: -4px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55) 0%, transparent 70%);
    animation: select-shadow-pulse 2.8s ease-in-out infinite;
    transform-origin: 50% 50%;
}

@keyframes select-shadow-pulse {
    0%,
    100% {
        transform: scaleX(1);
        opacity: 0.7;
    }
    50% {
        transform: scaleX(0.88);
        opacity: 0.45;
    }
}

.select-stage-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(245, 240, 230, 0.55);
    font-size: 14px;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.select-stage-empty[hidden] {
    display: none !important;
}

/* --- ข่าว --- */
.select-news-card {
    position: relative;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.select-news-card h3 {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.select-news-card p {
    margin: 0;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(245, 240, 230, 0.62);
}

.select-news-tag {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.select-news-tag--event {
    background: rgba(196, 70, 70, 0.85);
    color: #fff;
}

.select-news-tag--update {
    background: rgba(55, 120, 200, 0.85);
    color: #fff;
}

.select-news-card--event {
    background:
        linear-gradient(135deg, rgba(120, 40, 30, 0.35), transparent 60%),
        rgba(255, 255, 255, 0.04);
}

.select-news-card--update {
    background:
        linear-gradient(135deg, rgba(30, 60, 110, 0.35), transparent 60%),
        rgba(255, 255, 255, 0.04);
}

.select-news-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
}

.select-news-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: rgba(245, 240, 230, 0.78);
}

.select-news-list time {
    flex-shrink: 0;
    color: rgba(245, 240, 230, 0.4);
    font-size: 11px;
}

/* --- ฟุตเตอร์ --- */
.select-footer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
}

.select-footer-social {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: rgba(245, 240, 230, 0.55);
}

.select-footer-social a {
    color: rgba(240, 215, 140, 0.9);
    text-decoration: none;
}

.select-footer-social a:hover {
    text-decoration: underline;
}

.select-footer-legal {
    text-align: center;
    font-size: 11px;
    color: rgba(245, 240, 230, 0.42);
}

.select-footer-legal p {
    margin: 0;
}

.select-footer-legal a {
    color: rgba(240, 215, 140, 0.8);
    text-decoration: none;
}

.select-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.select-btn-hub,
.select-btn-exit {
    appearance: none;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.select-btn-hub {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 240, 230, 0.88);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.select-btn-hub:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(240, 215, 140, 0.35);
    color: #fff;
}

.select-btn-exit {
    border: 1px solid rgba(255, 120, 120, 0.28);
    background: linear-gradient(135deg, rgba(160, 48, 48, 0.85), rgba(90, 22, 22, 0.92));
    color: #ffe8e8;
    box-shadow: 0 6px 18px rgba(120, 24, 24, 0.28);
}

.select-btn-exit:hover {
    border-color: rgba(255, 160, 160, 0.45);
    filter: brightness(1.06);
}

.select-btn-exit:active,
.select-btn-hub:active {
    transform: scale(0.98);
}

.select-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    color: rgba(245, 240, 230, 0.9);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        color 0.15s ease;
}

.select-icon-btn:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.55);
    color: var(--select-gold-hi);
    transform: translateY(-1px);
}

/* --- Responsive --- */
@media (max-width: 980px) {
    .select-body {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    }

    .select-panel--news {
        display: none;
    }

    .select-topbar {
        grid-template-columns: auto 1fr auto;
    }

    .select-footer {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }

    .select-footer-social,
    .select-footer-actions {
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .select-shell {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .select-body {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .select-panel--chars {
        order: 2;
        max-height: none;
    }

    .select-stage {
        order: 1;
        min-height: 220px;
    }

    .select-top-title h1 {
        font-size: 15px;
    }

    .select-top-title p {
        display: block;
        font-size: 11px;
    }

    .select-brand-text span {
        display: none;
    }

    .select-stage-canvas {
        width: clamp(96px, 28vw, 140px);
    }

    .select-flame {
        width: 4.5%;
        height: 10%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .select-bg-plane,
    .select-godray,
    .select-flame,
    .select-ember,
    .select-stage-canvas,
    .select-stage-shadow {
        animation: none !important;
    }
}

/* ========== หน้าสร้างตัวละคร (โครงเดียวกับเลือกวีรยุทธ์) ========== */
.screen-create.screen-select {
    max-width: none;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #07060a;
}

.screen-create .create-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(280px, 340px);
}

.screen-create .create-panel-spacer {
    visibility: hidden;
    pointer-events: none;
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
}

.screen-create .create-panel {
    min-height: 0;
    gap: 10px;
}

.screen-create .create-name-plate {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.screen-create .create-name-plate label {
    font-size: 12px;
    font-weight: 600;
    color: var(--select-gold-hi);
}

.screen-create .create-name-plate input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font: inherit;
    font-size: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.94);
    color: #1a1410;
    outline: none;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.screen-create .create-name-plate input:focus {
    border-color: var(--select-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
}

.screen-create .create-customize-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.screen-create .customize-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(240, 215, 140, 0.85);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.screen-create .customize-opt {
    min-width: 40px;
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 240, 230, 0.85);
    box-shadow: none;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.screen-create .customize-opt:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(240, 215, 140, 0.35);
}

.screen-create .customize-opt.selected {
    border-color: rgba(212, 175, 55, 0.75);
    background: rgba(212, 175, 55, 0.16);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25);
    color: var(--select-gold-hi);
}

.screen-create .customize-opt.color-swatch {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.25);
}

.screen-create .customize-opt.color-swatch:active {
    transform: scale(0.96);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.25);
}

.screen-create .customize-opt.color-swatch.selected {
    border-color: #fff;
    box-shadow:
        0 0 0 2px var(--select-gold),
        0 0 14px rgba(212, 175, 55, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.screen-create .create-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    flex-shrink: 0;
    gap: 4px;
    padding: 6px;
    border-bottom: none;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px 12px 0 0;
}

.screen-create .create-tab {
    appearance: none;
    margin: 0;
    padding: 9px 6px;
    min-height: 38px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: rgba(245, 240, 230, 0.5);
    background: transparent;
    border: none;
    border-radius: 9px;
    border-bottom: none;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.screen-create .create-tab.selected {
    color: #1a1410;
    background: linear-gradient(135deg, #f0d78c, #d4af37);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.28);
    border-bottom-color: transparent;
}

.screen-create .create-tab:hover:not(.selected) {
    color: rgba(245, 240, 230, 0.85);
    background: rgba(255, 255, 255, 0.06);
}

.screen-create .customize-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.screen-create .create-error {
    min-height: 16px;
    margin: 0;
    font-size: 12px;
    color: #ff8a80;
    text-align: center;
    flex-shrink: 0;
}

.screen-create .create-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.screen-create .create-submit-btn {
    width: 100%;
}

.screen-create .create-footer .select-btn-hub {
    width: 100%;
    text-align: center;
}

.screen-create .select-topbar {
    align-items: start;
}

.screen-create .select-brand-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    justify-self: start;
}

.screen-create .create-facing-float {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    z-index: 3;
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
}

.screen-create .create-turn-btn {
    appearance: none;
    min-width: 58px;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(245, 240, 230, 0.62);
    background: transparent;
    border: none;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.screen-create .create-turn-btn.selected {
    color: #1a1410;
    background: linear-gradient(135deg, #f0d78c, #d4af37);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
}

.screen-create .create-turn-btn:hover:not(.selected) {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.screen-create .select-stage {
    pointer-events: none;
}

@media (max-width: 980px) {
    .screen-create .create-body {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    }

    .screen-create .create-panel-spacer {
        display: none;
    }
}

@media (max-width: 720px) {
    .screen-create .create-body {
        grid-template-columns: 1fr;
    }

    .screen-create .select-stage {
        order: 1;
        min-height: 240px;
    }

    .screen-create .create-panel {
        order: 2;
        max-height: min(52vh, 480px);
    }

    .screen-create .select-brand-col {
        gap: 8px;
    }
}
