/* Monster Arc: Tiny Realms - game UI in the approved "Minimal Storybook" style.
   Tokens and component shapes follow DesignPreview/minimal-v2 (DESIGN.md, style.css) and Documentation/ART_STYLE_LOCK.md:
   quiet cream surfaces, thin borders, small soft shadows, Kanit text, 12-20px radii, 44px touch targets on phones. */
/* Fullscreen guidance is visible when the platform cannot fullscreen an HTML game (not a silent no-op). */
.fullscreen-help-layer { position:fixed; inset:0; z-index:11000; display:grid; place-items:center; pointer-events:auto; background:#30334b66; padding:calc(12px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px)); }
.fullscreen-help-card { position:relative; width:min(480px, 100%); min-width:0; max-height:calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow:auto; overscroll-behavior:contain; touch-action:pan-y; background:#fff8e8; border:1px solid #e6ddc9; border-radius:18px; padding:20px; color:#53576c; box-shadow:0 12px 35px #30334b33; }
.fullscreen-help-card h2 { font-size:20px; line-height:1.4; margin:0 38px 12px 0; }
.fullscreen-help-card p, .fullscreen-help-card li { font-size:14px; line-height:1.65; }
.fullscreen-help-card ol { padding-inline-start:24px; }
.fullscreen-help-card li + li { margin-top:8px; }
.fullscreen-help-card .x { position:absolute; right:8px; top:8px; min-width:44px; min-height:44px; border:0; border-radius:50%; background:#f2ead9; font:inherit; }
.fullscreen-help-card > .btn { min-height:44px; }
@font-face { font-family: 'KanitArc'; src: url('../assets/reused/fonts/KanitArc-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'KanitArc'; src: url('../assets/reused/fonts/KanitArc-Medium.ttf') format('truetype'); font-weight: 500 700; font-display: swap; }

:root {
  --cream: #fff8e8; --paper: #fffcf3; --ink: #53576c; --muted: #858598; --line: #e6ddc9;
  --teal: #40bfb7; --teal-d: #35aaa5; --mint: #b9ddb9; --coral: #ef858a; --lavender: #b6a1d3; --butter: #e7bd68;
  --mpc: #6fbfc9; --soft: #f4edde; --chip: #f2ead9; --sel: #d9ebe0; --sel-line: #afcdbb; --rose: #f5d6d5;
  --glass: rgba(255, 248, 232, .93); --shadow: 0 4px 12px rgba(83, 87, 108, .08); --shadow-l: 0 12px 35px rgba(83, 87, 108, .16);
  --ui: 1; --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'KanitArc', 'Noto Sans Thai', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #9ed8c3; color: var(--ink); font-family: var(--font);
  user-select: none; -webkit-user-select: none; touch-action: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100% !important; height: 100% !important; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #3d8989; outline-offset: 2px; }
input, select { font-family: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 42px; background: var(--paper); color: var(--ink); outline: none; user-select: text; -webkit-user-select: text; max-width: 100%; }
input:focus, select:focus { border-color: var(--teal); }
h2, h3, h4 { font-weight: 500; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 12px; min-height: 40px; padding: 7px 16px; font-size: 15px; transition: background .15s, transform .1s; }
.btn:hover { background: #f5efdf; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn.primary:hover { background: var(--teal-d); }
.btn.danger { background: var(--rose); border-color: #ecc3c2; }
.btn.small { min-height: 32px; padding: 4px 11px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); text-decoration: underline; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- full screens: login, characters, loading ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; overflow: auto; padding: 16px;
  background: #cfe7d9 url('../assets/ui/world-bg.webp') center / cover no-repeat; }
.screen::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: rgba(255, 248, 232, .72); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.screen > * { position: relative; }
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; width: min(380px, 100%); }
.logo { display: flex; flex-direction: column; align-items: center; line-height: 1.05; text-align: center; }
.logo-a { font-size: 13px; letter-spacing: 5px; color: #829d94; text-transform: uppercase; }
.logo-b { font-size: clamp(38px, 8vw, 50px); font-weight: 500; letter-spacing: -1.5px; color: #607b89; margin-top: 4px; }
.logo-c { font-size: 15px; color: #7c938d; margin-top: 10px; letter-spacing: .5px; }
.card { background: var(--cream); border-radius: 20px; box-shadow: 0 6px 24px rgba(83, 87, 108, .08); padding: 22px; }
.login-card { width: 100%; display: flex; flex-direction: column; gap: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card .btn { flex: 1; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.msg { min-height: 20px; margin: 0; color: #c0585e; font-size: 13px; text-align: center; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.conn-state { position: fixed; bottom: calc(12px + var(--safe-b)); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 12px; background: var(--cream); padding: 4px 12px; border-radius: 10px; }

.chars-card { width: min(820px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.chars-card h2 { margin: 0; font-size: 22px; } .chars-card h3 { margin: 0; font-size: 16px; color: var(--muted); }
.char-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.char-slot { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; transition: border-color .15s, background .15s; }
.char-slot:hover { border-color: #8cb9a9; background: #fffaf0; }
.char-slot .av { width: 96px; height: 96px; background-repeat: no-repeat; }
.char-slot b { font-size: 16px; font-weight: 500; } .char-slot small { color: var(--muted); font-size: 12px; }
.char-create { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.class-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.class-opt { background: var(--paper); border: 1px solid transparent; border-radius: 18px; padding: 6px 4px 10px; display: flex; flex-direction: column; align-items: center; cursor: pointer; font-size: 13px; text-align: center; }
.class-opt.on { border-color: #8cb9a9; background: #fffaf0; box-shadow: 0 4px 16px rgba(83, 87, 108, .06); }
.class-opt .av { width: 72px; height: 72px; background-size: 864px 480px; background-position: 0 0; }
.class-desc { margin: 0; font-size: 13px; color: #7e8593; min-height: 40px; line-height: 1.6; }
.char-create input { flex: 1; min-width: 160px; }
.loading { text-align: center; color: var(--ink); background: var(--cream); padding: 26px 34px; border-radius: 20px; box-shadow: var(--shadow); }
.loading p { margin: 0; font-size: 14px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid #e0dfcd; border-top-color: var(--teal); animation: spin .9s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-size: calc(14px * var(--ui)); }
#hud > * { pointer-events: auto; }
.sq-btn { width: calc(40px * var(--ui)); height: calc(40px * var(--ui)); min-width: 36px; min-height: 36px; border-radius: 12px; border: 0; background: var(--cream); box-shadow: var(--shadow);
  font-size: calc(17px * var(--ui)); padding: 0; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.sq-btn img { width: 62%; height: 62%; object-fit: contain; }
.sq-btn.sm { width: calc(32px * var(--ui)); height: calc(32px * var(--ui)); min-width: 30px; min-height: 30px; font-size: calc(17px * var(--ui)); border-radius: 10px; }
.sq-btn:hover { background: #fffdf5; }
.sq-btn:active { transform: translateY(1px); }

/* status card (portrait, name, HP/MP) */
#hud-status { position: absolute; left: calc(14px + var(--safe-l)); top: 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#hud-status > * { pointer-events: auto; }
.status-card { display: flex; gap: 11px; align-items: center; background: var(--cream); padding: 9px 14px 9px 9px; border-radius: 20px; box-shadow: var(--shadow); width: calc(286px * var(--ui)); }
.portrait-ring { width: calc(54px * var(--ui)); height: calc(54px * var(--ui)); flex: none; border-radius: 50%; overflow: hidden; background: #f3e4cc; }
.portrait { width: 100%; height: 100%; background: #f3e4cc no-repeat; }
.status-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.name-plate { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; }
.name-plate #hud-name { font-weight: 500; font-size: 1em; overflow: hidden; text-overflow: ellipsis; }
.name-plate .lv { order: 2; margin-left: auto; font-size: .72em; color: var(--muted); }
.bar { position: relative; height: calc(13px * var(--ui)); min-height: 10px; background: #e8dfce; border-radius: 9px; overflow: hidden; }
.bar i { display: none; }
.bar .fill { position: absolute; inset: 0; transform-origin: left; transition: transform .15s; border-radius: 9px; }
.bar.hp .fill { background: var(--coral); } .bar.mp .fill { background: var(--mpc); }
.bar span { position: absolute; inset: 0; font-size: calc(10px * var(--ui)); color: #5c586b; text-align: center; line-height: calc(13px * var(--ui)); z-index: 2; font-variant-numeric: tabular-nums; }
.status-icons { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.buffs { display: flex; gap: 4px; flex-wrap: wrap; }
.buffs img { width: calc(28px * var(--ui)); height: calc(28px * var(--ui)); border-radius: 8px; background: var(--cream); box-shadow: var(--shadow); }
.pk-btn { width: auto; padding: 0 10px; font-size: calc(12px * var(--ui)); font-weight: 500; color: #5c8fae; letter-spacing: .5px; }
.pk-btn.on { background: var(--rose); color: #b4525a; }

/* left menu (icon + label) */
#hud-menu { position: absolute; left: calc(14px + var(--safe-l)); top: calc(118px * var(--ui) + 12px); display: flex; flex-direction: column; gap: calc(7px * var(--ui)); }
.menu-btn { display: flex; align-items: center; gap: 9px; background: var(--glass); border: 0; padding: 7px 13px 7px 9px; border-radius: 13px; min-height: calc(44px * var(--ui)); box-shadow: 0 2px 5px rgba(83, 87, 108, .04); color: var(--ink); }
.menu-btn img { width: calc(26px * var(--ui)); height: calc(26px * var(--ui)); object-fit: contain; }
.menu-btn span { font-size: calc(13px * var(--ui)); }
.menu-btn:hover { background: #fffdf5; }
.menu-btn:active { transform: translateY(1px); }

/* top right: location, settings, minimap, currency, quest tracker */
#hud-topright { position: absolute; top: 12px; right: calc(14px + var(--safe-r)); display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.top-row { display: flex; gap: 6px; align-items: center; }
.map-pill { display: flex; align-items: center; gap: 10px; min-height: calc(40px * var(--ui)); padding: 0 13px; border-radius: 12px; background: var(--cream); box-shadow: var(--shadow); font-size: .9em; max-width: calc(250px * var(--ui)); white-space: nowrap; overflow: hidden; }
.map-pill .safe { font-size: .78em; color: #6f9e8d; }
.mm-row { display: flex; gap: 6px; align-items: flex-start; }
.mm-zoom { display: flex; flex-direction: column; gap: 6px; }
#hud-minimap { position: relative; width: calc(150px * var(--ui)); border: 5px solid var(--cream); border-radius: 18px; background: var(--cream); box-shadow: 0 3px 8px rgba(83, 87, 108, .06); }
#minimap { width: 100%; aspect-ratio: 1; display: block; border-radius: 13px; background: #9ed8c3; }
.mm-chip { position: absolute; right: 4px; bottom: 4px; background: rgba(255, 248, 232, .92); border-radius: 8px; padding: 0 7px; font-size: .72em; color: var(--muted); }
.gold-line { display: flex; align-items: center; gap: 7px; background: rgba(255, 248, 232, .92); color: #5d7371; border-radius: 10px; padding: 3px 10px; font-size: .8em; font-variant-numeric: tabular-nums; }
.gold-line img { width: 18px; height: 18px; object-fit: contain; }
.gold-line .dot { color: #b7b6a8; }

/* quest tracker */
#hud-quest { position: relative; width: calc(250px * var(--ui)); background: var(--glass); border-radius: 14px; padding: 9px 12px 10px; box-shadow: var(--shadow); text-align: left; border: 0; display: block; color: var(--ink); }
#hud-quest .q-ch { font-size: .72em; color: var(--muted); letter-spacing: .3px; }
#hud-quest .q-title { font-size: .9em; font-weight: 500; margin: 2px 0 5px; line-height: 1.35; }
#hud-quest .q-prog { display: flex; align-items: center; gap: 8px; font-size: .78em; color: var(--muted); }
#hud-quest .q-track { flex: 1; height: 5px; border-radius: 5px; background: #e6dfd0; overflow: hidden; }
#hud-quest .q-track span { display: block; height: 100%; background: var(--teal); border-radius: 5px; transition: width .3s; }
#hud-quest .q-hint { font-size: .74em; color: #7a8a7b; margin-top: 4px; line-height: 1.45; }
#hud-quest.flash { animation: qflash .9s ease-out; }
@keyframes qflash { 0% { box-shadow: 0 0 0 0 rgba(64, 191, 183, .55); } 100% { box-shadow: 0 0 0 14px rgba(64, 191, 183, 0); } }

/* low-HP warning: soft coral edge glow (pointer-transparent) */
#lowhp { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; box-shadow: inset 0 0 90px 10px rgba(239, 133, 138, .55); z-index: 0; }
#lowhp.on { opacity: 1; animation: lowpulse 1.6s ease-in-out infinite; }
@keyframes lowpulse { 50% { box-shadow: inset 0 0 60px 4px rgba(239, 133, 138, .35); } }
/* daily tracker (under the story tracker) */
#hud-daily { position: relative; width: calc(250px * var(--ui)); background: var(--glass); border-radius: 12px; padding: 6px 11px; box-shadow: var(--shadow); border: 0; color: var(--ink);
  display: flex; align-items: center; gap: 8px; text-align: left; font-size: .78em; min-height: 32px; }
#hud-daily .d-lbl { color: var(--muted); flex: none; }
#hud-daily .d-pips { display: flex; gap: 3px; flex: none; }
#hud-daily .d-pips i { width: 8px; height: 8px; border-radius: 50%; background: #e6dfd0; display: block; }
#hud-daily .d-pips i.ok { background: var(--butter); } #hud-daily .d-pips i.got { background: var(--teal); }
#hud-daily .d-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-daily .d-txt b { font-weight: 500; color: var(--teal-d); }
#hud-daily.ready { background: #fff1cf; box-shadow: 0 0 0 2px var(--butter), var(--shadow); }
#hud-daily.ready .d-txt { color: #9a7424; font-weight: 500; }
#hud-daily.flash { animation: qflash .9s ease-out; }
.badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--coral); color: #fff; font-size: 11px; text-align: center; padding: 0 5px; margin-left: 4px; }
/* daily panel */
.daily-head { display: flex; align-items: center; gap: 12px; background: var(--soft); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.daily-head > div:first-child { flex: 1; } .daily-head b { display: block; font-weight: 500; } .daily-head small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.streak { flex: none; width: 58px; height: 58px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.streak span { font-size: 22px; line-height: 1; color: var(--butter); font-weight: 500; }
.list.daily .li { align-items: center; gap: 10px; }
.list.daily .q-prog { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 6px 0 2px; max-width: 340px; }
.list.daily .q-track { flex: 1; height: 6px; border-radius: 6px; background: #e6dfd0; overflow: hidden; }
.list.daily .q-track span { display: block; height: 100%; background: var(--teal); border-radius: 6px; }
.list.daily .rw { color: #8a7a52; }
.daily-bonus { display: flex; align-items: center; gap: 10px; margin-top: 12px; border: 1px dashed var(--butter); border-radius: 14px; padding: 11px 12px; background: #fffaf0; }
.daily-bonus b { display: block; font-weight: 500; } .daily-bonus small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.daily-bonus.ready { background: #fff1cf; border-style: solid; } .daily-bonus.got { opacity: .6; }

/* creator mode */
.dev-row { gap: 6px; }
.dev-row .btn.fit { box-shadow: inset 0 0 0 2px var(--mint); }
.dev-num { width: 74px; min-height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font: inherit; background: #fff; }
.dev-row select { min-height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font: inherit; background: #fff; }
.dev-stats { display: flex; flex-wrap: wrap; gap: 6px; } .dev-stats span { background: var(--soft); border-radius: 9px; padding: 4px 9px; font-size: 12px; color: var(--muted); } .dev-stats b { color: var(--ink); font-weight: 500; }
.dev-meter-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; } .dev-meter-head b { font-size: 22px; font-weight: 500; color: var(--teal-d); } .dev-meter-head span { color: var(--muted); font-size: 12px; }
.dev-bar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 8px; align-items: center; font-size: 12px; margin: 3px 0; }
.dev-bar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dev-bar .t { height: 8px; background: #ece4d4; border-radius: 6px; overflow: hidden; } .dev-bar .t i { display: block; height: 100%; background: var(--teal); border-radius: 6px; } .dev-bar .v { color: var(--muted); font-variant-numeric: tabular-nums; }
.dev-pets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; } .dev-pets span { background: #eef5ef; color: #527f70; border-radius: 9px; padding: 3px 9px; font-size: 12px; }
.dev-table-wrap { overflow-x: auto; } .dev-table { width: 100%; border-collapse: collapse; font-size: 12px; } .dev-table th, .dev-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; } .dev-table th { color: var(--muted); font-weight: 400; } .dev-table tr.lock td { opacity: .4; }
#dev-mini { position: fixed; right: calc(14px + var(--safe-r)); top: calc(380px * var(--ui)); width: calc(260px * var(--ui)); background: var(--glass); border-radius: 14px; box-shadow: var(--shadow-l); padding: 8px 12px 10px; pointer-events: auto; font-size: 13px; z-index: 30; }
#dev-mini .dev-mini-top { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; } #dev-mini .dev-mini-top b { flex: 1; font-weight: 500; }
#dev-mini .btn.small { min-height: 28px; padding: 2px 6px; }
@media (max-height: 520px) { #dev-mini { top: 50px; right: auto; left: 50%; transform: translateX(-50%); width: 280px; font-size: 12px; } #dev-mini .dev-pets { display: none; } }

/* social: menu badge, party frames, invite card */
.menu-btn { position: relative; }
.mbadge { position: absolute; top: 3px; left: 26px; min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 500; text-align: center; padding: 0 4px; }
.menu-btn:not(:has(img)) span { display: block !important; }
/* party members sit in a 2 x 2 grid right of your own status card (2026-11-05): each frame is half the card, so a
   full party of 5 (you + 4) takes no more room than one more card and never covers the play area */
.status-row { display: flex; gap: 6px; align-items: flex-start; }
#hud-party { display: grid; grid-template-columns: repeat(2, calc(143px * var(--ui))); gap: 4px; align-content: start; pointer-events: auto; }
#hud-party .pf { padding: 4px 8px 5px; border-radius: 10px; font-size: calc(11px * var(--ui)); min-height: calc(34px * var(--ui)); }
#hud-party .pf .hp { margin-top: 3px; height: 4px; } #hud-party .pf .mp { margin-top: 2px; height: 3px; }
#hud-party .pf.far { opacity: .72; } #hud-party .pf .pin { font-size: .9em; }
.pf { background: var(--glass); border-radius: 12px; padding: 6px 10px 7px; box-shadow: var(--shadow); font-size: calc(12px * var(--ui)); border: 0; text-align: left; color: var(--ink); display: block; width: 100%; }
.pf .top { display: flex; gap: 6px; align-items: baseline; } .pf .top b { font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf .top small { color: var(--muted); font-size: .9em; } .pf .lead { color: var(--butter); font-size: .85em; }
.pf .hp { height: 5px; border-radius: 4px; background: #eadfd0; overflow: hidden; margin-top: 4px; } .pf .hp i { display: block; height: 100%; background: var(--coral); }
.pf .mp { height: 3px; border-radius: 3px; background: #eadfd0; overflow: hidden; margin-top: 2px; } .pf .mp i { display: block; height: 100%; background: var(--mpc); }
.pf.dead { opacity: .5; } .pf .away { color: var(--muted); font-size: .85em; }
.invite-card { position: fixed; left: 50%; bottom: calc(120px + var(--safe-b)); transform: translateX(-50%); background: var(--cream); border-radius: 18px; box-shadow: var(--shadow-l); padding: 14px 16px; width: min(340px, 92vw); pointer-events: auto; z-index: 40; }
.invite-card b { font-weight: 500; } .invite-card p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.invite-card .row { display: flex; gap: 8px; justify-content: flex-end; }
.invite-card .bar { height: 3px; background: var(--teal); border-radius: 3px; margin-top: 10px; transform-origin: left; animation: invbar 60s linear forwards; }
@keyframes invbar { to { transform: scaleX(0); } }
/* social panel */
.soc-add { display: flex; gap: 6px; margin: 4px 0 10px; } .soc-add input, .mail-form input, .mail-form textarea { flex: 1; min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: inherit; background: #fff; }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5fbf7a; margin-right: 6px; } .dot-off { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d4cfc4; margin-right: 6px; }
.soc-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.mail-item { cursor: pointer; } .mail-item.unread b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); margin-right: 6px; vertical-align: middle; }
.mail-open { background: var(--soft); border-radius: 12px; padding: 10px 12px; margin: 4px 0 8px; white-space: pre-wrap; font-size: 13px; line-height: 1.6; }
.mail-att { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .mail-att span { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 3px 8px; font-size: 12px; }
.mail-form { display: grid; gap: 6px; margin-top: 6px; } .mail-form textarea { min-height: 70px; resize: vertical; }
@media (max-height: 520px) {
  /* short landscape phones: party members become a row of small chips under the quest pill */
  #hud-party { grid-template-columns: repeat(2, 116px); } /* half of the 232px status card */
  #hud-party .pf { padding: 3px 7px 4px; font-size: 10.5px; min-height: 0; }
  #toasts { top: 78px !important; }
}
.chat-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .chat-tabs::-webkit-scrollbar { display: none; } .chat-tabs button { flex: none; white-space: nowrap; }
@media (max-width: 560px) { #hud-party { grid-template-columns: repeat(2, 100px); } }

/* skill ranks */
.sp-head { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.sp-head > div { flex: 1; } .sp-head b { font-weight: 500; font-size: 15px; color: var(--teal-d); } .sp-head small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.rank-pips { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 4px; } .rank-pips i { width: 9px; height: 9px; border-radius: 3px; background: #e6dfd0; display: block; }
.rank-pips i.on { background: var(--teal); } .rank-pips i.aw { box-shadow: 0 0 0 1.5px var(--butter); }
.sk-row small.rk-now { display: block; color: #527f70; } .sk-row small.rk-next { display: block; color: var(--muted); } .aw-t { color: #9a7424; font-weight: 500; }
.sk-row small.sk-det { display: block; color: #3d6a8a; line-height: 1.35; }
.sk-btns { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.slot .rk { position: absolute; left: 3px; bottom: 2px; font-size: 9px; line-height: 1; background: var(--teal); color: #fff; border-radius: 4px; padding: 1px 3px; }
.rk-b { font-weight: 500; color: var(--teal-d); font-size: 11px; }

/* chat */
#hud-chat { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(26px + var(--safe-b)); width: calc(330px * var(--ui)); border-radius: 14px; overflow: hidden;
  background: var(--glass); box-shadow: var(--shadow); }
.chat-tabs { display: flex; gap: 4px; padding: 6px 6px 0; }
.chat-tabs button { border: 0; background: transparent; color: var(--muted); border-radius: 9px; font-size: .8em; padding: 3px 9px; min-height: 26px; }
.chat-tabs button.on { background: var(--sel); color: #527f70; }
#chat-expand { margin-left: auto; }
@font-face { font-family: "IBM Plex Sans Thai Looped"; src: url("../assets/reused/fonts/IBMPlexSansThaiLooped-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Thai Looped"; src: url("../assets/reused/fonts/IBMPlexSansThaiLooped-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
.chat-log { height: var(--chat-height, calc(var(--chat-lines, 5) * 1.5em)); overflow-y: auto; font-family: "IBM Plex Sans Thai Looped", var(--font); font-size: .82em; line-height: 1.5em; padding: 4px 11px; color: var(--ink); scrollbar-width: thin; user-select: text; }
.chat-log div { word-break: break-word; }
.chat-log .sys { color: #c24c25; } .chat-log .notice { color: #c32f42; } .chat-log .world { color: #3f7ea8; } .chat-log .guild { color: #997010; } .chat-log .whisper { color: #a34291; } .chat-log .party { color: #287846; } .chat-log .war { color: #c0585e; font-weight: 500; } .chat-log .local { color: var(--ink); }
.chat-log b { color: inherit; font-weight: 500; }
.chat-form { display: flex; gap: 4px; padding: 4px 7px 7px; }
.chat-form select { padding: 2px 4px; font-size: 12px; border-radius: 9px; min-height: 32px; }
.chat-form input { flex: 1; padding: 4px 9px; font-size: 13px; border-radius: 9px; min-width: 0; min-height: 32px; }
.chat-form .chat-send { flex: none; min-height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--teal); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.chat-bubble { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(30px + var(--safe-b)); font-size: 12px !important; width: auto !important; padding: 0 12px !important; }

/* hotbar tray */
#hud-bar { position: absolute; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: calc(6px * var(--ui)); align-items: center;
  background: rgba(255, 248, 232, .93); border-radius: 17px; padding: calc(7px * var(--ui)); box-shadow: var(--shadow); }
.slot { position: relative; width: calc(50px * var(--ui)); height: calc(50px * var(--ui)); border-radius: 12px; padding: 0; overflow: hidden; border: 0;
  background: #eee6d4 center / 100% 100% no-repeat; }
.slot.skill { background-size: 100% 100%; }
.slot.pot { background-color: #f6efdf; background-size: 78%; }
.slot .key { position: absolute; left: 3px; top: 2px; font-size: 9px; color: var(--ink); background: rgba(255, 248, 232, .78); border-radius: 4px; padding: 0 3px; line-height: 13px; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: var(--ink); background: rgba(255, 248, 232, .85); border-radius: 4px; padding: 0 3px; line-height: 13px; font-variant-numeric: tabular-nums; }
.slot .cd { position: absolute; inset: 0; background: rgba(83, 87, 108, .55); transform-origin: bottom; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 500; }
.slot.locked { filter: grayscale(1) opacity(.55); }
.slot.nomp { box-shadow: inset 0 0 0 2px var(--mpc); }
.sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--line); }

/* action buttons (attack / dodge / auto / target / talk) */
#hud-actions { position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: calc(200px * var(--ui)); height: calc(190px * var(--ui)); }
.act { position: absolute; border: 0; border-radius: 14px; background: rgba(255, 248, 232, .96); box-shadow: var(--shadow); font-size: calc(12px * var(--ui)); padding: 0; touch-action: none; color: var(--ink); }
.act:active, .act.pressed { transform: scale(.95); }
.act.big { width: calc(96px * var(--ui)); height: calc(96px * var(--ui)); right: 0; bottom: 0; border-radius: 50%; font-size: calc(16px * var(--ui)); color: #527e78; box-shadow: 0 4px 14px rgba(83, 87, 108, .12); }
.act.big span { font-size: inherit; }
.act.mid { width: calc(58px * var(--ui)); height: calc(58px * var(--ui)); right: calc(104px * var(--ui)); bottom: calc(10px * var(--ui)); border-radius: 50%; overflow: hidden; }
.act.small { width: calc(48px * var(--ui)); height: calc(44px * var(--ui)); font-size: calc(11px * var(--ui)); }
#btn-target { right: calc(8px * var(--ui)); bottom: calc(108px * var(--ui)); font-size: calc(20px * var(--ui)); }
#btn-target.on { background: var(--rose); color: #b4525a; }
#btn-auto { right: calc(62px * var(--ui)); bottom: calc(108px * var(--ui)); }
#btn-auto.on { background: #bdded0; color: #3f7464; }
#btn-interact { right: calc(116px * var(--ui)); bottom: calc(108px * var(--ui)); background: #ffe9b8; }
#hud-exp { position: absolute; left: calc(14px + var(--safe-l)); right: calc(14px + var(--safe-r)); bottom: calc(6px + var(--safe-b)); height: 14px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.exp-chip { color: var(--ink); background: rgba(255, 248, 232, .85); border-radius: 7px; padding: 0 7px; font-size: 10px; line-height: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exp-track { flex: 1; height: 4px; background: rgba(255, 248, 232, .55); border-radius: 4px; overflow: hidden; position: relative; }
.exp-track .fill { position: absolute; inset: 0; background: #e6c779; transform-origin: left; transition: transform .3s; border-radius: 4px; }
#joy { position: absolute; width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; background: rgba(255, 248, 232, .35); box-shadow: inset 0 0 0 1px rgba(255, 248, 232, .6); pointer-events: none; }
#joy-knob { position: absolute; left: 40px; top: 40px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 248, 232, .85); }

#toasts { position: absolute; left: 50%; top: 72px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; max-width: 86vw; }
.toast { background: var(--cream); color: var(--ink); box-shadow: 0 4px 16px rgba(83, 87, 108, .12); border-radius: 12px; padding: 8px 16px; animation: toast 3.2s forwards; font-size: 13px; text-align: center; }
.toast.err { background: #fbe4e3; color: #9d4a50; }
.toast.loot { background: #fdf2d6; display: flex; align-items: center; gap: 8px; justify-content: center; }
.inv-worn { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .inv-worn small { color: var(--muted); min-width: 44px; } .inv-worn .cell { width: 52px; flex: none; background-color: var(--soft); }
.toast .toast-ico { width: 26px; height: 26px; object-fit: contain; flex: none; }
.toast.loot.r-rare { box-shadow: 0 0 0 2px #6fa8e8, 0 4px 16px rgba(83, 87, 108, .12); } .toast.loot.r-epic { box-shadow: 0 0 0 2px #b07ae8, 0 4px 16px rgba(83, 87, 108, .12); }
.toast.loot.r-legendary { box-shadow: 0 0 0 2px #ffb547, 0 4px 16px rgba(255, 181, 71, .35); }
.toast.quest { background: #e3f1e8; color: #3f6f5d; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#center-msg { position: absolute; left: 50%; top: 28%; transform: translate(-50%, -50%); font-size: 24px; color: #fff; text-shadow: 0 2px 10px rgba(60, 70, 80, .55), 0 1px 2px rgba(60, 70, 80, .6); pointer-events: none; text-align: center; font-weight: 500; max-width: 90vw; }
#siege-banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: #ece3f6; color: #6d5a8f; border-radius: 12px; padding: 5px 14px; font-size: 13px; box-shadow: var(--shadow); }
#dead-overlay { position: absolute; inset: 0; background: rgba(72, 93, 105, .25); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 5; }
#dead-overlay .card { text-align: center; width: min(360px, 90vw); }
#dead-overlay h2 { color: #96818f; margin: 0 0 6px; font-size: 21px; } #dead-overlay p { color: var(--muted); margin: 0 0 16px; font-size: 13px; }

/* ---------- panels (modal) ---------- */
#panel-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(680px, 94vw); max-height: min(600px, 90vh); display: flex; flex-direction: column;
  background: var(--cream); border-radius: 22px; box-shadow: var(--shadow-l); pointer-events: auto; overflow: hidden; }
.panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px 22px; font-weight: 500; font-size: 19px; }
.panel header > span { display: flex; align-items: center; gap: 10px; }
.panel header img { width: 28px; height: 28px; object-fit: contain; }
.panel header .x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #f1eadc; font-size: 18px; color: var(--ink); flex: none; }
.panel .body { padding: 4px 22px 20px; overflow: auto; flex: 1; font-size: 14px; }
.panel .body h4 { margin: 16px 0 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.panel .body p { margin: 0 0 10px; line-height: 1.6; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: #f2ecdf; border-radius: 10px; min-height: 34px; padding: 5px 14px; font-size: 13px; }
.tabs button.on { background: #d6e7dc; color: #527f70; }
.grid-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid transparent; background: var(--chip) center / 80% no-repeat; padding: 0; }
.cell.sel { background-color: #e0e9d8; border-color: #3fbfaa; box-shadow: 0 0 0 3px #3fbfaa, 0 0 12px rgba(63, 191, 170, .55); z-index: 1; } /* the item being inspected */
.cell .cnt, .cell .plus { position: absolute; right: 5px; bottom: 2px; font-size: 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell .plus { left: 5px; top: 2px; right: auto; bottom: auto; color: #a18852; }
/* owner 2026-11-16 (players: "can't tell what the item is or its colour when buying / selling"): a clear frame in the
   rarity colour on every item icon, a tinted cell, and the item name in a readable darker shade of the same colour */
.r-common { border-color: transparent; }
.cell.r-uncommon, img.r-uncommon { border: 2px solid #6cc46a !important; background-color: #eef8ec; }
.cell.r-rare, img.r-rare { border: 2px solid #4f9ee8 !important; background-color: #e9f2fc; }
.cell.r-epic, img.r-epic { border: 2px solid #a868ec !important; background-color: #f3eafd; box-shadow: 0 0 6px rgba(168, 104, 236, .45); }
.cell.r-legendary, img.r-legendary { border: 2px solid #f0a12c !important; background-color: #fdf1d8; box-shadow: 0 0 8px rgba(240, 161, 44, .6); }
img.r-common, img.r-uncommon, img.r-rare, img.r-epic, img.r-legendary { border-radius: 10px; box-sizing: border-box; }
.r-common-t { color: var(--ink) !important; } .r-uncommon-t { color: #2e8a3a !important; } .r-rare-t { color: #1f66b8 !important; }
.r-epic-t { color: #7d36c9 !important; } .r-legendary-t { color: #b46a00 !important; }
.r-uncommon-t, .r-rare-t, .r-epic-t, .r-legendary-t { font-weight: 700; }
.cell.sel.r-uncommon, .cell.sel.r-rare, .cell.sel.r-epic, .cell.sel.r-legendary { border-color: #3fbfaa; }
.itemcard { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; }
.itemcard h4 { margin: 0 0 6px !important; color: var(--ink); font-size: 17px !important; font-weight: 700; } /* rarity colour from .r-*-t (owner 2026-11-16) */ .itemcard .stats { font-size: 13px; color: #7c8090; line-height: 1.7; }
.itemcard .btn { margin-top: 8px; }
.equip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.equip-grid .cell { aspect-ratio: 1; width: 100%; max-width: 78px; display: block; margin: 0 auto; background-color: var(--soft); }
.equip-grid label { font-size: 12px; text-align: center; display: block; color: var(--muted); margin-top: 4px; }
.statgrid { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 12px; align-items: center; font-size: 14px; }
.statgrid b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.statgrid button { min-width: 34px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper); padding: 0 6px; font-size: 13px; }
.statgrid button:hover { background: #d9ebe0; }
.statgrid button:disabled { opacity: .4; cursor: default; }
.stat-preview { color: #24867d; font-size: 12px; white-space: nowrap; }
.stat-confirm { padding: 10px; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f0f6ed; }
@media (max-width: 480px) {
  .statgrid { grid-template-columns: minmax(0, 1fr) auto; }
  .statgrid > span:nth-child(3n) { grid-column: 1 / -1; justify-self: end; margin-bottom: 6px; }
}
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; font-size: 13px; }
.kv b { font-weight: 500; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid rgba(230, 221, 201, .7); font-size: 14px; }
.li:last-child { border-bottom: 0; }
.li img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; }
.li .grow { flex: 1; min-width: 0; } .li b { font-weight: 500; } .li small { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; line-height: 1.5; }
.li.done { opacity: .55; } .li.cur { background: #eef5ef; border-radius: 12px; padding: 11px 10px; border-bottom-color: transparent; }
.emblem { width: 50px; height: 50px; image-rendering: pixelated; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.emblem-editor { display: grid; grid-template-columns: repeat(25, 12px); gap: 0; box-shadow: 0 0 0 1px var(--line); width: max-content; touch-action: none; }
.emblem-editor div { width: 12px; height: 12px; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.palette button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.palette button.on { box-shadow: 0 0 0 2px #6f8e86; }
.tip { font-size: 12px; color: var(--muted); line-height: 1.7; }
.pill { display: inline-block; background: #e1eadb; color: #6d8f75; border-radius: 7px; padding: 1px 8px; font-size: 11px; }
table.rank { width: 100%; border-collapse: collapse; font-size: 13px; } table.rank th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12px; padding: 8px; }
table.rank td { padding: 10px 8px; border-bottom: 1px solid rgba(230, 221, 201, .7); } table.rank td:first-child { color: #ad9560; }

/* story + quest-complete cards */
.story-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(72, 93, 105, .2); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 7; padding: 16px; }
.story-inner { width: min(520px, 100%); background: var(--cream); border-radius: 22px; padding: 22px 24px; box-shadow: var(--shadow-l); animation: storyIn .3s ease-out; }
.story-eyebrow { font-size: 11px; letter-spacing: 2px; color: #9a98a7; margin-bottom: 4px; }
.story-title { font-size: 21px; font-weight: 500; color: var(--ink); margin-bottom: 10px; }
.story-inner p { font-size: 14px; line-height: 1.8; margin: 0 0 18px; color: #6c7083; }
.story-inner .btn { min-width: 140px; }
.story-reward { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.story-reward span { background: var(--soft); border-radius: 8px; padding: 3px 9px; font-size: 12px; color: #6c7083; }
@keyframes storyIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* new-player guide (coach marks) */
#guide-layer { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.guide-ring { position: absolute; border-radius: 16px; box-shadow: 0 0 0 3px var(--teal), 0 0 0 9999px rgba(72, 93, 105, .28); transition: all .25s ease; pointer-events: none; }
.guide-tip { position: absolute; width: min(300px, 86vw); background: var(--cream); border-radius: 16px; padding: 14px 16px 12px; box-shadow: var(--shadow-l); pointer-events: auto; transition: left .25s, top .25s; }
.guide-tip .g-step { font-size: 11px; color: #9a98a7; letter-spacing: 1px; }
.guide-tip h3 { margin: 3px 0 6px; font-size: 16px; }
.guide-tip p { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: #6c7083; }
.guide-tip .row { justify-content: space-between; }

/* dodge button shows the class dodge icon */
#btn-dodge.has-icon { background-size: 100% 100%; background-position: center; background-repeat: no-repeat; color: #fff; text-shadow: 0 0 4px rgba(0,0,0,.6); font-weight: 500; font-size: calc(18px * var(--ui)); }

/* ---------- phones / small windows ---------- */
@media (max-height: 520px), (max-width: 760px) {
  :root { --ui: .72; }
  .menu-btn span { display: none; }
  .menu-btn { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .menu-btn img { width: 26px; height: 26px; }
  #hud-menu { top: calc(92px + 10px); gap: 5px; }
  .sq-btn { min-width: 44px; min-height: 44px; }
  .sq-btn.sm { min-width: 38px; min-height: 38px; }
  .status-card { width: 232px; padding: 7px 11px 7px 7px; }
  .map-pill { display: none; }
  #hud-minimap { width: 112px; border-width: 4px; }
  #hud-quest { width: 200px; padding: 7px 10px 8px; }
  #hud-quest .q-hint { display: none; }
  #hud-daily { width: 200px; min-height: 30px; padding: 4px 10px; }
  #hud-chat { --chat-lines: 3; width: 240px; }
  #hud-chat .chat-form { display: none; }
  #hud-chat.typing .chat-form { display: flex; }
  .slot { width: 44px; height: 44px; }
  .act.small { width: 46px; height: 44px; }
  .act.mid { width: 52px; height: 52px; }
  .act.big { width: 78px; height: 78px; }
  .panel { max-height: 94vh; width: min(680px, 96vw); }
  .panel header { padding: 12px 12px 8px 16px; font-size: 17px; }
  .panel header .x { width: 44px; height: 44px; }
  .panel .body { padding: 4px 16px 16px; }
  .tabs button, .btn.small { min-height: 40px; }
  .class-opt .av { width: 56px; height: 56px; background-size: 672px 373px; }
}
@media (max-height: 420px) {
  #hud-chat { display: none; } #hud-chat.open { display: block; }
  /* short landscape phones: the quest tracker becomes a compact pill at the top centre */
  #hud-quest { position: fixed; left: 50%; top: 8px; transform: translateX(-50%); width: auto; max-width: 44vw; padding: 5px 12px; display: flex; gap: 8px; align-items: center; }
  #hud-quest.hidden { display: none; }
  #hud-quest .q-ch, #hud-quest .q-hint { display: none; }
  #hud-quest .q-title { margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #hud-quest .q-prog { flex: none; font-size: 11px; } #hud-quest .q-track { display: none; }
  /* daily becomes a dot pill to the right of the quest pill */
  #hud-daily { position: fixed; top: 8px; left: calc(50% + 22vw + 6px); width: auto; padding: 5px 9px; min-height: 28px; }
  #hud-daily .d-txt, #hud-daily .d-lbl { display: none; }
  #toasts { top: 46px; }
}
@media (min-height: 421px) { .chat-bubble { display: none; } }
@media (max-height: 520px) {
  #hud-menu { display: grid; grid-template-columns: repeat(2, 44px); gap: 5px; }
  #hud-minimap { width: 92px; }
}
@media (max-width: 560px) {
  /* portrait phones: two-row skill tray at the left, chat lifted above it */
  #hud-bar { left: calc(12px + var(--safe-l)); transform: none; flex-wrap: wrap; max-width: calc(100vw - 150px); bottom: calc(22px + var(--safe-b)); }
  #hud-bar .sep { display: none; }
  #hud-chat { bottom: calc(150px + var(--safe-b)); width: min(240px, 60vw); }
  #hud-actions { bottom: calc(22px + var(--safe-b)); }
  .class-pick { grid-template-columns: repeat(3, 1fr); }
  .status-card { width: 200px; }
  #hud-quest { width: 170px; }
  #hud-daily { width: 170px; }
  #hud-daily .d-txt { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* secret quests */
#whisper { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translate(-50%, 10px); max-width: min(560px, 90vw); background: rgba(43, 36, 56, .86); color: #f6eedc; border-radius: 14px; padding: 10px 16px; font-size: 14px; line-height: 1.6; text-align: center; opacity: 0; transition: opacity .5s, transform .5s; pointer-events: none; z-index: 35; box-shadow: 0 8px 26px rgba(0, 0, 0, .18); font-style: italic; }
#whisper.show { opacity: 1; transform: translate(-50%, 0); }
.sq-page { background: var(--soft); border-radius: 12px; padding: 8px 12px; margin: 6px 0; } .sq-page summary { cursor: pointer; font-weight: 500; } .sq-page p { margin: 8px 0 2px; line-height: 1.7; font-size: 13px; }
@media (max-height: 520px) { #whisper { bottom: calc(96px + var(--safe-b)); font-size: 12.5px; } }

/* moderation (admins) */
.mod-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 8px 0; background: var(--paper); }
.mod-card small { color: var(--muted); }
.mod-note { margin: 6px 0; font-style: italic; }
.mod-chat { max-height: 180px; overflow: auto; font-size: 12.5px; line-height: 1.45; background: rgba(83, 87, 108, .05); border-radius: 10px; padding: 6px 8px; margin: 6px 0; overflow-wrap: anywhere; }
.mod-chat small { color: var(--muted); }
.pill.bad { background: var(--coral); color: #fff; }
.inv-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }

/* language switch (login card + settings) */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: #fffcf3; border: 1px solid #e6ddc9; margin: 0 auto 10px; }
.lang-switch button { border: 0; background: none; padding: 6px 14px; min-height: 32px; border-radius: 999px; font: inherit; font-size: 13px; color: #858598; cursor: pointer; }
.lang-switch button.on { background: #40bfb7; color: #fff; }
.title-wrap > .lang-switch { align-self: center; }
.chars-card > .lang-switch { align-self: flex-end; margin: 0 0 -6px; }

/* spirit gems */
.gchip { width: 22px; height: 22px; vertical-align: middle; object-fit: contain; }
/* owner 2026-11-19: socketed gems in the item details are tappable; the effect opens underneath */
.gpeek { font: inherit; color: inherit; background: rgba(255,255,255,.55); border: 1px dashed #c9a46a; border-radius: 8px; padding: 2px 6px; margin: 2px 0; cursor: pointer; min-height: 30px; }
.gpeek:hover, .gpeek[aria-expanded="true"] { background: #fff4d6; border-style: solid; }
.gpeek-box { margin: 4px 0 6px; padding: 8px 10px; border-radius: 10px; background: #fffaf0; border: 1px solid #e6cf9f; font-size: .92em; line-height: 1.45; }
.sock { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 13px; }
.gem-codex .gem-row img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.gem-codex .fx { font-weight: 600; color: #3f8f88; margin: 2px 0; font-size: 13px; }
.gem-codex small { line-height: 1.45; }

/* ---------- portrait phones (2026-11-02): one-hand layout ----------
   left thumb: joystick anywhere in the empty lower-left; right thumb: attack, dodge and a 4-wide skill grid above them.
   chat folds into the chat button (tap to open), like on short landscape phones. */
@media (orientation: portrait) and (max-width: 600px) {
  .chat-bubble { display: block !important; left: calc(12px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); }
  #hud-chat { display: none; bottom: calc(70px + var(--safe-b)); width: min(300px, 78vw); }
  #hud-chat.open { display: block; }
  #hud-chat.open .chat-form { display: flex; }
  #hud-bar { left: auto; right: calc(10px + var(--safe-r)); bottom: calc(160px + var(--safe-b)); transform: none; max-width: none;
    display: grid; grid-template-columns: repeat(4, 44px); gap: 5px; justify-content: end; }
  #hud-bar .sep { display: none; }
  #hud-actions { bottom: calc(18px + var(--safe-b)); right: calc(10px + var(--safe-r)); }
  #whisper { bottom: calc(260px + var(--safe-b)); }
  #toasts { top: 150px; }
}

.sock-note { display: flex; flex-direction: column; gap: 4px; background: #f3efe2; border: 1px solid #e3d9bf; border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; font-size: 13px; }
.pill.ghost { background: #f1ece0; color: #8a7a5c; }
/* Inventory management and insertion drag: existing cream/mint visual language. */
#hud-bar .slot,.bar-editor-track .slot { touch-action:none; user-select:none; -webkit-user-select:none; position:relative; }
.bar-held { opacity:.4; }
.bar-before { box-shadow:inset 4px 0 #40bfb7 !important; }
.bar-after { box-shadow:inset -4px 0 #40bfb7 !important; }
.bar-drag-ghost { position:fixed; z-index:10000; pointer-events:none; background-size:contain; background-position:center; background-repeat:no-repeat; background-color:#fff8e8; border:2px solid #40bfb7; border-radius:14px; opacity:.92; box-shadow:0 5px 14px #53576c33; transform:scale(1.08); }
.bar-drag-ghost .key { position:absolute; left:4px; top:2px; color:#53576c; font-size:12px; }
.bar-drag-ghost .cd { display:none !important; }
.bar-editor-track { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.bar-editor-track .slot { flex:0 0 52px; width:52px; height:52px; border:2px solid #e6ddc9; border-radius:12px; background-color:#fffcf3; background-size:contain; background-position:center; background-repeat:no-repeat; }
.bar-editor-track .slot .key { position:absolute; left:3px; top:1px; font-size:11px; color:#53576c; }
.bar-editor-track .bar-selected { border-color:#40bfb7; box-shadow:0 0 0 2px #b9ddb9; }
.bag-toolbar,.bag-selection { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:8px 0; }
.bag-selection { background:#f1f4eb; border:1px solid #e6ddc9; border-radius:12px; padding:10px; }
.bag-selection small { flex-basis:100%; color:#858598; }
.bag-selecting .cell.bag-picked { border-color:#40bfb7; box-shadow:inset 0 0 0 2px #40bfb7; }
.bag-selecting .cell.bag-picked::after { content:'✓'; position:absolute; top:1px; right:2px; background:#40bfb7; color:white; border-radius:50%; width:18px; height:18px; font-size:13px; line-height:18px; }
.bag-selecting .cell:disabled { opacity:.4; }
.bag-confirm { padding:12px; border:1px solid #e6ddc9; border-radius:16px; background:#fffcf3; }
.bag-confirm-list { max-height:40dvh; overflow:auto; margin:12px 0; }
.bag-confirm-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #e6ddc9; }
.bag-confirm-item img { width:40px; height:40px; object-fit:contain; flex-shrink:0; }
.bag-confirm-item span { flex:1; overflow-wrap:anywhere; }
.bag-confirm-item b { font-size:12px; text-align:right; }
.bag-total { font-weight:600; color:#3f7464; }
@media(max-width:480px) { .bag-toolbar .btn,.bag-selection .btn { flex:1 1 auto; min-height:44px; } .bag-confirm .row .btn { flex:1 1 100%; } }

/* Item action dialog and read-only equipment comparison. */
.cell.item-unusable::before { content:''; position:absolute; inset:0; border-radius:inherit; background:rgba(155,40,52,.44); pointer-events:none; z-index:1; }
.item-trend { position:absolute; top:2px; right:2px; z-index:3; width:19px; height:19px; border-radius:6px; background:#fffcf3; font:700 18px/19px sans-serif; text-align:center; box-shadow:0 1px 3px #53576c22; pointer-events:none; }
.item-trend.up { color:#287c43; } .item-trend.down { color:#b4394b; } .item-trend.mixed { color:#997334; font-size:16px; }
.item-popup-overlay { position:fixed; inset:0; z-index:30; display:grid; place-items:center; padding:12px; box-sizing:border-box; pointer-events:auto; background:rgba(37,40,53,.24); overscroll-behavior:contain; }
.item-popup-dialog { width:min(480px,100%); max-height:calc(100dvh - 24px); display:flex; flex-direction:column; overflow:hidden; border-radius:20px; background:var(--cream); color:var(--ink); box-shadow:var(--shadow-l); font-size:14px; }
.item-popup-dialog > header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; padding:12px 16px 8px; }
.item-popup-dialog > header b { font-size:18px; font-weight:500; }
.item-popup-dialog .x { flex:none; width:44px; height:44px; border:0; border-radius:50%; background:var(--chip); color:var(--ink); font-size:18px; }
.item-popup-content { min-height:0; overflow:auto; padding:0 16px 12px; overscroll-behavior:contain; }
.item-popup-cards { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.item-popup-cards.paired { grid-template-columns:repeat(2,minmax(0,1fr)); }
.item-popup-cards > article { min-width:0; border:1px solid var(--line); border-radius:14px; padding:12px; background:#fffcf3; overflow-wrap:anywhere; }
.item-popup-picked { border-color:#40bfb7 !important; }
.item-popup-label { display:flex; align-items:center; gap:8px; min-height:40px; font-size:13px; font-weight:500; color:#3c7668; }
.item-popup-current .item-popup-label { color:var(--muted); }
.item-popup-label img { width:42px; height:42px; object-fit:contain; flex:none; }
.item-popup-dialog .itemcard { border:0; margin:8px 0 0; padding:0; }
.item-popup-dialog .itemcard h4 { font-size:15px !important; line-height:1.45; }
.item-popup-dialog .itemcard .stats { font-size:13px; color:#636779; }
.item-equip-warning { color:#b4394b; font-weight:500; margin:10px 0 0; }
.item-popup-actions { flex-shrink:0; padding:10px 16px 14px; border-top:1px solid var(--line); background:var(--cream); }
.item-popup-actions .itemcard-actions { margin:0 !important; gap:8px; }
.item-popup-actions .btn { min-height:44px; margin:0; }
.item-popup-actions .tip { flex-basis:100%; margin:0; font-size:12px; }
.item-popup-delta h4 { font-size:14px; font-weight:500; margin:12px 0 6px; }
.gear-deltas > div { display:flex; justify-content:space-between; gap:12px; padding:5px 0; border-bottom:1px solid var(--line); font-size:13px; font-variant-numeric:tabular-nums; }
.gear-deltas .better { color:#287c43; } .gear-deltas .worse { color:#b4394b; }
.item-popup-delta .tip { font-size:12px; margin:8px 0 0; color:var(--muted); }
@media(max-width:520px) {
 .item-popup-overlay { padding:8px; padding-top:max(8px,env(safe-area-inset-top)); padding-bottom:max(8px,env(safe-area-inset-bottom)); }
 .item-popup-dialog { max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius:16px; }
 .item-popup-dialog > header,.item-popup-actions { padding-left:12px; padding-right:12px; }
 .item-popup-content { padding:0 12px 10px; }
 .item-popup-cards { gap:8px; } .item-popup-cards > article { padding:8px; }
 .item-popup-label { gap:5px; font-size:12px; flex-wrap:wrap; }
 .item-popup-label img { width:32px; height:32px; }
 .item-popup-dialog .itemcard .stats { font-size:12px; }
 .item-popup-actions .btn { flex:1 1 auto; }
 .gear-deltas > div { font-size:12px; }
}

.item-popup-dialog.has-comparison { width:min(820px,100%); }

/* Chat top-edge resize and player interactions. */
#chat-resize { height: 18px; display:flex; justify-content:center; align-items:center; cursor:ns-resize; touch-action:none; user-select:none; }
#chat-resize i { width:44px; height:3px; border-radius:3px; background:var(--border, #cfc5b4); }
#chat-resize:focus-visible { outline:2px solid var(--teal); outline-offset:-2px; }
.chat-tabs { gap:0; flex-wrap:wrap; }
.chat-tabs button { padding-left:6px; padding-right:6px; }
.chat-name { border:0; padding:0; background:none; color:inherit; font:inherit; font-weight:500; cursor:pointer; text-decoration:underline; text-decoration-color:transparent; }
.chat-name:hover, .chat-name:focus-visible { text-decoration-color:currentColor; }
.chat-form { flex-wrap:wrap; }
#chat-to { flex-basis:100%; order:-1; }
.player-menu { pointer-events:auto; position:fixed; z-index:90; left:50%; top:50%; transform:translate(-50%,-50%); width:min(310px, calc(100vw - 24px)); border-radius:18px; padding:16px; background:#fff8e8; border:1px solid #e6ddc9; box-shadow:0 8px 32px #302a4538; }
.player-menu header, .trade-card header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.player-actions { display:grid; gap:8px; margin-top:12px; }
.player-actions .btn { min-height:44px; }
.trade-overlay { position:fixed; inset:0; z-index:100; pointer-events:auto; display:flex; align-items:center; justify-content:center; padding:12px; background:#302a4555; }
.trade-card { background:#fff8e8; border:1px solid #e6ddc9; border-radius:20px; padding:18px; width:min(720px,100%); max-height:calc(100dvh - 24px); overflow:auto; box-shadow:0 8px 32px #302a4538; }
.trade-columns { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.trade-columns section { border:1px solid #e6ddc9; border-radius:12px; padding:10px; min-width:0; }
.trade-item { display:flex; align-items:center; gap:6px; font-size:13px; margin:6px 0; overflow-wrap:anywhere; }
.trade-item img { width:38px; height:38px; object-fit:contain; flex-shrink:0; }
.trade-item .btn { margin-left:auto; }
.trade-editor { display:flex; flex-wrap:wrap; align-items:end; gap:8px; padding:14px 0; }
.trade-editor label { display:flex; flex-direction:column; gap:4px; font-size:13px; min-width:0; max-width:100%; }
.trade-editor input { width:110px; } .trade-editor select { max-width:100%; }
.trade-footer { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.trade-card .btn, .trade-card .x { min-height:44px; }
@media(max-width:480px) { .trade-card { padding:12px; } .trade-columns { gap:6px; } .trade-columns section { padding:6px; } .trade-footer .btn { flex:1; } }

.trade-item { flex-wrap:wrap; align-items:flex-start; }
.trade-item > span { flex:1; min-width:0; }
.trade-item small { display:block; font-size:12px; line-height:1.5; }
.trade-item > .btn { flex-basis:100%; min-height:32px; }

/* trade: your bag right in the trade window (2026-11-05) */
.trade-bag { margin-top: 12px; border: 1px solid #e6ddc9; border-radius: 12px; padding: 10px; }
.trade-bag h4 { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; } .trade-bag h4 .tip { font-weight: 400; margin: 0; }
.tb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.tb-cell { cursor: pointer; } .tb-cell:hover:not(:disabled) { border-color: #3fbfaa; }
.tb-cell:disabled { cursor: default; opacity: .38; } .tb-cell.used { opacity: .25; }
.tb-lock { position: absolute; left: 3px; top: 1px; font-size: 10px; }
.tb-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; background: #eef6f0; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.tb-qty img { width: 36px; height: 36px; object-fit: contain; } .tb-qty > span:first-of-type { flex: 1; min-width: 120px; } .tb-qty small { display: block; }
.tb-qty label { display: flex; align-items: center; gap: 6px; } .tb-qty input { width: 80px; } .tb-qty .tip { margin: 0; }
.tb-wallet { flex-basis: 100%; font-size: 13px; color: var(--muted); } .tb-wallet b { color: #997010; font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .tb-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); max-height: 190px; } }
/* trade offers (2026-11-05, owner): six small bag-style squares per side instead of tall item rows */
.to-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin: 6px 0 8px; max-width: 320px; }
.to-cell { cursor: pointer; } .to-cell:hover { border-color: #3fbfaa; }
.to-empty { display: block; border: 1px dashed #e0d5bd; background: transparent; }
.to-info { margin-top: 8px; }
@media (max-width: 480px) { .to-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* party header + settings menu (2026-11-05, owner): one small gear by the party frames, everything else in its popover */
#hud-party .ph { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 0 2px 0 8px; height: calc(22px * var(--ui)); border-radius: 9px; background: var(--glass); box-shadow: var(--shadow); font-size: calc(11px * var(--ui)); color: var(--muted); }
#hud-party .ph-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-party .ph-gear { border: 0; background: none; color: var(--ink); font-size: calc(13px * var(--ui)); line-height: 1; padding: 2px 6px; border-radius: 7px; cursor: pointer; min-width: 30px; height: 100%; }
#hud-party .ph-gear:hover, #hud-party .ph-gear[aria-expanded="true"] { background: #e0e9d8; }
.party-menu { position: fixed; z-index: 85; pointer-events: auto; width: min(290px, calc(100vw - 16px)); max-height: calc(100dvh - 120px); overflow: auto; background: #fff8e8; border: 1px solid #e6ddc9; border-radius: 14px; padding: 10px 12px 12px; box-shadow: 0 8px 28px #302a4538; font-size: 13px; color: var(--ink); }
.party-menu header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; } .party-menu .x { min-width: 32px; min-height: 32px; }
.pm-sec small { color: var(--muted); }
.pm-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.pm-mode { border: 1px solid #e6ddc9; background: #fff; border-radius: 10px; padding: 6px; font: inherit; font-size: 12px; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; }
.pm-mode span { font-size: 15px; } .pm-mode.on { border-color: #3fbfaa; background: #e7f4ef; box-shadow: inset 0 0 0 1px #3fbfaa; } .pm-mode:disabled { cursor: default; } .pm-mode:disabled:not(.on) { opacity: .5; }
.pm-exp { margin: 8px 0; padding: 5px 8px; border-radius: 8px; font-size: 12px; } .pm-exp.ok { background: #e7f4ef; color: #2f7f6c; } .pm-exp.no { background: #f6e4e1; color: #a5574c; }
.pm-list { display: grid; gap: 2px; } .pm-row { display: flex; align-items: center; gap: 4px; padding: 3px 0; border-top: 1px solid #efe6d3; }
.pm-row .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pm-row small { color: var(--muted); } .pm-row .btn { min-height: 32px; padding: 2px 8px; }
.pm-leave { width: 100%; margin-top: 8px; min-height: 36px; }

/* chat close button: only the touch layout shows it (mobile.css) */
#chat-close { display: none; }

/* Native quest folding: independent open/fold controls, persistent compact HUD. */
#hud-quest, #hud-daily { padding-right: 50px; }
.quest-open { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; width: 100%; min-width: 0; cursor: pointer; }
.quest-fold { position: absolute; right: 0; top: 0; width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: 22px/1 sans-serif; cursor: pointer; }
.quest-fold:focus-visible, .quest-open:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.tracker-collapsed { display: none; font-size: 12px; white-space: nowrap; }
#hud-daily .tracker-expanded { display: flex; align-items: center; gap: 7px; min-width: 0; }
#hud-quest.is-folded, #hud-daily.is-folded { width: 44px; max-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-self: end; }
.is-folded .quest-open { display: none; }
.is-folded .quest-fold { width: 44px; height: 44px; padding: 0; font: 500 11px/1.2 Kanit, sans-serif; }
.is-folded .quest-fold .qbadge { position: absolute; right: -3px; top: -3px; }
.is-folded .quest-open { min-height: 44px; }
.is-folded .tracker-expanded { display: none !important; }
.is-folded .tracker-collapsed { display: inline; }
.panel.quest-panel-folded { left: auto; top: 16px; right: 12px; transform: none; width: min(280px, 94vw); }
.panel.quest-panel-folded > .body { display: none; }
.panel.quest-panel-folded header { padding: 5px 8px 5px 14px; }

#hud-character { position: relative; cursor: pointer; }
#hud-character:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.menu-btn, #btn-menu { position: relative; }
.guide-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #dc635f; border: 2px solid #fff8e8; box-sizing: content-box; pointer-events: none; }
.guide-dot[hidden] { display: none; }
.guide-new { margin-left: 6px; color: #ac474e; font-size: 11px; }

/* Status actions share the card width on both PC and mobile. */
#hud-status { --status-card-width: calc(286px * var(--ui)); }
#hud-status .status-card { width: var(--status-card-width); }
#hud-quick { width: var(--status-card-width); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; pointer-events: auto; }
#hud-quick > .sq-btn, #hud-quick .slot { width: 100% !important; height: 44px !important; min-height: 44px !important; margin: 0; padding: 0 !important; border: 0; border-radius: 12px; box-sizing: border-box; }
#hud-quick #btn-chat { display: inline-flex !important; position: static !important; left: auto !important; top: auto !important; bottom: auto !important; align-items: center; justify-content: center; font-size: 12px !important; }
#hud-quick .pk-btn { font-size: 11px; letter-spacing: 0; }
#hud-quick .quick-pot { min-width: 0; height: 44px; }
#hud-quick .slot { position: relative; display: block; background-color: var(--cream); background-size: 36px; background-position: center; background-repeat: no-repeat; box-shadow: var(--shadow); }
#hud-quick .slot .key { display: none; }
#hud-quick .slot .cnt { position: absolute; right: 3px; bottom: 1px; font-size: 11px; line-height: 14px; border-radius: 5px; background: rgba(255,248,232,.88); padding: 0 2px; }
#hud-quick .quick-empty { opacity: .5; }
#hud-quick .slot { touch-action: none; user-select: none; -webkit-user-select: none; }
#hud-chat.chat-collapsed { display: none; }
html:not([data-ui="mobile"]) #hud-menu { top: calc(154px * var(--ui) + 12px); }

/* update warning banner (Server/game/maint.js) */
#maint-banner { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 9000; display: none;
  max-width: min(92vw, 720px); padding: 8px 16px; border-radius: 12px; background: #4a2a1c; color: #fff4d6; border: 2px solid #f2b23a;
  font-size: 14px; line-height: 1.35; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); pointer-events: none; }
#maint-banner.show { display: block; animation: maint-pulse 2s ease-in-out infinite; }
@keyframes maint-pulse { 50% { border-color: #ffdf8a; } }
html[data-ui="mobile"] #maint-banner { font-size: 12px; padding: 5px 10px; top: calc(4px + env(safe-area-inset-top, 0px)); }

/* class 4 card in the skills panel */
.li.final-class { background: linear-gradient(100deg, #fff4d6, #ffe2a8 60%, #fff4d6); border-color: #f2b23a; box-shadow: 0 0 0 1px #f2b23a inset, 0 2px 10px rgba(242,178,58,.35); }

/* village storage and central market panels (Client/js/market-ui.js, 2026-11-05) */
.ex-act { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 10px; margin:6px 0 10px; border:1px solid var(--line); border-radius:12px; background:#fffaf0; }
.ex-act img { width:36px; height:36px; object-fit:contain; }
.ex-act b { flex:1 1 140px; min-width:0; }
.ex-act label { display:flex; align-items:center; gap:6px; font-size:13px; }
.ex-act input { width:120px; min-width:0; padding:6px 8px; border:1px solid var(--line); border-radius:8px; font:inherit; }
.ex-split { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:12px; align-items:start; }
.ex-split section { min-width:0; }
.ex-split h4 { margin-top:4px; }
.ex-grid { max-height:min(56vh, 420px); overflow:auto; overscroll-behavior:contain; touch-action:pan-y; grid-template-columns:repeat(auto-fill, minmax(44px, 1fr)) !important; }
.mk-cats { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 6px; }
.mk-cats button { border:1px solid var(--line); background:#fff; border-radius:999px; padding:5px 11px; font:inherit; font-size:13px; }
.mk-cats button span { display:inline-block; min-width:18px; margin-left:4px; padding:0 5px; border-radius:999px; background:#f1e7d3; font-size:11px; text-align:center; }
.mk-cats button.on { background:#f2b23a; border-color:#d9951c; color:#3b2a10; font-weight:600; }
.mk-cats button.on span { background:#fff4d6; }
.mk-cats button:disabled { opacity:.45; }
.mk-group { display:flex; align-items:baseline; gap:8px; border-bottom:2px solid #f1e2c2; padding-bottom:4px; }
.mk-filter { margin:6px 0 10px; }
.mk-filter input { flex:1 1 160px; min-width:0; padding:7px 10px; border:1px solid var(--line); border-radius:10px; font:inherit; }
.mk-filter select { padding:6px 8px; border:1px solid var(--line); border-radius:10px; font:inherit; background:#fff; }
.mk-price { white-space:nowrap; color:#a5700f; font-variant-numeric:tabular-nums; margin:0 6px; }
.mk-sellbox small { flex-basis:100%; color:var(--muted, #7a6a58); }
/* market item details (2026-11-05) */
.mk-row { cursor:pointer; transition:background .12s; }
.mk-row:hover { background:#fff3dc; }
.mk-verdict { margin:6px 0; padding:6px 10px; border-radius:10px; font-weight:600; font-size:13px; background:#f3efe6; }
.mk-verdict.up { background:#e3f6e1; color:#2f7a32; } .mk-verdict.down { background:#fbe5e1; color:#a8402f; }
.mk-verdict.mixed { background:#fff1d6; color:#9a6a12; } .mk-verdict.blocked { background:#f1ecf6; color:#6f5a8a; }
.mk-info { margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.mk-info .kv { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; font-size:14px; }
.mk-detail .item-popup-content { padding:12px 18px; overflow:auto; }
.mk-detail .item-popup-label { display:flex; align-items:center; gap:10px; } .mk-detail .item-popup-label img { width:48px; height:48px; object-fit:contain; }
.mk-detail .itemcard { margin-top:4px; border-top:0; padding-top:0; }
.mk-sellcard { flex-basis:100%; } .mk-sellcard .itemcard { margin-top:6px; }
.mk-tip { position:fixed; z-index:60; width:min(300px, 80vw); padding:10px 12px; border-radius:14px; background:var(--cream, #fff8e8); border:1px solid var(--line); box-shadow:0 10px 30px #30334b33; pointer-events:none; font-size:13px; }
.mk-tip .itemcard { margin-top:0; border-top:0; padding-top:0; }

/* item lock badge and the sell warning (2026-11-06) */
.cell .lock { position:absolute; left:2px; top:1px; font-size:11px; line-height:1; filter:drop-shadow(0 1px 1px #0006); }
.bag-warn { margin:8px 0; padding:8px 10px; border-radius:10px; background:#fff1d6; color:#8a5a0a; font-weight:600; font-size:13px; }

/* hotbar slot kept out of AUTO (double tap, 2026-11-06): lifted a little, with a small "มือ" (by hand) tag */
html:not([data-ui="mobile"]) #hud-bar .slot.no-auto { top:-10px; }
html[data-ui="mobile"] #hud-bar .slot.no-auto { margin-bottom:10px; }
#hud-bar .slot.no-auto { box-shadow:0 0 0 2px #f2b23a, 0 8px 14px #30334b55 !important; filter:saturate(.85); }
#hud-bar .slot .no-auto-tag { position:absolute; left:50%; bottom:1px; transform:translateX(-50%); padding:0 4px; border-radius:6px; background:#f2b23a; color:#3b2a10; font-size:9px; line-height:12px; font-weight:700; pointer-events:none; white-space:nowrap; z-index:2; }
.quick-pot .slot.quick-empty { opacity:.55; cursor:pointer; }

/* A fallen hero can still ask for help, trade and use the HUD. */
#dead-overlay { pointer-events: none; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; align-items: flex-start; padding-top: max(90px, 15dvh); }
#dead-overlay .card { pointer-events: auto; padding: 12px 16px; width: min(360px, 82vw); box-shadow: 0 3px 14px #53576c20; }
#dead-overlay h2 { font-size: 17px; }
#dead-overlay p { margin-bottom: 9px; }
@media (max-height: 500px) { #dead-overlay { padding-top: 65px; } #dead-overlay .card { width: min(300px, 58vw); padding: 8px 12px; } #dead-overlay h2 { font-size: 15px; } #dead-overlay p { font-size: 11px; margin-bottom: 6px; } }

#dead-overlay summary { cursor: pointer; color: #96818f; font-size: 17px; font-weight: 500; }
#dead-overlay summary small { color: var(--muted); font-size: 11px; font-weight: 400; }
#dead-overlay details[open] summary { margin-bottom: 6px; }
#dead-overlay details:not([open]) { width: auto; }
html[data-ui="mobile"][data-orient="portrait"] #dead-overlay { padding-top: max(170px, 20dvh); }

/* Verified staff world chat; normal channel colors remain intact. */
.chat-log .world.admin-world { color: #ad6500; font-weight: 500; }
.sq-time { display: block; color: #8a6a3a; } .sq-time.open { color: #3d8a55; font-weight: 600; }
/* owner 2026-11-12: bag full / too heavy card, above every window (Client/js/hud.js bagFull) */
#bagfull-pop { position:fixed; inset:0; z-index:9000; display:none; align-items:center; justify-content:center; padding:16px; background:#282c4240; }
#bagfull-pop.show { display:flex; animation:bf-in .18s ease-out; }
#bagfull-pop .bf-card { width:min(320px,100%); box-sizing:border-box; padding:16px 18px 14px; border-radius:18px; background:#fff8e8; border:2px solid #f0b7a8; color:#53576c; text-align:center; box-shadow:0 14px 40px #302a4540; font:14px/1.5 KanitArc,sans-serif; }
#bagfull-pop .bf-ic { font-size:38px; line-height:1; animation:bf-shake .5s ease-in-out 2; }
#bagfull-pop b { display:block; margin:6px 0 2px; font-size:19px; color:#c0503f; }
#bagfull-pop p { margin:0 0 4px; }
#bagfull-pop small { display:block; color:#8a8f9c; font-size:12px; }
#bagfull-pop .bf-row { display:flex; gap:8px; justify-content:center; margin-top:12px; }
#bagfull-pop .bf-row .btn { min-height:40px; min-width:110px; }
@keyframes bf-in { from { opacity:0; } to { opacity:1; } }
@keyframes bf-shake { 0%,100% { transform:rotate(0); } 25% { transform:rotate(-12deg); } 75% { transform:rotate(12deg); } }
@media (prefers-reduced-motion:reduce) { #bagfull-pop.show, #bagfull-pop .bf-ic { animation:none; } }
/* owner 2026-11-15: world-chat game tips stand apart from player chat and system lines */
.chat-log .chat-tip { color: #9a5a12; margin: 2px 0; font-weight: 500; } /* owner 2026-11-17: no background or frame, only the colour */
.chat-log .chat-tip b { color: #b5651d; }
#hud #hud-chat.chat-passive .chat-tip { color: #ffe39a; }
#hud #hud-chat.chat-passive .chat-tip b { color: #ffd166; }
/* owner 2026-11-17: top-up button beside the crystal count, and the live top-up box */
#hud-gold .currency-topup { margin-left:4px; width:20px; height:20px; padding:0; border-radius:50%; border:1px solid #2f7d4f; background:#3fae6a; color:#fff; font-weight:700; font-size:15px; line-height:18px; cursor:pointer; pointer-events:auto; vertical-align:middle; }
#hud-gold .currency-topup:hover { background:#4cc47b; }
.test-shop.live { border:2px solid #3fae6a; border-radius:8px; padding:.5rem .7rem; margin-bottom:.6rem; background:#f2fbf4; color:#2a2a2a; }
.test-shop.live h4 { margin:0 0 .4rem; }
.test-shop-note {
  background: #fff1df;
  border: 1px solid #91664d;
  border-left: 4px solid #694334;
  border-radius: 6px;
  color: #402a23;
  padding: .55rem .7rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
/* hotbar editor dock beside the bag (owner 2026-11-16, Client/js/bar-editor.js): the bag panel stays open above it */
.bar-editor-dock { position:fixed; left:50%; bottom:calc(8px + env(safe-area-inset-bottom, 0px)); transform:translateX(-50%); z-index:9000; font-family:inherit; color:var(--ink); width:min(760px, calc(100vw - 16px)); max-height:46vh; overflow:auto;
  background:#fffaf0; border:2px solid #e8dcc2; border-radius:18px; box-shadow:0 10px 30px rgba(60,50,30,.28); padding:8px 14px 10px; pointer-events:auto; }
.bar-editor-dock header { display:flex; align-items:center; justify-content:space-between; font-size:16px; }
.bar-editor-dock header .x { width:32px; height:32px; border-radius:50%; border:0; background:#f1eadc; font-size:16px; color:var(--ink); }
.bar-editor-dock .tip { margin:2px 0 6px; font-size:12px; }
.bar-editor-dock h4 { margin:6px 0 4px; font-size:13px; }
.bar-ed-row { display:flex; gap:10px; align-items:flex-start; }
.bar-ed-food { display:flex; flex-direction:column; align-items:center; gap:2px; font-size:11px; color:var(--muted); }
.bar-ed-slots { display:grid; grid-template-columns:repeat(10, 1fr); gap:6px; flex:1; }
.bar-ed-skills { display:flex; flex-wrap:wrap; gap:6px; }
.bar-editor-dock .slot { width:auto; height:auto; aspect-ratio:1; min-width:0; border:2px solid #e6ddc9; border-radius:12px; background-color:#fffcf3; background-size:contain; background-position:center; background-repeat:no-repeat;
  touch-action:none; user-select:none; -webkit-user-select:none; position:relative; cursor:pointer; }
.bar-ed-food .slot, .bar-ed-skills .slot { width:46px; height:46px; }
.bar-editor-dock .slot.bar-empty { background-color:#f6efe0; border-style:dashed; }
.bar-editor-dock .slot.bar-quick { border-color:#e3b85a; }
.bar-editor-dock .slot.bar-selected { border-color:#40bfb7; box-shadow:0 0 0 2px #b9ddb9; }
.bar-editor-dock .slot.bar-over { border-color:#40bfb7; background-color:#e2f4ee; }
.bar-editor-dock .slot.bar-on { opacity:.6; }
.bar-editor-dock .slot.locked { filter:grayscale(1) opacity(.45); cursor:default; }
.bar-editor-dock .slot .key { position:absolute; left:3px; top:1px; font-size:10px; color:#53576c; background:rgba(255,248,232,.8); border-radius:4px; padding:0 2px; line-height:12px; }
.bar-editor-dock .slot .cnt { position:absolute; right:2px; bottom:1px; font-size:10px; background:rgba(255,248,232,.85); border-radius:4px; padding:0 2px; line-height:12px; }
.bar-on-tag { position:absolute; right:2px; top:1px; font-size:11px; color:#2f9a7a; }
.grid-inv .cell.bar-cant { filter:grayscale(1) opacity(.4); }
.grid-inv .cell[data-bsrc] { box-shadow:0 0 0 2px #b9ddb9 inset; }
html[data-ui="mobile"] .bar-editor-dock { max-height:44vh; padding:6px 8px 8px; border-radius:14px; }
html[data-ui="mobile"] .bar-ed-slots { grid-template-columns:repeat(5, 1fr); gap:5px; }
html[data-ui="mobile"] .bar-ed-food .slot, html[data-ui="mobile"] .bar-ed-skills .slot { width:40px; height:40px; }
/* the bag moves up while the hotbar editor dock sits at the bottom */
html.bar-editing #panel-layer .panel { top:calc(8px + env(safe-area-inset-top, 0px)) !important; height:auto !important; max-height:calc(100vh - var(--bar-dock-h, 300px) - 28px) !important; }
html.bar-editing #panel-layer .panel:not(.floating-window) { top:calc(8px + env(safe-area-inset-top, 0px)); transform:translate(-50%, 0); }
@media (orientation: landscape) and (max-height: 500px) { .bar-editor-dock { max-height:52vh; } .bar-ed-slots { grid-template-columns:repeat(10, 1fr) !important; } .bar-editor-dock .tip { display:none; } }

/* owner 2026-11-16: power-save screen (Client/js/powersave.js) */
#powersave { position:fixed; inset:0; z-index:9000; background:#0d0f14; color:#e8e4d8; display:flex; align-items:center; justify-content:center; padding:16px; font-family:var(--font); user-select:none; }
#powersave .ps-card { width:min(360px,100%); text-align:center; }
#powersave h3 { margin:0 0 12px; font-size:18px; color:#f2d98a; }
#powersave .ps-name { display:block; margin-bottom:8px; font-size:16px; }
#powersave .ps-row { display:flex; justify-content:space-between; gap:12px; padding:6px 2px; border-bottom:1px solid rgba(255,255,255,.08); font-size:14px; }
#powersave .ps-row span { color:#9aa0ab; }
#powersave .ps-hint { color:#9aa0ab; font-size:12px; line-height:1.5; margin:14px 0; }
#powersave .ps-exit { width:100%; margin-bottom:6px; }
#powersave small { color:#6d7380; }
html.powersave #game, html.powersave canvas { visibility:hidden; }

/* owner 2026-11-16: item cell badges - +level (top left, existing .plus) and spirit-gem socket dots (bottom left) */
.cell .plus { font-weight: 700; color: #fff; background: rgba(120, 72, 20, .82); border-radius: 6px; padding: 0 4px; line-height: 15px; font-size: 10px; left: 3px; top: 3px; }
.cell .gem-dots { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 2px; pointer-events: none; }
.cell .gem-dots i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(80, 60, 40, .45); display: block; }
.cell .gem-dots i.on { box-shadow: 0 0 0 1px rgba(40, 25, 10, .7), 0 0 4px rgba(255, 255, 255, .6); }
.mk-ico { position: relative; display: inline-block; flex: none; line-height: 0; }
.mk-ico .plus { position: absolute; left: 1px; top: 1px; font-weight: 700; color: #fff; background: rgba(120, 72, 20, .82); border-radius: 6px; padding: 0 4px; line-height: 14px; font-size: 10px; }
.mk-ico .gem-dots { position: absolute; left: 3px; bottom: 3px; display: flex; gap: 2px; }
.mk-ico .gem-dots i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(80, 60, 40, .45); display: block; }
.mk-sorts { margin: 4px 0; align-items: center; } .mk-sorts small { color: var(--muted); }
.passive-row { background: linear-gradient(90deg, #fff4d6, #fffaf0); border: 1px solid #f0cf86; border-radius: 10px; margin: 6px 0; }
.passive-row b { color: #8a5a00; }
.guild-note { background: #fff8e2; border: 1px solid #f0d58e; border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.guild-note p { margin: 4px 0; white-space: normal; line-height: 1.5; } .guild-note textarea { width: 100%; box-sizing: border-box; margin: 6px 0 4px; }

/* owner 2026-11-16: Starter Pack window (Client/js/hud.js p_starter) */
.sp-banner { position: relative; border-radius: 12px; overflow: hidden; margin: 6px 0; line-height: 0; }
.sp-banner img { width: 100%; display: block; }
.sp-banner .sp-tier, .sp-banner .sp-price { position: absolute; left: 51.2%; width: 41.5%; display: flex; align-items: center; justify-content: center; line-height: 1.2; color: #4a3a2a; font-weight: 700; }
.sp-banner .sp-tier { top: 32%; height: 11.5%; font-size: clamp(12px, 2.4vw, 18px); }
.sp-banner .sp-price { top: 44.6%; height: 15.7%; font-size: clamp(15px, 3.4vw, 26px); color: #7a4a00; }
.sp-banner .sp-price small { font-size: .6em; margin-left: 6px; color: #8a7a6a; font-weight: 500; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 8px 0; }
.sp-cell { position: relative; background: #fff8e8; border: 1px solid #ecdcb8; border-radius: 12px; padding: 8px 4px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sp-cell img { width: 44px; height: 44px; object-fit: contain; }
.sp-cell small { font-size: 11px; line-height: 1.2; color: #5a4a3a; } .sp-cell b { font-size: 12px; color: #7a4a00; }
.sp-cell .plus { position: absolute; left: 4px; top: 4px; font-weight: 700; color: #fff; background: rgba(120, 72, 20, .82); border-radius: 6px; padding: 0 4px; font-size: 10px; line-height: 14px; }
.sp-buy { width: 100%; margin-top: 4px; font-size: 15px; padding: 10px; }
.shop-promo span { font-size: 20px; line-height: 1; }
.sp-banner .sp-best { position: absolute; left: 51.2%; width: 41.5%; top: 74.5%; height: 6.5%; display: flex; align-items: center; justify-content: center; line-height: 1; font-weight: 700; color: #2e6b3a; font-size: clamp(11px, 2vw, 15px); }
.sp-cell.r-epic { border: 2px solid #a868ec; background: #f3eafd; box-shadow: 0 0 6px rgba(168, 104, 236, .35); }
/* owner 2026-11-16: the starter window is Codex's poster with live text in its frames */
.sp-poster { position: relative; width: 100%; max-width: 560px; margin: 6px auto; background-size: 100% 100%; border-radius: 14px; overflow: hidden; container-type: inline-size; }
.sp-poster > * { position: absolute; box-sizing: border-box; }
.sp-poster .sp-t { display: flex; align-items: center; justify-content: center; text-align: center; color: #4a3a2a; font-weight: 700; line-height: 1.1; }
.sp-poster .sp-tier { font-size: 4.4cqw; } .sp-poster .sp-price { font-size: 5.6cqw; color: #7a4a00; gap: 1cqw; } .sp-poster .sp-price small { font-size: 2.8cqw; color: #8a7a6a; font-weight: 500; }
.sp-poster .sp-limit { font-size: 3cqw; font-weight: 500; color: #6a5a4a; } .sp-poster .sp-best { font-size: 3.2cqw; color: #2e6b3a; } .sp-poster .sp-gear { font-size: 3cqw; color: #6a3fb0; }
.sp-poster .sp-ic { object-fit: contain; }
.sp-poster .sp-lb, .sp-poster .sp-ct { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 2.5cqw; line-height: 1.05; color: #5a4a3a; }
.sp-poster .sp-ct { font-weight: 700; color: #7a4a00; font-size: 2.7cqw; } .sp-poster .sp-ct.epic { color: #7d36c9; }

/* quest window: level-up rewards (owner 2026-11-16, Client/js/levelgift-ui.js) */
.lvg .lvg-items { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.lvg .lvg-it { display: inline-flex; align-items: center; gap: 4px; }
.lvg .lvg-it img { width: 24px; height: 24px; border-radius: 6px; }
.lvg .lvg-it small { font-size: 12px; color: var(--ink); }
.lvg.claimed { opacity: .55; }
.lvg.locked { opacity: .75; }
.lvg .lvg-done, .lvg .lvg-lock { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* starter pack window: what each item does (owner 2026-11-16) */
.sp-dh { margin: 12px 0 6px; }
.sp-detail { list-style: none; margin: 0 0 8px; padding: 0; }
.sp-detail li { padding: 6px 0; border-bottom: 1px solid rgba(230, 221, 201, .7); }
.sp-detail li:last-child { border-bottom: 0; }
.sp-detail b { display: block; font-weight: 500; }
.sp-detail small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
/* owner 2026-11-16 (player feedback): smith rows say the item level and rarity in words */
.sm-lv { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; background: #f1eadc; color: #6a5a48; font-size: 11px; font-weight: 500; line-height: 18px; vertical-align: 1px; white-space: nowrap; }

/* creator mode: worn-piece fit tool (owner 2026-11-16, Client/js/wearfit-ui.js) */
.wf-row select { min-height: 36px; border-radius: 10px; border: 1px solid #e6ddc9; background: #fffcf3; padding: 2px 8px; font: inherit; }
.wf-stage { display: flex; justify-content: center; margin: 6px 0; }
.wf-stage canvas { border-radius: 14px; background: radial-gradient(ellipse at 50% 88%, #e9f3e2 0 28%, #f7f1e3 60%); border: 1px solid #ead8b8; touch-action: none; cursor: grab; }
.wf-sliders { display: grid; gap: 4px; margin: 6px 0; }
.wf-sliders label { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; }
.wf-sliders b { text-align: right; font-weight: 500; }

/* owner 2026-11-16: VIP Lotus / Moon chat colour (Shared/vip.js) */
.vipc-lotus .chat-name, .vipc-lotus > span[translate] { color: #c4527f !important; }
.vipc-moon .chat-name, .vipc-moon > span[translate] { color: #4f6fc4 !important; }
.vip-badge { margin-right: 2px; }
/* owner 2026-11-20: admin / GM chat is always plain gold (name and text), above any VIP colour */
.chat-gm, .chat-gm .chat-name, .chat-gm b, .chat-gm > span[translate] { color: #b8860b !important; font-weight: 400 !important; text-shadow: none; } /* owner 2026-11-20: plain gold, no bold (the 700 weight was a faux bold that looked doubled) */

/* owner 2026-11-16: VIP window (Client/js/vip-ui.js) */
.vip-now { margin: 2px 0 6px; }
.vip-quick { margin-bottom: 6px; }
.vip-head { display: block; width: 100%; border-radius: 12px; margin: 4px 0 6px; }
.vip-perks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin-bottom: 8px; }
.vip-perk { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #ead8b8; border-radius: 10px; background: #fffaf0; }
.vip-perk img { width: 32px; height: 32px; flex: none; }
.vip-perk span { display: flex; flex-direction: column; min-width: 0; }
.vip-perk small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.vip-perk b { font-weight: 600; font-size: 13.5px; }
.vip-perk.soon { opacity: .6; }
#vip-buy { width: 100%; }
.vip-bank { font-size: 12.5px; color: var(--muted); padding-left: 22px; } .vip-bank.on { color: var(--ink); font-weight: 500; } /* owner 2026-11-17: days per VIP tier */

/* owner 2026-11-17: collection book (Client/js/hud.js p_coll) */
.coll-list .coll-set { align-items: flex-start; }
.coll-list .coll-done { background: #eef9ee; }
.coll-entries { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.coll-entries .coll-have { background: #d8f2d8; color: #2f6b34; }
.coll-entries .coll-miss { opacity: .55; }
