/* ==========================================================================
   三國天命 v12.15 — 登入 / 伺服器 / 角色欄位 / 建立角色 美化
   使用遊戲既有美術：主視覺 (ui_title_bg)、角色大廳 (ui_create_bg)、龍紋徽章、石紋面板框、金屬按鈕
   修正：畫面高度不夠時 (手機) 伺服器清單可捲動，不會被切掉點不到
   ========================================================================== */

/* ---------- 背景：登入 = 戰場主視覺；角色欄位 / 建立角色 = 角色大廳 ---------- */
#title-screen { justify-content: safe center; }
#title-screen > * { flex-shrink: 0; }
#title-screen .ts-bg { background: #050403 url('../assets/img/ui/ui_title_bg.jpg') center 30% / cover no-repeat; filter: brightness(0.62) saturate(0.95); transform: scale(1.04); transition: background-image .4s; }
#title-screen[data-scene='hall'] .ts-bg { background-image: url('../assets/img/ui/ui_create_bg.jpg'); background-position: center; filter: brightness(0.7) saturate(0.95); }
#title-screen .ts-bg::after { background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.88) 100%), linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.6) 100%); }
#title-screen .ts-bg::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 70% 18%, rgba(255,80,40,.18), rgba(0,0,0,0) 40%); pointer-events: none; }

/* ---------- 標誌 ---------- */
#title-screen .ts-logo { position: relative; display: flex; flex-direction: column; align-items: center; }
#title-screen .ts-logo::before { content: ''; width: clamp(64px, 12vw, 104px); height: clamp(64px, 12vw, 104px); margin-bottom: -6px;
  background: url('../assets/img/ui/ui_logo_emblem.png') center / contain no-repeat; filter: drop-shadow(0 4px 10px #000) drop-shadow(0 0 18px rgba(220,160,60,.35)); }
#title-screen .ts-name { letter-spacing: .3em; padding-left: .3em; }
#title-screen .ts-sub { display: flex; align-items: center; gap: 12px; }
#title-screen .ts-sub::before, #title-screen .ts-sub::after { content: ''; width: clamp(30px, 8vw, 80px); height: 1px; background: linear-gradient(90deg, rgba(214,180,106,0), #d6b46a, rgba(214,180,106,0)); }

/* ---------- 面板：石紋鐵框 ---------- */
#title-screen .nt-box { width: min(420px, 94vw); padding: 18px 20px 20px; gap: 11px; border: 22px solid transparent; border-radius: 0;
  border-image: url('../assets/img/ui9/panel_stone.webp') 64 fill / 22px / 0 stretch; background: none;
  box-shadow: 0 18px 50px rgba(0,0,0,.75); filter: drop-shadow(0 0 1px rgba(0,0,0,.9)); }
#title-screen .nt-box > * { position: relative; }
#title-screen .nt-t { font-size: 22px; letter-spacing: 6px; padding: 2px 0 8px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, #fff3c9, #e2bd6c 55%, #9b7230); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 3px #000); }
#title-screen .nt-t::before, #title-screen .nt-t::after { content: ''; flex: 1; max-width: 70px; height: 2px; background: linear-gradient(90deg, rgba(214,180,106,0), #c9a45a); -webkit-text-fill-color: initial; }
#title-screen .nt-t::after { background: linear-gradient(270deg, rgba(214,180,106,0), #c9a45a); }
#title-screen .nt-srv { color: #c9b48a; }
#title-screen .nt-box input { height: 44px; padding: 0 14px; font-size: 15px; border-radius: 2px; color: #f6e7c1;
  background: linear-gradient(180deg, rgba(0,0,0,.75), rgba(18,13,8,.85)); border: 1px solid #5d4a28; box-shadow: inset 0 2px 6px rgba(0,0,0,.8); }
#title-screen .nt-box input::placeholder { color: #8a7a5c; }
#title-screen .nt-box input:focus { border-color: #e2bd6c; box-shadow: inset 0 2px 6px rgba(0,0,0,.8), 0 0 0 1px rgba(226,189,108,.4), 0 0 14px rgba(226,189,108,.25); }

/* ---------- 按鈕：金屬牌匾 ---------- */
#title-screen .nt-box .v4-btn, #title-screen .cc-wrap .v4-btn { position: relative; min-height: 44px; border-radius: 0; font-family: "Noto Serif TC", serif; letter-spacing: 2px; cursor: pointer; transition: filter .15s, transform .1s; }
#title-screen .nt-box .v4-btn:active, #title-screen .cc-wrap .v4-btn:active { transform: translateY(1px); }
#title-screen .nt-box .v4-btn.gold, #title-screen .nt-box .v4-btn.big:not(:disabled), #title-screen .cc-wrap .v4-btn.gold {
  border: 12px solid transparent; border-image: url('../assets/img/ui9/btn_gold.webp') 36 fill / 12px / 0 stretch; background: none !important;
  color: #2b1a08 !important; font-weight: 900; text-shadow: 0 1px 0 rgba(255,240,200,.55); box-shadow: none !important; padding: 2px 10px; }
#title-screen .nt-box .v4-btn.gold:hover, #title-screen .nt-box .v4-btn.big:not(:disabled):hover, #title-screen .cc-wrap .v4-btn.gold:hover { filter: brightness(1.15) drop-shadow(0 0 8px rgba(251,191,36,.45)); }
#title-screen .nt-box .v4-btn.big small { color: #4a3214 !important; text-shadow: none; letter-spacing: 1px; }
#title-screen .nt-box .v4-btn.ghost, #title-screen .nt-box .v4-btn:not(.gold):not(.big), #title-screen .cc-wrap .v4-btn:not(.gold) {
  background: linear-gradient(180deg, #2a2117, #15100b) !important; border: 1px solid #7a6232 !important; color: #e6d3a6 !important;
  box-shadow: inset 0 1px 0 rgba(255,230,170,.12), inset 0 -2px 4px rgba(0,0,0,.6), 0 2px 4px rgba(0,0,0,.6) !important; }
#title-screen .nt-box .v4-btn.ghost:hover, #title-screen .nt-box .v4-btn:not(.gold):not(.big):hover { filter: brightness(1.25); }
#title-screen .nt-box .v4-btn:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; }
#title-screen .nt-ic, #title-screen .nt-dot { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; object-fit: contain; }
.nt-dot.on { filter: sepia(1) saturate(6) hue-rotate(70deg) drop-shadow(0 0 3px #4ade80); }
.nt-dot:not(.on) { filter: grayscale(1) brightness(.7); }
#title-screen .nt-tos { color: #bda97c; }

/* ---------- 伺服器清單：可捲動 ---------- */
#title-screen .nt-list { display: flex; flex-direction: column; gap: 8px; max-height: min(52vh, 430px); overflow-y: auto; padding: 2px 4px 2px 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
#title-screen .nt-list::-webkit-scrollbar { width: 6px; } #title-screen .nt-list::-webkit-scrollbar-thumb { background: #7a6232; border-radius: 3px; }
#title-screen .nt-list .v4-btn.big { flex-shrink: 0; }

/* ---------- 角色欄位 ---------- */
#title-screen .nt-slots { display: flex; flex-direction: column; gap: 8px; }
#title-screen .nt-slot { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px; border: 1px solid #5d4a28; position: relative;
  background: linear-gradient(90deg, rgba(60,40,18,.55), rgba(12,9,6,.75)); box-shadow: inset 0 0 12px rgba(0,0,0,.7); transition: border-color .15s, box-shadow .15s; }
#title-screen .nt-slot:not(.empty):hover { border-color: #c9a45a; }
#title-screen .nt-slot.sel { border-color: #f0c96a; box-shadow: inset 0 0 14px rgba(0,0,0,.6), 0 0 0 1px rgba(240,201,106,.5), 0 0 16px rgba(240,201,106,.3); background: linear-gradient(90deg, rgba(110,60,18,.7), rgba(20,12,6,.8)); }
#title-screen .nt-slot.empty { opacity: .9; border-style: dashed; }
#title-screen .nt-sl-i { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font: 900 15px "Noto Serif TC", serif; color: #fde68a;
  background: url('../assets/img/ui9/ring_ornate.webp') center / contain no-repeat; text-shadow: 0 1px 2px #000; }
#title-screen .nt-sl-b { flex: 1; min-width: 0; } #title-screen .nt-sl-b b { display: block; color: #fde68a; font-size: 15px; letter-spacing: 1px; }
#title-screen .nt-sl-b small { color: #c9b48a; }
#title-screen .nt-slot .v4-btn { width: auto !important; min-height: 36px; padding: 0 14px; font-size: 13px; }

/* ---------- 建立角色 ---------- */
#title-screen .cc-wrap { border: 22px solid transparent; border-image: url('../assets/img/ui9/panel_stone.webp') 64 fill / 22px / 0 stretch; background: none; box-shadow: 0 18px 50px rgba(0,0,0,.75); padding: 10px 14px; }
#title-screen .cc-title { color: #fde68a; font-size: 15px; letter-spacing: 4px; border-bottom: 1px solid rgba(214,180,106,.35); }
#title-screen .cc-card { border: 2px solid #3a2c18; box-shadow: 0 6px 14px rgba(0,0,0,.6); }
#title-screen .cc-card.sel { border-color: #f0c96a; box-shadow: 0 0 0 1px #f0c96a, 0 0 24px rgba(240,201,106,.5), 0 6px 14px rgba(0,0,0,.6); transform: translateY(-4px); }
#title-screen .cc-card:not(.sel) img { filter: brightness(.72) saturate(.85); transition: filter .15s; } #title-screen .cc-card:hover img { filter: none; }
#title-screen .cc-desc { background: linear-gradient(90deg, rgba(60,40,18,.5), rgba(0,0,0,.35)); border-left: 3px solid #c9a45a; }
#title-screen .cc-nat { border: 1px solid #5d4a28; background: linear-gradient(180deg, rgba(30,22,14,.85), rgba(10,8,6,.9)); }
#title-screen #cc-name { background: linear-gradient(180deg, rgba(0,0,0,.75), rgba(18,13,8,.85)); border: 1px solid #5d4a28; box-shadow: inset 0 2px 6px rgba(0,0,0,.8); min-height: 44px; }
#title-screen .cc-row .v4-btn { min-height: 46px; padding: 0 22px; }

/* ---------- 手機 ---------- */
@media (max-width: 480px) {
  #title-screen { gap: 8px; padding: 12px 8px 26px; }
  #title-screen .nt-box { padding: 10px 8px 12px; border-width: 16px; border-image-width: 16px; }
  #title-screen .ts-logo::before { width: 56px; height: 56px; }
  #title-screen .nt-list { max-height: 46vh; }
}
@media (max-height: 520px) {   /* 手機橫向 */
  #title-screen { gap: 6px; padding-top: 8px; }
  #title-screen .ts-logo::before { display: none; }
  #title-screen .ts-name { font-size: 34px; } #title-screen .ts-sub { font-size: 12px; }
  #title-screen .nt-list { max-height: 48vh; }
}
/* 版本文字放在內容最下方 (原本固定在螢幕底部，畫面較矮時會蓋住面板) */
#title-screen .ts-foot { position: static; margin-top: 4px; padding-bottom: 4px; }

/* ---------- v12.53：伺服器 / 角色頁文字更醒目，限制創角紅字 ---------- */
/* 伺服器按鈕的金色牌匾被其他樣式的 border 簡寫 (!important) 蓋掉 → 深色字壓在灰石頭上看不清楚；這裡強制還原 */
#title-screen .nt-box .v4-btn.big:not(:disabled) { border: 12px solid transparent !important; border-image: url('../assets/img/ui9/btn_gold.webp') 36 fill / 12px / 0 stretch !important; border-radius: 0 !important; }
#title-screen .nt-list .v4-btn.big { font-size: 17px; line-height: 1.35; }
#title-screen .nt-box .v4-btn.big small { display: block; font-size: 12.5px !important; font-weight: 700; color: #3a2408 !important; opacity: 1 !important; margin-top: 2px; }
#title-screen .nt-srv { font-size: 14px; color: #ead9b0 !important; text-shadow: 0 1px 2px #000; line-height: 1.6; }
#title-screen .nt-srv b { color: #fde68a; }
#title-screen .nt-sl-b b { font-size: 16px; text-shadow: 0 1px 2px #000; }
#title-screen .nt-sl-b small { display: block; font-size: 13px; color: #e6d4a8 !important; text-shadow: 0 1px 2px #000; }
#title-screen .nt-slot.empty { opacity: 1; }
#title-screen .nt-lock { color: #ff4d4d !important; font-weight: 900; text-shadow: 0 0 6px rgba(255, 60, 60, .55), 0 1px 1px #000; letter-spacing: 1px; }
#title-screen .nt-box .v4-btn.big small .nt-lock { color: #b30000 !important; text-shadow: 0 0 1px rgba(255, 255, 255, .5); }
#title-screen .nt-lockbar { margin: 4px 0 8px; padding: 8px 12px; text-align: center; font-size: 14px; font-weight: 700; color: #ffe2e2; letter-spacing: 1px;
  background: linear-gradient(90deg, rgba(120, 10, 10, .15), rgba(150, 18, 18, .85), rgba(120, 10, 10, .15)); border-top: 1px solid #ff5a5a; border-bottom: 1px solid #ff5a5a; text-shadow: 0 1px 2px #000; }
#title-screen .nt-lockbar b { color: #ff6b6b; font-size: 15px; }
#title-screen .nt-slot .v4-btn.nt-lockbtn:disabled { filter: none !important; color: #ff6b6b !important; border-color: #a33 !important; background: linear-gradient(180deg, #3a1010, #1d0707) !important; font-weight: 900; }
/* v1.277：遊戲改名「三國：血盟誓約」(7 個字)，標題不換行；手機縮小字距 */
#title-screen .ts-name { white-space: nowrap; }
@media (max-width: 560px) { #title-screen .ts-name { font-size: 30px; letter-spacing: .1em; padding-left: .1em; } }
@media (max-width: 360px) { #title-screen .ts-name { font-size: 26px; } }
