/* Panel contents (js/panels.js): shared rows / switches / chips / stages, then one block per panel.
   Generic helpers that older modules also use (.spin, .money-pill, .qty, .total, .detail) are kept here too. */

/* ---------------------------------------------------------------- shared */
.sec { margin: 18px 2px 8px; font-size: 11.5px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 12px; color: var(--muted); }
.empty .ic-tile { width: 48px; height: 48px; opacity: .8; }
.empty b { color: #fff; font-size: 15px; }
.empty small { font-size: 13px; max-width: 280px; }
.spin { width: 20px; height: 20px; border: 3px solid var(--accent-2); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.money-pill { align-self: flex-end; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px 14px; font-size: 18px; font-weight: 900; color: var(--gold); }
.qty { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qty input { width: 64px; min-height: 38px; background: rgba(0,0,0,.3); color: #fff; border: 1px solid var(--line-2); border-radius: 10px; text-align: center; font: inherit; font-weight: 900; }
.total { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px 12px; }
.total b { font-size: 20px; }
.detail { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 14px; padding: 10px; }
.detail small { display: block; color: var(--muted); }
.desc { font-size: 13px; margin: 0; color: #dde5ff; }

.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-text b { font-size: 14.5px; }
.row-text small { font-size: 12.5px; color: var(--muted); }
.sw-row { cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; margin: 0; border-radius: 999px; background: rgba(255,255,255,.18); position: relative; cursor: pointer; transition: background var(--t); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.35); transition: transform var(--t) var(--ease); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.seg-row { flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: rgba(0,0,0,.3); border-radius: 12px; flex: none; }
.seg-b { min-height: 34px; min-width: 52px; padding: 4px 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 800; font-size: 13px; transition: background var(--t), color var(--t); }
.seg-b:hover { color: #fff; }
.seg-b.on { background: #fff; color: #13204a; }
.range-row input[type=range] { flex: 1 1 140px; max-width: 220px; accent-color: var(--gold); min-height: 30px; }
.range-row output { width: 44px; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.chip { min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 800; font-size: 13px; }
.chip.on { background: rgba(122, 168, 255, .22); border-color: var(--accent-2); color: #fff; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; background: rgba(0,0,0,.28); border: 1px solid var(--line-2); border-radius: 12px; color: var(--muted); }
.search:focus-within { border-color: var(--accent-2); }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: #fff; font: inherit; font-size: 14px; font-weight: 700; outline: none; }
.sort, select { display: flex; align-items: center; gap: 6px; }
.modal select { min-height: 42px; padding: 0 10px; background: rgba(0,0,0,.28); border: 1px solid var(--line-2); border-radius: 12px; color: #fff; font: inherit; font-weight: 800; font-size: 13.5px; }
.sort { padding-left: 10px; background: rgba(0,0,0,.28); border: 1px solid var(--line-2); border-radius: 12px; color: var(--muted); }
.sort select { border: 0; background: none; }
.lbl { display: block; font-size: 11.5px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

.type-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px;
  color: #10183a; background: linear-gradient(color-mix(in srgb, var(--c) 80%, #fff), var(--c)); box-shadow: inset 0 -1px 0 rgba(0,0,0,.2); }
.st-chip { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 6px; font-size: 10px; font-weight: 900; color: #fff; background: var(--c); }
.lead-chip { font-size: 10px; font-weight: 900; color: #3a2400; background: var(--gold); padding: 1px 6px; border-radius: 6px; }
.hpbar, .xpbar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hp-lbl { width: 26px; font-size: 10px; font-weight: 900; color: var(--muted); }
.hp-track, .xp-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; }
.xp-track { height: 4px; }
.xp-track > div { height: 100%; background: #4fc3ff; }
.hp-num { font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

/* 3D stage (summaries, Pokédex, wardrobe, trainer card) */
.stage { position: relative; border-radius: 18px; overflow: hidden; min-height: 240px;
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--t, #4c8dff) 40%, #24306a), #10183a 72%); border: 1px solid var(--line); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.stage-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 700; pointer-events: none; }
.stage.silhouette { background: radial-gradient(ellipse at 50% 40%, #5a70c0, #1c2756 72%); }

/* summary / detail chrome */
.sum-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sum-nav .muted { flex: 1; font-size: 13px; font-weight: 700; }
.sum-arrows { display: flex; gap: 6px; }
.sum-grid { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 16px; }
.sum-grid .stage { min-height: 300px; }
.sum-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sum-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sum-title h3 { margin: 0; font-size: 24px; }
.mc-types { display: flex; gap: 5px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 10px 0 0; padding: 12px 14px; background: var(--surface); border-radius: 14px; align-items: center; }
.facts dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 800; }
.facts dt .ic { width: 16px; height: 16px; }
.facts dd { margin: 0; font-weight: 800; font-size: 14px; }
.held { display: inline-flex; align-items: center; gap: 6px; }
.held .ball3d { width: 20px; height: 20px; }
.flavour { margin: 10px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border-left: 3px solid var(--gold); font-size: 14px; line-height: 1.5; color: #e4eaff; }
.stats { display: grid; gap: 6px; padding: 12px 14px; background: var(--surface); border-radius: 14px; }
.stat { display: grid; grid-template-columns: 74px 40px 1fr; align-items: center; gap: 10px; font-size: 13px; }
.stat span { color: var(--muted); font-weight: 800; }
.stat b { text-align: right; font-variant-numeric: tabular-nums; }
.stat .bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; }
.stat .bar > div { height: 100%; border-radius: inherit; background: var(--accent-2); }
.stat.up span { color: #ff9b8a; } .stat.down span { color: #8ab8ff; }
.stat.total { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.moves-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.mv-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'ty name pp' 'ty meta meta'; gap: 2px 10px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--surface); border-left: 4px solid var(--c); }
.mv-ty { grid-area: ty; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 10px; font-weight: 900; color: #10183a; background: var(--c); }
.mv-row b { grid-area: name; font-size: 14px; }
.mv-meta { grid-area: meta; display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.mv-pp { grid-area: pp; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- bag */
.pockets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -2px -2px 10px; padding: 2px; }
.pockets::-webkit-scrollbar { display: none; }
.pockets .tab { flex: none; }
.bag-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.bag-split { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.bag-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bag-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 12px 6px 8px; border-radius: 12px; border: 1px solid transparent; background: var(--surface); text-align: left; transition: background var(--t), border-color var(--t); }
.bag-row:hover { background: var(--surface-2); }
.bag-row.sel { border-color: var(--gold); background: rgba(255, 207, 74, .08); }
.br-name { flex: 1; min-width: 0; font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.br-count { font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.new { font-style: normal; font-size: 9.5px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: #fff; background: var(--danger); border-radius: 6px; padding: 1px 5px; }
.reg { color: var(--muted); display: inline-flex; }
.reg .ic { width: 15px; height: 15px; }
.bag-detail { position: sticky; top: 0; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.bag-detail.none { min-height: 200px; justify-content: center; }
.bd-head { display: flex; gap: 12px; align-items: center; }
.bd-head b { font-size: 17px; }
.bd-head small { display: block; color: var(--muted); font-weight: 700; }
.bd-desc { margin: 0; font-size: 13.5px; line-height: 1.45; color: #dde5ff; }
.bd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-actions .primary { flex: 1 1 100px; }
.toss { display: flex; align-items: center; gap: 4px; }
.toss-n { min-width: 26px; text-align: center; font-weight: 900; }
.reg-slots { display: flex; gap: 6px; }
.reg-slot { position: relative; width: 46px; height: 46px; border-radius: 12px; border: 1px dashed var(--line-2); background: rgba(0,0,0,.25); display: grid; place-items: center; padding: 0; }
.reg-slot > span { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 900; color: var(--muted); }
.reg-slot .item-art, .reg-slot .ic { width: 26px; height: 26px; }
.reg-slot.on { border: 1px solid var(--gold); background: rgba(255, 207, 74, .14); }
.give-list { display: grid; gap: 6px; margin-bottom: 8px; }
.give-mon { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 10px 4px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-weight: 800; }
.give-mon small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.gm-pic { width: 40px; height: 40px; border-radius: 10px; background: rgba(0,0,0,.25); overflow: hidden; flex: none; }
.gm-pic img { width: 100%; height: 100%; object-fit: contain; }

/* ---------------------------------------------------------------- pokémon */
.mon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 10px; margin-top: 4px; }
.mon-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.mon-card.lead { border-color: rgba(255, 207, 74, .7); }
.mon-card.fainted .mc-pic { filter: grayscale(.85); }
.mon-card.egg { flex-direction: row; align-items: center; }
.mc-open { display: flex; gap: 12px; align-items: center; background: none; border: 0; padding: 0; text-align: left; width: 100%; border-radius: 12px; }
.mc-pic { position: relative; width: 76px; height: 76px; flex: none; border-radius: 16px; display: block;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--t, #4c8dff) 45%, #1d2b5c), #10183a 75%); }
.mc-pic img { width: 100%; height: 100%; object-fit: contain; }
.mc-held { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--panel-solid); border: 1px solid var(--line-2); display: grid; place-items: center; }
.mc-held .item-art { width: 20px; height: 20px; }
.mc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mc-top { display: flex; gap: 6px; align-items: center; }
.mc-top b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-lv { margin-left: auto; color: var(--gold); font-weight: 900; font-size: 13px; white-space: nowrap; }
.mc-main .hpbar, .mc-main .xpbar { margin-top: 2px; }
.mc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mc-grip { touch-action: none; cursor: grab; margin-right: auto; }
.mon-card.dragging { position: relative; z-index: 5; opacity: .92; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); transition: none; }
.mon-card.dragging .mc-grip { cursor: grabbing; }
.mon-card.drop-target { outline: 2px dashed var(--accent, #6fb6ff); outline-offset: 2px; }

/* ---------------------------------------------------------------- shop (Poké Mart) */
.shop { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: min(460px, 60vh); overflow: auto; padding: 2px; }
.shop-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px 8px; }
.shop-item:hover { background: var(--surface-2); }
.shop-item.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.shop-item b { font-size: 12.5px; text-align: center; }
.shop-item .own { position: absolute; top: 6px; right: 8px; font-size: 10.5px; font-weight: 900; color: var(--muted); }
.price { background: rgba(255, 207, 74, .16); color: var(--gold); border-radius: 8px; padding: 1px 8px; font-weight: 900; font-size: 12px; }
.shop-right { display: flex; flex-direction: column; gap: 10px; }

/* ---------------------------------------------------------------- wardrobe */
.wardrobe { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.wd-stage { height: 440px; }
.wd-side { min-width: 0; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.wd-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wd-item:hover { background: var(--surface-2); }
.wd-item.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.wd-item b { font-size: 13px; text-align: center; }
.wd-item small { color: var(--muted); font-size: 11.5px; text-align: center; }
.wd-thumb { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #26468f, #10183a 75%); border-radius: 10px; overflow: hidden; }
.wd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.in-use, .wd-item .lock { position: absolute; top: 8px; right: 8px; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.in-use { background: var(--ok); color: #06301a; }
.wd-item .lock { background: rgba(0,0,0,.55); color: var(--gold); }
.in-use .ic, .wd-item .lock .ic { width: 14px; height: 14px; }
.wd-item.locked .wd-thumb { filter: grayscale(.85) brightness(.7); }
.wd-item.locked small { color: var(--gold); }
.wd-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.wd-foot > b { font-size: 17px; color: var(--gold); }
.wd-pin { display: flex; gap: 4px; align-items: center; }
.wd-pin small { color: var(--muted); font-weight: 800; margin-right: 4px; }
.wd-pin .reg-slot { width: 38px; height: 38px; }
.wd-pin .reg-slot > span { position: static; font-size: 12px; color: #fff; }

/* ---------------------------------------------------------------- pokédex */
.dex-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.dex-prog { display: flex; align-items: center; gap: 12px; }
.dex-prog > div:last-child { display: flex; flex-direction: column; }
.dex-prog b { font-size: 15px; }
.dex-prog small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.dex-prog small .ic { width: 15px; height: 15px; }
.ring { --p: 0; width: 58px; height: 58px; border-radius: 50%; display: grid; place-content: center; text-align: center; flex: none;
  background: radial-gradient(circle, #121c3a 0 62%, transparent 63%), conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.ring b { font-size: 15px; line-height: 1; }
.ring small { font-size: 10px; color: var(--muted); font-weight: 800; }
.dex-tools { display: flex; gap: 8px; }
.dex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 6px; }
.dex-row { display: grid; grid-template-columns: 46px 38px 1fr auto 26px; align-items: center; gap: 8px; min-height: 56px; padding: 4px 10px 4px 4px; border-radius: 12px; background: var(--surface); border: 1px solid transparent; text-align: left; }
.dex-row:hover { background: var(--surface-2); border-color: var(--line); }
.dex-pic, .evo-pic { width: 46px; height: 46px; border-radius: 12px; background: rgba(0,0,0,.25); display: grid; place-items: center; overflow: hidden; }
.dex-pic img, .evo-pic img { width: 100%; height: 100%; object-fit: contain; }
.sil .ic { width: 26px; height: 26px; color: rgba(160, 180, 230, .28); }
.dex-no { font-size: 12px; font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
.dex-no.big { font-size: 14px; }
.dex-row b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-row.unseen b { color: var(--muted); }
.dex-ty { display: flex; gap: 3px; }
.ty-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--c); font-style: normal; font-size: 0; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
html.cb-types .ty-dot { width: auto; height: 20px; padding: 0 5px; border-radius: 6px; font: 900 9.5px/20px Nunito, sans-serif; color: #10183a; }
.dex-st { display: grid; place-items: center; }
.dex-st .seen .ic { width: 18px; height: 18px; color: var(--muted); }
.got .ball3d { width: 20px; height: 20px; }
.dex-detail .stage { min-height: 300px; }
.evo { display: flex; overflow-x: auto; padding: 4px 2px 8px; }
.evo-node { display: flex; align-items: center; gap: 6px; }
.evo-kids { display: flex; flex-direction: column; gap: 6px; }
.evo-arrow { display: flex; flex-direction: column; align-items: center; color: var(--muted); min-width: 56px; }
.evo-arrow .ic { width: 20px; height: 20px; }
.evo-arrow small { font-size: 11px; font-weight: 800; text-align: center; white-space: nowrap; }
.evo-mon { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 84px; }
.evo-mon.cur { border-color: var(--gold); }
.evo-mon b { font-size: 12.5px; }
.evo-mon .evo-pic { width: 56px; height: 56px; }
.where { display: grid; gap: 6px; }
.where-row { display: grid; grid-template-columns: 20px auto 1fr; gap: 4px 8px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.where-row .ic { width: 18px; height: 18px; color: var(--gold); margin-top: 1px; }
.where-row b { font-size: 14px; }
.where-row span { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: flex-end; }
.where-row em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 700; }

/* ---------------------------------------------------------------- trainer card */
.tcard { display: flex; flex-direction: column; gap: 14px; }
.tc-front { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 14px; border-radius: 22px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2b4fa8, #1a2a62 55%, #2a1f5c); border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.tc-front::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 26px solid rgba(255,255,255,.06); pointer-events: none; }
.tc-avatar { min-height: 230px; --t: #6fa6ff; }
.tc-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; z-index: 1; }
.tc-kicker { font-size: 11px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,.7); }
.tc-name { display: flex; align-items: center; gap: 6px; }
.tc-name input { flex: 1; min-width: 0; font: 900 26px Nunito, sans-serif; color: #fff; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 2px 6px; margin-left: -6px; }
.tc-name input:hover, .tc-name input:focus { border-color: rgba(255,255,255,.35); background: rgba(0,0,0,.2); }
.tc-edit .ic { width: 18px; height: 18px; color: rgba(255,255,255,.6); }
.tc-user { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13.5px; color: #cfe0ff; }
.tc-user .ic { width: 16px; height: 16px; }
.tc-title { align-self: flex-start; font-size: 12px; font-weight: 900; color: #3a2400; background: linear-gradient(#ffe07a, #f0a51c); padding: 2px 10px; border-radius: 999px; }
.tc-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: auto; padding: 10px; border-radius: 14px; background: rgba(0,0,0,.25); }
.tc-badge { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.06); }
.badge-svg { width: 78%; height: 78%; }
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: 8px; }
.tc-stat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tc-stat .ic-tile { width: 36px; height: 36px; }
.tc-stat span { display: flex; flex-direction: column; min-width: 0; }
.tc-stat small { font-size: 11.5px; color: var(--muted); font-weight: 800; }
.tc-stat b { font-size: 14.5px; }

/* ---------------------------------------------------------------- quest log */
.qcard { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; }
.qcard.main { border-color: rgba(255, 207, 74, .45); background: linear-gradient(180deg, rgba(255, 207, 74, .07), rgba(255,255,255,.03)); }
.qcard h3 { margin: 2px 0 6px; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.qcard h3 .ic { width: 18px; height: 18px; color: var(--ok); }
.qcard p { margin: 0; font-size: 13.5px; line-height: 1.45; color: #dde5ff; }
.qc-kicker { font-size: 11px; font-weight: 900; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.qc-bar { position: relative; height: 8px; border-radius: 4px; background: rgba(0,0,0,.4); margin: 4px 40px 12px 0; }
.qc-bar > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd85e, #f3a51e); }
.qc-bar span { position: absolute; right: -40px; top: -5px; font-size: 12px; font-weight: 900; color: var(--muted); }
.qc-now { padding: 12px; border-radius: 12px; background: rgba(0,0,0,.22); margin-bottom: 10px; }
.qc-now b { font-size: 15px; color: var(--gold); }
.qc-where, .qc-reward { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 800; color: #c8e7ff; }
.qc-reward { color: #ffd98a; }
.qc-where .ic, .qc-reward .ic { width: 16px; height: 16px; }
.qsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.qs { display: flex; gap: 10px; padding: 6px 2px; font-size: 13.5px; }
.qs i { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--muted); margin-top: 3px; }
.qs span { display: flex; flex-direction: column; gap: 1px; }
.qs small { color: var(--muted); font-size: 12.5px; }
.qs em { display: flex; align-items: center; gap: 4px; font-style: normal; font-size: 12px; color: #ffd98a; font-weight: 700; }
.qs em .ic { width: 13px; height: 13px; }
.qs.done { color: var(--muted); }
.qs.done i { background: var(--ok); border-color: var(--ok); }
.qs.now b { color: #fff; }
.qs.now i { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 3px #1a2550; }
.qs.todo { opacity: .55; }
details.qcard summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; }
details.qcard summary::-webkit-details-marker { display: none; }
details.qcard summary h3 { grid-column: 1; }
.qc-count { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 900; color: var(--muted); }
.qcard.done { opacity: .9; }

/* ---------------------------------------------------------------- mail / events */
.inbox { display: flex; flex-direction: column; gap: 8px; }
.msg-card, .event-card { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.msg-card summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; min-height: 60px; }
.msg-card summary::-webkit-details-marker { display: none; }
.msg-card .ic-tile { width: 38px; height: 38px; }
.mc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-txt b { font-size: 14.5px; }
.mc-txt small { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); display: none; }
.msg-card.unread .unread-dot { display: block; }
.msg-card.unread { border-color: rgba(122, 168, 255, .45); }
.chev .ic { width: 18px; height: 18px; color: var(--muted); transition: transform var(--t); }
.msg-card[open] .chev .ic { transform: rotate(180deg); }
.msg-card p { margin: 0; padding: 0 14px 14px 62px; font-size: 14px; line-height: 1.5; color: #dde5ff; }
.event-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; }
.event-card .ic-tile { width: 42px; height: 42px; }
.event-card b { font-size: 15px; }
.event-card p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* ---------------------------------------------------------------- settings */
.settings { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; }
.set-nav { flex-direction: column; align-items: stretch; margin: 0; position: sticky; top: 0; }
.set-nav .tab { border-radius: 12px; justify-content: flex-start; background: transparent; border-color: transparent; min-height: 44px; }
.set-nav .tab:hover { background: var(--surface); }
.set-nav .tab.on { background: var(--surface-2); color: #fff; border-color: var(--line-2); }
.set-body { min-width: 0; }
.set-body > .sec:first-child { margin-top: 0; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; margin: 0; padding: 12px 14px; background: var(--surface); border-radius: 14px; font-size: 13.5px; }
.keys dt { display: flex; gap: 3px; font-weight: 900; }
.keys dd { margin: 0; color: var(--muted); font-weight: 700; }
.acct { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; }
.acct .ic-tile { width: 46px; height: 46px; }
.acct div { display: flex; flex-direction: column; }
.acct b { font-size: 17px; }
.acct small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.pw-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pw-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.pw-form input { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.3); color: #fff; font: inherit; font-size: 15px; }
.pw-form input:focus { border-color: var(--accent-2); outline: none; }
.form-msg { margin: 0; min-height: 18px; font-size: 13px; font-weight: 800; }
.form-msg.err { color: #ff9aa2; }
.form-msg.ok { color: #8cf0b0; }
.pw-form .btn { align-self: flex-start; }

/* ---------------------------------------------------------------- responsive (narrow windows / phones) */
@media (max-width: 760px) {
  .bag-split, .shop, .wardrobe, .sum-grid, .tc-front { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .set-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; position: static; scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav .tab { flex: none; }
  .wd-stage { height: 240px; }
  .sum-grid .stage, .dex-detail .stage { min-height: 240px; }
  .tc-avatar { min-height: 200px; }
  .bag-detail { position: sticky; bottom: 0; top: auto; margin: 0 -2px; box-shadow: 0 -10px 24px rgba(4, 8, 22, .6); background: #18254f; }
  .bag-list { padding-bottom: 6px; }
  .dex-tools { flex-wrap: wrap; }
  .dex-tools select { flex: 1; }
  .where-row { grid-template-columns: 20px 1fr; }
  .where-row span { grid-column: 2; justify-content: flex-start; }
  .msg-card p { padding-left: 14px; }
}
.bag-tools .search, .dex-tools .search { min-width: 0; }
.sort { flex: none; }
.sort select { max-width: 116px; padding-right: 4px; }
@media (max-width: 420px) { .sort select { max-width: 92px; } }

/* ---------- Help & Support (js/support.js) ---------- */
.sup { display: grid; gap: 12px; }
.sup .sec { margin: 6px 0 0; }
.sup-new { min-height: 48px; font-size: 16px; }
.sup-list { display: grid; gap: 8px; }
.sup-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer; min-height: 56px; }
.sup-row:hover { border-color: var(--line-2); }
.sup-row.unread { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.sup-ic { font-size: 22px; }
.sup-main { display: grid; min-width: 0; }
.sup-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-main small { color: var(--muted); font-weight: 700; font-size: 12px; }
.sup-st { font: 900 11px Nunito, sans-serif; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st-open { background: rgba(79, 140, 255, .2); color: #a9c6ff; }
.st-waiting { background: rgba(255, 180, 70, .2); color: #ffd08a; }
.st-answered { background: rgba(70, 210, 120, .2); color: #8ff0b0; }
.st-closed { background: rgba(255,255,255,.1); color: var(--muted); }
.sup-faq details { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; }
.sup-faq summary { padding: 12px 14px; font-weight: 800; cursor: pointer; min-height: 44px; }
.sup-faq p { margin: 0; padding: 0 14px 12px; color: var(--muted); font-weight: 700; }
.sup-back { justify-self: start; background: none; border: 0; color: var(--gold); font: 900 14px Nunito, sans-serif; padding: 6px 0; cursor: pointer; min-height: 36px; }
.sup-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sup-cat { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: inherit; font: inherit; cursor: pointer; }
.sup-cat span { font-size: 20px; }
.sup-cat small { color: var(--muted); font-weight: 700; font-size: 12px; line-height: 1.3; }
.sup-cat.on { border-color: var(--gold); background: rgba(255, 207, 74, .1); }
.sup-form label { display: grid; gap: 6px; font-weight: 800; font-size: 13px; color: var(--muted); }
.sup-form input, .sup-form textarea, .sup-reply textarea { font: 700 15px Nunito, sans-serif; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.28); color: #fff; resize: vertical; }
.sup-note { margin: 0; font-size: 12px; color: var(--muted); font-weight: 700; }
.sup-err { margin: 0; min-height: 18px; color: #ff8a8a; font-weight: 800; }
.sup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sup-head b { font-size: 17px; }
.sup-thread { display: grid; gap: 8px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.sup-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; }
.sup-msg small { display: block; font-weight: 800; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.sup-msg p { margin: 0; white-space: pre-line; font-weight: 700; }
.sup-msg.me { justify-self: end; background: rgba(79, 140, 255, .18); border: 1px solid rgba(79, 140, 255, .35); }
.sup-msg.staff { justify-self: start; background: rgba(255, 207, 74, .12); border: 1px solid rgba(255, 207, 74, .35); }
.sup-reply { display: grid; gap: 8px; }
.sup-reply div { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Events calendar (js/calendar.js) ---------- */
.cal { display: grid; gap: 10px; }
.cal .sec { margin: 6px 0 0; }
.cal-ev { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); color: inherit; font: inherit; }
.cal-ev.live { border-color: rgba(255, 207, 74, .7); background: linear-gradient(135deg, rgba(255, 207, 74, .14), rgba(255, 140, 40, .06)); box-shadow: 0 0 0 1px rgba(255, 207, 74, .25); }
.cal-btn { cursor: pointer; width: 100%; }
.cal-btn:hover { border-color: var(--line-2); }
.cal-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,.07); }
.cal-ev.live .cal-ic { background: rgba(255, 207, 74, .22); }
.cal-main { display: grid; gap: 2px; min-width: 0; }
.cal-main b { font-size: 15.5px; }
.cal-main p { margin: 0; color: #d7e0ff; font-weight: 700; font-size: 13px; }
.cal-main small { color: var(--muted); font-weight: 800; font-size: 12px; }
.cal-ev.live .cal-main small { color: #ffd979; }
.cal-mult { font: 900 18px Nunito, sans-serif; color: #3a2400; background: linear-gradient(#ffe066, #ffb21c); border-radius: 12px; padding: 4px 10px; }
.cal-day { display: grid; gap: 8px; }
.cal-day > span { font: 900 12px Nunito, sans-serif; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---------- Ferry route board + sailing scene (js/ferry.js) ---------- */
.fs { display: grid; gap: 10px; }
.fs-head { display: flex; align-items: center; gap: 10px; font: 900 19px Nunito, sans-serif; color: #ffd979; }
.fs-ticket { font-size: 22px; }
.fs .sec { margin: 6px 0 0; }
.fs-route { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 10px; overflow-x: auto; padding: 18px 2px 8px; position: relative; scroll-snap-type: x proximity; scrollbar-width: thin; }
.fs-route::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #36a8e8, #7fd6ff); opacity: .7; }
.fs-stop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 14px 10px 12px; border-radius: 16px; text-align: center; scroll-snap-align: start;
  background: linear-gradient(180deg, rgba(40, 70, 140, .55), rgba(16, 30, 72, .8)); border: 1.5px solid rgba(120, 180, 255, .3); }
.fs-stop::before { content: ''; position: absolute; top: -14px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #0d1838; border: 3px solid #4fb6f0; box-shadow: 0 0 0 3px rgba(79, 182, 240, .25); }
.fs-stop.here { border-color: #6fe0a0; box-shadow: 0 0 0 1px rgba(111, 224, 160, .4), 0 8px 20px rgba(0,0,0,.3); }
.fs-stop.here::before { border-color: #6fe0a0; background: #6fe0a0; }
.fs-stop.locked { opacity: .62; filter: saturate(.55); }
.fs-art svg { width: 96px; height: 54px; display: block; }
.fs-stop b { font-size: 14.5px; line-height: 1.15; }
.fs-stop small { color: var(--muted); font-weight: 800; font-size: 11.5px; min-height: 2.4em; }
.fs-go { min-width: 92px; min-height: 40px; }
.fs-here { font: 900 11px Nunito, sans-serif; color: #8ff0b0; border: 1.5px solid rgba(111, 224, 160, .7); border-radius: 10px; padding: 7px 10px; letter-spacing: .3px; }
.fs-lock { font-size: 18px; min-height: 40px; display: grid; place-items: center; }
.fs-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); font-weight: 700; }
/* phones in portrait: a vertical list reads better than a long sideways strip */
html.touch.portrait .fs-route { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; overflow: visible; padding: 4px 0 4px 18px; }
html.touch.portrait .fs-route::before { left: 6px; right: auto; top: 0; bottom: 0; width: 4px; height: auto; }
html.touch.portrait .fs-stop { grid-template-columns: 74px 1fr auto; grid-template-rows: auto auto; justify-items: start; text-align: left; align-items: center; column-gap: 12px; padding: 10px 12px; }
html.touch.portrait .fs-stop::before { top: 50%; left: -19px; margin: -7px 0 0; }
html.touch.portrait .fs-art { grid-row: 1 / 3; }
html.touch.portrait .fs-art svg { width: 74px; height: 42px; }
html.touch.portrait .fs-stop small { min-height: 0; }
html.touch.portrait .fs-go, html.touch.portrait .fs-here, html.touch.portrait .fs-lock { grid-column: 3; grid-row: 1 / 3; }

.fs-scene { position: fixed; inset: 0; z-index: 60; overflow: hidden; opacity: 0; transition: opacity .35s; pointer-events: none; }
.fs-scene.on { opacity: 1; }
.fs-scene.out { opacity: 0; transition: opacity .45s; }
.fs-sky { position: absolute; inset: 0; background: linear-gradient(#5fb7ff 0%, #a9dbff 48%, #2f86d6 50%, #1b5ea8 100%); }
.fs-sun { position: absolute; right: 14%; top: 14%; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #fff7c2, #ffd76a 60%, transparent 70%); }
.fs-sea { position: absolute; left: -50%; width: 200%; background-repeat: repeat-x; }
.fs-sea1 { bottom: 0; height: 32%; background-image: radial-gradient(60px 18px at 60px 0, transparent 58px, #1b5ea8 60px); background-size: 120px 100%; animation: fs-wave 2.2s linear infinite; }
.fs-sea2 { bottom: 12%; height: 30%; background-image: radial-gradient(60px 16px at 60px 0, transparent 58px, rgba(47, 134, 214, .95) 60px); background-size: 120px 100%; animation: fs-wave 3.2s linear infinite reverse; }
.fs-sea3 { bottom: 26%; height: 26%; background-image: radial-gradient(70px 14px at 70px 0, transparent 68px, rgba(90, 170, 235, .9) 70px); background-size: 140px 100%; animation: fs-wave 4.5s linear infinite; }
@keyframes fs-wave { to { transform: translateX(-120px); } }
.fs-boat { position: absolute; bottom: 37%; left: -30%; z-index: 1; width: min(300px, 60vw); animation: fs-sail 2.6s ease-in-out forwards, fs-bob 1.1s ease-in-out infinite; }
.fs-boat svg { width: 100%; height: auto; filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); }
@keyframes fs-sail { to { left: 105%; } }
@keyframes fs-bob { 50% { transform: translateY(6px) rotate(-1.5deg); } }
.fs-smoke { animation: fs-smoke 1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes fs-smoke { from { opacity: .9; transform: translate(0, 0) scale(.6); } to { opacity: 0; transform: translate(-14px, -12px) scale(1.6); } }
.fs-label { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); text-align: center; color: #fff; text-shadow: 0 2px 8px rgba(0, 40, 90, .6); }
.fs-label small { display: block; font: 900 13px Nunito, sans-serif; letter-spacing: 3px; text-transform: uppercase; opacity: .9; }
.fs-label b { font: 400 clamp(30px, 7vw, 54px) 'Lilita One', Nunito, sans-serif; letter-spacing: 1px; }
html.reduce-motion .fs-sea, html.reduce-motion .fs-boat { animation: none; } html.reduce-motion .fs-boat { left: 35%; }
