:root {
  --bg: #15111f; --panel: #221b33; --panel2: #2c2342; --line: #4a3d6b; --gold: #ffd36a; --text: #eee6ff; --mute: #a89cc4;
  --red: #ff5a6a; --green: #6ade8a; --blue: #6ab0ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  /* 手機：禁止長按選字、複製選單、點擊藍框、雙擊縮放、橡皮筋回彈 */
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
* { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#hud, #modal, #bossAlert, #toasts { touch-action: manipulation; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 共用元件 ---------- */
.btn { background: linear-gradient(#5a4690, #3e2f68); color: #fff; border: 1px solid #8a74c8; border-radius: 8px; padding: 8px 16px; font-size: 14px; transition: .12s; }
.btn:hover:not(:disabled) { filter: brightness(1.2); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(#f0b43a, #b8781a); border-color: #ffe08a; color: #2a1800; font-weight: bold; }
.btn.red { background: linear-gradient(#c8404e, #8a2030); border-color: #ff8a9a; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.big { padding: 14px 40px; font-size: 20px; font-weight: bold; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.mute { color: var(--mute); font-size: 12px; }
.gold-t { color: var(--gold); }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
h2 { margin: 0 0 10px; font-size: 18px; color: var(--gold); }
h3 { margin: 8px 0; font-size: 15px; }

/* ---------- 畫面 ---------- */
.screen { position: fixed; inset: 0; overflow: auto; background:
  radial-gradient(ellipse at top, #3a2a5a 0%, transparent 60%), radial-gradient(ellipse at bottom, #1e3a3a 0%, transparent 60%), var(--bg); z-index: 5; }
.title-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 20px; }
.logo { font-size: 56px; font-weight: 900; letter-spacing: 6px; background: linear-gradient(#fff3b0, #f0a020 60%, #a05010); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #3a1a00) drop-shadow(0 0 30px rgba(255,180,60,.4)); text-align: center; }
.logo small { display: block; font-size: 20px; letter-spacing: 12px; }
.title-chars { display: flex; gap: 8px; align-items: flex-end; }
.title-chars img { height: 140px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); animation: bob 2s ease-in-out infinite; }
.title-chars img:nth-child(2n) { animation-delay: -1s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* 村莊 */
.village { display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: rgba(0,0,0,.35); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar .title { font-size: 20px; font-weight: bold; color: var(--gold); }
.res { display: flex; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.res span { background: rgba(255,255,255,.06); padding: 4px 10px; border-radius: 20px; }
.tabs { display: flex; gap: 4px; padding: 8px 16px 0; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 8px 8px 0 0; background: var(--panel); border: 1px solid var(--line); border-bottom: none; color: var(--mute); font-size: 14px; }
.tab.on { background: var(--panel2); color: #fff; font-weight: bold; }
.tab.lock { opacity: .5; }
.content { flex: 1; overflow: auto; padding: 14px 16px 30px; background: var(--panel2); margin: 0 16px 16px; border-radius: 0 12px 12px 12px; border: 1px solid var(--line); }

/* 出征 */
.cls-cards { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; }
.cls-card { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; cursor: pointer; position: relative; transition: .15s; }
.cls-card:hover { transform: translateY(-3px); }
.cls-card.on { border-color: var(--gold); box-shadow: 0 0 18px rgba(255,210,100,.35); }
.cls-card img { height: 110px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.cls-card .nm { font-weight: bold; font-size: 17px; }
.schools { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.schools i { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: rgba(255,255,255,.08); }
.map-cards { display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)); gap: 10px; }
.map-card { border-radius: 12px; padding: 12px; border: 2px solid var(--line); cursor: pointer; position: relative; min-height: 120px; }
.map-card.on { border-color: var(--gold); }
.map-card.lock { opacity: .4; cursor: not-allowed; }
.map-card .mn { font-size: 18px; font-weight: bold; text-shadow: 0 2px 4px #000; }
.diffs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.diff { padding: 6px 12px; border-radius: 8px; border: 2px solid transparent; background: rgba(0,0,0,.35); font-size: 13px; cursor: pointer; }
.diff.on { border-color: #fff; }
.diff.lock { opacity: .35; cursor: not-allowed; }
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 18px; }
.mod { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mod input { flex: 1; accent-color: #f0a020; }
.mod b { width: 44px; text-align: right; color: var(--gold); }

/* 倉庫 / 裝備 */
.inv-layout { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.char-panel { width: 300px; flex-shrink: 0; }
.char-view { position: relative; height: 230px; display: flex; justify-content: center; align-items: flex-end; background: radial-gradient(circle at 50% 70%, #3a2f5a, #1a1428); border-radius: 10px; overflow: hidden; }
.char-view img { height: 190px; position: relative; z-index: 2; margin-bottom: 14px; }
.char-view .glow { position: absolute; left: 50%; bottom: 40px; width: 200px; height: 200px; transform: translateX(-50%); border-radius: 50%; z-index: 1; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: translateX(-50%) scale(.9); } }
.equip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.eslot { height: 58px; background: rgba(0,0,0,.35); border: 1px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--mute); cursor: pointer; position: relative; }
.eslot .ic { font-size: 24px; }
.eslot.has { border-style: solid; }
.eslot.drop { background: rgba(255,210,100,.2); }
.stat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; margin-top: 8px; }
.stat-list div { display: flex; justify-content: space-between; }
.stat-list b { color: #fff; }
.wh-panel { flex: 1; min-width: 300px; }
.page-tabs { display: flex; gap: 4px; margin-bottom: 6px; align-items: center; flex-wrap: wrap; }
.ptab { padding: 5px 12px; border-radius: 6px; background: rgba(0,0,0,.35); border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.ptab.on { background: #5a4690; color: #fff; }
.ptab.drop { background: rgba(255,210,100,.35); }
.wh-scroll { overflow-x: auto; padding-bottom: 6px; }
.wh-grid { position: relative; background-color: #120e1c; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  border: 1px solid var(--line); border-radius: 6px; }
.item { position: absolute; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: grab; border: 2px solid; overflow: hidden; touch-action: none; }
.item .ic { font-size: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); pointer-events: none; }
.item .enh { position: absolute; right: 3px; top: 1px; font-size: 11px; font-weight: bold; color: #fff; text-shadow: 0 0 3px #000; pointer-events: none; }
.item .cl { position: absolute; left: 3px; bottom: 1px; font-size: 10px; opacity: .9; pointer-events: none; }
.item .gm { position: absolute; left: 2px; top: 1px; font-size: 8px; pointer-events: none; }
.item.sel { outline: 2px solid #fff; outline-offset: 1px; }
.item.ghost { position: fixed; pointer-events: none; z-index: 100; opacity: .85; }
.item.dim { opacity: .3; }
.place-hint { position: absolute; border-radius: 4px; pointer-events: none; z-index: 5; }
.glow3 { box-shadow: 0 0 8px 1px rgba(255,255,255,.7); }
.glow6 { box-shadow: 0 0 10px 2px rgba(74,160,255,.9); }
.glow9 { box-shadow: 0 0 12px 3px rgba(192,112,255,.95); }
.glow10 { box-shadow: 0 0 16px 4px rgba(255,208,64,1); animation: gl 1.2s infinite; }
@keyframes gl { 50% { box-shadow: 0 0 22px 6px rgba(255,208,64,.8); } }
.detail { margin-top: 10px; }

/* 物品說明 */
.tooltip { position: fixed; z-index: 200; pointer-events: none; max-width: 280px; background: rgba(16,12,26,.97); border: 2px solid; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.tt-name { font-size: 15px; font-weight: bold; }
.tt-sub { color: var(--mute); font-size: 12px; }
.tt-sec { border-top: 1px solid rgba(255,255,255,.12); margin-top: 5px; padding-top: 5px; }
.tt-base { color: #fff; }
.tt-aff { color: #8ab8ff; }
.tt-enh { color: #ffd36a; }
.tt-gem { color: #c8a0ff; }

/* 強化 / 寶石 */
.two-col { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.item-list { width: 340px; max-height: 62vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.il { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px solid transparent; cursor: pointer; font-size: 13px; }
.il:hover { background: rgba(255,255,255,.06); }
.il.on { border-color: var(--gold); }
.il .ic { font-size: 22px; width: 30px; text-align: center; }
.enh-box { flex: 1; min-width: 300px; }
.big-item { display: flex; gap: 14px; align-items: center; }
.big-item .icb { width: 90px; height: 90px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 48px; border: 3px solid; position: relative; }
.rate-bar { height: 16px; background: #3a1a22; border-radius: 8px; overflow: hidden; margin: 6px 0; }
.rate-bar div { height: 100%; background: linear-gradient(90deg, #ff7a4a, #ffd36a, #6ade8a); }
.enh-result { font-size: 18px; font-weight: bold; margin-top: 10px; min-height: 26px; }
.gem-grid { display: grid; grid-template-columns: 90px repeat(5, 1fr) ; gap: 4px; font-size: 12px; align-items: center; }
.gem-cell { background: rgba(0,0,0,.3); border-radius: 6px; padding: 4px; text-align: center; cursor: pointer; border: 2px solid transparent; }
.gem-cell.on { border-color: var(--gold); }
.gem-cell.zero { opacity: .35; }
.sockets { display: flex; gap: 8px; margin: 10px 0; }
.socket { width: 54px; height: 54px; border-radius: 50%; border: 2px dashed #8a74c8; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; background: rgba(0,0,0,.35); flex-direction: column; }
.socket.full { border-style: solid; }
.socket small { font-size: 9px; }

/* 天賦 */
.talent-cols { display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)); gap: 12px; }
.tnode { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: rgba(0,0,0,.3); border: 2px solid var(--line); margin-bottom: 8px; cursor: pointer; position: relative; }
.tnode.can { border-color: #8a74c8; }
.tnode.max { border-color: var(--gold); background: rgba(255,210,100,.08); }
.tnode.lock { opacity: .4; cursor: not-allowed; }
.tnode .rk { margin-left: auto; font-weight: bold; color: var(--gold); white-space: nowrap; }
.tnode + .tnode::before { content: ''; position: absolute; left: 24px; top: -10px; height: 10px; border-left: 2px solid var(--line); }

/* 村莊 */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.vcard .ic { font-size: 30px; }
.vcard.lock { opacity: .5; }
.pips { display: flex; gap: 2px; flex-wrap: wrap; margin: 4px 0; }
.pips i { width: 7px; height: 7px; border-radius: 2px; background: #3a2f55; }
.pips i.on { background: var(--gold); }

/* 成就 / 排行榜 */
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(0,0,0,.3); border-radius: 8px; margin-bottom: 5px; }
.ach.done { background: rgba(255,210,100,.1); border: 1px solid rgba(255,210,100,.35); }
.ach .pt { margin-left: auto; color: var(--gold); font-weight: bold; white-space: nowrap; }
table.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lb th, table.lb td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.lb tr:nth-child(2) td { color: #ffd36a; }

/* 彈窗 */
.modal { position: fixed; inset: 0; background: rgba(5,3,12,.7); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 14px; }
.modal-box { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 20px; max-width: 980px; width: 100%; max-height: 94vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.lv-title { text-align: center; font-size: 26px; font-weight: 900; color: var(--gold); margin-bottom: 4px; }
.cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.card { width: 210px; background: linear-gradient(#2f2548, #1c1630); border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; transition: .12s; position: relative; display: flex; flex-direction: column; gap: 6px; }
.card:hover { transform: translateY(-4px); border-color: var(--gold); }
.card .sc { font-size: 11px; padding: 2px 8px; border-radius: 10px; align-self: flex-start; color: #111; font-weight: bold; }
.card .ci { font-size: 40px; text-align: center; }
.card .cn { font-size: 17px; font-weight: bold; text-align: center; }
.card .cl { text-align: center; font-size: 12px; color: var(--gold); }
.card .cd { font-size: 12px; color: #d8cff0; min-height: 34px; }
.card .cs { font-size: 11px; color: #9fd0ff; }
.card .acts { display: flex; gap: 4px; justify-content: center; margin-top: auto; }
.card.locked { border-color: #6ab0ff; box-shadow: 0 0 16px rgba(106,176,255,.5); }
.card .lockmark { position: absolute; right: 8px; top: 6px; }
.fate { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.results h1 { text-align: center; margin: 0 0 10px; }
.loot-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; }
.loot { width: 46px; height: 46px; border-radius: 8px; border: 2px solid; display: flex; align-items: center; justify-content: center; font-size: 22px; position: relative; }

/* HUD 與通知 */
#hud { position: fixed; top: 192px; right: 12px; z-index: 10; }
.hud-btn { width: 42px; height: 42px; border-radius: 10px; background: rgba(10,8,20,.7); border: 1px solid var(--line); color: #fff; font-size: 18px; }
#toasts { position: fixed; right: 14px; top: 244px; z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.toast { background: rgba(16,12,26,.92); border-left: 4px solid; padding: 7px 12px; border-radius: 6px; font-size: 13px; animation: tin .25s ease-out; max-width: 340px; }
@keyframes tin { from { transform: translateX(30px); opacity: 0; } }
.boss-alert { position: fixed; left: 0; right: 0; top: 38%; text-align: center; z-index: 40; pointer-events: none; font-size: 40px; font-weight: 900; color: #ff4a5a;
  text-shadow: 0 0 20px #f00, 0 4px 0 #300; animation: balert 2.6s ease-out forwards; letter-spacing: 4px; }
.boss-alert small { display: block; font-size: 16px; color: #fff; letter-spacing: 2px; }
@keyframes balert { 0% { transform: scale(2); opacity: 0; } 15% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 760px) {
  .cls-cards { grid-template-columns: repeat(2, 1fr); }
  .map-cards, .talent-cols { grid-template-columns: 1fr; }
  .char-panel, .item-list { width: 100%; }
  .logo { font-size: 38px; }
  .content { margin: 0 6px 6px; padding: 10px; }
}

/* ---------- 一鍵出售 ---------- */
.sell-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 8px; font-size: 13px; }
.sell-bar select { background: #1a1428; color: #fff; border: 1px solid #4a3d6b; border-radius: 6px; padding: 3px; }
.rchip { padding: 3px 9px; border-radius: 12px; border: 1px solid var(--c); color: var(--c); cursor: pointer; font-size: 12px; opacity: .55; }
.rchip.on { background: var(--c); color: #111; opacity: 1; font-weight: bold; }

/* ---------- 直式手機 ---------- */
@media (max-width: 639px) {
  #hud { top: 136px; }
  #toasts { top: 186px; max-width: 70vw; }
  .modal-box { padding: 12px !important; }
  .cards { gap: 8px !important; }
  .card { width: 100%; display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; row-gap: 2px; padding: 8px 10px; }
  .card > * { grid-column: 2; }
  .card .ci { grid-column: 1; grid-row: 1 / span 4; font-size: 30px; align-self: center; }
  .card .cn { font-size: 15px; text-align: left; }
  .card .sc { font-size: 10px; }
  .card .cd, .card .cs, .card .cl { font-size: 12px; text-align: left; min-height: 0; }
  .card .acts { justify-content: flex-start; }
  .lv-title { font-size: 22px !important; }
}

/* LINE / FB 內建瀏覽器警告 */
#inAppWarn { position: fixed; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); z-index: 9999; background: #3a1420; border: 2px solid #ff6a6a; border-radius: 10px; padding: 10px 12px; color: #fff; font-size: 13px; line-height: 1.6; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
#inAppWarn a { color: #ffd36a; text-decoration: underline; }
#inAppWarn .btn { margin-left: 8px; margin-top: 4px; }

/* 雲端帳號 */
.acct-box { background: rgba(20,14,36,.75); border: 1px solid #4a3d6b; border-radius: 10px; padding: 10px 12px; max-width: 460px; margin: 0 auto; text-align: center; font-size: 14px; }
.acct-box input { width: 170px; padding: 8px; border-radius: 8px; border: 1px solid #4a3d6b; background: #1a1428; color: #fff; font-size: 15px; -webkit-user-select: text; user-select: text; }

/* 戰鬥中按鈕直排（暫停 / 靜音） */
#hud:not(.hidden) { display: flex; flex-direction: column; gap: 6px; }
.audio-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
.audio-row input[type=range] { width: 180px; }
.music-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.music-list .btn { text-align: left; }
.audio-row select { background: #1a1428; color: #fff; border: 1px solid #4a3d6b; border-radius: 6px; padding: 5px; max-width: 240px; }

/* 職業等級 */
.cls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.cls-col { border: 2px solid; border-radius: 10px; overflow: hidden; background: rgba(20,14,36,.6); }
.cls-head { padding: 6px 10px; font-weight: bold; color: #111; display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.cls-head span { font-weight: normal; font-size: 12px; }
.cls-skill { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-top: 1px solid rgba(255,255,255,.06); }
.cls-skill .ci { font-size: 22px; width: 28px; text-align: center; }
.cls-skill .rank { display: flex; gap: 3px; align-items: center; margin-top: 3px; }
.cls-skill .rank i { width: 14px; height: 6px; border-radius: 3px; background: #3a3050; }
.cls-skill .rank i.on { background: #ffd36a; }
.cls-skill .rank .mute { margin-left: 6px; font-size: 12px; }
.rank-btns { display: flex; gap: 4px; }
.rank-btns .btn { min-width: 30px; padding: 4px 6px; }
/* 鍵盤選取中的升級卡片 */
.card.kbsel { outline: 3px solid #ffd36a; outline-offset: 2px; transform: translateY(-4px); box-shadow: 0 0 18px rgba(255,211,106,.45); }
.card[data-n] { position: relative; }
.card[data-n]::before { content: attr(data-n); position: absolute; left: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 6px; background: rgba(0,0,0,.55); border: 1px solid #ffd36a; color: #ffd36a; font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; }
@media (hover: none) { .card[data-n]::before { display: none; } }

/* 暫停畫面：人物屬性 */
.pause-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; max-width: 760px; margin: 10px auto; }
.ps-col { background: rgba(20,14,36,.7); border: 1px solid #4a3d6b; border-radius: 10px; padding: 8px 10px; }
.ps-col h4 { margin: 0 0 6px; color: #ffd36a; font-size: 14px; }
.ps-col > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,.06); }

/* 變異進化 */
.card.evo { border: 2px solid var(--ec); box-shadow: 0 0 22px var(--ec), inset 0 0 30px rgba(255,255,255,.06); background: linear-gradient(160deg, rgba(60,20,80,.95), rgba(20,10,40,.95)); animation: evoPulse 1.2s ease-in-out infinite alternate; }
@keyframes evoPulse { from { box-shadow: 0 0 10px var(--ec); } to { box-shadow: 0 0 28px var(--ec); } }
.evo-hint { margin-top: 5px; font-size: 11px; color: #c9a0ff; border-top: 1px dashed rgba(200,160,255,.3); padding-top: 4px; }
.evo-hint.ok { color: #ff9aff; font-weight: bold; }

/* 進化圖鑑 */
.evo-school { border: 2px solid; border-radius: 10px; overflow: hidden; margin-bottom: 12px; background: rgba(20,14,36,.6); }
.evo-shead { padding: 6px 10px; font-weight: bold; color: #111; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.evo-shead span { font-weight: normal; font-size: 12px; }
.evo-row { display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; gap: 6px; align-items: stretch; padding: 8px; border-top: 1px solid rgba(255,255,255,.06); }
.evo-skill { display: flex; gap: 8px; align-items: flex-start; background: rgba(10,8,20,.55); border: 1px solid #3a3050; border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.evo-skill .ci { font-size: 22px; line-height: 1; }
.evo-skill .mute { font-size: 12px; }
.evo-res { border: 2px solid var(--ec); box-shadow: 0 0 10px var(--ec); background: linear-gradient(160deg, rgba(60,20,80,.8), rgba(20,10,40,.8)); }
.evo-op { align-self: center; font-size: 18px; color: #ffd36a; font-weight: bold; }
@media (max-width: 760px) {
  .evo-row { grid-template-columns: 1fr; }
  .evo-op { text-align: center; line-height: 1; }
}
.ver-tag { margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid #4a3d6b; color: #b9a8e0; font-size: 12px; white-space: nowrap; }

/* 廣告畫面 */
.ad-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ad-box { width: min(440px, 100%); background: #1a1428; border: 2px solid #4a3d6b; border-radius: 14px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.ad-tag { font-weight: bold; color: #ffd36a; }
.ad-screen { background: repeating-linear-gradient(45deg, #241b38, #241b38 12px, #2b2142 12px, #2b2142 24px); border-radius: 10px; padding: 34px 10px; display: flex; flex-direction: column; gap: 6px; }
.ad-big { font-size: 46px; }
.ad-count { font-size: 16px; }
.ad-reward { color: #6ade8a; }
