/* ==========================================================================
   MojiBlade Wiki - Original Forge Terminal (カスタム刀身鍛造ドック)
   完全オリジナル独自UI設計：サイバーパンク/重工刀身ドックテーマ
   競合サイトの丸角カード・中央配置・黄色バー配置からの完全差別化
   ========================================================================== */

.immersive #setup-card {
    display: none;
}

/* 浮动侧翼战术终端面板（避免原版居中圆角卡片模态外观） */
.immersive.settings-open #setup-card {
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 9999;
    left: 32px;
    top: calc(50dvh + 26px);
    transform: translateY(-50%);
    width: min(480px, calc(100vw - 36px));
    max-height: calc(100dvh - 90px);
    background: linear-gradient(165deg, rgba(10, 24, 40, 0.98) 0%, rgba(5, 14, 25, 0.98) 100%);
    border: 1px solid rgba(103, 221, 255, 0.45);
    border-left: 4px solid #38bdf8;
    border-radius: 4px 16px 4px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8),
                0 0 30px rgba(56, 189, 248, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    backdrop-filter: blur(16px);
}

/* 背景压暗与轻微网格扫描线 */
.immersive.settings-open .game-layout:after {
    content: '';
    position: fixed;
    inset: 53px 0 0;
    z-index: 9990;
    background: radial-gradient(circle at 20% 50%, rgba(14, 40, 68, 0.6) 0%, rgba(4, 10, 18, 0.85) 100%);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.immersive.settings-open .launch-instruction,
.immersive.settings-open .versus,
.immersive.settings-open .time,
.immersive.settings-open .battle-bottom,
.immersive.settings-open .arena-head,
.immersive.settings-open #challenge-progress,
.immersive.settings-open #challenge-result {
    visibility: hidden;
}

/* 内部滚动槽 */
#setup-card .setup-scroll {
    overflow-y: auto;
    min-height: 0;
    overscroll-behavior: contain;
    padding: 20px 22px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.immersive.settings-open #setup-card .builder,
.immersive.settings-open #setup-card .modes {
    display: block;
    position: static;
    inset: auto;
    transform: none;
    width: auto;
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    color: #e2f1fb;
}

/* 顶部标题栏：军械工坊终端风格 */
#setup-card .section-heading {
    position: relative;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(103, 221, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#setup-card .section-heading > span {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 8px;
    border-radius: 3px;
}

#setup-card #builder-title {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.8px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

#setup-card #builder-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 14px;
    background: #38bdf8;
    border-radius: 1px;
}

#setup-card #close-settings {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(114, 178, 228, 0.25);
    border-radius: 4px;
    color: #94b8d7;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#setup-card #close-settings:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #f87171;
    color: #ffffff;
}

/* 文字选定标签 */
#setup-card .builder > label {
    font-size: 12px;
    font-weight: 700;
    color: #93c5fd;
    margin-top: 0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#setup-card .builder > label span {
    font-size: 10px;
    color: #64748b;
    font-weight: 400;
}

/* 输入框：机械蓝发光槽 */
#setup-card .input-wrap {
    background: rgba(13, 31, 51, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    display: flex;
    align-items: stretch;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

#setup-card .input-wrap:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

#setup-card .input-wrap input {
    font-size: 24px;
    font-weight: 900;
    height: 48px;
    color: #ffffff;
    background: transparent;
    border: 0;
    padding: 0 16px;
    letter-spacing: 2px;
    flex: 1;
}

#setup-card .input-wrap input::placeholder {
    font-size: 14px;
    font-weight: 400;
    color: #475569;
    letter-spacing: 0;
}

#setup-card #random {
    width: 48px;
    height: 48px;
    background: rgba(56, 189, 248, 0.15);
    border: 0;
    border-left: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#setup-card #random:hover {
    background: rgba(56, 189, 248, 0.3);
    color: #ffffff;
}

#setup-card #character-help {
    font-size: 11px;
    line-height: 1.5;
    margin: 8px 0 10px;
    color: #7ba2c5;
}

/* 快捷候选文字：方正切角微晶芯片风格，取代原版胶囊丸子按键 */
#setup-card .quick {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin: 0 0 16px;
}

#setup-card .quick button {
    padding: 8px 0;
    font-size: 16px;
    font-weight: 800;
    background: rgba(16, 38, 62, 0.85);
    border: 1px solid rgba(114, 178, 228, 0.25);
    border-radius: 4px;
    color: #c7e3f7;
    cursor: pointer;
    transition: all 0.15s ease;
}

#setup-card .quick button:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

#setup-card .quick button:active {
    transform: translateY(0);
}

/* ==========================================================================
   性能分析与书体面板 (独自工学スペック・コンソール)
   ========================================================================== */
#setup-card .blade-font-panel {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px 16px;
    margin-top: 0;
    padding: 16px;
    background: rgba(10, 26, 44, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

#setup-card .font-heading,
#setup-card .fonts {
    grid-column: 1 / -1;
}

#setup-card .font-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #7dd3fc;
    margin-bottom: 2px;
}

#setup-card .font-heading b {
    font-size: 11px;
    color: #67e8f9;
    padding: 1px 6px;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 3px;
}

/* 4大书体选择器：战术分段式开关 */
.immersive #setup-card .fonts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    background: rgba(5, 14, 25, 0.6);
    padding: 3px;
    border: 1px solid rgba(114, 178, 228, 0.25);
    border-radius: 6px;
}

.immersive #setup-card .fonts button {
    font-size: 12px;
    font-weight: 600;
    padding: 8px 4px;
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: #94b8d7;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.immersive #setup-card .fonts button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.immersive #setup-card .fonts button.selected {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.immersive #setup-card .fonts button.selected:after {
    display: none; /* 去除原本下方对勾字符，采用现代光效 */
}

/* 预览图框：全息文字投影台风格 (深灰蓝金属座 + 激光蓝晕) */
#setup-card .character-preview {
    grid-row: auto;
    grid-column: 1;
    padding: 14px 8px;
    margin: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 40%, rgba(14, 52, 84, 0.9) 0%, rgba(6, 20, 34, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 0 15px rgba(56, 189, 248, 0.15);
}

.immersive #setup-card .character-preview > span {
    font-size: 68px;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 0 16px rgba(103, 221, 255, 0.6), 0 4px 8px rgba(0, 0, 0, 0.8);
    display: block;
    margin-bottom: 6px;
}

#setup-card .character-preview small {
    font-size: 10px;
    line-height: 1.35;
    padding: 4px;
    color: #7dd3fc;
    text-align: center;
    background: rgba(14, 42, 68, 0.6);
    border-radius: 4px;
    width: 100%;
}

/* 战力条：高科技刻度柱状条（由原版的黄色扁平条全面升级为蓝/绿/青战术光柱） */
#setup-card .stats {
    grid-column: 2;
    align-self: center;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 12px;
}

#setup-card .stats > div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 11px;
}

#setup-card .stats span {
    width: 62px;
    font-weight: 700;
    color: #94b8d7;
    flex-shrink: 0;
}

#setup-card .stats i {
    flex: 1;
    height: 7px;
    background: rgba(15, 30, 48, 0.9);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(114, 178, 228, 0.2);
    display: block;
    position: relative;
}

#setup-card .stats b {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #22d3ee);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 根据属性项赋予个性化光效 */
#setup-card .stats > div:nth-child(1) b {
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
}

#setup-card .stats > div:nth-child(2) b {
    background: linear-gradient(90deg, #f43f5e, #fb7185);
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

#setup-card .stats > div:nth-child(3) b {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

#setup-card .stats strong {
    font-size: 13px;
    font-weight: 900;
    width: 26px;
    text-align: right;
    color: #ffffff;
    font-family: monospace;
}

/* 个人 ID 与收藏 */
#setup-card .collection-tools {
    margin: 12px 0 0;
}

#setup-card .collection-tools #favorite-blade {
    width: 100%;
    padding: 8px 12px;
    background: rgba(22, 45, 68, 0.7);
    border: 1px solid rgba(114, 178, 228, 0.3);
    color: #bae6fd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
}

#setup-card .collection-tools #favorite-blade:hover {
    background: rgba(35, 75, 110, 0.8);
    border-color: #38bdf8;
    color: #ffffff;
}

#setup-card .player-identity {
    margin: 10px 0 0;
    padding: 8px 12px;
    background: rgba(10, 20, 32, 0.6);
    border: 1px solid rgba(114, 178, 228, 0.2);
    border-radius: 4px;
}

#setup-card .player-identity > span {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#setup-card .player-identity > b {
    font-size: 12px;
    color: #e2f1fb;
    font-family: monospace;
}

#setup-card .note {
    font-size: 10px;
    line-height: 1.5;
    color: #64748b;
    margin: 10px 0 0;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(103, 221, 255, 0.4);
    border-radius: 0 4px 4px 0;
}

/* 模式抽屉 */
#setup-card .setup-options {
    margin-top: 12px;
    border-top: 1px solid rgba(114, 178, 228, 0.2);
    padding-top: 8px;
}

#setup-card .setup-options > summary {
    font-size: 11px;
    font-weight: 700;
    color: #7dd3fc;
    cursor: pointer;
    padding: 4px 0 8px;
    outline: none;
    transition: color 0.2s ease;
}

#setup-card .setup-options > summary:hover {
    color: #38bdf8;
}

#setup-card .modes > .ui-title,
#setup-card .modes > p,
#setup-card .event,
#setup-card .demo-note {
    display: none;
}

#setup-card .modes .mode {
    margin-top: 6px;
    padding: 10px 12px;
    background: rgba(14, 30, 48, 0.8);
    border: 1px solid rgba(114, 178, 228, 0.2);
    border-radius: 4px;
    color: #e2f1fb;
    cursor: pointer;
    transition: all 0.2s ease;
}

#setup-card .modes .mode:hover {
    background: rgba(24, 52, 82, 0.9);
    border-color: rgba(56, 189, 248, 0.5);
}

#setup-card .modes .mode.selected {
    background: rgba(2, 132, 199, 0.2);
    border-color: #38bdf8;
    box-shadow: inset 3px 0 0 #38bdf8;
}

/* ==========================================================================
   底部行动坞 (独自ブレード射出カタパルト)
   彻底废弃原版黄色高圆角按钮，采用机甲深蓝核心+青色能量流激光按钮
   ========================================================================== */
#setup-card .start-panel {
    display: block;
    position: static;
    inset: auto;
    z-index: auto;
    transform: none;
    width: 100%;
    flex-shrink: 0;
    background: rgba(7, 18, 30, 0.98);
    border-top: 1px solid rgba(56, 189, 248, 0.35);
    margin: 0;
    padding: 14px 22px 18px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.5);
}

#setup-card #start-help {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #7dd3fc;
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: 500;
}

.immersive #setup-card #prepare {
    margin: 0;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #075985 100%);
    color: #ffffff;
    border: 1px solid #38bdf8;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                0 4px 12px rgba(0, 0, 0, 0.4);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.immersive #setup-card #prepare:hover:not(:disabled) {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    border-color: #7dd3fc;
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                0 6px 16px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.immersive #setup-card #prepare:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.immersive #setup-card #prepare:disabled {
    opacity: 0.45;
    background: #1e293b;
    border-color: #334155;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 响应式断点适配 */
@media (max-width: 768px) {
    .immersive.settings-open #setup-card {
        left: 50%;
        top: calc(50dvh + 24px);
        transform: translate(-50%, -50%);
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 84px);
        border-radius: 8px;
    }

    #setup-card .setup-scroll {
        padding: 16px 16px 8px;
    }

    #setup-card #builder-title {
        font-size: 15px;
    }

    #setup-card .blade-font-panel {
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 8px 12px;
        padding: 12px;
    }

    .immersive #setup-card .character-preview > span {
        font-size: 56px;
    }

    .immersive #setup-card .fonts button {
        font-size: 11px;
        padding: 7px 2px;
    }

    #setup-card .stats > div {
        gap: 6px;
        font-size: 10px;
    }

    #setup-card .stats span {
        width: 52px;
    }

    #setup-card .start-panel {
        padding: 12px 16px 16px;
    }

    .immersive #setup-card #prepare {
        font-size: 15px;
        min-height: 48px;
        padding: 10px 16px;
    }

    #setup-card .input-wrap input {
        font-size: 20px;
        height: 42px;
    }
}

@media (max-height: 580px) {
    .immersive.settings-open #setup-card {
        top: calc(50dvh + 20px);
        max-height: calc(100dvh - 65px);
    }

    #setup-card .start-panel {
        padding: 8px 16px 10px;
    }

    #setup-card #start-help {
        display: none;
    }
}
