:root {
  --panel-top: rgba(27, 35, 54, 0.88);
  --panel-bot: rgba(12, 16, 27, 0.92);
  --line: rgba(227, 194, 126, 0.42);
  --line-soft: rgba(255, 255, 255, 0.07);
  --edge: rgba(255, 255, 255, 0.09);
  --well: rgba(6, 5, 10, 0.42);
  --lift: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.3);
  --gold: #e3c27e;
  --cream: #f1e8d6;
  --muted: #a99f8e;
  --hp: #e2474f;
  --mp: #4a8de0;
  --exp: #e9c35a;
  --ok: #7ddc8a;
  --warn: #ff8a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #15131a; color: var(--cream); font: 14px/1.45 Sarabun, 'Segoe UI', sans-serif; user-select: none; }
canvas#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: default; }
canvas#world.over-monster { cursor: crosshair; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* Panel: frosted dark glass, one thin gold hairline, depth from a soft lift shadow. */
.panel {
  position: absolute;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--lift);
  backdrop-filter: blur(10px);
}
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 600 13.5px Kanit, sans-serif; color: var(--gold); padding: 9px 14px 8px; border-bottom: 1px solid var(--line-soft); letter-spacing: 0.02em; }

.btn { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01)), #252030; border: 1px solid var(--edge); border-radius: 8px; padding: 8px 16px; cursor: pointer; font: 500 14px Kanit, sans-serif; color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 5px rgba(0, 0, 0, 0.3); transition: border-color 0.12s, transform 0.08s, filter 0.12s; }
.btn:hover { border-color: rgba(227, 194, 126, 0.55); color: #fff; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #f1d79c, #c89a4f); border-color: #f5dfa8; color: #2a1d0c; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 3px 10px rgba(200, 154, 79, 0.3); }
.btn.primary:hover { filter: brightness(1.08); color: #2a1d0c; }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- title ---------- */
#title-screen { position: fixed; inset: 0; display: grid; place-items: end center; padding-bottom: 4vh;
  background: linear-gradient(180deg, rgba(12, 10, 16, 0) 35%, rgba(12, 10, 16, 0.55) 70%, rgba(12, 10, 16, 0.8)), url('assets/sprites/title.jpg') center / cover no-repeat, #15131a; }
#title-screen .title-card { background: linear-gradient(180deg, rgba(36, 31, 43, 0.82), rgba(18, 16, 23, 0.88)); backdrop-filter: blur(3px); }
/* Wide screens: the card sits to the right so the three heroes in the key art stay visible. */
@media (min-width: 1200px) {
  #title-screen { place-items: center end; padding: 0 4vw 0 0; background-position: 30% center, 30% center, 0 0; }
  #title-screen .title-card { width: min(620px, 50vw); }
  .class-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .class-card canvas { width: 84px; height: 84px; }
}
.title-card { position: relative; width: min(760px, calc(100vw - 32px)); padding: 26px 28px 22px; text-align: center; }
.logo { font: 800 52px/1 Kanit, sans-serif; letter-spacing: 0.18em; color: var(--gold); text-shadow: 0 0 18px rgba(227, 194, 126, 0.45), 0 2px 0 #4a3a22; }
.logo-sub { color: var(--muted); margin: 6px 0 18px; font-size: 13px; }
.field { display: flex; align-items: center; justify-content: center; gap: 10px; font: 500 14px Kanit, sans-serif; color: var(--gold); }
.field input, #chat-input { background: rgba(10, 8, 14, 0.7); border: 1px solid var(--line); border-radius: 5px; color: var(--cream); padding: 8px 12px; font: 15px Sarabun, sans-serif; outline: none; }
.field input { width: 240px; }
.field input:focus, #chat-input:focus { border-color: var(--gold); }
.field-label { margin: 18px 0 8px; color: var(--muted); font: 500 13px Kanit, sans-serif; text-align: left; }
/* Six classes in two rows of three; the cards stay short so the title card never needs to scroll. */
.class-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.class-card { position: relative; padding: 8px 8px 10px; border: 1px solid var(--edge); border-radius: 6px; background: rgba(12, 10, 16, 0.55); cursor: pointer; transition: transform 0.12s, border-color 0.12s; }
.class-card:hover { transform: translateY(-2px); border-color: var(--line); }
.class-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(227, 194, 126, 0.25); }
.class-card canvas { width: 92px; height: 92px; display: block; margin: 0 auto; }
.class-card h3 { margin: 2px 0 1px; font: 600 16px Kanit, sans-serif; color: var(--cream); }
.class-card .stats { font-size: 11.5px; color: var(--gold); }
.class-card p { margin: 3px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
@media (max-height: 820px) {
  .class-card canvas { width: 72px; height: 72px; }
  .class-card p { display: none; }
  .logo-sub { margin-bottom: 10px; }
  .field-label { margin: 10px 0 6px; }
}
.title-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.error { color: var(--warn); min-height: 1.4em; margin: 8px 0 0; font-size: 13px; }

/* ---------- HUD ---------- */
#profile { top: 14px; left: 14px; display: flex; align-items: center; gap: 12px; padding: 9px 14px 9px 9px; width: 290px; border-radius: 16px; }
#portrait { width: 62px; height: 62px; border-radius: 50%; border: 2px solid rgba(227, 194, 126, 0.65); background: radial-gradient(circle at 50% 35%, #4a3f56, #1b1720); flex: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.45); }
.pf-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pf-name { display: flex; align-items: center; gap: 6px; font: 600 15px Kanit, sans-serif; white-space: nowrap; overflow: hidden; }
.tag { font: 500 11px Kanit, sans-serif; color: var(--gold); background: rgba(227, 194, 126, 0.1); border-radius: 10px; padding: 0 8px; }
.pf-meta { display: flex; justify-content: space-between; font: 500 12px Kanit, sans-serif; color: var(--muted); }
.pf-meta b { color: var(--cream); }
.gold, .gold b { color: var(--gold) !important; }

/* Bars: a recessed well with a glossy fill. */
.bar { position: relative; height: 14px; border-radius: 7px; background: var(--well); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 7px; transition: width 0.15s; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.bar span { position: absolute; inset: 0; display: grid; place-items: center; font: 600 10.5px Kanit, sans-serif; text-shadow: 0 1px 2px #000; }
.bar.hp i { background: linear-gradient(180deg, #ff8a8f, var(--hp) 60%, #b5303b); }
.bar.mp i { background: linear-gradient(180deg, #9cc8ff, var(--mp) 60%, #3364b4); }
.bar.exp i { background: linear-gradient(180deg, #ffe39a, var(--exp) 60%, #b38c2e); }
#profile .bar.mp { height: 10px; }
#profile .bar.mp span { font-size: 9px; }
/* Class resource (resolve, faith) under the MP bar, in the class colour (--res); the shield shows over the HP fill. */
#profile .bar.res { height: 8px; }
#profile .bar.res i { background: linear-gradient(180deg, #fff6dc, var(--res, #ffd27a) 60%, color-mix(in srgb, var(--res, #ffd27a) 70%, #000)); }
#profile .bar.res span { font-size: 8px; }
#profile .bar i.shield { background: linear-gradient(180deg, rgba(235, 248, 255, 0.9), rgba(150, 210, 255, 0.75)); box-shadow: 0 0 6px rgba(170, 225, 255, 0.8); }
#hud.has-res #buffs { top: 116px; }
#profile.low .bar.hp { animation: hp-low 0.9s ease-in-out infinite alternate; }
@keyframes hp-low { to { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 80, 90, 0.8); } }

#buffs { position: absolute; top: 104px; left: 16px; display: flex; gap: 6px; }
.buff { width: 32px; height: 32px; border: 1px solid var(--edge); border-radius: 8px; background: #1d1923; position: relative; overflow: hidden; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
.buff canvas { width: 100%; height: 100%; }
.buff span { position: absolute; bottom: -2px; right: 1px; font: 600 10px Kanit, sans-serif; text-shadow: 0 1px 2px #000; }

/* Minimap and quest tracker float on the world: no plate, a gold-rimmed map and shadowed text. */
#map-panel { background: none; border: 0; box-shadow: none; backdrop-filter: none; text-shadow: 0 1px 2px #000, 0 0 5px rgba(0, 0, 0, 0.9); }
#map-panel .panel-title { border: 0; padding: 0 2px 4px; }
/* Quest tracker: a light glass card with a gold left edge, so it reads as the quest box at a glance. */
#quest-panel { --panel-top: rgba(18, 24, 40, 0.72); --panel-bot: rgba(10, 13, 24, 0.8); border-color: rgba(227, 194, 126, 0.5); border-left: 3px solid var(--gold); border-radius: 10px; }
#quest-panel .panel-title { padding: 6px 10px 5px; gap: 6px; justify-content: flex-start; }
#quest-panel .panel-title canvas { width: 20px; height: 20px; }
#map-panel { top: 12px; right: 12px; width: 220px; }
#minimap { display: block; width: 216px; margin: 0; border-radius: 10px; border: 2px solid rgba(227, 194, 126, 0.75); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 8px 18px rgba(0, 0, 0, 0.5); }
#quest-panel { top: 232px; right: 12px; width: 220px; }
#quest-body { padding: 6px 10px 9px; }
#quest-body { font-size: 13px; }
.quest-name { font: 600 14px Kanit, sans-serif; color: var(--cream); }
.quest-desc { color: var(--muted); font-size: 12px; margin: 2px 0 5px; }
.quest-prog { color: var(--gold); font: 500 13px Kanit, sans-serif; }
.quest-prog.done { color: var(--ok); }

#chat { left: 14px; bottom: 18px; width: 320px; --panel-top: rgba(18, 23, 36, 0.62); --panel-bot: rgba(11, 14, 23, 0.72); border-color: var(--edge); height: 210px; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 2px; padding: 5px 6px 0; border-bottom: 1px solid var(--line-soft); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 3px 6px 4px; cursor: pointer; font: 500 12.5px Kanit, sans-serif; color: var(--muted); }
.tab.active { color: var(--cc, var(--gold)); border-bottom-color: var(--cc, var(--gold)); }
#chat-log { flex: 1; overflow-y: auto; padding: 6px 10px; font-size: 13px; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; user-select: text; }
#chat-log .line { margin: 1px 0; }
/* Each chat channel its own colour, the same on its lines, its tab and the input while it is the one typed to:
   system blue-grey · world orange · map white · party green · whisper pink. */
#chat .tab[data-tab="system"], #chat-log .sys { --cc: #a9c4e0; }
#chat .tab[data-tab="world"], #chat-log .chat-world, #chat-form[data-ch="world"] { --cc: #ffa64d; }
#chat .tab[data-tab="talk"], #chat-log .chat-map, #chat-form[data-ch="map"] { --cc: #f4efe4; }
#chat .tab[data-tab="party"], #chat-log .chat-party, #chat-form[data-ch="party"] { --cc: #7ee08a; }
#chat .tab[data-tab="whisper"], #chat-log .chat-whisper, #chat-form[data-ch="whisper"] { --cc: #ff8fd2; }
#chat .tab:not(.active):hover { color: var(--cc, var(--cream)); }
#chat-log .sys, #chat-log .talk { color: var(--cc); }
#chat-log .talk b, #chat-log .ch-tag { color: var(--cc); font-weight: 600; }
#chat-log .talk .ch-tag { opacity: 0.85; }
#chat-form #chat-input { border-color: color-mix(in srgb, var(--cc, var(--line)) 55%, transparent); }
#chat-form #chat-input:focus { border-color: var(--cc, var(--gold)); }
#chat-log .warn { color: var(--warn); }
#chat-log .loot { color: #9fe3ff; }
#chat-form { display: flex; gap: 6px; padding: 6px; }
#chat-input { flex: 1; padding: 5px 9px; font-size: 13px; }

/* Action bar: no backing plate. Small slots either side of the emblem, a gold rail with wings, the numbered skills below. */
#skillbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
/* Three columns of equal side width, so the emblem sits at the bar's centre whatever each side holds (2 slots left, 4 right). */
.sb-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; align-self: stretch; }
#dock-right { justify-content: flex-start; }
.sb-group { display: flex; gap: 6px; }
#dock-left { justify-content: flex-end; }
/* Six numbered skills: the row is wider than the top one, so the rail and wings stretch to it. */
#dock-main { gap: 8px; }
.sb-emblem { position: relative; z-index: 2; width: 96px; height: 60px; margin-bottom: -22px; background: radial-gradient(circle, #f3dca0 0 14%, #c89a4f 15% 19%, transparent 21%); }
.sb-rail { position: relative; align-self: stretch; height: 10px; margin: 5px -4px 6px; border-radius: 5px;
  background: linear-gradient(90deg, transparent, rgba(227, 194, 126, 0.85) 10%, rgba(227, 194, 126, 0.85) 90%, transparent); }
.sb-wing { position: absolute; bottom: -6px; width: 100px; height: 63px; pointer-events: none; }
.sb-wing.left { right: calc(100% - 2px); }
.sb-wing.right { left: calc(100% - 2px); transform: scaleX(-1); }
.slot { position: relative; width: 44px; height: 44px; flex: none; border: 1px solid rgba(227, 194, 126, 0.6); border-radius: 10px; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, rgba(42, 55, 86, 0.6), rgba(8, 10, 18, 0.6)); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s, filter 0.12s, box-shadow 0.12s; }
#dock-main .slot { width: 58px; height: 58px; border-radius: 12px; }
.slot:hover { transform: translateY(-3px); filter: brightness(1.12); }
.slot:active { transform: translateY(1px); }
.slot canvas { width: 100%; height: 100%; display: block; }
.slot .key { position: absolute; left: 4px; bottom: 1px; font: 700 9px Kanit, sans-serif; color: var(--cream); text-shadow: 0 1px 2px #000, 0 0 3px #000; letter-spacing: 0.02em; }
#dock-main .slot .key { top: 2px; bottom: auto; left: 6px; font-size: 13px; }
.slot .count { position: absolute; bottom: 1px; right: 4px; font: 700 11px Kanit, sans-serif; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(5, 3, 8, 0.72) calc(var(--cd, 0) * 360deg), transparent 0); display: grid; place-items: center; font: 700 15px Kanit, sans-serif; text-shadow: 0 1px 3px #000; }
.slot.off { filter: grayscale(0.8) brightness(0.7); }
.slot.on { box-shadow: 0 0 0 2px var(--ok), 0 0 14px rgba(125, 220, 138, 0.6); }
/* EXP: a hairline along the bottom edge of the screen. */
#exp-line { position: relative; align-self: stretch; height: 5px; margin: 7px 6px 12px; border-radius: 3px; background: rgba(8, 10, 18, 0.35); box-shadow: inset 0 0 0 1px rgba(227, 194, 126, 0.22); }
#exp-line i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, rgba(233, 195, 90, 0.55), rgba(255, 236, 170, 0.8)); transition: width 0.3s; }
#exp-line span { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); font: 600 9.5px Kanit, sans-serif; color: rgba(255, 236, 180, 0.85); text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; }

/* Menu and top buttons: a floating icon with its name under it, no plate; the hotkey sits in a corner. */
#menu { position: absolute; right: 14px; bottom: 16px; display: grid; grid-template-columns: repeat(5, 56px); gap: 4px 6px; }
.menu-btn, .top-btn { position: relative; width: 56px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; padding: 0 0 2px; cursor: pointer;
  font: 600 11px Kanit, sans-serif; color: var(--cream); background: none; border: 0; text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 8px rgba(0, 0, 0, 0.7);
  transition: transform 0.12s, filter 0.12s; }
.menu-btn svg, .top-btn svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--gold); filter: drop-shadow(0 2px 2px #000); }
.menu-btn:hover, .top-btn:hover { transform: translateY(-3px) scale(1.06); filter: brightness(1.15); }
.menu-btn:active, .top-btn:active { transform: translateY(0) scale(0.97); }
.menu-btn .key { position: absolute; top: 0; left: 2px; font: 700 9.5px Kanit, sans-serif; color: var(--gold); }
.top-btn.gem-btn svg { color: #8fd8ff; }
.menu-btn canvas, .top-btn canvas { width: 40px; height: 40px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.6)); }

#prompt { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); padding: 7px 16px; border-radius: 18px; background: rgba(18, 16, 23, 0.85); border: 1px solid var(--line); box-shadow: var(--lift); backdrop-filter: blur(8px); font: 500 14px Kanit, sans-serif; }
#prompt b { color: var(--gold); }
#banner { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font: 700 30px Kanit, sans-serif; color: var(--cream); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 0 24px rgba(227, 194, 126, 0.4); opacity: 0; transition: opacity 0.6s; pointer-events: none; letter-spacing: 0.04em; white-space: nowrap; }
#banner.show { opacity: 1; }
#banner small { display: block; text-align: center; font: 500 14px Kanit, sans-serif; color: var(--gold); }
#death { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; }
.death-title { font: 700 34px Kanit, sans-serif; color: #ff9aa0; text-shadow: 0 2px 14px #000; }
#death-text { color: var(--cream); text-shadow: 0 1px 6px #000; }

.window { left: 50%; top: 50%; transform: translate(-50%, -55%); width: 380px; max-height: calc(100vh - 60px); overflow: hidden; z-index: 20; }
.window .body { padding: 12px 14px 14px; }
.window .close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.window .close:hover { color: #fff; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cell { position: relative; aspect-ratio: 1; border: 1px solid var(--edge); border-radius: 9px; background: var(--well); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35); display: grid; place-items: center; font: 600 11px Kanit, sans-serif; text-align: center; color: var(--muted); }
.cell.filled { color: var(--cream); border-color: rgba(227, 194, 126, 0.3); }
.cell canvas { width: 70%; height: 70%; }
.cell .n { position: absolute; bottom: 1px; right: 3px; font-size: 11px; color: var(--cream); text-shadow: 0 1px 2px #000; }
.rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font: 500 14px Kanit, sans-serif; }
.rows span:nth-child(odd) { color: var(--muted); }
.rows span:nth-child(even) { text-align: right; }
.help li { margin: 3px 0; }
.help kbd { display: inline-block; min-width: 22px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; background: #241f2b; color: var(--gold); font: 600 12px Kanit, sans-serif; text-align: center; }
.dlg-who { display: flex; align-items: center; gap: 10px; }
.dlg-who canvas { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: radial-gradient(circle at 50% 35%, #4a3f56, #1b1720); }
.dlg-text { margin: 10px 0 12px; line-height: 1.6; }
.dlg-quest { border: 1px solid var(--line-soft); border-radius: 5px; padding: 8px 10px; margin-bottom: 12px; background: rgba(10, 8, 14, 0.4); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tooltip { position: fixed; z-index: 40; pointer-events: none; padding: 9px 12px; max-width: 250px; font-size: 12.5px; }
.tooltip b { display: block; font: 600 14px Kanit, sans-serif; color: var(--gold); }

.small { font-size: 12px; }
.menu-btn.alert::after { content: ''; position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 6px #ff5a5a; }
#chat-log .boss { color: #e2a2ff; font-weight: 600; }

/* rarity frames: each .r-<id> gets its --rc from RARITY in data.js (ui.js writes those rules) */
.cell[class*="r-"], .doll-slot[class*="r-"], .av-card[class*="r-"] { border-color: color-mix(in srgb, var(--rc) 70%, transparent); box-shadow: inset 0 0 10px color-mix(in srgb, var(--rc) 25%, transparent); }
.cell.r-apex, .cell.r-omega, .doll-slot.r-apex, .doll-slot.r-omega, .av-card.r-apex, .av-card.r-omega { animation: rare-pulse 2.4s ease-in-out infinite; }
@keyframes rare-pulse { 50% { box-shadow: inset 0 0 16px color-mix(in srgb, var(--rc) 45%, transparent), 0 0 8px color-mix(in srgb, var(--rc) 55%, transparent); } }
.rarity-tag { display: inline-block; padding: 0 6px; border: 1px solid var(--rc); border-radius: 3px; color: var(--rc); font: 700 10px/16px Kanit, sans-serif; letter-spacing: 0.12em; }
.cell.filled { cursor: pointer; }

/* waygate chapter cards */
#win-waygate { width: 760px; display: flex; flex-direction: column; }
/* More chapters than fit on screen: the card list scrolls inside the window, the title and header stay put. */
#win-waygate .body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#win-waygate .wg-list { flex: 1; min-height: 0; overflow-y: auto; grid-auto-rows: max-content; align-content: start; padding-right: 6px; scrollbar-width: thin; scrollbar-color: rgba(227, 194, 126, 0.55) transparent; }
#win-waygate .wg-list::-webkit-scrollbar { width: 6px; }
#win-waygate .wg-list::-webkit-scrollbar-thumb { background: rgba(227, 194, 126, 0.55); border-radius: 3px; }
.wg-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.wg-head > b { font: 600 22px Kanit, sans-serif; color: var(--gold); }
.wg-head span { padding: 3px 12px; border: 1px solid var(--line); border-radius: 14px; font: 500 13px Kanit, sans-serif; color: var(--muted); }
.wg-head span b { color: var(--cream); }
.wg-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
.wg-card { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 16, 23, 0.55), rgba(18, 16, 23, 0.92)), var(--bg, none) center / 160px #2a2331; transition: transform 0.12s, border-color 0.12s; }
.wg-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.wg-card.here { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.wg-card.locked { cursor: not-allowed; filter: grayscale(0.6); }
.wg-card.locked:hover { transform: none; border-color: var(--line); }
.wg-top { display: flex; justify-content: space-between; align-items: center; }
.wg-no { padding: 1px 7px; border: 1px solid var(--line-soft); border-radius: 4px; background: rgba(0, 0, 0, 0.45); font: 600 13px Kanit, sans-serif; }
.wg-state { padding: 1px 8px; border-radius: 10px; font: 600 11.5px Kanit, sans-serif; }
.wg-state.here { background: var(--gold); color: #241f2b; }
.wg-state.lock { background: rgba(255, 90, 90, 0.18); color: #ff9a8a; border: 1px solid rgba(255, 120, 110, 0.4); }
.wg-go { font: 600 12px Kanit, sans-serif; color: var(--gold); }
.wg-name { font: 700 20px Kanit, sans-serif; letter-spacing: 0.03em; text-shadow: 0 2px 4px #000; }
.wg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.wg-chips span { padding: 1px 9px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(0, 0, 0, 0.45); font: 500 12px Kanit, sans-serif; }
.wg-chips .ok { color: #9fe3a8; border-color: rgba(125, 220, 138, 0.5); }
.wg-chips .low { color: #ffb09a; border-color: rgba(255, 138, 106, 0.5); }
.wg-loot { display: flex; gap: 4px; align-items: center; }
.wg-loot i { width: 30px; height: 30px; border: 1px solid var(--edge); border-color: color-mix(in srgb, var(--rc, var(--edge)) 70%, transparent); border-radius: 4px; background: rgba(0, 0, 0, 0.5); display: grid; place-items: center; }
.wg-loot canvas { width: 82%; height: 82%; }
.wg-more { padding: 2px 8px; border: 1px solid var(--line-soft); border-radius: 10px; font: 600 11.5px Kanit, sans-serif; color: var(--muted); }
@media (max-width: 700px) { .wg-list { grid-template-columns: 1fr; } }

/* auto settings */
#win-auto { width: 420px; }
.auto-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 6px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(10, 8, 14, 0.45); cursor: default; }
.auto-row.col { flex-direction: column; align-items: stretch; }
.auto-row b { font: 600 13px Kanit, sans-serif; display: block; }
.auto-row small { color: var(--muted); font-size: 11.5px; }
.auto-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); }
.auto-row input[type=range] { width: 100%; accent-color: var(--gold); }
.seg.wide { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 6px; }
.seg.wide button { padding: 6px 0; font-size: 13px; }

/* boss result */
#win-result { width: 420px; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; }
.result-head { display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(122, 90, 46, 0.45), transparent); }
.result-head small { grid-column: 1; color: var(--gold); font: 500 12px Kanit, sans-serif; }
.result-head > b { grid-column: 1; font: 700 22px Kanit, sans-serif; letter-spacing: 0.04em; }
.result-head span { grid-column: 2; grid-row: 1 / 3; text-align: right; font: 700 26px Kanit, sans-serif; }
.result-head span small { display: block; color: var(--muted); }
.result-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: radial-gradient(circle at 50% 30%, rgba(227, 194, 126, 0.16), transparent 70%); }
.result-card canvas { width: 110px; height: 110px; }
.result-card b { font: 600 16px Kanit, sans-serif; }
.result-card small { color: var(--muted); }
.result-dmg { margin-top: 4px; color: var(--muted); font: 500 13px Kanit, sans-serif; }
.result-dmg b { color: var(--gold); font-size: 18px; }
.result-loot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.result-loot .cell { width: 46px; }
.pill { padding: 4px 10px; border: 1px solid var(--line-soft); border-radius: 12px; font: 600 13px Kanit, sans-serif; }

/* bag: worn look + stats on the left, item grid + detail on the right */
#win-bag { width: 860px; }
#win-bag .panel-title { gap: 14px; }
.bag-money { display: flex; gap: 14px; margin-left: auto; font: 600 13px Kanit, sans-serif; }
.bag-money .gem { color: #7fd0ff; }
.bag-tabs { display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.bag-tab { padding: 6px 20px; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: #1d1923; color: var(--muted); font: 600 14px Kanit, sans-serif; cursor: pointer; }
.bag-tab.on { background: linear-gradient(180deg, #3b3242, #2a2331); color: var(--gold); }
.bag-kind { margin-left: auto; padding-bottom: 4px; font: 600 11px Kanit, sans-serif; letter-spacing: 0.14em; color: var(--muted); }
.bag-wrap { display: grid; grid-template-columns: 270px 1fr; gap: 14px; }
.bag-left { display: flex; flex-direction: column; gap: 6px; padding-right: 14px; border-right: 1px solid var(--line-soft); }
.bag-sub { display: flex; justify-content: space-between; align-items: center; font: 600 13px Kanit, sans-serif; color: var(--gold); margin-bottom: 6px; }
.bag-sub small { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); font: 500 12px Kanit, sans-serif; padding: 2px 10px; cursor: pointer; }
.seg button.on { background: var(--gold); color: #241f2b; }
.doll { display: grid; grid-template-columns: 52px 1fr 52px; gap: 6px; align-items: center; }
.doll-col { display: flex; flex-direction: column; gap: 6px; }
.doll-look { width: 100%; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(circle at 50% 42%, #4a3f56, #17141c); }
.doll-slot { position: relative; width: 52px; aspect-ratio: 1; border: 1px solid var(--edge); border-radius: 6px; background: rgba(10, 8, 14, 0.6); cursor: pointer; display: grid; place-items: center; }
.doll-slot canvas { width: 80%; height: 80%; }
.doll-slot small { position: absolute; bottom: -1px; left: 0; right: 0; text-align: center; font: 500 10px Kanit, sans-serif; color: var(--cream); text-shadow: 0 1px 2px #000; }
.doll-slot.empty canvas { opacity: 0; }
.doll-slot.sel, .cell.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.cap { text-align: center; font: 600 13px Kanit, sans-serif; color: var(--muted); letter-spacing: 0.1em; margin-top: 4px; }
.cap b { font: 700 24px Kanit, sans-serif; color: var(--gold); letter-spacing: 0.02em; margin-left: 6px; }
.who { text-align: center; font: 600 13px Kanit, sans-serif; }
.who small { display: block; color: var(--muted); font-weight: 500; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; font: 500 11px Kanit, sans-serif; color: var(--muted); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 5px 0; }
.trio b { display: block; font: 600 16px Kanit, sans-serif; color: var(--cream); }
.bag-stats { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 2px 8px; font-size: 11.5px; color: var(--muted); }
.bag-stats b { color: var(--cream); font: 600 12.5px Kanit, sans-serif; text-align: right; }
.bag-stats small { font-size: 10.5px; opacity: 0.8; }
.bag-sets { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.bag-sets span { padding: 1px 8px; border: 1px solid var(--line-soft); border-radius: 10px; font: 500 11.5px Kanit, sans-serif; color: var(--muted); }
.bag-sets .set-on, .set-tip .set-on { color: #9fe3a8; border-color: rgba(125, 220, 138, 0.5); }
.set-tip { margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--line-soft); }
.set-tip b { color: #9fe3a8; font: 600 13px Kanit, sans-serif; display: block; }
.doll-col { gap: 5px; }
.bag-right { display: flex; flex-direction: column; min-width: 0; }
.bag-filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.bag-filters button { padding: 3px 10px; border: 1px solid var(--edge); border-radius: 12px; background: #1d1923; color: var(--muted); font: 500 12px Kanit, sans-serif; cursor: pointer; }
.bag-filters button.on { border-color: var(--gold); color: var(--gold); }
.bag-filters .sort { margin-left: auto; }
#win-bag .bag-grid { grid-template-columns: repeat(10, 1fr); gap: 4px; }
.cell.av canvas { width: 92%; height: 92%; }
.cell.locked canvas { filter: grayscale(0.8) brightness(0.55); }
.cell .worn { position: absolute; top: 1px; right: 3px; color: var(--ok, #7ddc8a); font: 700 12px Kanit, sans-serif; }
.bag-detail { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-top: 10px; min-height: 96px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(10, 8, 14, 0.45); font-size: 13px; }
.bag-detail.muted { display: grid; place-items: center; grid-template-columns: 1fr; color: var(--muted); }
.bag-detail b { font: 600 14px Kanit, sans-serif; }
.bag-detail .acts { display: flex; gap: 6px; }

.attr-head { font: 500 14px Kanit, sans-serif; margin-bottom: 8px; color: var(--muted); }
.attr { display: grid; grid-template-columns: 1fr 36px 34px; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.attr b { font: 600 14px Kanit, sans-serif; display: block; }
.attr small { color: var(--muted); font-size: 11.5px; }
.attr span { text-align: center; font: 600 16px Kanit, sans-serif; }
.attr .btn { padding: 2px 0; }

#dialog { width: 430px; }
.shop-tabs { display: flex; justify-content: space-between; align-items: center; font: 600 14px Kanit, sans-serif; margin-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.shop-list { max-height: min(360px, calc(100vh - 330px)); overflow-y: auto; margin-bottom: 12px; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
.shop-head { font: 600 13px Kanit, sans-serif; color: var(--gold); margin: 8px 0 4px; }
.shop-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; padding: 5px 6px; border: 1px solid var(--edge); border-left: 3px solid var(--rc); border-radius: 5px; margin-bottom: 4px; background: rgba(10, 8, 14, 0.45); }
.shop-row canvas { width: 36px; height: 36px; }
.shop-name b { display: block; font: 500 13.5px Kanit, sans-serif; color: var(--rc); }
.shop-name small { color: var(--muted); font-size: 11.5px; }

#bossbar { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: min(520px, 46vw); text-align: center; }
.boss-name { font: 700 16px Kanit, sans-serif; color: #f0c8ff; text-shadow: 0 2px 6px #000, 0 0 12px rgba(200, 120, 255, 0.5); margin-bottom: 3px; }
.bar.boss { height: 18px; border: 1px solid var(--line); }
.bar.boss i { background: linear-gradient(180deg, #d98aff, #8e3fc4 55%, #5a1f86); }
#castbar { position: absolute; left: 50%; bottom: 168px; transform: translateX(-50%); width: 220px; text-align: center; }
.cast-label { font: 500 13px Kanit, sans-serif; text-shadow: 0 1px 4px #000; margin-bottom: 3px; }

.slot .lock { position: absolute; inset: 0; display: none; place-items: center; background: rgba(5, 3, 8, 0.72); font: 700 11px Kanit, sans-serif; color: var(--muted); }
.slot.locked .lock { display: grid; }
.slot.locked canvas { filter: grayscale(1) brightness(0.5); }
#win-skills { width: 520px; }
.skill-row { display: grid; grid-template-columns: 46px 1fr 64px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.skill-row canvas { width: 46px; height: 46px; border: 1px solid var(--edge); border-radius: 6px; background: radial-gradient(circle at 50% 40%, #2f2836, #141118); }
.skill-row.locked canvas { filter: grayscale(0.9) brightness(0.6); }
.skill-info b { font: 600 14px Kanit, sans-serif; display: block; }
.skill-info small { display: block; font-size: 12px; }
.skill-info .next { color: var(--ok); }
.skill-lv { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 14px Kanit, sans-serif; }
.skill-lv .btn { width: 100%; }
#win-quests { width: 420px; }
.quest-daily { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--line-soft); }
#win-map { width: auto; }
#worldmap { display: block; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.6); cursor: crosshair; margin-bottom: 6px; }
.bounty { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--edge); border-radius: 5px; margin-bottom: 4px; background: rgba(10, 8, 14, 0.45); }
.bounty.done, .bounty.locked { opacity: 0.55; }
.bounty.ready { border-color: var(--ok); }
.bounty b { display: block; font: 500 13.5px Kanit, sans-serif; }
.bounty small { color: var(--muted); font-size: 11.5px; }

.gem, .gem b { color: #8fd8ff !important; }
.pf-meta { gap: 8px; }
.plus { color: #ffd27a; font: 700 12px Kanit, sans-serif; }
#top-buttons { position: absolute; top: 14px; right: 262px; display: flex; gap: 6px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e2474f; color: #fff; font: 700 11px/18px Kanit, sans-serif; font-style: normal; box-shadow: 0 0 6px rgba(226, 71, 79, 0.7); }
#win-mail { width: 600px; }
.mail-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }
.mail-list { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; scrollbar-width: thin; }
.mail-list .btn { margin-top: 6px; }
.mail-item { padding: 6px 8px; border: 1px solid var(--edge); border-radius: 5px; background: rgba(10, 8, 14, 0.45); cursor: pointer; }
.mail-item.active { border-color: var(--gold); }
.mail-item.unread b::before { content: '● '; color: #e2474f; }
.mail-item.claimed { opacity: 0.55; }
.mail-item b { display: block; font: 500 13px Kanit, sans-serif; }
.mail-item small { color: var(--muted); font-size: 11.5px; }
.mail-read .btn { float: right; }
#win-events { width: 560px; }
.login-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.login-day { position: relative; min-height: 78px; padding: 6px 4px; border: 1px solid var(--edge); border-radius: 6px; background: rgba(10, 8, 14, 0.5); text-align: center; font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.login-day small { color: var(--gold); font: 600 11px Kanit, sans-serif; }
.login-day.today { border-color: var(--gold); box-shadow: 0 0 12px rgba(227, 194, 126, 0.35); }
.login-day.done { opacity: 0.5; }
.login-day i { position: absolute; bottom: 4px; right: 6px; color: var(--ok); font-style: normal; font-weight: 700; }
/* Gem shop: a wide window that always fits the screen (centred, never taller than the view); only the card list scrolls. */
#win-gems { width: min(920px, calc(100vw - 32px)); top: 50%; transform: translate(-50%, -50%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
#win-gems .gs-body { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 12px 18px 16px; }
#win-gems .gs-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 6px 4px 2px; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
#win-gems .bag-filters { align-items: center; margin-bottom: 10px; }
#win-gems .bag-filters button { padding: 4px 14px; font-size: 13px; }
.gs-note { margin-left: auto; font: 500 12px Kanit, sans-serif; color: var(--muted); }
.av-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; }
.av-shop .av-card { padding: 10px 10px 12px; gap: 6px; border-radius: 12px; background: linear-gradient(180deg, rgba(40, 32, 52, 0.85), rgba(14, 11, 20, 0.92)); transition: transform 0.15s, box-shadow 0.15s; }
.av-shop .av-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), 0 0 14px color-mix(in srgb, var(--rc, #e3c27e) 35%, transparent); }
.av-shop .av-card canvas { border-radius: 10px; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc, #6a5a80) 30%, #2c2436), #120f17 75%); }
.av-shop .av-card .rarity-tag { position: absolute; top: 14px; left: 14px; z-index: 2; }
.av-shop .av-card b { font-size: 14px; line-height: 1.25; min-height: 1.25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.av-shop .av-card .btn { width: 100%; padding: 6px 0; font-size: 13px; }
.av-shop .av-card.owned .btn { color: var(--ok); opacity: 1; }
.av-shop .av-card .av-zoom { top: 14px; right: 14px; }
#win-gems .gs-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }

.av-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; border: 1px solid var(--edge); border-radius: 6px; background: rgba(10, 8, 14, 0.6); cursor: pointer; text-align: center; }
.av-card canvas { width: 100%; aspect-ratio: 1; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #3a3044, #141118); }
.av-card b { font: 600 13px Kanit, sans-serif; }
.av-card small { font-size: 11.5px; color: var(--muted, #a99f8c); }
.av-card.worn { outline: 2px solid var(--gold); }
.av-card.locked canvas { filter: grayscale(0.7) brightness(0.6); }
.topup { display: flex; gap: 8px; margin-bottom: 8px; }
.topup .btn { flex: 1; }
.guard { margin-left: 10px; cursor: pointer; }
#dialog .shop-list + .shop-head, #dialog .body > .shop-head { margin-top: 10px; }

.set-row { display: grid; grid-template-columns: 1fr 160px 44px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font: 500 14px Kanit, sans-serif; cursor: pointer; }
.set-row input[type="range"] { accent-color: var(--gold); width: 100%; }
.set-row input[type="checkbox"] { accent-color: var(--gold); width: 18px; height: 18px; justify-self: start; }
.set-row b { color: var(--gold); text-align: right; }

#joystick { display: none; position: absolute; left: 28px; bottom: 120px; width: 130px; height: 130px; border-radius: 50%; touch-action: none;
  background: radial-gradient(circle, rgba(36, 31, 43, 0.35), rgba(18, 16, 23, 0.6)); border: 1px solid var(--line); }
#joystick i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f3e3b8, var(--gold) 55%, #7d6a45); box-shadow: 0 0 12px rgba(227, 194, 126, 0.6); }
#talk-btn { display: none; }
@media (pointer: coarse) {
  #joystick { display: block; }
  #talk-btn:not([hidden]) { display: block; position: absolute; right: 24px; bottom: 210px; width: 70px; height: 70px; border-radius: 50%;
    font: 600 16px Kanit, sans-serif; color: var(--cream); background: radial-gradient(circle at 50% 35%, #3a3044, #17141c); border: 1px solid var(--gold); }
  #chat { display: none; }
  canvas#world { touch-action: none; }
}

/* Phones (portrait): compact profile and map, two-row skill bar, menu in a column on the right. */
@media (max-width: 700px) {
  #profile { width: 196px; padding: 6px; gap: 6px; }
  #portrait { width: 44px; height: 44px; }
  .pf-name { font-size: 13px; }
  #map-panel { width: 128px; top: 8px; right: 8px; }
  #minimap { width: 112px !important; height: auto !important; margin: 6px; }
  #map-panel .panel-title #coords { display: none; }
  #quest-panel { display: none; }
  #top-buttons { top: 168px; right: 8px; flex-direction: column; }
  .top-btn { width: 52px; height: 48px; font-size: 10.5px; }
  #skillbar { bottom: 12px; }
  .slot { width: 38px; height: 38px; }
  .sk-list { grid-template-columns: 1fr; }
  #dock-main { gap: 5px; }
  #dock-main .slot { width: 46px; height: 46px; }
  .sb-wing { display: none; }
  #menu { right: 8px; bottom: 170px; grid-template-columns: repeat(2, 50px); gap: 5px; }
  .menu-btn { width: 50px; height: 48px; }
  #joystick { bottom: 170px; left: 14px; width: 116px; height: 116px; }
  .window, #dialog, #win-bag, #win-mail, #win-events { width: calc(100vw - 16px) !important; max-height: calc(100vh - 40px); overflow-y: auto; }
  .bag-wrap { grid-template-columns: 1fr; }
  .bag-left { padding-right: 0; border-right: 0; }
  #win-bag .bag-grid { grid-template-columns: repeat(6, 1fr); }
  .bag-money .gem { display: none; }
  .bag-wrap, .mail-wrap { grid-template-columns: 1fr; }
  #title-screen .title-card { width: calc(100vw - 16px); padding: 16px; }
  .class-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .class-card p, .class-card .stats { display: none; }
  .logo { font-size: 36px; }
}

/* The chat steps up above the action bar once they would meet. */
@media (max-width: 1279px) { #chat { width: 270px; height: 160px; bottom: 104px; } }
@media (max-width: 1100px) {
  #menu { grid-template-columns: repeat(3, 56px); }
}

/* Short screens: a window never runs off the screen; it scrolls inside as a last resort. */
@media (max-height: 720px) { .window { max-height: calc(100vh - 16px); overflow-y: auto; } }

/* shop window: list on the left, the picked item on the right */
#win-shop { width: 820px; }

/* ---------- Town notice board: a quiet two-column list in the game's own glass-and-gold ---------- */
#win-board { width: min(760px, calc(100vw - 24px)); }
#win-board .bd-town { margin-right: auto; color: var(--cream); font: 500 13px Kanit, sans-serif; }
.board-body { display: flex; flex-direction: column; gap: 10px; }
.bd-meta { display: flex; gap: 18px; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.bd-meta b { color: var(--cream); font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd-row { --kind: rgba(227, 194, 126, 0.6); display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px 8px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 2px 0 0 var(--kind); transition: background 0.15s, border-color 0.15s; }
.bd-row:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(227, 194, 126, 0.25); }
.bd-row.k-hunt { --kind: #d0705f; } .bd-row.k-collect { --kind: #7cbf86; } .bd-row.k-champ { --kind: #e0b35a; } .bd-row.k-boss { --kind: #a98bd8; }
.bd-pic { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25)); }
.bd-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bd-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.bd-name b { font: 500 13.5px Kanit, sans-serif; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-name em { font-style: normal; font-size: 10.5px; color: var(--kind); white-space: nowrap; }
.bd-main small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-reward { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #b9cfe6; }
.bd-gold { color: var(--gold); }
.cur { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.cur .ci-icon { width: 1.35em; height: 1.35em; margin: -0.25em 0; }
.bd-item { display: inline-flex; align-items: center; gap: 1px; color: var(--cream); }
.bd-item .ci-icon { width: 16px; height: 16px; margin: -3px 0; }
.bd-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 3px; }
.bd-bar i { display: block; height: 100%; background: var(--kind); border-radius: 2px; }
.bd-act { display: flex; align-items: center; gap: 6px; }
.bd-prog { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bd-btn { min-width: 46px; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(227, 194, 126, 0.55); background: transparent;
  color: var(--gold); font: 500 12.5px Kanit, sans-serif; cursor: pointer; transition: background 0.15s; }
.bd-btn:hover { background: rgba(227, 194, 126, 0.12); }
.bd-btn.ok { border-color: transparent; background: #3f9a52; color: #fff; }
.bd-btn.ok:hover { background: #48ad5d; }
.bd-btn.ghost { min-width: 32px; padding: 4px 8px; border-color: rgba(185, 230, 255, 0.35); color: #b9e6ff; }
.bd-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px; }
.bd-x:hover { color: #ff8a7a; }
.bd-done { color: #7cbf86; font-size: 15px; padding: 0 12px; }
.bd-lv { font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.bd-row.s-done, .bd-row.s-locked { opacity: 0.45; }
.bd-row.s-ready { border-color: rgba(124, 191, 134, 0.5); background: rgba(63, 154, 82, 0.08); }
.bd-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); margin: 24px 0; }
@media (max-width: 620px) { .bd-list { grid-template-columns: 1fr; } }
.shop-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.shop-who { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: radial-gradient(circle at 50% 35%, #4a3f56, #1b1720); flex: none; }
.shop-top .dlg-text { margin: 0; font-size: 13px; }
.shop-wrap { display: grid; grid-template-columns: 1fr 290px; gap: 12px; }
.shop-wrap.wide { grid-template-columns: 1fr; }
.shop-left { min-width: 0; }
.shop-bulk { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shop-items { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.shop-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border: 1px solid var(--edge); border-left: 3px solid var(--rc, var(--edge)); border-radius: 5px; background: rgba(10, 8, 14, 0.45); cursor: pointer; }
.shop-item:hover { background: rgba(227, 194, 126, 0.08); }
.shop-item.sel { border-color: var(--gold); background: rgba(227, 194, 126, 0.12); }
.shop-item.poor .shop-price .gold { color: #ff8a6a; }
.shop-item canvas { width: 36px; height: 36px; }
.shop-item .shop-name small { display: block; }
.shop-item .warn, .shop-total .warn { color: #ff8a6a; }
.shop-price { text-align: right; font: 600 13px Kanit, sans-serif; white-space: nowrap; }
.shop-price small { display: block; color: var(--muted); font-weight: 500; }
.shop-detail { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(10, 8, 14, 0.45); font-size: 13px; }
.shop-detail.muted { place-items: center; justify-content: center; color: var(--muted); }
.shop-big { display: flex; flex-direction: column; align-items: center; }
.shop-big canvas { width: 72px; height: 72px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #3a3044, #141118); }
.qty { display: grid; grid-template-columns: auto 1fr auto; gap: 4px; }
.qty-presets { display: flex; gap: 4px; }
.qty-presets .btn { flex: 1; padding: 3px 4px; font-size: 12px; }
.qty-presets .btn.on { border-color: var(--gold); color: var(--gold); }
.qty .btn { padding: 4px 7px; }
.qty input { width: 100%; min-width: 0; text-align: center; background: rgba(10, 8, 14, 0.7); border: 1px solid var(--line); border-radius: 5px; color: var(--cream); font: 600 14px Kanit, sans-serif; }
.shop-info > b:first-child { display: block; font: 600 14px Kanit, sans-serif; }
.shop-total { display: flex; justify-content: space-between; font: 500 13px Kanit, sans-serif; border-top: 1px solid var(--line-soft); padding-top: 6px; }
.shop-total b { font-size: 17px; }
.shop-acts { display: flex; gap: 6px; }
.shop-acts .btn { flex: 1; }
@media (max-width: 700px) { .shop-wrap { grid-template-columns: 1fr; } }

/* avatar preview: a magnifier on cards opens a turning, animated look at the character wearing it */
.av-card, .cell.av { position: relative; }
.av-zoom { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 3px; border: 1px solid var(--line); border-radius: 50%; background: rgba(18, 16, 23, 0.85); cursor: pointer; z-index: 2; display: grid; place-items: center; }
.av-zoom svg { width: 14px; height: 14px; fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; }
.av-zoom:hover { background: var(--gold); }
.av-zoom:hover svg { stroke: #241f2b; }
.cell.av .av-zoom { top: 2px; right: 2px; width: 18px; height: 18px; padding: 2px; }
.cell.av .av-zoom svg { width: 11px; height: 11px; }
.cell.av .worn { right: auto; left: 3px; }
#win-preview { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 640px; max-width: calc(100vw - 16px); z-index: 40; }
.pv { display: grid; grid-template-columns: 1fr 230px; gap: 12px; align-items: start; }
.pv-stage { width: 100%; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(circle at 50% 45%, #4a3f56, #141118); }
.pv-side { display: flex; flex-direction: column; gap: 6px; }
.pv-name { display: block; font: 700 19px Kanit, sans-serif; margin-top: 4px; }
.seg.wide.pv-poses { grid-template-columns: repeat(4, 1fr); }
.pv-turn { display: grid; grid-template-columns: auto 1fr auto; gap: 4px; }
.pv-turn .btn.on { border-color: var(--gold); color: var(--gold); }
@media (max-width: 700px) { .pv { grid-template-columns: 1fr; } }
/* ---------- painted frame kit (html.kit, set `uikit`, pieces in --ui-*) ---------- */
.kit .window::before, .kit .window::after, .kit #win-preview::before, .kit #win-preview::after {
  content: ''; position: absolute; top: -1px; width: 58px; height: 62px; z-index: 3; pointer-events: none;
  background: var(--ui-corner) left top / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.kit .window::before, .kit #win-preview::before { left: -1px; }
.kit .window::after, .kit #win-preview::after { right: -1px; transform: scaleX(-1); }
.kit .window > .panel-title, .kit #win-preview > .panel-title { position: relative; border-bottom: 0; padding-left: 26px; padding-right: 18px; }
.kit .window[style*="--icon"] > .panel-title { padding-left: 58px; background: var(--icon) 30px center / 22px no-repeat; }
.kit .window > .panel-title::before, .kit #win-preview > .panel-title::before {
  content: ''; position: absolute; left: 50%; top: 0; width: 84px; height: 26px; transform: translateX(-50%); pointer-events: none;
  background: var(--ui-crest) center top / contain no-repeat; }
.kit .window > .panel-title::after, .kit #win-preview > .panel-title::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -5px; height: 10px; pointer-events: none;
  background: var(--ui-divider) center / auto 10px no-repeat, linear-gradient(90deg, transparent, rgba(227, 194, 126, 0.4), transparent) center / 100% 1px no-repeat; }
.kit .window .close, .kit #win-preview .close { width: 26px; height: 26px; padding: 0; border: 0; font-size: 0; color: transparent; cursor: pointer; flex: none;
  background: var(--ui-close) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.kit .window .close:hover, .kit #win-preview .close:hover { filter: brightness(1.2) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }


.kit .slot { border: 0; background: var(--ui-sframe) center / 100% 100% no-repeat, radial-gradient(circle at 50% 40%, rgba(42, 55, 86, 0.6), rgba(8, 10, 18, 0.6)) center / 86% 86% no-repeat; }
.kit .slot canvas { width: 80%; height: 80%; margin: 10%; }
/* (The bar slot's rim ends 9.6% in.) */
.kit .slot canvas.c2-art { width: 81%; height: 81%; margin: 9.5%; border-radius: 6px; }
.kit .slot .lock { inset: 10%; border-radius: 6px; background: rgba(5, 8, 16, 0.55); }
.kit .slot .cd { inset: 10%; border-radius: 6px; }
.kit .sb-emblem { background: var(--ui-emblem) center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.kit .sb-rail { height: 14px; background: none; border: solid transparent; border-width: 0 15px; border-image: var(--ui-rail) 0 32 fill / 0 15px stretch; }
.kit .sb-wing { background: var(--ui-wing) right bottom / contain no-repeat; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45)); }
.kit #portrait { border: 0; box-shadow: none; }
.kit #profile::after { content: ''; position: absolute; left: 3px; top: 50%; width: 74px; height: 81px; transform: translateY(-46%); pointer-events: none;
  background: var(--ui-ring) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.kit .skill-row canvas { border: 0; padding: 4px; background: var(--ui-slot) center / 100% 100% no-repeat; }
/* gem shop: bundle cards with painted icons (set `gemshop`) */
.gs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.gs-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; text-align: center; border: 1px solid var(--edge); border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, rgba(80, 110, 170, 0.22), transparent 70%), var(--well); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); transition: transform 0.1s, border-color 0.12s; }
.gs-card:hover { transform: translateY(-2px); border-color: rgba(227, 194, 126, 0.55); }
.gs-card canvas { width: 64px; height: 64px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.45)); }
.gs-card b { font: 600 13px Kanit, sans-serif; line-height: 1.25; }
.gs-card small { color: var(--muted); font-size: 11px; min-height: 2.4em; }
.gs-card .btn { width: 100%; margin-top: 4px; }
.gs-top { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px 8px; }
.gs-top canvas { width: 54px; height: 54px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45)); }
/* ---------- motion & feedback (juice.js) ---------- */
.window:not([hidden]), #win-preview:not([hidden]) { animation: win-in 0.17s ease-out; }
@keyframes win-in { from { opacity: 0; scale: 0.96; } to { opacity: 1; scale: 1; } }
.body.tab-in > :not(.bag-tabs) { animation: tab-in 0.22s ease-out; }
@keyframes tab-in { from { opacity: 0; translate: 14px 0; } to { opacity: 1; translate: 0 0; } }
.ticking { color: #fff2c4 !important; text-shadow: 0 0 6px rgba(255, 220, 120, 0.8); }

#toasts { position: fixed; right: 16px; bottom: 150px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.toast { --tc: rgba(227, 194, 126, 0.55); display: flex; align-items: center; gap: 8px; max-width: 320px; padding: 6px 12px 6px 8px; border-radius: 10px; font: 500 13px Kanit, sans-serif;
  background: linear-gradient(90deg, rgba(14, 18, 30, 0.92), rgba(24, 31, 50, 0.86)); border: 1px solid var(--tc); border-left: 3px solid var(--tc);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 14px color-mix(in srgb, var(--tc) 35%, transparent); animation: toast-in 0.28s cubic-bezier(.2, 1.4, .5, 1); }
.toast canvas { width: 30px; height: 30px; flex: none; }
.toast.warn { --tc: #ff8a7a; }
.toast.good { --tc: #7ddc8a; }
.toast.out { opacity: 0; translate: 24px 0; transition: opacity 0.3s, translate 0.3s; }
@keyframes toast-in { from { opacity: 0; translate: 40px 0; } to { opacity: 1; translate: 0 0; } }

#popcards { position: fixed; left: 50%; top: 24%; z-index: 46; translate: -50% 0; pointer-events: none; }
.popcard { position: relative; min-width: 300px; padding: 16px 28px 14px; text-align: center; border-radius: 16px; border: 1px solid rgba(227, 194, 126, 0.6);
  background: radial-gradient(ellipse at 50% 0%, rgba(80, 110, 170, 0.45), transparent 70%), linear-gradient(180deg, rgba(24, 31, 50, 0.95), rgba(10, 13, 24, 0.95));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(227, 194, 126, 0.25); animation: pop-in 0.42s cubic-bezier(.2, 1.5, .4, 1); }
.popcard > small { display: block; font: 700 12px Kanit, sans-serif; letter-spacing: 0.3em; color: var(--gold); }
.popcard > b { display: block; font: 800 30px/1.2 Kanit, sans-serif; color: #fff6d8; text-shadow: 0 2px 10px rgba(227, 194, 126, 0.6); }
.popcard .pc-sub { display: block; color: var(--muted); font-size: 13px; }
.popcard.level > b { font-size: 40px; background: linear-gradient(180deg, #fff6d2, #f0c45a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.popcard.quest { border-color: rgba(125, 220, 138, 0.7); }
.popcard.quest > small { color: var(--ok); }
.pc-burst { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; translate: -50% -50%; z-index: -1;
  box-shadow: 0 0 0 0 rgba(255, 220, 120, 0.6); animation: burst 0.9s ease-out forwards; }
@keyframes burst { to { box-shadow: 0 0 0 220px rgba(255, 220, 120, 0); } }
.pc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.pc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 12px; font: 600 12.5px Kanit, sans-serif; color: var(--cream);
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(227, 194, 126, 0.35); }
.popcard .pc-chip { opacity: 0; animation: chip-in 0.3s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes chip-in { from { opacity: 0; scale: 0.5; } to { opacity: 1; scale: 1; } }
@keyframes pop-in { from { opacity: 0; scale: 0.7; } to { opacity: 1; scale: 1; } }
.popcard.out { opacity: 0; translate: 0 -14px; transition: opacity 0.4s, translate 0.4s; }
.ci { font-style: normal; font-size: 11px; }
/* A reward item's own icon in its chip. */
.ci-icon { width: 22px; height: 22px; margin: -3px 0 -3px -4px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.popcard .ci-icon { width: 28px; height: 28px; }
.ci.exp { color: #b9e6ff; } .ci.gold { color: var(--gold); } .ci.gem { color: #8fd8ff; } .ci.hp { color: #ff8a8f; }

.fly-coin { position: fixed; z-index: 60; pointer-events: none; font: 700 15px Kanit, sans-serif; color: var(--gold); text-shadow: 0 0 6px rgba(255, 210, 90, 0.9), 0 1px 2px #000; translate: -50% -50%; }

/* ---------- NPC dialog: a visual-novel box above the action bar ---------- */
#dialog { left: 50%; top: auto; bottom: 168px; transform: translateX(-50%); width: min(820px, calc(100vw - 24px)); max-height: none; overflow: visible; padding: 0 0 0 200px; min-height: 170px; }
#dialog .dlg-bust { position: absolute; left: 0; bottom: 0; width: 210px; height: 250px; pointer-events: none; }
#dialog .dlg-bust canvas { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
#dialog .dlg-name { position: absolute; left: 186px; top: -16px; display: flex; align-items: baseline; gap: 8px; padding: 4px 16px; border-radius: 10px; z-index: 4;
  background: linear-gradient(180deg, #f1d79c, #c89a4f); color: #2a1d0c; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }
#dialog .dlg-name b { font: 700 15px Kanit, sans-serif; }
#dialog .dlg-name small { font: 500 11.5px Kanit, sans-serif; opacity: 0.75; }
#dialog > .close { position: absolute; right: 10px; top: 10px; z-index: 4; }
#dialog .dlg-main { display: grid; grid-template-columns: 1fr 210px; gap: 14px; padding: 24px 16px 14px 0; }
#dialog .dlg-text { margin: 0 0 10px; font-size: 15px; line-height: 1.65; min-height: 3.3em; cursor: pointer; }
#dialog .dlg-text.typing::after { content: '▍'; color: var(--gold); animation: blink 0.7s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
#dialog .dlg-quest { margin-bottom: 0; }
#dialog .shop-list { max-height: 200px; }
/* The town board: two columns of compact notices, all in view (a dialog never scrolls). */
#dialog .board-list { max-height: none; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#dialog .board-list .bounty { margin: 0; padding: 4px 6px; gap: 4px; }
#dialog .board-list .bounty b { font-size: 12.5px; }
#dialog .board-list .bounty small { font-size: 10.5px; display: block; line-height: 1.25; }
#dialog .board-list .qc-rewards { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
#dialog .board-list .pc-chip { font-size: 10.5px; padding: 0 6px; }
#dialog .board-list .ci-icon { width: 16px; height: 16px; }
@media (max-width: 700px) { #dialog .board-list { grid-template-columns: 1fr; } }
.dlg-choices { display: flex; flex-direction: column; gap: 6px; align-self: end; }
.dlg-choice { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 10px; cursor: pointer; text-align: left; font: 500 14px Kanit, sans-serif; color: var(--cream);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--edge); transition: translate 0.12s, background 0.12s, border-color 0.12s; }
.dlg-choice:hover:not(:disabled) { translate: 4px 0; border-color: rgba(227, 194, 126, 0.6); background: rgba(227, 194, 126, 0.1); }
.dlg-choice.main { border-color: rgba(227, 194, 126, 0.6); background: linear-gradient(90deg, rgba(227, 194, 126, 0.22), rgba(227, 194, 126, 0.05)); }
.dlg-choice.bye { color: var(--muted); }
.dlg-choice:disabled { opacity: 0.45; cursor: default; }
.dlg-choice canvas { width: 26px; height: 26px; flex: none; }
.dlg-choice i { width: 26px; text-align: center; font-style: normal; color: var(--gold); font-size: 18px; }
@media (max-width: 700px) { #dialog { padding-left: 0; bottom: 150px; } #dialog .dlg-bust { display: none; } #dialog .dlg-name { left: 12px; } #dialog .dlg-main { grid-template-columns: 1fr; padding-left: 14px; } }

/* ---------- quests ---------- */
#win-quests { width: 480px; }
.qlist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.qcard { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--edge); background: var(--well); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.qcard.ready { border-color: rgba(125, 220, 138, 0.6); box-shadow: 0 0 14px rgba(125, 220, 138, 0.2); }
.qcard.next { border-style: dashed; border-color: rgba(227, 194, 126, 0.5); }
.qc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qc-head b { font: 600 15px Kanit, sans-serif; }
.qc-state { font: 600 11px Kanit, sans-serif; padding: 1px 8px; border-radius: 10px; background: rgba(227, 194, 126, 0.15); color: var(--gold); }
.qcard.ready .qc-state { background: rgba(125, 220, 138, 0.18); color: var(--ok); }
.qc-desc { color: var(--muted); font-size: 12.5px; margin: 3px 0 6px; }
/* The main quest's steps: done ones ticked green, the current one gold with its twist underneath. */
.qc-head .qc-ch { font: 500 11px Kanit, sans-serif; color: var(--muted); margin-right: auto; white-space: nowrap; }
.qc-head .qc-ch + b { margin-right: auto; }
.qc-steps, .dlg-steps { list-style: none; margin: 2px 0 8px; padding: 0; display: grid; gap: 3px; }
.qc-steps li { display: grid; grid-template-columns: 14px 1fr; gap: 6px; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.qc-steps li i { font-style: normal; text-align: center; }
.qc-steps li small { display: block; color: #ffb38a; font-size: 11.5px; }
.qc-steps li.ok { color: #8fe0a0; }
.qc-steps li.now { color: var(--gold); font-weight: 600; }
.dlg-steps li { font-size: 12.5px; color: var(--muted); padding-left: 14px; position: relative; }
.dlg-steps li::before { content: '•'; position: absolute; left: 3px; color: var(--gold); }
.dlg-steps li small { color: #ffb38a; }
.q-timer { color: #ffb38a; font-weight: 600; margin-left: 6px; }
.qc-prog { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font: 500 12.5px Kanit, sans-serif; }
.qbar { height: 7px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); overflow: hidden; }
.qbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #c89a4f, #ffe08a); transition: width 0.4s; }
.qcard.ready .qbar i, #quest-panel.done .qbar i { background: linear-gradient(90deg, #4fae62, #a6f0b2); }
.qc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.qc-rewards { display: flex; flex-wrap: wrap; gap: 4px; }
.qc-rewards .pc-chip { font-size: 11.5px; padding: 1px 8px; }
.qc-empty { padding: 20px; text-align: center; color: var(--muted); }
.qc-sum { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.tab-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); vertical-align: middle; }

#quest-panel { cursor: pointer; transition: box-shadow 0.2s; }
#quest-panel:hover { border-color: rgba(227, 194, 126, 0.85); }
#quest-panel .qbar { margin-top: 4px; height: 5px; }
#quest-panel.bump { animation: q-bump 0.5s ease-out; }
@keyframes q-bump { 30% { box-shadow: var(--lift), 0 0 18px rgba(255, 220, 120, 0.7); scale: 1.03; } }
#quest-panel.done { border-color: rgba(125, 220, 138, 0.7); border-left-color: var(--ok); box-shadow: var(--lift), 0 0 14px rgba(125, 220, 138, 0.35); }
.q-go { margin-left: 6px; padding: 0 7px; border: 1px solid rgba(227, 194, 126, 0.5); border-radius: 8px; background: rgba(227, 194, 126, 0.12); color: var(--gold); cursor: pointer; font: 700 12px Kanit, sans-serif; }
.q-go:hover { background: var(--gold); color: #2a1d0c; }
.quest-daily { cursor: pointer; }

/* ---------- shop & forge ---------- */
.cap-d { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; font: 700 10.5px Kanit, sans-serif; }
.cap-d.up { color: #9fe3a8; background: rgba(125, 220, 138, 0.14); }
.cap-d.down { color: #ff9a8a; background: rgba(255, 120, 100, 0.12); }
.btn.poor { filter: grayscale(0.6) brightness(0.8); }
.rate { height: 4px; margin-top: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.45); overflow: hidden; max-width: 260px; }
.rate i { display: block; height: 100%; border-radius: 2px; }
.shop-item.forging { animation: forge-shake 0.16s linear infinite; }
.shop-item.forging canvas { filter: brightness(1.6) drop-shadow(0 0 8px #ffd27a); }
@keyframes forge-shake { 25% { translate: -2px 0; } 75% { translate: 2px 0; } }
.shop-item.forge-ok { animation: forge-ok 0.8s ease-out; }
@keyframes forge-ok { 0% { box-shadow: 0 0 0 0 rgba(255, 220, 120, 0.9); background: rgba(255, 220, 120, 0.35); } 100% { box-shadow: 0 0 0 18px rgba(255, 220, 120, 0); } }
.shop-item.forge-fail { animation: forge-fail 0.6s ease-out; }
@keyframes forge-fail { 0%, 40% { background: rgba(255, 90, 80, 0.3); } 10% { translate: -6px 0; } 20% { translate: 6px 0; } 30% { translate: -4px 0; } 40% { translate: 0 0; } }
/* ---------- button colours say what they do: gold = main, green = complete/claim, blue = go/open, red = danger, dark = neutral ---------- */
.btn.ok { background: linear-gradient(180deg, #8fe09a, #3f9c50); border-color: #b8f0c0; color: #0d2a12; font-weight: 600; }
.btn.go { background: linear-gradient(180deg, #8cc4ff, #3a72c8); border-color: #bcdcff; color: #08203f; font-weight: 600; }
.btn.danger { background: linear-gradient(180deg, #ff9a8f, #c0443a); border-color: #ffc4bc; color: #3a0b06; font-weight: 600; }
/* With the painted kit every button is a gem-capped pill (9-sliced so it stretches to any label). */
.kit .btn { border: solid transparent; border-width: 0 20px; border-radius: 0; padding: 8px 2px; background: none; box-shadow: none; color: #f3ecdc;
  border-image: var(--ui-btn_dark) 0 62 fill / 0 20px stretch; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4)); transition: filter 0.12s, transform 0.08s; }
.kit .btn.small { border-width: 0 14px; border-image-width: 0 14px; padding: 4px 1px; }
.kit .btn.primary, .kit .btn.on { border-image-source: var(--ui-btn_gold); color: #3a2405; text-shadow: 0 1px 0 rgba(255, 244, 210, 0.7); }
.kit .btn.ok { border-image-source: var(--ui-btn_green); color: #fff; text-shadow: 0 1px 2px #0b3a14; }
.kit .btn.go { border-image-source: var(--ui-btn_blue); color: #fff; text-shadow: 0 1px 2px #08244a; }
.kit .btn.danger { border-image-source: var(--ui-btn_red); color: #fff; text-shadow: 0 1px 2px #4a0b06; }
.kit .btn:hover:not(:disabled) { filter: brightness(1.13) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); transform: translateY(-1px); }
.kit .btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(0.95); }
.kit .btn:disabled { filter: grayscale(0.85) brightness(0.65); }
.kit .btn.poor { filter: grayscale(0.6) brightness(0.75); }

/* ---------- NPC dialog, dressed ---------- */
#dialog { background: radial-gradient(ellipse at 30% 0%, rgba(90, 120, 190, 0.28), transparent 60%), linear-gradient(180deg, rgba(26, 34, 54, 0.95), rgba(10, 13, 24, 0.96));
  box-shadow: inset 0 0 0 1px rgba(227, 194, 126, 0.22), inset 0 0 0 5px rgba(0, 0, 0, 0.22), inset 0 0 0 6px rgba(227, 194, 126, 0.12), var(--lift); }
.kit #dialog .dlg-name { top: -22px; padding: 7px 4px 11px; border-radius: 0; background: none; box-shadow: none; color: #fff1c8; border: solid transparent; border-width: 0 40px;
  border-image: var(--ui-ribbon) 0 120 fill / 0 40px stretch; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5)); text-shadow: 0 1px 2px #000; }
.kit #dialog .dlg-name small { color: var(--gold); opacity: 1; }
#dialog .dlg-quest { position: relative; border: 1px solid rgba(227, 194, 126, 0.3); border-left: 3px solid var(--gold); border-radius: 10px; padding: 8px 12px;
  background: linear-gradient(90deg, rgba(227, 194, 126, 0.1), rgba(0, 0, 0, 0.2)); }
#dialog .dlg-quest .qc-rewards { margin-top: 6px; align-items: center; }
.kit .dlg-choice { border: solid transparent; border-width: 0 24px; border-radius: 0; padding: 6px 0; background: none; color: #f3ecdc; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  border-image: var(--ui-btn_dark) 0 62 fill / 0 24px stretch; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4)); }
.kit .dlg-choice.primary { border-image-source: var(--ui-btn_gold); color: #3a2405; text-shadow: 0 1px 0 rgba(255, 244, 210, 0.7); }
.kit .dlg-choice.ok { border-image-source: var(--ui-btn_green); color: #fff; }
.kit .dlg-choice.go { border-image-source: var(--ui-btn_blue); color: #fff; }
.kit .dlg-choice:hover:not(:disabled) { translate: 4px 0; filter: brightness(1.13) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); background: none; }
.kit .dlg-choice.bye { filter: brightness(0.85) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4)); }
.dlg-choice.primary canvas, .dlg-choice.ok canvas, .dlg-choice.go canvas { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }

/* ---------- pop-up cards, dressed ---------- */
.popcard { padding-top: 34px; margin-top: 30px;
  background: repeating-conic-gradient(from 0deg at 50% -10%, rgba(255, 220, 140, 0.07) 0deg 5deg, transparent 5deg 12deg),
    radial-gradient(ellipse at 50% 0%, rgba(90, 120, 190, 0.5), transparent 70%), linear-gradient(180deg, rgba(26, 34, 56, 0.97), rgba(10, 13, 24, 0.97));
  box-shadow: inset 0 0 0 1px rgba(227, 194, 126, 0.3), inset 0 0 0 5px rgba(0, 0, 0, 0.25), inset 0 0 0 6px rgba(227, 194, 126, 0.15), 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 34px rgba(227, 194, 126, 0.3); }
.kit .popcard::before { content: ''; position: absolute; left: 50%; top: -38px; width: 360px; height: 84px; translate: -50% 0; background: var(--ui-header) center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.kit .btn { white-space: nowrap; }
.kit .qty .btn { min-width: 48px; font-size: 15px; font-weight: 700; }
.kit .qty-presets .btn { flex: 1 1 auto; }/* Pop-up cards: no plate, just a soft golden aura behind the crest and text. */
.popcard, .popcard.quest { border: 0; border-radius: 50%; box-shadow: none; padding: 40px 60px 26px;
  background: radial-gradient(ellipse 50% 55% at 50% 52%, rgba(255, 214, 120, 0.42), rgba(255, 190, 90, 0.16) 55%, transparent 72%); }
.popcard.quest { background: radial-gradient(ellipse 50% 55% at 50% 52%, rgba(150, 240, 160, 0.38), rgba(120, 220, 140, 0.14) 55%, transparent 72%); }
.popcard > b, .popcard > small, .popcard .pc-sub { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.6); }
.popcard.level > b { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 12px rgba(255, 200, 90, 0.7)); text-shadow: none; }
.popcard .pc-chip { background: rgba(12, 16, 28, 0.55); border-color: rgba(255, 220, 140, 0.55); text-shadow: 0 1px 2px #000; }
.kit .popcard::before { top: -30px; }.popcard > small { font-size: 13px; color: #ffe7a8; }
.popcard > b, .popcard > small { text-shadow: 0 0 3px #000, 0 2px 4px #000, 0 0 16px rgba(0, 0, 0, 0.7); }
.popcard .pc-chip { background: rgba(10, 13, 24, 0.78); color: #fff4d6; }
/* ---------- bag: power & stats panel — type and thin gold rules, no boxes ---------- */
.power { position: relative; margin: 6px 0 0; padding: 4px 0 2px; text-align: center; }
.power small { display: flex; align-items: center; justify-content: center; gap: 10px; font: 600 11px Kanit, sans-serif; letter-spacing: 0.32em; color: rgba(227, 194, 126, 0.85); }
.power small::before, .power small::after { content: ''; flex: 1; max-width: 70px; height: 1px; background: linear-gradient(90deg, transparent, rgba(227, 194, 126, 0.7)); }
.power small::after { background: linear-gradient(90deg, rgba(227, 194, 126, 0.7), transparent); }
.power b { display: block; margin-top: 1px; font: 700 32px/1.05 Kanit, sans-serif; letter-spacing: 0.04em; color: #ffe7a6;
  text-shadow: 0 1px 0 #8a5a18, 0 2px 3px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 196, 80, 0.35); }
.who { display: block; text-align: center; font: 500 13.5px Kanit, sans-serif; color: var(--cream); }
.who em { font-style: normal; font-weight: 700; color: var(--gold); margin-right: 2px; }
.who small { display: block; font-size: 11px; color: var(--muted); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); margin: 4px 0 2px; padding: 8px 0; text-align: center;
  border-top: 1px solid transparent; border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(227, 194, 126, 0.45), transparent) 1; }
.trio span { position: relative; }
.trio span + span::before { content: ''; position: absolute; left: 0; top: 15%; bottom: 15%; width: 1px; background: linear-gradient(180deg, transparent, rgba(227, 194, 126, 0.4), transparent); }
.trio b { display: block; font: 700 19px/1.1 Kanit, sans-serif; color: #fff4d8; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.trio small { font: 500 10.5px Kanit, sans-serif; letter-spacing: 0.08em; color: var(--muted); }
.bag-stats { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; font-size: 12px; }
.bag-stats .st { display: flex; align-items: baseline; gap: 4px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.bag-stats .st span { color: var(--muted); white-space: nowrap; }
.bag-stats .st b { margin-left: auto; color: var(--cream); font: 600 12.5px Kanit, sans-serif; }
/* ---------- chat: collapse to its tab bar, drag the top-right corner to resize ---------- */
#chat-toggle { margin-left: auto; width: 26px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
#chat-toggle:hover { background: rgba(227, 194, 126, 0.15); }
#chat-toggle span { width: 8px; height: 8px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); rotate: 45deg; translate: 0 -2px; transition: rotate 0.2s, translate 0.2s; }
#chat.collapsed #chat-toggle span { rotate: -135deg; translate: 0 2px; }
#chat.collapsed { height: auto !important; }
#chat.collapsed #chat-log, #chat.collapsed #chat-form, #chat.collapsed #chat-grip { display: none; }
#chat.collapsed .tabs { border-bottom: 0; padding-bottom: 3px; }
#chat-toggle.unread::after { content: ''; position: absolute; width: 7px; height: 7px; margin: -12px -14px 0 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
#chat-toggle { position: relative; }
#chat-grip { position: absolute; right: -1px; top: -1px; width: 16px; height: 16px; cursor: nesw-resize; z-index: 2; border-top-right-radius: 12px;
  background: linear-gradient(225deg, rgba(227, 194, 126, 0.75) 0 2px, transparent 2px 5px, rgba(227, 194, 126, 0.55) 5px 7px, transparent 7px); opacity: 0.6; transition: opacity 0.15s; }
#chat:hover #chat-grip, #chat.resizing #chat-grip { opacity: 1; }
#chat.resizing { user-select: none; }
/* ---------- target frame (top centre): portrait socket + HP bar; the painted frame sits over both ---------- */
#target { position: absolute; left: 50%; top: 12px; translate: -50% 0; width: 340px; height: 104px; z-index: 6; pointer-events: none; }
#bossbar:not([hidden]) ~ #target { top: 96px; }
#target canvas { position: absolute; left: 4.6%; top: 8%; width: 23%; aspect-ratio: 1; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 50% 40%, #3a4a6e, #101522 75%); }
#target .tg-body { display: contents; }
#target .tg-hp { position: absolute; left: 32.5%; top: 22%; width: 64.5%; height: 36%; border-radius: 12px; z-index: 1; }
#target .tg-hp span { font-size: 12px; }
#target .tg-name { position: absolute; left: 33%; top: 66%; width: 49%; height: 18%; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 0 8px;
  font: 600 12.5px Kanit, sans-serif; white-space: nowrap; overflow: hidden; text-shadow: 0 1px 2px #000; }
#target .tg-name em { font-style: normal; font-size: 10.5px; color: #ffd27a; }
.tg-lv { font-weight: 700; color: #f3ecdc; }
.tg-lv.hard { color: #ffb36a; } .tg-lv.deadly { color: #ff6a5a; } .tg-lv.trivial { color: #9aa3ad; }
#target.champ canvas { box-shadow: 0 0 14px rgba(255, 210, 90, 0.8); }
#target::after { content: ''; position: absolute; inset: 0; z-index: 2; background: none; }
.kit #target::after { background: var(--ui-target) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
html:not(.kit) #target { background: linear-gradient(180deg, var(--panel-top), var(--panel-bot)); border: 1px solid var(--line); border-radius: 14px; }
/* A second, slower fill trails behind each HP bar so a hit shows as a white chunk draining away. */
.bar i.lag { background: rgba(255, 245, 225, 0.85) !important; transition: width 0.6s ease-in 0.25s; }
.bar i:not(.lag) { z-index: 1; }
.bar.tg-hp i:not(.lag) { background: linear-gradient(180deg, #ff8a8f, var(--hp) 60%, #b5303b); }

/* ---------- boss bar ---------- */
#bossbar { width: min(560px, 50vw); top: 8px; }
.boss-name { font: 700 16px Kanit, sans-serif; display: flex; justify-content: center; align-items: baseline; gap: 8px; }
.boss-name small { font-size: 12px; color: #ffb36a; }
.kit #bossbar .bar.boss { height: auto; aspect-ratio: 610 / 110; background: none; box-shadow: none; border: 0; overflow: visible; }
.kit #bossbar .bar.boss::after { content: ''; position: absolute; inset: 0; z-index: 2; background: var(--ui-bossbar) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); pointer-events: none; }
.kit #bossbar .bar.boss i { left: 11.4%; top: 53%; bottom: 13%; inset-inline-start: 11.4%; width: 0; max-width: 77%; border-radius: 10px; }
.kit #bossbar .bar.boss i { scale: 0.77 1; transform-origin: left; }
.kit #bossbar .bar.boss span { z-index: 3; top: 48%; font-size: 12px; }

/* ---------- recall cast bar ---------- */
#castbar { width: 300px; bottom: 182px; }
.cast-label { font: 600 13px Kanit, sans-serif; color: #bfe8ff; text-shadow: 0 1px 3px #000; letter-spacing: 0.06em; }
.bar.cast i { background: linear-gradient(90deg, #4aa8ff, #bfe8ff); box-shadow: 0 0 10px rgba(120, 200, 255, 0.8); }
.kit #castbar .bar.cast { height: auto; aspect-ratio: 499 / 42; background: none; box-shadow: none; overflow: visible; }
.kit #castbar .bar.cast::after { content: ''; position: absolute; inset: 0; z-index: 2; background: var(--ui-castbar) center / 100% 100% no-repeat; pointer-events: none; }
.kit #castbar .bar.cast i { left: 8%; top: 30%; bottom: 30%; max-width: 84%; border-radius: 3px; scale: 0.84 1; transform-origin: left; }

/* ---------- area name banner ---------- */
#banner { text-align: center; padding: 18px 70px 20px; min-width: 380px; }
.kit #banner { background: var(--ui-areabanner) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.kit #banner { font-size: 24px; text-shadow: 0 2px 4px #000; }
.kit #banner small { font-size: 12.5px; }

/* ---------- [F] prompt ---------- */
#prompt { display: flex; align-items: center; gap: 8px; padding: 5px 16px 5px 6px; }
#prompt kbd { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font: 700 13px Kanit, sans-serif; color: #2a1d0c;
  background: linear-gradient(180deg, #f8e4b0, #c89a4f); box-shadow: inset 0 -2px 0 #8a5a18, 0 2px 4px rgba(0, 0, 0, 0.4); }
#prompt b { color: #ffe7a6; }

/* ---------- knocked out ---------- */
#death { position: fixed; inset: 0; translate: none; left: 0; top: 0; z-index: 30; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(20, 10, 16, 0.25), rgba(8, 4, 8, 0.78)); backdrop-filter: grayscale(0.85) blur(1px); animation: win-in 0.6s ease-out; }
.death-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.death-emblem { width: 170px; height: 107px; background: radial-gradient(circle, rgba(140, 190, 255, 0.25), transparent 65%); }
.kit .death-emblem { background: var(--ui-fallen) center / contain no-repeat; filter: drop-shadow(0 0 18px rgba(140, 190, 255, 0.35)); animation: fallen 3s ease-in-out infinite; }
@keyframes fallen { 50% { translate: 0 6px; filter: drop-shadow(0 0 26px rgba(140, 190, 255, 0.55)); } }
.death-title { font: 800 34px Kanit, sans-serif; color: #e8eefc; letter-spacing: 0.1em; text-shadow: 0 2px 14px #000; }
#death-text { color: #c9cfdc; font-size: 13.5px; text-shadow: 0 1px 4px #000; }
.death-ring { --k: 1; position: relative; width: 76px; height: 76px; margin: 6px 0; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle, #141a2a 58%, transparent 60%), conic-gradient(#bfe8ff calc(var(--k) * 360deg), rgba(255, 255, 255, 0.12) 0); }
#death { --k: 1; }
.death-ring b { font: 800 26px/1 Kanit, sans-serif; color: #fff; }
.death-ring small { font-size: 10px; color: var(--muted); }

/* ---------- status window (C) ---------- */
#win-stats { width: min(860px, 96vw); }
.pts { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 6px 0 10px; }
.pts small { color: var(--muted); font-size: 12.5px; }
.pts b { font: 800 26px/1 Kanit, sans-serif; color: var(--muted); }
.pts span { color: var(--muted); font-size: 11px; }
.pts.has b { color: #ffe7a6; text-shadow: 0 0 14px rgba(255, 200, 90, 0.7); animation: pts-glow 1.6s ease-in-out infinite; }
@keyframes pts-glow { 50% { text-shadow: 0 0 22px rgba(255, 200, 90, 1); } }
.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.attr-card { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'name val' 'gain gain' 'btns btns'; gap: 4px 8px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--edge); background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.25)); overflow: hidden; }
.attr-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ac); }
.attr-card.str { --ac: #ff8a5a; } .attr-card.vit { --ac: #7ddc8a; } .attr-card.agi { --ac: #8fd8ff; } .attr-card.int { --ac: #c8a4ff; }
.ac-name { grid-area: name; } .ac-name small { display: block; font: 700 11px Kanit, sans-serif; letter-spacing: 0.18em; color: var(--ac); } .ac-name b { font: 600 15px Kanit, sans-serif; }
.ac-val { grid-area: val; font: 800 28px/1 Kanit, sans-serif; color: #fff4d8; align-self: center; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); }
.ac-gain { grid-area: gain; color: var(--muted); font-size: 11.5px; }
.ac-btns { grid-area: btns; display: flex; gap: 6px; }
.ac-btns .btn { flex: 1; }
.attr-card.bump, .sk-card.bump { animation: card-bump 0.5s ease-out; }
@keyframes card-bump { 30% { box-shadow: 0 0 0 2px rgba(255, 220, 120, 0.8), 0 0 18px rgba(255, 220, 120, 0.5); } }
.st-win .power { margin: 12px 0 4px; }

/* ---------- skills window (K) ---------- */
/* Six skills in two columns (so the window fits without scrolling), the class passive across the bottom. */
#win-skills { width: min(900px, calc(100vw - 24px)); }
.sk-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sk-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--edge);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.25)); }
.sk-card.passive { grid-column: 1 / -1; border-color: rgba(227, 194, 126, 0.45);
  background: linear-gradient(160deg, rgba(227, 194, 126, 0.1), rgba(0, 0, 0, 0.25)); }
.sk-tag { padding: 0 8px; border-radius: 8px; font: 600 11px Kanit, sans-serif; color: #1a1408; background: var(--gold); }
.sk-card.new { border-color: rgba(125, 220, 138, 0.6); box-shadow: 0 0 12px rgba(125, 220, 138, 0.2); }
.sk-card.locked { opacity: 0.6; }
.sk-icon { position: relative; width: 64px; height: 64px; border-radius: 14px; padding: 6px; background: var(--well); }
.kit .sk-icon { background: var(--ui-slot) center / 100% 100% no-repeat; }
.sk-icon canvas { width: 100%; height: 100%; }
/* A class-2 skill picture (a full square badge, not a floating icon) fills the frame up to its gold rim (measured from
   the slot art: the rim ends 5% in), its corners rounded to the rim's inner curve. */
.sk-icon canvas.c2-art { margin: -2.5px; width: calc(100% + 5px); height: calc(100% + 5px); border-radius: 10px; }
.sk-card.locked .sk-icon canvas { filter: grayscale(1) brightness(0.55); }
.sk-key { position: absolute; left: 4px; top: 3px; font: 700 12px Kanit, sans-serif; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.sk-icon em { position: absolute; inset: 0; display: grid; place-items: center; font: 700 13px Kanit, sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 3px #000; }
.sk-head { display: flex; align-items: center; gap: 10px; }
.sk-head b { font: 600 15px Kanit, sans-serif; }
.pips { display: flex; gap: 3px; }
.pips i { width: 10px; height: 10px; rotate: 45deg; border: 1px solid rgba(227, 194, 126, 0.5); background: rgba(0, 0, 0, 0.4); }
.pips i.on { background: linear-gradient(135deg, #fff3c4, #e6b553); border-color: #f5dfa8; box-shadow: 0 0 6px rgba(255, 210, 90, 0.7); }
.sk-desc { font-size: 12.5px; margin: 3px 0 2px; }
.sk-next { font-size: 12px; color: #9fe3a8; } .sk-next span { font-weight: 700; margin-right: 6px; }
.sk-act { display: grid; justify-items: center; gap: 3px; }
.sk-act small { font: 500 11px Kanit, sans-serif; color: #ff9d8a; white-space: nowrap; }
.sk-meta { display: flex; gap: 6px; margin-top: 4px; }
.sk-meta span { padding: 0 8px; border-radius: 8px; font: 500 11px Kanit, sans-serif; color: var(--muted); background: rgba(255, 255, 255, 0.05); }
#death { transform: none; }

/* ---------- events: check-in cards + daily missions ---------- */
#win-events { width: 640px; }
.ev-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 8px; }
.ev-head b { display: block; font: 600 15px Kanit, sans-serif; color: var(--gold); }
.ev-head small { color: var(--muted); font-size: 12px; }
.login-grid { gap: 8px; margin-bottom: 14px; }
.login-day { position: relative; min-height: 0; aspect-ratio: 155 / 198; padding: 14% 6% 8%; border: 0; border-radius: 10px; background: linear-gradient(180deg, #1d2740, #0e1322); justify-content: space-between; align-items: center; transition: transform 0.15s; }
.kit .login-day { background: var(--ui-daycard) center / 100% 100% no-repeat; border-radius: 0; }
.login-day small { position: absolute; top: 2.5%; left: 0; right: 0; font: 700 10.5px Kanit, sans-serif; color: #3a2405; }
html:not(.kit) .login-day small { color: var(--gold); }
.login-day canvas { width: 64%; aspect-ratio: 1; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5)); }
.login-day span { font: 600 10.5px/1.25 Kanit, sans-serif; color: var(--cream); text-shadow: 0 1px 2px #000; }
.login-day.today { transform: translateY(-4px); box-shadow: none; filter: drop-shadow(0 0 10px rgba(255, 210, 90, 0.75)); animation: today 1.8s ease-in-out infinite; }
@keyframes today { 50% { filter: drop-shadow(0 0 18px rgba(255, 210, 90, 1)); } }
.login-day em { position: absolute; bottom: -9px; left: 50%; translate: -50% 0; padding: 0 10px; border-radius: 8px; font: 700 11px Kanit, sans-serif; font-style: normal; color: #2a1d0c; background: linear-gradient(180deg, #f8e4b0, #c89a4f); }
.login-day.done { opacity: 1; filter: grayscale(0.7) brightness(0.6); }
.login-day i { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; color: #8fe09a; text-shadow: 0 2px 6px #000; filter: none; }
.login-day.big canvas { width: 74%; }
.qcard.claimed { opacity: 0.5; }

/* ---------- mail ---------- */
.mail-item { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 10px; background: var(--well); border: 1px solid var(--edge); }
.mail-item canvas { width: 32px; height: 32px; }
.mail-item.unread { border-color: rgba(227, 194, 126, 0.5); background: linear-gradient(90deg, rgba(227, 194, 126, 0.12), var(--well)); }
.mail-item.unread b::before { content: '● '; color: var(--gold); }
.mail-item.active { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(227, 194, 126, 0.4); }
.mail-item.claimed canvas { filter: grayscale(1) brightness(0.6); }
.mail-read { padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, rgba(255, 245, 220, 0.06), rgba(0, 0, 0, 0.2)); border: 1px solid var(--edge); }
.mail-body { margin: 10px 0; padding: 10px 0; line-height: 1.7; border-top: 1px solid rgba(227, 194, 126, 0.2); border-bottom: 1px solid rgba(227, 194, 126, 0.2); }
.mail-att { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mail-att small { color: var(--gold); font: 600 12px Kanit, sans-serif; }
.mail-read .btn { float: none; width: 100%; }

/* ---------- boss result: aura card like level-up ---------- */
#win-result { background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(255, 206, 110, 0.28), transparent 70%), linear-gradient(180deg, rgba(26, 34, 56, 0.97), rgba(10, 13, 24, 0.97)); padding-top: 26px; overflow: visible; }
.kit #win-result .result-head { position: relative; }
.kit #win-result .result-head::before { content: ''; position: absolute; left: 50%; top: -58px; width: 330px; height: 76px; translate: -50% 0; background: var(--ui-header) center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.result-head > b { color: #ffe7a6; text-shadow: 0 2px 8px rgba(255, 196, 80, 0.4); }
.result-card canvas { filter: drop-shadow(0 0 16px rgba(255, 210, 120, 0.45)); }
.result-dmg b { color: #ffe7a6; }

/* ---------- switches and sliders (auto, settings) ---------- */
.auto-row input[type=checkbox], .set-row input[type=checkbox] { appearance: none; width: 42px; height: 22px; border-radius: 11px; position: relative; cursor: pointer; flex: none;
  background: rgba(0, 0, 0, 0.5); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--edge); transition: background 0.2s; }
.auto-row input[type=checkbox]::after, .set-row input[type=checkbox]::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(180deg, #e8e2d4, #9a9284); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); transition: left 0.2s, background 0.2s; }
.auto-row input[type=checkbox]:checked, .set-row input[type=checkbox]:checked { background: linear-gradient(90deg, #3f9c50, #7ddc8a); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 8px rgba(125, 220, 138, 0.5); }
.auto-row input[type=checkbox]:checked::after, .set-row input[type=checkbox]:checked::after { left: 23px; background: linear-gradient(180deg, #fff, #e8f8ea); }
input[type=range] { appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #c89a4f, #ffe08a) 0 / var(--fill, 50%) 100% no-repeat, rgba(0, 0, 0, 0.5); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff6d2, #e6b553 60%, #a7782c); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 0 8px rgba(255, 210, 90, 0.6); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff6d2, #e6b553 60%, #a7782c); }
.auto-row { padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; border: 1px solid var(--edge); background: var(--well); }
.set-row { padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; border: 1px solid var(--edge); background: var(--well); border-bottom: 1px solid var(--edge); }

/* ---------- help ---------- */
#win-help { width: 640px; }
.hk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.hk-group { padding: 10px; border-radius: 12px; background: var(--well); border: 1px solid var(--edge); }
.hk-group > b { display: block; font: 600 13px Kanit, sans-serif; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 6px; }
.hk { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.hk span { display: flex; gap: 2px; flex: none; }
.hk small { color: var(--cream); font-size: 12px; line-height: 1.3; }
.help kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 0; border-radius: 6px; font: 700 11px Kanit, sans-serif; color: #2a1d0c;
  background: linear-gradient(180deg, #f8e4b0, #c89a4f); box-shadow: inset 0 -2px 0 #8a5a18, 0 2px 3px rgba(0, 0, 0, 0.4); }
.tips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tips div { padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; background: linear-gradient(90deg, rgba(227, 194, 126, 0.08), transparent); border-left: 2px solid rgba(227, 194, 126, 0.6); }
.tips b { display: block; font: 600 12.5px Kanit, sans-serif; color: var(--gold); }
.tips em { font-style: normal; color: #ffe7a6; }

/* ---------- world map legend ---------- */
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; font-size: 12px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; font: 800 10px Kanit, sans-serif; font-style: normal; color: #2a1d0c; }
.lg-me { background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%, 30% 50%); border-radius: 0 !important; }
.lg-npc { background: #ffd23a; width: 10px !important; height: 10px !important; }
.lg-q { background: #ffd23a; } .lg-q.ok { background: #7ddc8a; }
.lg-goal { border: 2px dashed #ffd23a; background: none; }
.lg-portal { background: #bfe8ff; }
/* ---------- smaller, out-of-the-way target frame (beside the profile) ---------- */
#target { left: 316px; top: 18px; translate: none; width: 236px; height: 72px; }
#bossbar:not([hidden]) ~ #target { top: 18px; }
#target .tg-hp span { font-size: 10px; }
#target .tg-name { font-size: 10.5px; gap: 4px; padding: 0 6px; }
#target .tg-name em { font-size: 9px; }
@media (max-width: 700px) { #target { left: auto; right: 140px; top: 8px; width: 180px; height: 55px; } }

/* ---------- check-in labels sit on the card's ribbon, the "today" tag clear of the text ---------- */
.login-day { padding: 17% 6% 15%; }
.login-day small { top: 4.2%; line-height: 1; font-size: 10px; }
.login-day em { bottom: -8px; font-size: 10px; padding: 0 8px; line-height: 16px; z-index: 1; }

/* ---------- area banner, a size smaller ---------- */
#banner { min-width: 300px; padding: 14px 56px 16px; }
.kit #banner { font-size: 20px; line-height: 1.2; }
/* ---------- centre text on the painted plates (positions measured on the art) ---------- */
.login-day small { top: 10.5%; translate: 0 -50%; line-height: 1.35; }
#target .tg-name { left: 31.5%; top: 70%; width: 50%; height: 16%; line-height: 1.35; padding-top: 1px; }
.kit #banner { box-sizing: border-box; width: 385px; min-width: 0; height: 70px; padding: 18px 56px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 19px; line-height: 1.2; white-space: nowrap; }
.kit #banner small { font-size: 11px; line-height: 1.1; }.bar span { z-index: 2; }
@media (max-width: 1100px) { #target { left: 14px; top: 136px; } }#target .tg-name { top: 59%; height: 17%; }
/* Name plate measured on the frame art: x 32.3–79.5 %, y 70–82 %. */
#target .tg-name { left: 32.3%; width: 47.2%; top: 70%; height: 12%; line-height: 1; padding: 0 6px; overflow: visible; justify-content: center; }
/* Check-in card art (measured): ribbon = top 0–13.6 %, card body from 13.6 %. The label fills the ribbon, the icon starts below it. */
.login-day small { top: 0; height: 13.6%; translate: none; display: flex; align-items: center; justify-content: center; line-height: 1; font-size: 9px; }
.login-day { padding: 25% 6% 15%; }
.login-day canvas { width: 56%; }
.login-day.big canvas { width: 64%; }#target .tg-name { top: 71.5%; }

/* ---------- player frame (set `uiplayer`): every socket placed from measurements of the art (591×200) ---------- */
.kit #profile { width: 340px; height: auto; aspect-ratio: 591 / 200; padding: 0; display: block; background: none; border: 0; box-shadow: none; backdrop-filter: none; border-radius: 0; }
.kit #profile::after { left: 0; top: 0; width: 100%; height: 100%; transform: none; z-index: 2; background: var(--ui-player) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55)); }
.kit #portrait { position: absolute; left: 13.9%; top: 28.5%; width: 17.2%; height: 51%; border-radius: 50%; z-index: 1; }
.kit #profile .pf-body { display: contents; }
.kit #profile .pf-name { position: absolute; left: 37.9%; top: 23.5%; width: 42.5%; height: 15%; z-index: 3; justify-content: center; align-items: center; gap: 6px; line-height: 1; overflow: visible; text-shadow: 0 1px 2px #000; }
.kit #profile .pf-name b { font: 600 13px Kanit, sans-serif; color: #fff4d8; }
.kit #profile .pf-name small { font: 500 10.5px Kanit, sans-serif; color: var(--gold); }
/* Class 2: the emblem before a gold name. */
#pf-emblem { width: 16px; height: 16px; flex: none; filter: drop-shadow(0 0 3px rgba(255, 210, 120, 0.7)); }
#profile.c2 .pf-name b { color: #ffe08a; }
.kit #profile .bar.hp { position: absolute; left: 36.2%; top: 47%; width: 57.9%; height: 13.5%; border-radius: 10px; z-index: 1; }
.kit #profile .bar.mp { position: absolute; left: 37.7%; top: 70%; width: 37.6%; height: 9%; border-radius: 6px; z-index: 1; }
.kit #profile .bar span { font-size: 10.5px; }
.kit #profile .bar.mp span { font-size: 8.5px; }
.pf-lv { display: none; }
.kit .pf-lv { position: absolute; left: 31.9%; top: 79.8%; translate: -50% -50%; width: 6.4%; aspect-ratio: 1; z-index: 3; display: grid; place-content: center; text-align: center; line-height: 1; text-shadow: 0 1px 2px #000; }
.kit .pf-lv small { font: 600 7px Kanit, sans-serif; color: var(--gold); letter-spacing: 0.05em; }
.kit .pf-lv b { font: 800 13px Kanit, sans-serif; color: #fff4d8; }
.kit #buffs { top: 134px; }
.kit #target { left: 362px; }
@media (max-width: 1100px) { .kit #target { left: 14px; top: 150px; } }
@media (max-width: 700px) { .kit #profile { width: 250px; } }/* Level badge disc measured on the art: centre x 31.1 %, y 80.8 %, diameter 7.6 % of the width. Number only, it is small. */
.kit .pf-lv { left: 31.1%; top: 80.8%; width: 7.6%; display: flex; align-items: center; justify-content: center; }
.kit .pf-lv small { display: none; }
.kit .pf-lv b { font-size: 14px; line-height: 1; padding-top: 1px; }/* Player frame v2 (562×200, measured): portrait x 13.2–33.4 % y 37–91 %, name x 40–81.3 % y 27.5–44 %, HP x 37.7–92.2 % y 53.5–67.5 %, MP x 36.5–74.6 % y 78.5–88.5 %.
   The winged level plate (266×96, number field x 21.1–78.2 % y 44.8–87.5 %) sits centred under the portrait. */
.kit #profile { aspect-ratio: 562 / 200; }
.kit #portrait { left: 13.2%; top: 37%; width: 20.2%; height: 54%; }
.kit #profile .pf-name { left: 40%; top: 27.5%; width: 41.3%; height: 16.5%; }
.kit #profile .bar.hp { left: 37.7%; top: 53.5%; width: 54.5%; height: 14%; }
.kit #profile .bar.mp { left: 36.5%; top: 78.5%; width: 38.1%; height: 10%; }
.kit .pf-lv { left: 9.3%; top: 76%; width: 28%; height: 28%; aspect-ratio: auto; translate: none; display: block; background: var(--ui-lvplate) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.kit .pf-lv b { position: absolute; left: 21.1%; right: 21.8%; top: 44.8%; bottom: 12.5%; display: flex; align-items: center; justify-content: center; padding: 0; font: 800 13px/1 Kanit, sans-serif; color: #ffe7a6; text-shadow: 0 1px 2px #000; }
.kit #buffs { top: 146px; }.kit #portrait { background: none; box-shadow: none; }
/* The resource gauge hangs just under the painted frame, lined up with the MP socket. */
.kit #profile .bar.res { position: absolute; left: 36.5%; top: 101%; width: 38.1%; height: 9%; border-radius: 6px; z-index: 1; }
.kit #hud.has-res #buffs { top: 160px; }

/* ---------- kill combo (right side) ---------- */
#combo { position: absolute; right: 24px; top: 46%; z-index: 5; text-align: right; pointer-events: none; --cc: #ffe7a6; }
#combo b { display: block; font: 900 40px/1 Kanit, sans-serif; font-style: italic; color: var(--cc); letter-spacing: 0.02em;
  text-shadow: 0 2px 0 #7a4a10, 0 3px 6px rgba(0, 0, 0, 0.7), 0 0 18px color-mix(in srgb, var(--cc) 60%, transparent); animation: combo-pop 0.25s cubic-bezier(.2, 1.8, .4, 1); }
#combo small { display: block; margin-top: -2px; font: 800 13px Kanit, sans-serif; letter-spacing: 0.35em; color: #fff; text-shadow: 0 1px 3px #000; }
#combo span { display: block; font: 600 11.5px Kanit, sans-serif; color: #b9e6ff; text-shadow: 0 1px 2px #000; }
#combo i { display: block; margin: 4px 0 0 auto; width: 110px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--cc)); transform-origin: right; animation: combo-drain 5s linear forwards; }
#combo.hot1 { --cc: #ffb84a; } #combo.hot2 { --cc: #ff7a4a; } #combo.hot3 { --cc: #ff4f8a; }
@keyframes combo-pop { from { scale: 1.6; opacity: 0.4; } to { scale: 1; opacity: 1; } }
@keyframes combo-drain { from { scale: 1 1; } to { scale: 0 1; } }

/* ---------- boss intro card ---------- */
.popcard.boss { background: radial-gradient(ellipse 50% 55% at 50% 52%, rgba(255, 70, 90, 0.42), rgba(160, 30, 60, 0.16) 55%, transparent 72%); }
.popcard.boss > small { color: #ff9aa8; letter-spacing: 0.5em; }
.popcard.boss > b { font-size: 36px; color: #ffe1e6; text-shadow: 0 0 3px #000, 0 2px 4px #000, 0 0 22px rgba(255, 70, 90, 0.8); }#popcards { top: 29%; }

/* ---------- auto hunt: window (switch + 3 tabs) and the small status line on the HUD ---------- */
.auto-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--edge); background: var(--well); }
.auto-head b { display: flex; align-items: center; gap: 7px; font: 600 15px Kanit, sans-serif; }
.auto-head b::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #6a6474; }
.auto-head.on b::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: auto-blink 1.4s ease-in-out infinite; }
.auto-head small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.auto-head .btn { min-width: 86px; }
.auto-set .bag-tabs { margin-bottom: 8px; }
.auto-row.dim { opacity: 0.45; pointer-events: none; }
.auto-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.auto-chip { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line-soft); background: rgba(10, 8, 14, 0.4);
  color: var(--muted); font: 500 12.5px Kanit, sans-serif; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.auto-chip small { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.auto-chip kbd { font: 600 10px Kanit, sans-serif; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line-soft); color: var(--muted); }
.auto-chip i { flex: none; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #6a6474; }
.auto-chip.on { color: var(--cream, #efe6d2); border-color: color-mix(in srgb, var(--gold) 70%, transparent); background: rgba(227, 194, 126, 0.1); }
.auto-chip.on i { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 2px #241f2b; }
.auto-chip:hover { border-color: var(--gold); }
/* ---------- online: sign in, friends and party ---------- */
.auth { display: grid; gap: 8px; max-width: 380px; margin: 6px auto 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.auth-tabs button { padding: 8px 0; border: 0; background: transparent; color: var(--muted); font: 600 14px Kanit, sans-serif; cursor: pointer; }
.auth-tabs button.on { background: var(--gold); color: #241f2b; }
.auth .title-actions { margin-top: 4px; }
.auth p { margin: 0; text-align: center; }
.account-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 8px; font: 500 13px Kanit, sans-serif; }
.account-bar b { color: var(--gold); }
#win-social { width: min(560px, calc(100vw - 32px)); top: 50%; transform: translate(-50%, -50%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
#win-social .soc { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.soc-list { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
.soc-add { display: flex; gap: 6px; margin-bottom: 8px; }
.soc-add input { flex: 1; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(10, 8, 14, 0.6); color: inherit; font: 500 13px Kanit, sans-serif; }
.soc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; border: 1px solid var(--edge); background: var(--well, rgba(10, 8, 14, 0.45)); }
.soc-row.off { opacity: 0.6; }
.soc-row b { font: 600 14px Kanit, sans-serif; }
.soc-place { font: 500 12px Kanit, sans-serif; margin-top: 2px; }
.soc-place .ok, .soc-row .ok { color: var(--ok); }
.soc-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.soc-empty { padding: 24px 10px; text-align: center; color: var(--muted); font: 500 14px Kanit, sans-serif; }
.soc-note { margin-bottom: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(125, 220, 138, 0.1); color: #bfeec6; font: 500 12px Kanit, sans-serif; }
.crown { color: var(--gold); font-style: normal; }
.soc-card { display: grid; gap: 8px; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(180deg, rgba(60, 48, 30, 0.35), rgba(14, 11, 20, 0.6)); }
.soc-card-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.soc-card-row b { font: 600 15px Kanit, sans-serif; color: var(--gold); }
.soc-card input[name=name] { flex: 1; min-width: 140px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(10, 8, 14, 0.6); color: inherit; font: 500 13px Kanit, sans-serif; }
.soc-lv { display: flex; align-items: center; gap: 4px; font: 500 12px Kanit, sans-serif; color: var(--muted); }
.soc-lv input { width: 54px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line); background: rgba(10, 8, 14, 0.6); color: inherit; font: 600 13px Kanit, sans-serif; text-align: center; }
.soc-switch { display: flex; align-items: center; gap: 8px; flex: 1; font: 500 13px Kanit, sans-serif; cursor: pointer; }
.soc-switch input { appearance: none; width: 42px; height: 22px; border-radius: 11px; position: relative; cursor: pointer; flex: none; background: #3a3444; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5); transition: background 0.2s; }
.soc-switch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d8d2e0; transition: left 0.2s; }
.soc-switch input:checked { background: linear-gradient(90deg, #3f9c50, #7ddc8a); }
.soc-switch input:checked::after { left: 23px; background: #fff; }
.soc-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line-soft); font: 600 11px Kanit, sans-serif; color: var(--muted); }
.soc-chip.open { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.soc-lobby-head { display: flex; align-items: center; justify-content: space-between; }
.lobby-row .crown-ico, .soc-place .crown-ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
/* The party panel (left, under the profile): header with the live EXP bonus, then a card per member. */
#party-frames { position: absolute; left: 14px; top: 200px; z-index: 4; display: grid; gap: 5px; width: 222px; font: 500 12px Kanit, sans-serif; }
.kit #hud.has-res #party-frames { top: 214px; }
/* On narrow screens the target frame sits under the profile too: the party panel steps down below it while it shows. */

.pt-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; border-radius: 9px; background: linear-gradient(90deg, rgba(20, 22, 40, 0.88), rgba(20, 22, 40, 0.55)); border: 1px solid rgba(227, 194, 126, 0.35); }
.pt-head .ui-ico { margin: 0; width: 18px; height: 18px; }
.pt-head b { flex: 1; min-width: 0; color: var(--gold); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-bonus { padding: 0 7px; border-radius: 8px; font: 700 10.5px Kanit, sans-serif; color: #8d879a; background: rgba(0, 0, 0, 0.35); white-space: nowrap; }
.pt-bonus.on { color: #12301a; background: linear-gradient(90deg, #7ddc8a, #b8f5a0); box-shadow: 0 0 8px rgba(125, 220, 138, 0.55); }
.pt-leave { height: 20px; padding: 0 7px; border-radius: 6px; border: 1px solid rgba(224, 106, 96, 0.45); background: rgba(160, 40, 40, 0.25); color: #ffb3a8; font: 600 10.5px Kanit, sans-serif; cursor: pointer; white-space: nowrap; }
.pt-leave:hover, .pt-leave.armed { background: #c0443a; color: #fff; border-color: #ff8a7a; }
.pt-fold { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: var(--muted); cursor: pointer; font-size: 11px; }
.pt-card { position: relative; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 7px; padding: 5px 6px 5px 5px; border-radius: 11px; cursor: pointer;
  background: linear-gradient(90deg, rgba(16, 20, 36, 0.9), rgba(16, 20, 36, 0.62)); border: 1px solid rgba(143, 240, 160, 0.3); transition: border-color 0.15s, opacity 0.2s, transform 0.12s; }
.pt-card:hover { border-color: #8ff0a0; transform: translateX(2px); }
.pt-card canvas { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3d4a66, #151a2a); box-shadow: 0 0 0 2px rgba(143, 240, 160, 0.55); }
.pt-card .crown-ico { position: absolute; left: 30px; top: -3px; width: 17px; height: 17px; }
.pt-info { min-width: 0; display: grid; gap: 2px; }
.pt-name { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.pt-name b { font-weight: 600; color: #f1fbf2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-name small { color: #9fb6a5; font-size: 10.5px; white-space: nowrap; }
.pt-hp { position: relative; height: 11px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.pt-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #8ff0a0, #3fae52); transition: width 0.25s; }
.pt-hp i.low { background: linear-gradient(180deg, #ff9a7a, #d8443a); }
.pt-hp span { position: relative; display: block; text-align: center; font: 700 8.5px/11px Kanit, sans-serif; color: #fff; text-shadow: 0 1px 1px #000; }
.pt-where { font-size: 10.5px; color: #9fb6a5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-card[data-state="near"] .pt-where { color: #8ff0a0; }
.pt-card[data-state="near"] canvas { box-shadow: 0 0 0 2px #8ff0a0, 0 0 10px rgba(143, 240, 160, 0.6); }
.pt-card[data-state="far"], .pt-card[data-state="away"] { border-color: rgba(159, 216, 255, 0.25); }
.pt-card[data-state="away"] .pt-where { color: #9fd8ff; }
.pt-card[data-state="far"] canvas, .pt-card[data-state="away"] canvas { box-shadow: 0 0 0 2px rgba(159, 216, 255, 0.4); }
.pt-card[data-state="dead"] { border-color: rgba(255, 120, 110, 0.5); }
.pt-card[data-state="dead"] canvas { filter: grayscale(1) brightness(0.6); box-shadow: 0 0 0 2px #e06a60; }
.pt-card[data-state="dead"] .pt-where { color: #ff9a8a; }
.pt-card[data-state="off"] { opacity: 0.5; }
.pt-acts button { width: 26px; height: 26px; padding: 0; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06); cursor: pointer; display: grid; place-items: center; }
.pt-acts .ui-ico { margin: 0; width: 18px; height: 18px; }
.pt-acts button:hover { border-color: var(--gold); }
.pt-acts { display: flex; gap: 4px; }
.pt-acts button:disabled { opacity: 0.35; cursor: default; border-color: rgba(255, 255, 255, 0.12); }
.pt-acts button.on { border-color: #8ff0a0; background: rgba(143, 240, 160, 0.2); box-shadow: 0 0 8px rgba(143, 240, 160, 0.5); animation: pt-follow 1.2s ease-in-out infinite; }
@keyframes pt-follow { 50% { box-shadow: 0 0 2px rgba(143, 240, 160, 0.2); } }

/* Another player's worn gear (right-click → ดูอุปกรณ์). */
#win-inspect { width: min(340px, calc(100vw - 32px)); top: 50%; transform: translate(-50%, -50%); }
.insp { display: flex; flex-direction: column; gap: 7px; }
.insp-who { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font: 600 14px Kanit, sans-serif; }
.insp-who span { margin-left: auto; font-size: 12.5px; color: var(--cream); }
.insp-who em { color: var(--gold); font-style: normal; }
.insp-detail { min-height: 64px; padding: 7px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(10, 8, 14, 0.4); font-size: 12px; line-height: 1.45; }
.insp-detail b { display: block; }

/* Right-click menu on another player. */
.peer-menu { position: fixed; z-index: 60; min-width: 150px; padding: 4px; border-radius: 10px; background: rgba(18, 24, 40, 0.74);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); color: #f4f1ea; font-size: 12px; }
.peer-menu[hidden] { display: none; }
.pm-head { display: flex; align-items: center; gap: 7px; padding: 3px 6px 5px; }
.pm-head canvas { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); flex: none; }
.pm-head b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.pm-head small { color: rgba(244, 241, 234, 0.55); font-size: 10.5px; }
.peer-menu button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.peer-menu button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.peer-menu button:disabled { opacity: 0.5; cursor: default; }
.peer-menu button small { margin-left: auto; padding-left: 8px; color: rgba(244, 241, 234, 0.7); font-size: 10px; }
.peer-menu .ui-ico { width: 15px; height: 15px; margin: 0; }
.pt-wait { padding: 8px 10px; border-radius: 10px; background: rgba(16, 20, 36, 0.7); color: var(--muted); font-size: 11.5px; }
.pf-member { position: relative; display: grid; grid-template-columns: 1fr; gap: 1px; padding: 5px 9px 7px; text-align: left; border-radius: 9px; border: 1px solid rgba(143, 240, 160, 0.35);
  background: rgba(14, 16, 30, 0.7); color: #eaf7ec; cursor: pointer; font: 500 12px Kanit, sans-serif; }
.pf-member b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-member small { color: #a9c4ae; font-size: 10.5px; }
.pf-member .bar { display: block; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.5); overflow: hidden; margin-top: 2px; }
.pf-member .bar i { display: block; height: 100%; background: linear-gradient(90deg, #4fbf5f, #8ff0a0); }
.pf-member .crown { position: absolute; right: 8px; top: 4px; }
.pf-member:hover { border-color: #8ff0a0; }
#invite { position: absolute; left: 50%; top: 22%; translate: -50% 0; z-index: 30; display: grid; gap: 6px; padding: 12px 16px; text-align: center; font: 500 13px Kanit, sans-serif; }
#invite b { color: var(--gold); font-size: 15px; }
#invite div { display: flex; gap: 8px; justify-content: center; }
#target em.gap-green { color: #a6eea0; } #target em.gap-blue { color: #9cc8ff; } #target em.gap-gray { color: #b4b2be; } #target em.gap-red { color: #ff9a7a; }
.ui-ico { display: inline-block; width: 18px; height: 18px; margin-right: 5px; vertical-align: -4px; background: var(--ico) center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.bag-tab .ui-ico { width: 20px; height: 20px; }
#invite b .ui-ico { width: 26px; height: 26px; vertical-align: -7px; }
.pf-member .crown-ico { position: absolute; right: 6px; top: 3px; width: 16px; height: 16px; margin: 0; }

/* Picture cards: a monster (or skill icon) to tap; picked = gold frame and tick, left out = grey and faded. */
.auto-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 9px; }
.auto-cards.skills { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.auto-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px 6px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line-soft); background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(255, 255, 255, 0.07), rgba(10, 8, 14, 0.5));
  color: var(--muted); font: 500 11.5px Kanit, sans-serif; transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s; }
.auto-card canvas { width: 100%; max-width: 72px; aspect-ratio: 1; filter: grayscale(1) brightness(0.6); opacity: 0.55; transition: filter 0.15s, opacity 0.15s; }
.auto-cards.skills canvas { max-width: 40px; border-radius: 8px; }
.auto-card b { font: 600 11.5px/1.2 Kanit, sans-serif; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-card small { font-size: 10px; color: var(--muted); }
.auto-card .tick { position: absolute; top: 5px; right: 5px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #6a6474; background: rgba(0, 0, 0, 0.4); }
.auto-card em { position: absolute; top: 5px; left: 5px; font: 800 8.5px Kanit, sans-serif; font-style: normal; letter-spacing: 0.08em; padding: 1px 5px; border-radius: 6px; background: #8a2a36; color: #ffd6dc; }
.auto-card kbd { position: absolute; top: 4px; left: 5px; font: 600 10px Kanit, sans-serif; color: var(--muted); }
.auto-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.auto-card.on { color: #f3ead6; border-color: var(--gold); box-shadow: 0 0 10px rgba(227, 194, 126, 0.25), inset 0 0 12px rgba(227, 194, 126, 0.1); }
.auto-card.on canvas { filter: none; opacity: 1; }
.auto-card.on .tick { border-color: var(--gold); background: var(--gold); }
.auto-card.on .tick::after { content: ''; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #241f2b; border-width: 0 2px 2px 0; rotate: 45deg; }
.auto-card.boss.on { border-color: #e06a78; box-shadow: 0 0 10px rgba(224, 106, 120, 0.3); }
.auto-card.boss.on .tick { border-color: #e06a78; background: #e06a78; }
#autochip { position: absolute; left: 50%; bottom: 226px; translate: -50% 0; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 9px;
  border-radius: 12px; border: 1px solid rgba(227, 194, 126, 0.35); background: rgba(14, 16, 30, 0.62); backdrop-filter: blur(3px);
  font: 500 12px Kanit, sans-serif; color: #e8e0cc; cursor: pointer; text-shadow: 0 1px 2px #000; }
#autochip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); animation: auto-blink 1.4s ease-in-out infinite; }
#autochip b { font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
#autochip span { color: #b8b0c4; }
#autochip span.low { color: #ff8a7a; }
#autochip:hover { border-color: var(--gold); }
@keyframes auto-blink { 50% { opacity: 0.35; } }

/* ---------- target frame and boss bar, v2: plain and easy to read (user, 2026-11-07: the painted frames were too ornate) ---------- */
/* The selected monster: a small bar at the top centre (where eyes look for a target), under the boss bar when both show. */
#hud #target { left: 50%; top: 12px; translate: -50% 0; width: 214px; height: auto; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 7px;
  padding: 4px 9px 5px 4px; border-radius: 10px; background: rgba(16, 18, 32, 0.82); border: 1px solid rgba(227, 194, 126, 0.3); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
#hud #bossbar:not([hidden]) ~ #target { top: 80px; }
/* Under 1400 px the top row (profile, event/mail/shop buttons, minimap) leaves no room in the middle: both bars step
   down below it. */
@media (max-width: 1399px) { #hud #bossbar { top: 78px; } #hud #target { top: 80px; } #hud #bossbar:not([hidden]) ~ #target { top: 148px; } }
#hud #target::after { display: none; }
#hud #target canvas { position: static; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3d4a66, #151a2a); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.2); }
#hud #target.champ canvas { box-shadow: 0 0 0 1.5px #ffd27a, 0 0 8px rgba(255, 210, 90, 0.7); }
#hud #target .tg-body { display: grid; gap: 3px; min-width: 0; }
#hud #target .tg-name { position: static; width: auto; height: auto; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; justify-content: flex-start; line-height: 1.15; overflow: hidden; }
#hud #target .tg-name b { font: 600 12.5px Kanit, sans-serif; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
#hud #target .tg-lv { font: 700 11px Kanit, sans-serif; }
#hud #target .tg-name em { flex-basis: 100%; font: 500 9.5px Kanit, sans-serif; }
#hud #target .tg-name em:empty { display: none; }
#hud #target .tg-hp { position: relative; left: auto; top: auto; width: 100%; height: 9px; border-radius: 5px; }
#hud #target .tg-hp span { font: 700 8px/9px Kanit, sans-serif; }
#hud #bossbar { top: 10px; width: min(440px, 60vw); padding: 6px 12px 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(34, 20, 44, 0.88), rgba(16, 12, 24, 0.84));
  border: 1px solid rgba(214, 160, 255, 0.4); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
#hud #bossbar .boss-name { margin-bottom: 5px; font: 700 15px Kanit, sans-serif; color: #f3dcff; text-shadow: 0 1px 3px #000; }
#hud #bossbar .boss-name small { font: 700 12px Kanit, sans-serif; color: #ffb36a; }
#hud #bossbar .bar.boss { height: 16px; aspect-ratio: auto; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(0, 0, 0, 0.55); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); }
#hud #bossbar .bar.boss::after { display: none; }
#hud #bossbar .bar.boss i { left: 0; top: 0; bottom: 0; inset-inline-start: 0; max-width: none; scale: none; border-radius: 0; }
#hud #bossbar .bar.boss i:not(.lag) { background: linear-gradient(180deg, #d79bff, #8a3fd0 60%, #5e2496); }
#hud #bossbar .bar.boss span { top: 0; font: 700 11px/16px Kanit, sans-serif; }#hud #bossbar .boss-name { align-items: center; }
.boss-tag { font: 800 10px/1 Kanit, sans-serif; font-style: normal; letter-spacing: 0.06em; color: #fff; padding: 3px 7px; border-radius: 8px;
  background: linear-gradient(180deg, #ff6a78, #a8162e); border: 1px solid #ffd27a; box-shadow: 0 0 8px rgba(255, 70, 90, 0.7); animation: boss-tag-pulse 1.8s ease-in-out infinite; }
@keyframes boss-tag-pulse { 50% { box-shadow: 0 0 3px rgba(255, 70, 90, 0.4); } }
/* An MVP: a gold tag, its phase and rage beside the name, a molten bar. */
.boss-tag.mvp { color: #3a1a04; background: linear-gradient(180deg, #ffe27a, #c8650e); box-shadow: 0 0 10px rgba(255, 180, 60, 0.85); }
.mvp-phase, .mvp-rage { font: 700 10px/1 Kanit, sans-serif; font-style: normal; padding: 3px 6px; border-radius: 7px; margin-left: 6px; }
.mvp-phase { color: #ffe0a0; background: rgba(120, 40, 10, 0.7); border: 1px solid rgba(255, 170, 80, 0.6); }
.mvp-rage { color: #fff; background: linear-gradient(180deg, #ff4a3a, #8a0e0e); border: 1px solid #ffb36a; animation: boss-tag-pulse 0.8s ease-in-out infinite; }
#hud #bossbar.mvp .bar.boss i:not(.lag) { background: linear-gradient(180deg, #ffd06a, #ff6a1a 55%, #a8200a); }
.mvp-name { color: #ffd06a; text-shadow: 0 0 6px rgba(255, 140, 40, 0.8); }
/* Admin tools (accounts in data/admins.json only): a small red button top-left, a compact window. */
#admin-btn { position: absolute; top: 146px; left: 14px; z-index: 30; font: 700 11px Kanit, sans-serif; letter-spacing: 0.08em; color: #fff; padding: 4px 10px;
  background: linear-gradient(180deg, #c8323c, #7a1220); border: 1px solid #ffd27a; border-radius: 8px; cursor: pointer; box-shadow: 0 0 8px rgba(200, 40, 60, 0.6); }
#win-admin { width: min(560px, 94vw); }
.adm { display: grid; gap: 8px; }
.adm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.adm-row > span:first-child { width: 52px; color: var(--muted, #a99f8c); font-size: 13px; }
.adm-row input, .adm-row select { background: rgba(0, 0, 0, 0.35); color: inherit; border: 1px solid var(--line, #7d6a45); border-radius: 6px; padding: 4px 8px; font: 14px Sarabun, sans-serif; }
.adm-row input[type=number] { width: 70px; } #adm-q { flex: 1; min-width: 200px; } #adm-map { max-width: 260px; }
.adm-god { color: #ffd86a; font-style: normal; }
.adm-items { display: grid; gap: 4px; max-height: 300px; overflow: hidden; }
.adm-item { display: flex; align-items: center; gap: 8px; } .adm-item canvas { width: 30px; height: 30px; } .adm-item b { flex: 1; font-weight: 600; } .adm-item small { font-size: 11px; }
/* Boss junk in the bag: a molten frame; an MVP prize: a gold frame that shimmers. */
.cell.boss-loot { border-color: #ff8a3a !important; box-shadow: inset 0 0 12px rgba(255, 110, 30, 0.45), 0 0 6px rgba(255, 110, 30, 0.5); }
.cell.mvp-loot { border-color: #ffd86a !important; animation: mvp-cell 1.6s ease-in-out infinite; }
@keyframes mvp-cell { 0%, 100% { box-shadow: inset 0 0 14px rgba(255, 200, 80, 0.55), 0 0 8px rgba(255, 120, 40, 0.7); } 50% { box-shadow: inset 0 0 20px rgba(255, 90, 30, 0.7), 0 0 14px rgba(255, 210, 90, 0.9); } }
/* Online game waiting for the server (main.js netWait). */
#netwait { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(8, 10, 18, 0.55); backdrop-filter: blur(2px); }
#netwait[hidden] { display: none; }
#netwait .nw-card { min-width: 300px; max-width: 420px; padding: 20px 26px; text-align: center; background: linear-gradient(180deg, var(--panel-top), var(--panel-bot)); border: 1px solid var(--line); border-radius: 10px; color: var(--cream, #f3ead8); font: 15px Sarabun, sans-serif; }
#netwait .nw-card p { margin: 8px 0 4px; font: 600 15px Kanit, sans-serif; color: var(--gold); }
#netwait .nw-card small { display: block; opacity: 0.75; margin-bottom: 10px; }
#netwait .nw-spin { display: inline-block; width: 26px; height: 26px; border: 3px solid rgba(227, 194, 126, 0.25); border-top-color: var(--gold); border-radius: 50%; animation: nw-spin 0.9s linear infinite; }
@keyframes nw-spin { to { transform: rotate(360deg); } }
/* Class 2 in the skill window (ui.js skills): tabs, the change card, cards and tags in the class-2 colour. */
.sk-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.sk-tabs button { flex: 1; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(10, 8, 14, 0.5); color: var(--cream, #f3ead8); font: 500 13px Kanit, sans-serif; cursor: pointer; }
.sk-tabs button.on { background: linear-gradient(180deg, rgba(255, 210, 122, 0.28), rgba(255, 170, 70, 0.12)); color: #ffe7a6; border-color: rgba(255, 210, 122, 0.7); }
.sk-tag.c2 { background: linear-gradient(90deg, #ffd27a, #ff9d5c); }
.c2-title { font: 600 11px Kanit, sans-serif; color: #1a1408; background: linear-gradient(90deg, #ffd27a, #ff9d5c); padding: 0 7px; border-radius: 7px; vertical-align: 2px; }
.c2-emblem { width: 26px; height: 26px; vertical-align: -6px; margin-right: 6px; filter: drop-shadow(0 0 4px rgba(255, 210, 120, 0.6)); }
.sk-card.c2 { border-color: rgba(255, 210, 122, 0.55); box-shadow: inset 0 0 18px rgba(255, 190, 90, 0.08); }
.pts.c2 b { color: #ffd27a; }
.c2-change { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255, 210, 122, 0.6);
  background: linear-gradient(135deg, rgba(255, 210, 122, 0.16), rgba(160, 110, 255, 0.10)); }
.c2-change > div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 220px; }
.c2-change b { font: 600 15px Kanit, sans-serif; color: #ffe7a6; }
.c2-change span { font-size: 13px; }
.c2-change small { font-size: 12px; opacity: 0.75; }
/* The class-change checklist (skills window and the master's dialog): done rows green with a tick, the rest muted. */
.c2-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.c2-steps li { display: grid; grid-template-columns: 16px 1fr auto; gap: 6px; align-items: baseline; font-size: 12.5px; color: var(--muted, #a99f8c); }
.c2-steps li i { font-style: normal; text-align: center; }
.c2-steps li b { font: 500 12.5px Kanit, sans-serif; color: inherit; }
.c2-steps li small { opacity: 0.7; }
.c2-steps li.ok { color: #8fe0a0; }
/* ---------- Quest book: one card shape for every quest, in the HUD's glass and thin gold ---------- */
#win-quests { width: min(540px, calc(100vw - 24px)); }
.qb-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line-soft); }
.qb-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--muted); font: 500 13.5px Kanit, sans-serif; cursor: pointer; transition: background 0.15s, color 0.15s; }
.qb-tabs button:hover { color: var(--cream); }
.qb-tabs button.on { background: linear-gradient(180deg, rgba(227, 194, 126, 0.2), rgba(227, 194, 126, 0.07)); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(227, 194, 126, 0.35); }
.qb-tabs em { font-style: normal; font-size: 11px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); color: var(--cream); }
.qb-tabs .tab-dot { margin-left: 0; }
.qb-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.qb-card { position: relative; padding: 12px 14px 12px; border-radius: 12px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--edge); box-shadow: inset 2px 0 0 rgba(227, 194, 126, 0.55); }
.qb-card.ready { border-color: rgba(125, 220, 138, 0.35); box-shadow: inset 2px 0 0 var(--ok), 0 0 18px rgba(125, 220, 138, 0.08); }
.qb-card.next { box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.18); }
.qb-card.class { box-shadow: inset 2px 0 0 #c9a2ff; }
.qb-top { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; }
.qb-who { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.3));
  box-shadow: inset 0 0 0 1px rgba(227, 194, 126, 0.35); }
.qb-title { min-width: 0; display: flex; flex-direction: column; }
.qb-title small { font: 500 11.5px Kanit, sans-serif; color: var(--gold); opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-title b { font: 600 17px Kanit, sans-serif; color: var(--cream); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-state { align-self: start; font: 500 11px Kanit, sans-serif; padding: 2px 9px; border-radius: 10px; color: var(--gold); border: 1px solid rgba(227, 194, 126, 0.35); white-space: nowrap; }
.qb-card.ready .qb-state { color: var(--ok); border-color: rgba(125, 220, 138, 0.45); }
.qb-desc { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.qb-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.qb-steps li { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 8px; padding-bottom: 7px; font-size: 12.5px; color: rgba(241, 232, 214, 0.45); }
.qb-steps li:last-child { padding-bottom: 0; }
/* The timeline: a dot per step on one thin line. */
.qb-steps li::before { content: ''; position: absolute; left: 7.5px; top: 12px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, 0.1); }
.qb-steps li:last-child::before { display: none; }
.qb-steps li > i { width: 9px; height: 9px; margin: 5px 0 0 3.5px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: #15131a; position: relative; }
.qb-steps li.ok { color: rgba(143, 224, 160, 0.75); }
.qb-steps li.ok > i { background: var(--ok); border-color: var(--ok); }
.qb-steps li.now { color: var(--cream); font-weight: 600; }
.qb-steps li.now > i { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 0 3px rgba(227, 194, 126, 0.18), 0 0 8px rgba(227, 194, 126, 0.6); }
.qb-steps li small { display: block; font-weight: 400; color: #ffb38a; font-size: 11.5px; }
.qb-steps li .qbar { margin-top: 5px; height: 5px; max-width: 260px; }
.qb-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.qb-reward { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.qb-reward .pc-chip { font-size: 12px; padding: 2px 9px 2px 6px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08); }
.qb-reward .ci-icon { width: 20px; height: 20px; margin: -3px 0; }
.qb-go { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.qb-where { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.qb-where svg { width: 12px; height: 12px; fill: none; stroke: var(--gold); stroke-width: 2; }
.qb-card.compact .qb-top { grid-template-columns: 38px 1fr auto; gap: 10px; }
.qb-card.compact .qb-who { width: 38px; height: 38px; }
.qb-card.compact .qb-title b { font-size: 15px; }
.qb-card.compact .qb-steps li > i, .qb-card.compact .qb-steps li::before { display: none; }
.qb-card.compact .qb-steps li { grid-template-columns: 1fr; }
.qb-card.compact .qb-foot { margin-top: 8px; padding-top: 8px; }
.qb-card .c2-steps { margin-top: 10px; }
.qb-sum { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 4px; font-size: 12px; color: var(--muted); }
.qb-sum .qbar.story { flex: 1; max-width: 260px; height: 4px; }
/* Quest book: "doing now / see all" switch, and the whole list a chapter (main) or region (side) at a time. */
.qb-view { display: flex; justify-content: flex-end; gap: 14px; margin: 8px 2px 0; }
.qb-view button { border: 0; background: none; padding: 2px 0; color: var(--muted); font: 500 12.5px Kanit, sans-serif; cursor: pointer; border-bottom: 1px solid transparent; }
.qb-view button.on { color: var(--gold); border-bottom-color: var(--gold); }
.qi-groups { display: flex; flex-wrap: wrap; gap: 4px; }
.qi-groups button { padding: 3px 10px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.03); color: var(--muted); font: 500 12px Kanit, sans-serif; cursor: pointer; }
.qi-groups button:hover { color: var(--cream); }
.qi-groups button.done { color: rgba(143, 224, 160, 0.8); }
.qi-groups button.on { color: var(--gold); border-color: rgba(227, 194, 126, 0.55); background: rgba(227, 194, 126, 0.1); }
.qi-list { display: flex; flex-direction: column; gap: 4px; }
.qi-row { display: grid; grid-template-columns: 22px 1fr auto 92px; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); }
.qi-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font: 700 12px Kanit, sans-serif; font-style: normal; border: 1px solid rgba(255, 255, 255, 0.15); color: var(--muted); }
.qi-mark svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.qi-main { min-width: 0; display: flex; flex-direction: column; }
.qi-main b { font: 500 13.5px Kanit, sans-serif; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-main b em { font-style: normal; font-size: 10.5px; margin-left: 6px; color: #8fd8ff; }
.qi-main small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-reward { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--cream); }
.qi-reward > .ci-icon { width: 20px; height: 20px; margin: 0; }
.qi-state { text-align: right; font-size: 11px; color: var(--muted); line-height: 1.3; }
.qi-row.done { opacity: 0.55; }
.qi-row.done .qi-mark { color: var(--ok); border-color: rgba(125, 220, 138, 0.5); }
.qi-row.now { border-color: rgba(227, 194, 126, 0.4); background: rgba(227, 194, 126, 0.07); }
.qi-row.now .qi-mark { color: var(--gold); border-color: var(--gold); }
.qi-row.now .qi-state { color: var(--gold); }
.qi-row.open .qi-mark { color: #1b1408; background: var(--gold); border-color: var(--gold); }
.qi-row.lock .qi-main b { color: rgba(241, 232, 214, 0.6); }
.qi-pager { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.qi-pager button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(227, 194, 126, 0.4); background: none; color: var(--gold); cursor: pointer; font: 600 14px Kanit, sans-serif; line-height: 1; }
.qi-pager button:disabled { opacity: 0.3; cursor: default; }
@media (max-width: 560px) { .qi-row { grid-template-columns: 22px 1fr 80px; } .qi-reward { display: none; } }
/* Quest tracker fold: a chevron like the chat's; folded shows only the title and how many quests run. */
#quest-fold { margin-left: auto; width: 24px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
#quest-fold:hover { background: rgba(227, 194, 126, 0.15); }
#quest-fold span { width: 7px; height: 7px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); rotate: 45deg; translate: 0 -2px; transition: rotate 0.2s, translate 0.2s; }
#quest-panel.folded #quest-fold span { rotate: -135deg; translate: 0 2px; }
#quest-panel.folded #quest-body { display: none; }
#quest-panel.folded .panel-title { border-bottom: 0; }
#quest-count:not(:empty) { font: 600 10.5px Kanit, sans-serif; min-width: 17px; padding: 0 5px; border-radius: 9px; background: rgba(227, 194, 126, 0.18); color: var(--gold); text-align: center; }
#quest-panel:not(.folded) #quest-count { display: none; }
/* Tracker rows: every quest the same shape (kind tag, name, go), so each reads as something to do in any order. */
#quest-body .q-entry { padding: 5px 0 6px; border-top: 1px solid var(--line-soft); cursor: pointer; }
#quest-body .q-entry:first-child { border-top: 0; padding-top: 1px; }
#quest-body .q-entry .quest-name { display: flex; align-items: center; gap: 5px; font-size: 13px; }
#quest-body .q-entry .quest-name span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#quest-body .q-entry .q-go { margin-left: 0; flex: none; }
#quest-body .q-entry .quest-prog { font-size: 12px; line-height: 1.35; }
#quest-body .q-entry.ready .quest-prog { color: var(--ok); }
.q-tag { flex: none; font: 500 10px Kanit, sans-serif; font-style: normal; padding: 0 5px; border-radius: 6px; line-height: 16px;
  color: var(--gold); background: rgba(227, 194, 126, 0.14); }
.q-tag.c2 { color: #d9c2ff; background: rgba(169, 139, 216, 0.18); }
.q-entry[data-go^="side"] .q-tag { color: #b9e6ff; background: rgba(120, 190, 240, 0.15); }
.q-entry:not([data-go^="side"]):not([data-go^="quest"]):not([data-go="class"]) .q-tag { color: #a6f0b2; background: rgba(125, 220, 138, 0.14); }
/* The training yard's damage meter (ui renderDrill): where the target frame sits, in the same glass and gold. */
#hud #drill { position: absolute; left: 50%; top: 12px; translate: -50% 0; width: 236px; padding: 7px 12px 8px; border-radius: 10px; background: rgba(16, 18, 32, 0.84);
  border: 1px solid rgba(227, 194, 126, 0.35); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); font: 500 11px Kanit, sans-serif; color: #d9dcea; pointer-events: auto; display: grid; gap: 4px; }
#hud #drill[hidden] { display: none; }
#hud #drill .dr-head { font: 600 10.5px Kanit, sans-serif; color: #e3c27e; letter-spacing: 0.02em; }
#hud #drill .dr-big { display: flex; align-items: baseline; gap: 6px; }
#hud #drill .dr-big b { font: 700 24px/1 Kanit, sans-serif; color: #fff; text-shadow: 0 1px 3px #000; }
#hud #drill .dr-big small { font: 500 11px Kanit, sans-serif; color: #e3c27e; }
#hud #drill .dr-row { display: flex; justify-content: space-between; gap: 8px; }
#hud #drill .dr-row b { color: #fff; font-weight: 600; }
#hud #drill.done { border-color: rgba(120, 220, 150, 0.45); }
#hud #drill.done .dr-head { color: #8fe0a6; }
#hud #bossbar:not([hidden]) ~ #drill { top: 80px; }
@media (max-width: 1399px) { #hud #drill { top: 80px; } }#hud #drill .dr-note { font: 500 9.5px Kanit, sans-serif; color: #aab0c8; margin-top: -2px; }
#hud #drill .dr-set { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
#hud #drill button { font: 500 10px Kanit, sans-serif; color: #c9cde0; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(227, 194, 126, 0.22); border-radius: 6px; padding: 2px 4px; cursor: pointer; }
#hud #drill button:hover { border-color: rgba(227, 194, 126, 0.6); color: #fff; }
#hud #drill button.on { background: rgba(227, 194, 126, 0.2); border-color: #e3c27e; color: #ffe8b0; }
#hud #drill .dr-lv { display: flex; align-items: center; gap: 3px; }
#hud #drill .dr-lv[hidden] { display: none; }
#hud #drill .dr-lv span { flex: 1; text-align: center; font: 600 10px Kanit, sans-serif; color: #fff; white-space: nowrap; }
#hud #drill .dr-lv button { min-width: 20px; padding: 1px 3px; }
#hud #drill .dr-stats:empty { display: none; }
#hud #drill .dr-stats { display: grid; gap: 3px; }
/* Crafting (ui renderCraft): rows of recipe → materials (have/need) → craft buttons, in the glass-and-gold window. */
#win-craft { width: min(560px, 94vw); }
#win-craft .cf-list { display: grid; gap: 6px; }
#win-craft .cf-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(227, 194, 126, 0.14); }
#win-craft .cf-row.blocked { opacity: 0.75; }
#win-craft .cf-row canvas { width: 44px; height: 44px; }
#win-craft .cf-body { display: grid; gap: 3px; min-width: 0; }
#win-craft .cf-body b { font: 600 13.5px Kanit, sans-serif; color: #fff; }
#win-craft .cf-body small { font: 500 11px Kanit, sans-serif; color: #aab0c8; }
#win-craft .cf-why { color: #ff9a7a !important; }
#win-craft .cf-needs { display: flex; flex-wrap: wrap; gap: 4px 8px; }
#win-craft .cf-need { display: inline-flex; align-items: center; gap: 3px; font: 600 11.5px Kanit, sans-serif; color: #dfe3f0; font-variant-numeric: tabular-nums; }
#win-craft .cf-need .ci-icon { width: 18px; height: 18px; }
#win-craft .cf-need.short { color: #ff8f80; }
#win-craft .cf-btns { display: grid; gap: 4px; }
#win-craft .cf-pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; font: 500 12px Kanit, sans-serif; color: #c9cde0; }
#win-craft .cf-empty { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 28px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(227, 194, 126, 0.25); }
#win-craft .cf-empty b { font: 600 15px Kanit, sans-serif; color: #e3c27e; }
#win-craft .cf-empty small { color: #aab0c8; max-width: 36ch; }
#win-craft .cf-foot { margin-top: 10px; display: flex; gap: 6px; align-items: center; }
/* Central market (ui renderMarket), minimal (user 2026-11-09): a segmented tab bar, a quiet list on the left, one
   action card on the right with a single big button. Glass, thin gold, no scrollbars (pages). */
#win-market { width: min(820px, 96vw); }
#win-market .mk-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
#win-market .mk-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(227, 194, 126, 0.22); }
#win-market .mk-seg button { font: 600 13px Kanit, sans-serif; color: #b9bed2; background: none; border: 0; border-radius: 999px; padding: 5px 18px; cursor: pointer; }
#win-market .mk-seg button.on { background: linear-gradient(180deg, #f0d48e, #c9a050); color: #241a08; }
#win-market .mk-collect { font: 600 12.5px Kanit, sans-serif; color: #d9f7e1; background: rgba(111, 207, 134, 0.18); border: 1px solid #6fcf86; border-radius: 999px; padding: 4px 14px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; animation: mk-pulse 2s ease-in-out infinite; }
@keyframes mk-pulse { 50% { box-shadow: 0 0 0 4px rgba(111, 207, 134, 0.15); } }
@media (prefers-reduced-motion: reduce) { #win-market .mk-collect { animation: none; } }
#win-market .mk-gold { margin-left: auto; font: 600 13px Kanit, sans-serif; color: #e3c27e; }
#win-market .mk-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 16px; min-height: 360px; }
@media (max-width: 720px) { #win-market .mk-body { grid-template-columns: 1fr; } }
#win-market .mk-left { display: grid; gap: 8px; align-content: start; min-width: 0; }
#win-market .mk-right { min-width: 0; }
#win-market canvas[data-icon] { width: 32px; height: 32px; }
#win-market input { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; color: #fff; font: 600 13px Kanit, sans-serif; padding: 4px 10px; min-width: 0; }
#win-market input:focus { outline: none; border-color: #e3c27e; }
#win-market input[type=number] { -moz-appearance: textfield; text-align: center; font-variant-numeric: tabular-nums; }
#win-market input::-webkit-outer-spin-button, #win-market input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Search and category, one row. */
#win-market .mk-find { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
#win-market .mk-find input { flex: 1 1 120px; }
#win-market .mk-find button, #win-market .mk-chips button { font: 500 11.5px Kanit, sans-serif; color: #b9bed2; background: none; border: 1px solid transparent; border-radius: 999px; padding: 2px 9px; cursor: pointer; }
#win-market .mk-find button.on, #win-market .mk-chips button.on { color: #ffe8b0; border-color: rgba(227, 194, 126, 0.55); }
/* The list: quiet rows, the picked one outlined in gold. */
#win-market .mk-list, #win-market .mk-mine { display: grid; gap: 2px; }
#win-market .mk-line { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 10px; border: 1px solid transparent; background: none; color: inherit; text-align: left; cursor: pointer; }
#win-market .mk-mine .mk-line { grid-template-columns: 32px minmax(0, 1fr) auto; background: rgba(255, 255, 255, 0.03); cursor: default; }
#win-market .mk-line:not(.static):hover { background: rgba(255, 255, 255, 0.04); }
#win-market .mk-line.on { border-color: rgba(227, 194, 126, 0.6); background: rgba(227, 194, 126, 0.07); }
#win-market .mk-nm { display: grid; min-width: 0; }
#win-market .mk-nm b { font: 600 13px Kanit, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-market .mk-nm small { font: 500 11px Kanit, sans-serif; color: #8f95ab; }
#win-market .mk-pr { font: 600 13.5px Kanit, sans-serif; color: #e3c27e; font-variant-numeric: tabular-nums; white-space: nowrap; }
#win-market i.up { color: #7ddc8a; font-style: normal; font-size: 9px; margin-left: 4px; vertical-align: 2px; }
#win-market i.down { color: #ff8f80; font-style: normal; font-size: 9px; margin-left: 4px; vertical-align: 2px; }
#win-market .mk-want { font: 600 10.5px Kanit, sans-serif; margin-left: 4px; }
#win-market .mk-want.high { color: #7ddc8a; } #win-market .mk-want.low { color: #ff9a7a; }
#win-market .mk-pages { display: flex; justify-content: center; align-items: center; gap: 10px; font: 500 12px Kanit, sans-serif; color: #b9bed2; }
#win-market .mk-pages button { background: none; border: 1px solid rgba(227, 194, 126, 0.3); color: #e3c27e; border-radius: 8px; width: 28px; height: 24px; cursor: pointer; }
#win-market .mk-pages button:disabled { opacity: 0.3; cursor: default; }
/* The bag to sell from. */
#win-market .mk-bag { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
#win-market .mk-cell { position: relative; aspect-ratio: 1; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); display: grid; place-items: center; cursor: pointer; padding: 0; }
#win-market .mk-cell:hover { border-color: rgba(227, 194, 126, 0.35); }
#win-market .mk-cell.on { border-color: #e3c27e; background: rgba(227, 194, 126, 0.08); }
#win-market .mk-cell canvas { width: 70%; height: 70%; }
#win-market .mk-cell i { position: absolute; right: 5px; bottom: 2px; font: 600 10.5px Kanit, sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
/* The action card. */
#win-market .mk-card { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(227, 194, 126, 0.22); }
#win-market .mk-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; }
#win-market .mk-item canvas { width: 44px; height: 44px; }
#win-market .mk-item div { display: grid; min-width: 0; }
#win-market .mk-item b { font: 600 15px Kanit, sans-serif; }
#win-market .mk-item small { font: 500 11.5px Kanit, sans-serif; color: #9aa0b6; }
#win-market .mk-amt { display: grid; grid-template-columns: auto 30px minmax(0, 1fr) 30px auto; gap: 4px; }
#win-market .mk-amt button { font: 600 11.5px Kanit, sans-serif; color: #e3c27e; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(227, 194, 126, 0.35); border-radius: 8px; padding: 0 9px; height: 30px; cursor: pointer; }
#win-market .mk-amt button:hover { background: rgba(227, 194, 126, 0.14); }
#win-market .mk-amt input { height: 30px; font-size: 14px; }
#win-market .mk-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 500 12.5px Kanit, sans-serif; color: #b9bed2; }
#win-market .mk-sum b { font: 600 15px Kanit, sans-serif; color: #fff; display: inline-flex; gap: 4px; align-items: center; }
#win-market .mk-sum b.ok { color: #8fe0a6; }
#win-market .mk-sum input { width: 110px; }
#win-market .mk-chips { display: flex; gap: 4px; margin-top: -4px; }
#win-market .mk-go { width: 100%; padding: 8px 10px; font-size: 14px; }
#win-market .mk-note { font: 500 11px Kanit, sans-serif; color: #8f95ab; }
#win-market .mk-note.big { font-size: 12.5px; color: #c9cde0; }
#win-market .mk-link { justify-self: start; background: none; border: 0; padding: 0; font: 500 12px Kanit, sans-serif; color: #9fd0ff; cursor: pointer; }
#win-market .mk-bid { display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, 0.1); }
#win-market .mk-tag { font-style: normal; font: 600 10px Kanit, sans-serif; padding: 0 6px; border-radius: 999px; margin-right: 2px; }
#win-market .mk-tag.sell { background: rgba(227, 194, 126, 0.18); color: #ffe8b0; } #win-market .mk-tag.buy { background: rgba(159, 208, 255, 0.15); color: #bfe0ff; }
#win-market .mk-x { font: 500 11.5px Kanit, sans-serif; color: #ff9a8a; background: none; border: 1px solid rgba(255, 140, 120, 0.35); border-radius: 8px; padding: 3px 10px; cursor: pointer; }
#win-market .mk-hint, #win-market .mk-empty { color: #8f95ab; font: 500 12.5px Kanit, sans-serif; padding: 14px 6px; }
#win-market .mk-right > .mk-hint { display: grid; place-items: center; height: 100%; min-height: 200px; border: 1px dashed rgba(255, 255, 255, 0.08); border-radius: 14px; }
#win-market .mk-empty { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 40px 12px; }
#win-market .mk-empty b { color: #e3c27e; font: 600 15px Kanit, sans-serif; }
#win-market .mk-mine + .mk-note { margin-top: 8px; }

#win-craft .cf-rate { font-style: normal; font: 600 11px Kanit, sans-serif; color: #ffcf7a; margin-left: 6px; }

/* ---------- Guild window (ui renderGuild): the market's glass-and-gold look, lists paged, never scrolls ---------- */
#chat .tab[data-tab="guild"], #chat-log .chat-guild, #chat-form[data-ch="guild"] { --cc: #e8c86a; }
/* Seven chat tabs (with the guild's) on one line: tighter, never wrapping. */
#chat .tab { padding: 3px 4px 4px; white-space: nowrap; font-size: 12px; }
@media (max-width: 1279px) { #chat .tab { padding: 3px 3px 4px; font-size: 11px; } }
#win-guild { width: min(860px, 96vw); }
#win-guild .gd { display: grid; gap: 12px; }
#win-guild .mk-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#win-guild .mk-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(227, 194, 126, 0.22); }
#win-guild .mk-seg button { font: 600 13px Kanit, sans-serif; color: #b9bed2; background: none; border: 0; border-radius: 999px; padding: 5px 16px; cursor: pointer; }
#win-guild .mk-seg button.on { background: linear-gradient(180deg, #f0d48e, #c9a050); color: #241a08; }
#win-guild .mk-find { display: flex; }
#win-guild .mk-find input { flex: 1; }
#win-guild input, #win-guild textarea { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; color: #fff; font: 500 13px Kanit, sans-serif; padding: 5px 10px; min-width: 0; }
#win-guild input:focus, #win-guild textarea:focus { outline: none; border-color: #e3c27e; }
#win-guild textarea { resize: none; height: 74px; width: 100%; box-sizing: border-box; }
#win-guild input[type=number] { width: 80px; text-align: center; -moz-appearance: textfield; }
#win-guild input::-webkit-outer-spin-button, #win-guild input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#win-guild .mk-pages { display: flex; justify-content: center; align-items: center; gap: 10px; font: 500 12px Kanit, sans-serif; color: #b9bed2; }
#win-guild .mk-pages button { background: none; border: 1px solid rgba(227, 194, 126, 0.3); color: #e3c27e; border-radius: 8px; width: 28px; height: 24px; cursor: pointer; }
#win-guild .mk-pages button:disabled { opacity: 0.3; cursor: default; }
#win-guild .mk-hint, #win-guild .mk-empty { font: 500 12.5px Kanit, sans-serif; color: #8f95ab; text-align: center; padding: 18px 0; }
#win-guild .muted { color: #8f95ab; }
/* The emblem: a symbol in its colour on a dark shield. */
.gd-emb { display: inline-grid; place-items: center; flex: none; border-radius: 30% 30% 46% 46%; background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.35)), var(--eb, #18181c);
  border: 1px solid color-mix(in srgb, var(--ec) 70%, transparent); box-shadow: inset 0 0 8px color-mix(in srgb, var(--ec) 25%, transparent); }
.gd-emb svg { width: 64%; height: 64%; fill: color-mix(in srgb, var(--ec) 35%, transparent); stroke: var(--ec); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.insp-guild { display: flex; align-items: center; gap: 6px; font: 600 12.5px Kanit, sans-serif; color: #f2d58a; }
.insp-guild small { color: #9aa0b6; font-weight: 500; }
/* Two columns: a list on the left, a card on the right. */
#win-guild .gd-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 16px; align-items: start; }
@media (max-width: 720px) { #win-guild .gd-split { grid-template-columns: 1fr; } }
#win-guild .gd-left { display: grid; gap: 8px; min-width: 0; }
#win-guild .gd-list { display: grid; gap: 3px; }
#win-guild .gd-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; }
#win-guild .gd-row.invited { border-color: rgba(227, 194, 126, 0.55); background: rgba(227, 194, 126, 0.07); }
#win-guild .gd-row:not(:has(.gd-emb)) { grid-template-columns: minmax(0, 1fr) auto; }
#win-guild .gd-main { display: grid; min-width: 0; }
#win-guild .gd-main b { font: 600 13.5px Kanit, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-main b em { font-style: normal; color: #e3c27e; font-size: 12px; margin-left: 4px; }
#win-guild .gd-main small { font: 500 11px Kanit, sans-serif; color: #8f95ab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-act { display: flex; gap: 4px; align-items: center; }
#win-guild .gd-wait { font: 500 12px Kanit, sans-serif; color: #ff9a7a; text-align: center; }
#win-guild .gd-card { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(227, 194, 126, 0.22); min-width: 0; }
#win-guild .gd-card-title { font: 600 12px Kanit, sans-serif; color: #e3c27e; letter-spacing: 0.02em; }
#win-guild .gd-preview { display: flex; align-items: center; gap: 12px; font: 600 16px Kanit, sans-serif; }
img.gd-emb.art { display: inline-block; border: 0; border-radius: 0; background: none; box-shadow: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
/* The emblem picker: four parts as text tabs, then one part's sixteen (or eight) choices in two rows of eight. */
#win-guild .gd-ptabs { display: flex; gap: 16px; border-bottom: 1px solid var(--hair, rgba(255, 255, 255, 0.08)); }
#win-guild .gd-ptabs button { background: none; border: 0; border-bottom: 1px solid transparent; padding: 2px 0 6px; color: var(--mute, #9aa0b6); font: 500 12px var(--sans, Kanit), sans-serif; cursor: pointer; }
#win-guild .gd-ptabs button.on { color: var(--ink, #f2ede3); border-bottom-color: var(--gilt, #c9a96e); }
#win-guild .gd-pick { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; min-height: 76px; align-content: start; }
#win-guild .gd-pick button { aspect-ratio: 1; display: grid; place-items: center; padding: 0; border-radius: 2px; border: 1px solid transparent; background: none; cursor: pointer; }
#win-guild .gd-pick button:hover { background: rgba(255, 255, 255, 0.04); }
#win-guild .gd-pick button.on { border-color: var(--gilt, #c9a96e); background: rgba(201, 169, 110, 0.08); }
/* A colour is a solid bead of that colour: a small highlight and a darker rim. */
#win-guild .gd-pick.colors button { border-radius: 50%; width: 22px; height: 22px; aspect-ratio: auto; justify-self: center; align-self: center; border: 0;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55) 0 7%, transparent 16%), radial-gradient(circle at 40% 35%, var(--m1), var(--m2) 40%, var(--m3) 100%);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.6); }
#win-guild .gd-pick.colors button:hover { transform: scale(1.08); }
#win-guild .gd-pick.colors button.on { box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.45), 0 0 0 2px #0d0c0f, 0 0 0 3px var(--gilt, #c9a96e); }
#win-guild .gd-pick.colors { min-height: 58px; }
#win-guild .gd-mname { margin-top: -4px; font: 500 11.5px var(--serif, Kanit), serif; color: var(--gilt-hi, #e8d3a6); letter-spacing: 0.04em; text-align: center; }
#win-guild .gd-req { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 500 11.5px Kanit, sans-serif; }
#win-guild .gd-req .ok { color: #8fe0a6; } #win-guild .gd-req .no { color: #ff9a7a; }
#win-guild .gd-req span { display: inline-flex; align-items: center; gap: 3px; }
#win-guild .gd-card .btn.primary { width: 100%; }
/* The banner of one's own guild. */
#win-guild .gd-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(227, 194, 126, 0.09), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(227, 194, 126, 0.25); }
#win-guild .gd-title { display: grid; gap: 3px; min-width: 0; }
#win-guild .gd-title b { font: 600 18px Kanit, sans-serif; color: #fff; }
#win-guild .gd-title span, #win-guild .gd-title small { font: 500 11.5px Kanit, sans-serif; color: #b9bed2; }
#win-guild .gd-exp { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.4); overflow: hidden; max-width: 320px; }
#win-guild .gd-exp i { display: block; height: 100%; background: linear-gradient(90deg, #c9a050, #f0d48e); }
#win-guild .gd-perk { display: grid; gap: 2px; text-align: right; font: 500 11px Kanit, sans-serif; color: #8f95ab; }
#win-guild .gd-perk b { font: 600 13.5px Kanit, sans-serif; color: #8fe0a6; }
#win-guild .gd-leave { margin-left: auto; }
#win-guild .gd-badge { font-style: normal; background: #e0605a; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 10.5px; margin-left: 2px; }
/* Members: a quiet table, the picked row outlined; actions for the picked one in the bar below. */
#win-guild .gd-mtable { display: grid; gap: 2px; }
#win-guild .gd-mhead, #win-guild .gd-mrow { display: grid; grid-template-columns: 14px minmax(0, 1.4fr) 44px minmax(0, 1fr) 84px 84px minmax(0, 1.2fr); gap: 8px; align-items: center; padding: 5px 10px; text-align: left; }
#win-guild .gd-mhead { font: 500 11px Kanit, sans-serif; color: #8f95ab; }
#win-guild .gd-mrow { border-radius: 9px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.025); color: #c9cde0; font: 500 12.5px Kanit, sans-serif; cursor: pointer; }
#win-guild .gd-mrow:hover { background: rgba(255, 255, 255, 0.05); }
#win-guild .gd-mrow.sel { border-color: rgba(227, 194, 126, 0.6); background: rgba(227, 194, 126, 0.07); }
#win-guild .gd-mrow b { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-mrow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-mrow:not(.on) { opacity: 0.6; }
#win-guild .gd-dot { width: 8px; height: 8px; border-radius: 50%; background: #565c70; }
#win-guild .gd-mrow.on .gd-dot { background: #6fcf86; box-shadow: 0 0 6px #6fcf86; }
#win-guild .rk-leader { color: #f2d58a; } #win-guild .rk-officer { color: #9fd0ff; }
#win-guild .gd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 34px; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); font: 500 12.5px Kanit, sans-serif; }
#win-guild .gd-invite { margin-left: auto; display: flex; gap: 4px; }
#win-guild .gd-invite input { width: 160px; }
/* Activity: today's three tasks, the level table, the notice and the log. */
#win-guild .gd-today { display: grid; gap: 4px; }
#win-guild .gd-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
#win-guild .gd-task b { font: 600 13px Kanit, sans-serif; }
#win-guild .gd-task small { grid-row: 2; font: 500 11px Kanit, sans-serif; color: #8f95ab; }
#win-guild .gd-task > :last-child { grid-row: 1 / 3; grid-column: 2; }
#win-guild .gd-give { display: flex; gap: 4px; align-items: center; }
#win-guild .gd-give input { width: 90px; }
#win-guild .gd-levels { display: grid; gap: 2px; }
#win-guild .gd-levels div { display: grid; grid-template-columns: 50px 56px minmax(0, 1fr) 80px; gap: 8px; padding: 4px 12px; border-radius: 8px; font: 500 12px Kanit, sans-serif; color: #8f95ab; }
#win-guild .gd-levels div.past { color: #b9bed2; }
#win-guild .gd-levels div.on { color: #fff; background: rgba(227, 194, 126, 0.1); border: 1px solid rgba(227, 194, 126, 0.4); }
#win-guild .gd-levels b { color: #e3c27e; }
#win-guild .gd-levels small { text-align: right; font-variant-numeric: tabular-nums; }
#win-guild .gd-notice { margin: 0; font: 500 12.5px Kanit, sans-serif; color: #e8ebf4; white-space: pre-wrap; max-height: 80px; overflow: hidden; }
#win-guild .gd-log { display: grid; gap: 3px; font: 500 11.5px Kanit, sans-serif; color: #b9bed2; }
#win-guild .gd-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-log small { color: #8f95ab; margin-right: 6px; }
#win-guild .gd-open { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font: 500 12px Kanit, sans-serif; color: #b9bed2; }
#win-guild .gd-save { display: flex; gap: 6px; justify-content: space-between; }
#win-guild .gd-save .btn { white-space: nowrap; }
#win-guild .gd-save .btn.primary { width: auto; flex: 1; }

/* ===================================================================================================================
   Theme A · นัวร์ทองคำเปลว (user picked 2026-11-09 from the UI canvas https://claude.ai/artifact/W2yMGaSE5LcsqW1Jdy85vV):
   every window and the NPC dialog on near-black, one hairline of gilt, serif titles and key numbers, flat buttons,
   square corners, tabs as underlines. Layered over the glass+gold rules above (delete this block to go back); the
   in-world HUD keeps its painted kit.
   =================================================================================================================== */
:root { --gilt: #C9A96E; --gilt-hi: #E8D3A6; --gilt-soft: rgba(201, 169, 110, 0.32); --ink: #F2EDE3; --mute: #A59F93; --hair: rgba(242, 237, 227, 0.08);
  --serif: 'Noto Serif Thai', 'Kanit', serif; --sans: 'IBM Plex Sans Thai', 'Sarabun', sans-serif; }
.window, #win-preview {
  background: rgba(13, 12, 15, 0.94); border: 1px solid var(--gilt-soft); border-radius: 2px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
  color: var(--ink); --gold: var(--gilt); --cream: var(--ink); --muted: var(--mute); --line: var(--gilt-soft); --line-soft: var(--hair); --edge: var(--hair); --well: rgba(255, 255, 255, 0.02); }
/* (Plex's own line height is taller than Kanit's: one fixed height keeps every window the size it was, so none outgrows the screen.) */
.window *, #win-preview * { font-family: var(--sans) !important; line-height: 1.4 !important; }
.window .power b { line-height: 1.05 !important; }
#dialog .dlg-text { line-height: 1.75 !important; }
/* Titles: serif, larger, quiet; the painted corners, crest, divider and close are off on windows. */
.window > .panel-title, #win-preview > .panel-title { font-family: var(--serif) !important; font-size: 19px; font-weight: 500; color: var(--ink); padding: 12px 20px 10px; border-bottom: 1px solid var(--hair); letter-spacing: 0.01em; }
.kit .window::before, .kit .window::after, .kit #win-preview::before, .kit #win-preview::after,
.kit .window > .panel-title::before, .kit .window > .panel-title::after, .kit #win-preview > .panel-title::before, .kit #win-preview > .panel-title::after { display: none; }
.kit .window[style*="--icon"] > .panel-title { padding-left: 22px; background: none; }
.window .close, .kit .window .close, .kit #win-preview .close { width: 30px; height: 30px; font-size: 20px; color: var(--mute); background: none; filter: none; border: 0; }
.window .close:hover, .kit .window .close:hover { color: var(--ink); filter: none; }
.window :is(.qb-title b, .shop-info > b:first-child, .bag-detail b, .gd-title b, .gd-card-title, .mk-item b, .insp-who b, .bag-sub, .shop-head), #dialog .dlg-name b { font-family: var(--serif) !important; font-weight: 500; }
.window .power b { font-family: var(--serif) !important; font-weight: 500; color: var(--gilt-hi); text-shadow: none; letter-spacing: 0.02em; }
.window .power small { color: var(--mute); letter-spacing: 0.24em; }
.window .power small::before, .window .power small::after { background: var(--hair); }
/* Buttons: hairline gilt; the main action solid gilt; ok / go / danger keep their meaning, flattened. */
.window .btn, #win-preview .btn { background: none; border: 1px solid rgba(201, 169, 110, 0.5); border-radius: 2px; box-shadow: none; color: var(--gilt-hi); font-weight: 500; }
.window .btn:hover:not(:disabled) { background: rgba(201, 169, 110, 0.08); color: #fff; border-color: var(--gilt); }
.window .btn.primary { background: var(--gilt); border-color: var(--gilt); color: #17130c; font-weight: 600; }
.window .btn.primary:hover:not(:disabled) { background: var(--gilt-hi); color: #17130c; filter: none; }
.window .btn.ok { background: rgba(111, 207, 134, 0.14); border-color: rgba(111, 207, 134, 0.6); color: #b4ecc2; }
.window .btn.go { background: rgba(120, 180, 255, 0.12); border-color: rgba(140, 196, 255, 0.55); color: #c4defc; }
.window .btn.danger { background: rgba(255, 120, 110, 0.1); border-color: rgba(255, 140, 128, 0.55); color: #ffc0b8; }
.window :is(.bd-btn) { border-radius: 2px; }
/* The painted 9-slice button art (html.kit) never shows inside a theme A window: it drew tan blobs round "−", "+", "x10"
   and "ถอด" (user 2026-11-09: "ดูโคตรห่วยแตก"). */
:is(.window, #win-preview, #dialog) .btn { border-image: none !important; border-width: 1px !important; border-style: solid; filter: none !important; text-shadow: none !important;
  min-height: 30px; padding: 5px 14px; line-height: 1.2 !important; }
:is(.window, #win-preview, #dialog) .btn.small { min-height: 26px; padding: 3px 10px; font-size: 12.5px; }
.window .btn.on:not(.primary) { background: rgba(201, 169, 110, 0.12); border-color: var(--gilt); color: var(--ink); }
.window .qty { grid-template-columns: 34px 1fr 34px; gap: 6px; }
.window .qty .btn { padding: 0; font-size: 16px; color: var(--ink); border-color: var(--hair); }
.window .qty input { height: 34px; border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.03); font: 500 15px var(--serif); color: var(--ink); }
.window .qty-presets { display: grid; grid-template-columns: repeat(3, 1fr) 1.6fr; gap: 6px; margin-top: 6px; }
.window .qty-presets .btn { padding: 3px 4px; color: var(--mute); border-color: var(--hair); }
.window .qty-presets .btn.on { color: var(--ink); border-color: var(--gilt); background: rgba(201, 169, 110, 0.1); }
/* Tabs and segmented switches: text with a gilt underline. */
.bag-tabs { border-bottom: 1px solid var(--hair); gap: 22px; }
.bag-tab, .bag-tab.on { background: none; border: 0; border-bottom: 1px solid transparent; border-radius: 0; padding: 6px 0 10px; }
.bag-tab.on { color: var(--ink); border-bottom-color: var(--gilt); }
.window .qb-tabs, :is(#win-market, #win-guild) .mk-seg { background: none; border: 0; border-radius: 0; padding: 0; gap: 22px; }
.window .qb-tabs button, :is(#win-market, #win-guild, #win-ranking) .mk-seg button { flex: none; border-radius: 0; padding: 6px 0 9px; background: none; box-shadow: none; color: var(--mute); border-bottom: 1px solid transparent; }
.window .qb-tabs button.on, :is(#win-market, #win-guild, #win-ranking) .mk-seg button.on { background: none; box-shadow: none; color: var(--ink); border-bottom-color: var(--gilt); }
.window .qb-tabs em { background: none; color: var(--gilt); padding: 0; }
.bag-filters button, .window .mk-find button { border: 0; border-radius: 0; background: none; padding: 3px 2px; border-bottom: 1px solid transparent; }
.bag-filters button.on, .window .mk-find button.on { color: var(--ink); border-color: transparent; border-bottom-color: var(--gilt); }
/* Cells, slots and cards: square, hairline, no inner glow; the selected one outlined in gilt. */
.window .cell { border-radius: 2px; border-color: var(--hair); background: rgba(255, 255, 255, 0.02); box-shadow: none; }
.window .cell.filled { border-color: rgba(242, 237, 227, 0.12); }
.window .cell.sel, .window .cell.on { border-color: var(--gilt); background: rgba(201, 169, 110, 0.07); }
.window .doll-slot { border-radius: 2px; background: rgba(255, 255, 255, 0.02); }
.window :is(.qb-card, .shop-item, .shop-detail, .bag-detail, .shop-row, .dlg-quest, .mk-card, .mk-line, .mk-cell, .gd-row, .gd-card, .gd-task, .gd-banner, .gd-mrow, .gd-bar, .bd-row, .gs-card, .qi-row) { border-radius: 2px; }
.window :is(.qb-card, .bag-detail, .shop-detail, .mk-card, .gd-card) { background: rgba(255, 255, 255, 0.025); border-color: var(--hair); box-shadow: none; }
.window .shop-item.sel { border-color: var(--gilt); background: rgba(201, 169, 110, 0.07); }
.window .shop-big canvas { border-radius: 2px; background: radial-gradient(closest-side, rgba(201, 169, 110, 0.14), transparent); }
.window :is(.shop-who, .dlg-who canvas) { border-color: var(--gilt-soft); background: #1b1820; }
.window input, .window textarea, .window select { border-radius: 2px; }
/* The NPC dialog: a dark box, the name in serif gilt on a hairline plate, choices as plain rows. */
#dialog { border-width: 1px 0 0; border-top-color: rgba(201, 169, 110, 0.55); }
#dialog .dlg-name { background: rgba(13, 12, 15, 0.97); color: var(--gilt-hi); border: 1px solid var(--gilt-soft); border-radius: 2px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); padding: 5px 16px; }
#dialog .dlg-name b { font-size: 18px; }
#dialog .dlg-name small { color: var(--mute); opacity: 1; letter-spacing: 0.12em; }
#dialog .dlg-text { font-size: 15.5px; line-height: 1.8; color: #ECE6DA; }
.dlg-choice { border-radius: 2px; background: none; border-color: transparent; }
.dlg-choice:hover:not(:disabled) { translate: 0; background: rgba(201, 169, 110, 0.07); border-color: transparent; }
.dlg-choice.main { background: rgba(201, 169, 110, 0.1); border-color: transparent; }
.dlg-choice.bye { color: var(--mute); }

/* ---------- Theme A on the HUD (user 2026-11-09: "ทำ 2 ก่อน"): the same near-black, gilt hairline and square corners as
   the windows, in place of the painted player frame, bar rail, wings, emblem and slot frames. Skill and menu icons
   stay painted. ---------- */
#hud :is(#profile, #quest-panel, #chat, #party-frames, #target, #bossbar, #map-panel, #castbar, #autochip, #drill) *, .toast { font-family: var(--sans) !important; }
#hud :is(#profile, #quest-panel, #party-frames, #target, #bossbar, #castbar) * { line-height: 1.3 !important; }
/* The player frame: portrait, serif name, level at the top right, two flat bars. */
#hud #profile, .kit #hud #profile { width: 300px; height: auto; aspect-ratio: auto; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px;
  background: rgba(13, 12, 15, 0.86); border: 1px solid var(--gilt-soft); border-radius: 2px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px); }
.kit #hud #profile::after { display: none; }
#hud #portrait, .kit #hud #portrait { position: static; width: 60px; height: 60px; flex: none; border-radius: 2px; border: 1px solid var(--gilt-soft); box-shadow: none;
  background: radial-gradient(closest-side, rgba(201, 169, 110, 0.16), #141218); }
#hud #profile .pf-body, .kit #hud #profile .pf-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
#hud #profile .pf-name, .kit #hud #profile .pf-name { position: static; width: auto; height: auto; justify-content: flex-start; align-items: baseline; gap: 8px; padding-right: 54px; }
#hud #profile .pf-name b { font-family: var(--serif) !important; font-size: 16px; font-weight: 500; color: var(--ink); }
#hud #profile.c2 .pf-name b { color: var(--gilt-hi); }
#hud #profile .pf-name small { font-size: 11px; color: var(--mute); }
#hud .pf-lv, .kit #hud .pf-lv { position: absolute; right: 12px; top: 9px; left: auto; bottom: auto; width: auto; height: auto; translate: none; aspect-ratio: auto;
  display: flex; align-items: baseline; gap: 4px; background: none; filter: none; }
#hud .pf-lv small, .kit #hud .pf-lv small { display: inline; font-size: 10px; letter-spacing: 0.18em; color: var(--gilt); }
#hud .pf-lv b, .kit #hud .pf-lv b { position: static; display: inline; padding: 0; font-family: var(--serif) !important; font-size: 17px; font-weight: 500; color: var(--gilt-hi); }
#hud #profile .bar, .kit #hud #profile .bar { position: relative; left: auto; top: auto; width: 100%; height: 13px; border-radius: 1px; background: rgba(255, 255, 255, 0.06); box-shadow: none; }
#hud #profile .bar.mp, .kit #hud #profile .bar.mp { height: 9px; }
#hud #profile .bar.res, .kit #hud #profile .bar.res { height: 6px; }
#hud #profile .bar i { border-radius: 1px; box-shadow: none; }
#hud #profile .bar.hp i:not(.lag):not(.shield) { background: linear-gradient(90deg, #8e2a35, #d6505a); }
#hud #profile .bar.mp i { background: linear-gradient(90deg, #2a4f8e, #4f8fe0); }
#hud #profile .bar span { font-size: 10px; font-weight: 500; }
#hud #profile .bar.mp span { font-size: 8.5px; }
.kit #hud #buffs { top: 104px; }
/* Minimap, quest tracker, chat. */
#hud #minimap { border: 1px solid var(--gilt-soft); border-radius: 2px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
#hud #map-panel .panel-title { font-family: var(--serif) !important; font-weight: 500; }
#hud #quest-panel { background: rgba(13, 12, 15, 0.84); border: 1px solid var(--gilt-soft); border-radius: 2px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4); }
#hud #quest-panel .panel-title { font-family: var(--serif) !important; font-weight: 500; color: var(--ink); border-bottom-color: var(--hair); }
#hud #quest-panel:hover { border-color: var(--gilt); }
#hud #quest-panel.done { border-color: rgba(111, 207, 134, 0.6); box-shadow: 0 0 14px rgba(111, 207, 134, 0.25); }
#hud #quest-panel .qbar { border-radius: 1px; }
#hud #chat { background: rgba(13, 12, 15, 0.74); border: 1px solid var(--hair); border-radius: 2px; }
#hud #chat-input { border-radius: 2px; background: rgba(255, 255, 255, 0.04); }
#hud #chat .btn { border-radius: 2px; background: none; border: 1px solid rgba(201, 169, 110, 0.5); color: var(--gilt-hi); box-shadow: none; }
#hud #chat-grip { border-top-right-radius: 2px; }
/* The skill bar keeps painted wings, emblem, rail and slot frames (a flat one was "ไม่เท่"): the noir-gilt set `uibar2`
   (blackened steel, antique-gold edges, amber gems), picked over `uibar` in ui.js; the slot's well is warm black. */
.kit #hud .slot { background: var(--ui-sframe) center / 100% 100% no-repeat, radial-gradient(circle at 50% 40%, rgba(46, 38, 30, 0.75), rgba(8, 7, 10, 0.88)) center / 88% 88% no-repeat; }
.kit #hud .sb-emblem { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(255, 150, 40, 0.18)); }
#hud .slot .key { color: var(--gilt-hi); }
#hud #exp-line { box-shadow: inset 0 0 0 1px rgba(201, 169, 110, 0.25); background: rgba(8, 7, 10, 0.55); }
#hud #exp-line i { background: linear-gradient(90deg, rgba(201, 169, 110, 0.55), var(--gilt-hi)); }
/* Target, boss bar, cast bar, party frames, toasts. */
#hud #target { background: rgba(13, 12, 15, 0.88); border: 1px solid var(--gilt-soft); border-radius: 2px; }
#hud #target canvas { border-radius: 2px; }
#hud #target .tg-hp, #hud #target .tg-hp i { border-radius: 1px; }
#hud #bossbar { background: rgba(13, 12, 15, 0.9); border: 1px solid rgba(201, 169, 110, 0.45); border-radius: 2px; }
#hud #bossbar .boss-name { font-family: var(--serif) !important; font-weight: 500; }
#hud #bossbar .bar.boss { border-radius: 1px; }
.kit #hud #castbar .bar.cast { height: 8px; aspect-ratio: auto; border-radius: 1px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.kit #hud #castbar .bar.cast::after { display: none; }
.kit #hud #castbar .bar.cast i { left: 0; top: 0; bottom: 0; max-width: none; scale: none; border-radius: 0; background: linear-gradient(90deg, rgba(201, 169, 110, 0.6), var(--gilt-hi)); box-shadow: none; }
#hud :is(.pt-head, .pt-card, .pt-wait, .pf-member) { border-radius: 2px; background: rgba(13, 12, 15, 0.84); }
#hud .pt-card canvas { border-radius: 2px; }
#hud :is(.pt-acts button, .pt-fold, .pt-leave, .pt-bonus) { border-radius: 2px; }
#hud :is(.pt-hp, .pt-hp i) { border-radius: 1px; }
.toast { border-radius: 2px; background: rgba(13, 12, 15, 0.92); }
@media (max-width: 700px) { #hud #profile, .kit #hud #profile { width: 220px; padding: 6px; gap: 8px; } #hud #portrait, .kit #hud #portrait { width: 44px; height: 44px; } }

/* AFK by a road camp's fire (core afkTick), on the auto chip's place above the skill bar. */
#autochip .afk-fire { background: #ff9a3a; box-shadow: 0 0 8px #ff8a2a; animation: afk-fire 1.1s ease-in-out infinite alternate; }
@keyframes afk-fire { from { transform: scale(0.8); opacity: 0.75; } to { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #autochip .afk-fire { animation: none; } }
#autochip .afk-warm { color: #ffc27a; }
#autochip .afk-pay { color: #9fe3a8; }
/* ---------- The golden chest's opening scene (ui openChest / chestReveal) ----------
   Rattle with light leaking out, then the lid bursts: a flash, turning rays, a ring of sparks, the prize rising.
   Tier colour --tc: gilt for everyday things, sky blue for stones, the gear's rarity colour for the jackpot. */
#chest-open { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; align-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 42%, rgba(20, 16, 10, 0.72), rgba(5, 4, 6, 0.9) 70%); backdrop-filter: blur(3px);
  --tc: #e8d3a6; animation: co-fade 0.25s ease-out; font-family: var(--sans, 'IBM Plex Sans Thai', sans-serif); }
@keyframes co-fade { from { opacity: 0; } }
#chest-open .co-stage { position: relative; width: 300px; height: 260px; display: grid; place-items: center; }
#chest-open .co-chest { position: relative; z-index: 2; width: 176px; height: 176px; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6)); }
#chest-open .co-glow { position: absolute; z-index: 1; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 85%, white) 0%, color-mix(in srgb, var(--tc) 40%, transparent) 35%, transparent 70%); opacity: 0; }
#chest-open .co-rays { position: absolute; z-index: 0; width: 520px; height: 520px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 55%, transparent) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, black 18%, transparent 62%); mask: radial-gradient(circle, black 18%, transparent 62%); }
#chest-open .co-sparks { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#chest-open .co-sparks i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; opacity: 0;
  background: color-mix(in srgb, var(--tc) 60%, white); box-shadow: 0 0 8px var(--tc); }
#chest-open .co-prize { position: absolute; z-index: 4; display: grid; place-items: center; opacity: 0; transform: scale(0.2); }
#chest-open .co-prize canvas { width: 116px; height: 116px; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--tc) 70%, transparent)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
#chest-open .co-prize em { position: absolute; right: -18px; bottom: 4px; font: 600 22px var(--serif, serif); font-style: normal; color: #fff; text-shadow: 0 2px 6px #000; }
#chest-open .co-text { display: grid; justify-items: center; gap: 2px; text-align: center; min-height: 72px; }
#chest-open .co-text small { font-size: 12px; letter-spacing: 0.16em; color: var(--tc); }
#chest-open .co-text b { font: 600 26px/1.25 var(--serif, serif); color: #f6efe2; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
#chest-open .co-text span { font: 500 15px var(--serif, serif); color: var(--tc); }
#chest-open .co-btns { display: flex; gap: 10px; min-height: 34px; }
#chest-open .co-btns .btn { border-image: none !important; border: 1px solid rgba(201, 169, 110, 0.55); border-radius: 2px; background: rgba(13, 12, 15, 0.8); color: #e8d3a6; padding: 7px 18px; font: 500 14px var(--sans, sans-serif); cursor: pointer; }
#chest-open .co-btns .btn.primary { background: #c9a96e; color: #17130c; border-color: #c9a96e; }
#chest-open .co-btns .btn small { opacity: 0.75; }
/* The rattle: knocks getting quicker, light leaking out and swelling. */
#chest-open.co-shake .co-chest { animation: co-rattle 1.3s cubic-bezier(.5, 0, 1, 1) forwards; }
#chest-open.co-shake .co-glow { animation: co-leak 1.3s ease-in forwards; }
#chest-open.co-shake .co-text b { animation: co-blink 0.8s ease-in-out infinite; }
@keyframes co-rattle {
  0% { transform: rotate(0) scale(1); } 8% { transform: rotate(-5deg); } 16% { transform: rotate(5deg); } 24% { transform: rotate(0); }
  42% { transform: rotate(-7deg) translateY(-4px); } 50% { transform: rotate(7deg); } 58% { transform: rotate(0); }
  68% { transform: rotate(-9deg) translateY(-6px) scale(1.04); } 74% { transform: rotate(9deg) scale(1.04); } 80% { transform: rotate(-9deg) scale(1.06); }
  86% { transform: rotate(10deg) scale(1.07); } 92% { transform: rotate(-10deg) scale(1.08); } 100% { transform: rotate(0) translateY(-10px) scale(1.12); } }
@keyframes co-leak { 0% { opacity: 0; transform: scale(0.4); } 100% { opacity: 0.85; transform: scale(1.05); } }
@keyframes co-blink { 50% { opacity: 0.55; } }
/* The burst. */
#chest-open.co-open .co-chest { animation: co-burst 0.5s ease-out forwards; }
#chest-open.co-open .co-glow { animation: co-flash 0.9s ease-out forwards; }
#chest-open.co-open .co-rays { animation: co-rays-in 0.6s ease-out forwards, co-spin 14s linear infinite; }
#chest-open.co-open .co-sparks i { animation: co-spark 0.9s cubic-bezier(.15, .7, .3, 1) forwards; }
#chest-open.co-open .co-prize { animation: co-rise 0.7s cubic-bezier(.2, 1.6, .4, 1) 0.15s forwards, co-float 2.6s ease-in-out 0.9s infinite; }
#chest-open.co-open .co-text, #chest-open.co-open .co-btns { animation: co-up 0.4s ease-out 0.35s both; }
@keyframes co-burst { 0% { transform: scale(1.12); opacity: 1; filter: brightness(1.6); } 100% { transform: scale(1.6) translateY(30px); opacity: 0; filter: brightness(3) blur(4px); } }
@keyframes co-flash { 0% { opacity: 1; transform: scale(0.8); } 30% { opacity: 1; transform: scale(2.2); } 100% { opacity: 0.45; transform: scale(1.4); } }
@keyframes co-rays-in { from { opacity: 0; transform: scale(0.3); } to { opacity: 0.9; transform: scale(1); } }
@keyframes co-spin { to { rotate: 360deg; } }
@keyframes co-spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(var(--s)); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(0.2); } }
@keyframes co-rise { to { opacity: 1; transform: scale(1); } }
@keyframes co-float { 50% { translate: 0 -8px; } }
@keyframes co-up { from { opacity: 0; transform: translateY(10px); } }
/* Louder tiers: stones bigger rays; the jackpot a second slower ring, rays at full strength and a shimmering title. */
#chest-open.tier-rare .co-rays { width: 580px; height: 580px; }
#chest-open.tier-jackpot .co-rays { width: 680px; height: 680px; animation-duration: 0.6s, 8s; }
#chest-open.tier-jackpot .co-sparks i { width: 8px; height: 8px; animation-duration: 1.3s; }
#chest-open.tier-jackpot .co-text b { font-size: 30px; background: linear-gradient(90deg, #fff, var(--tc), #fff); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: co-shimmer 1.6s linear infinite; }
@keyframes co-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { #chest-open *, #chest-open { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; } }
/* The reel (one chest): a strip of prize cards sliding under a gilt marker, easing out onto the real prize. */
#chest-open .co-reel { position: absolute; z-index: 5; left: 50%; top: 50%; width: min(92vw, 760px); height: 112px; transform: translate(-50%, -50%);
  overflow: hidden; border-top: 1px solid rgba(201, 169, 110, 0.5); border-bottom: 1px solid rgba(201, 169, 110, 0.5);
  background: linear-gradient(90deg, rgba(8, 7, 9, 0.95), rgba(20, 17, 14, 0.82) 30%, rgba(20, 17, 14, 0.82) 70%, rgba(8, 7, 9, 0.95));
  -webkit-mask: linear-gradient(90deg, transparent, black 14%, black 86%, transparent); mask: linear-gradient(90deg, transparent, black 14%, black 86%, transparent);
  animation: co-reel-in 0.35s ease-out; }
@keyframes co-reel-in { from { opacity: 0; transform: translate(-50%, -50%) scaleY(0.2); } }
#chest-open .co-strip { display: flex; gap: 8px; padding: 12px 0; will-change: transform; }
#chest-open .co-card { flex: none; width: 88px; height: 88px; display: grid; place-items: center; border-radius: 2px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--cc) 22%, transparent), rgba(255, 255, 255, 0.03) 70%);
  border: 1px solid color-mix(in srgb, var(--cc) 35%, transparent); border-bottom: 3px solid var(--cc); }
#chest-open .co-card img { width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.55)); }
#chest-open .co-card.t-jackpot { box-shadow: inset 0 0 18px color-mix(in srgb, var(--cc) 45%, transparent); }
#chest-open .co-card.won { animation: co-won 0.42s ease-out forwards; border-color: var(--cc); }
@keyframes co-won { 50% { transform: scale(1.14); box-shadow: 0 0 28px var(--cc); } 100% { transform: scale(1.1); box-shadow: 0 0 22px var(--cc); } }
#chest-open .co-mark { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f2d58a; box-shadow: 0 0 10px #f2d58a; }
#chest-open .co-mark::before, #chest-open .co-mark::after { content: ''; position: absolute; left: -6px; border: 7px solid transparent; }
#chest-open .co-mark::before { top: 0; border-top-color: #f2d58a; }
#chest-open .co-mark::after { bottom: 0; border-bottom-color: #f2d58a; }
#chest-open.co-reeling .co-chest { animation: co-burst 0.45s ease-out forwards; }
#chest-open.co-reeling .co-glow { animation: co-flash 0.8s ease-out forwards; }
#chest-open.co-reeling .co-text span { font: 400 12px var(--sans, sans-serif); color: #8a8478; }
/* All chests: the prizes as cards popping in one after another. */
#chest-open.co-all .co-stage { width: min(92vw, 640px); height: auto; min-height: 260px; }
/* (The single prize starts hidden and rises in; the cards hold no hidden start of their own, so the box stays shown.) */
#chest-open.co-all .co-prize { position: relative; z-index: 4; opacity: 1; transform: none; animation: none; }
#chest-open .co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; width: min(92vw, 620px); }
#chest-open .co-got { display: grid; justify-items: center; gap: 2px; padding: 10px 6px 8px; border-radius: 2px; text-align: center;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cc) 20%, transparent), rgba(13, 12, 15, 0.85) 75%);
  border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent); border-bottom: 3px solid var(--cc);
  opacity: 0; animation: co-pop 0.38s cubic-bezier(.2, 1.5, .4, 1) calc(0.25s + var(--i) * 0.07s) forwards; }
#chest-open .co-got img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5)); }
#chest-open .co-got b { font: 500 12.5px/1.3 var(--sans, sans-serif); color: #f2ede3; }
#chest-open .co-got em { position: static; font: 600 16px var(--serif, serif); font-style: normal; color: var(--cc); text-shadow: none; }
#chest-open.co-all .co-rays { opacity: 0.5; }
#chest-open .co-got.t-jackpot { box-shadow: 0 0 22px color-mix(in srgb, var(--cc) 55%, transparent); }
@keyframes co-pop { from { opacity: 0; transform: scale(0.5) translateY(10px); } to { opacity: 1; transform: none; } }
/* Rare cards on the reel stand out as they pass: stones in a pulsing electric-blue aura; the jackpot's boss pieces in
   their rarity colour with a turning gold-and-colour rim, a light sweep and a strong glow. */
#chest-open .co-card { position: relative; overflow: hidden; isolation: isolate; }
#chest-open .co-card.t-rare { border-color: var(--cc); border-bottom-width: 3px;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--cc) 55%, transparent), color-mix(in srgb, var(--cc) 12%, #0b0d14) 72%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--cc) 80%, transparent), inset 0 0 18px color-mix(in srgb, var(--cc) 60%, transparent);
  animation: co-aura 0.9s ease-in-out infinite; }
#chest-open .co-card.t-rare img { filter: drop-shadow(0 0 8px var(--cc)) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5)); }
@keyframes co-aura { 50% { box-shadow: 0 0 26px var(--cc), inset 0 0 26px color-mix(in srgb, var(--cc) 75%, transparent); } }
#chest-open .co-card.t-jackpot { border: 0; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--cc) 70%, white 10%), color-mix(in srgb, var(--cc) 25%, #0b0910) 75%);
  box-shadow: 0 0 22px var(--cc), 0 0 40px color-mix(in srgb, var(--cc) 55%, transparent); animation: co-aura-j 0.7s ease-in-out infinite; }
#chest-open .co-card.t-jackpot::before { content: ''; position: absolute; inset: -40%; z-index: -2;
  background: conic-gradient(from 0deg, #ffd65a, var(--cc), #fff6c8, var(--cc), #ffd65a); animation: co-spin 1.6s linear infinite; }
#chest-open .co-card.t-jackpot::after { content: ''; position: absolute; inset: 3px; z-index: -1; border-radius: 1px;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--cc) 60%, transparent), #0d0a12 78%); }
#chest-open .co-card.t-jackpot img { filter: drop-shadow(0 0 10px var(--cc)) drop-shadow(0 0 4px #fff6c8); animation: co-shine 1.1s ease-in-out infinite; }
@keyframes co-aura-j { 50% { box-shadow: 0 0 34px var(--cc), 0 0 60px color-mix(in srgb, var(--cc) 70%, transparent); } }
@keyframes co-shine { 50% { filter: drop-shadow(0 0 16px var(--cc)) drop-shadow(0 0 8px #fff6c8) brightness(1.25); } }
/* The same auras on the "open all" cards. */
#chest-open .co-got.t-rare { border-color: var(--cc); box-shadow: 0 0 18px color-mix(in srgb, var(--cc) 75%, transparent), inset 0 0 16px color-mix(in srgb, var(--cc) 45%, transparent); }
#chest-open .co-got.t-jackpot { border-color: var(--cc); box-shadow: 0 0 28px var(--cc), inset 0 0 22px color-mix(in srgb, var(--cc) 55%, transparent); }
/* Room for the auras to spread inside the reel, and louder rare cards. */
#chest-open .co-reel { height: 136px; }
#chest-open .co-strip { padding: 24px 0; }
#chest-open .co-card.t-rare { border: 2px solid var(--cc); transform: scale(1.04);
  box-shadow: 0 0 22px var(--cc), 0 0 6px #fff inset, inset 0 0 24px color-mix(in srgb, var(--cc) 70%, transparent); }
@keyframes co-aura { 50% { box-shadow: 0 0 34px var(--cc), 0 0 10px #fff inset, inset 0 0 32px var(--cc); } }
#chest-open .co-card.t-jackpot { transform: scale(1.08); box-shadow: 0 0 30px var(--cc), 0 0 56px color-mix(in srgb, var(--cc) 70%, transparent); }
#chest-open .co-card.t-jackpot::after { inset: 4px; }
@keyframes co-aura-j { 50% { box-shadow: 0 0 44px var(--cc), 0 0 80px var(--cc); } }
/* Stones on the reel and in the summary: only a cooler steel-blue edge than the potions, no aura (user: not rare). */
#chest-open .co-card.t-stone { border-color: color-mix(in srgb, var(--cc) 45%, transparent); border-bottom: 3px solid var(--cc);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--cc) 16%, transparent), rgba(255, 255, 255, 0.03) 70%); }
#chest-open .co-got.t-stone { border-color: color-mix(in srgb, var(--cc) 40%, transparent); border-bottom: 3px solid var(--cc); }
/* An item-bar slot under a dragged item. */
#skillbar .slot.drop { outline: 2px solid #f2d58a; outline-offset: 2px; filter: brightness(1.25); }

/* ---------- Skill bar v3 (user 2026-11-09: "not minimal; make it proportional, minimal, easy and restful") ----------
   One dark glass strip in theme A: utilities | the six skills | the item bar, the groups parted by hairlines. No wings,
   emblem or rail. Skills one size up from the small slots, all square-cornered, the key on a small corner tab, the
   count bottom-right. The EXP line runs along the strip's foot with its percentage under it. */
#hud #skillbar { display: grid; grid-template-columns: auto auto auto; align-items: center; justify-content: center; gap: 0; bottom: 8px; width: max-content; max-width: calc(100vw - 16px);
  padding: 8px 12px 0; background: rgba(13, 12, 15, 0.8); border: 1px solid rgba(201, 169, 110, 0.26); border-radius: 3px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42); backdrop-filter: blur(6px); }
#hud #skillbar .sb-top { display: contents; }
#hud #skillbar .sb-emblem, #hud #skillbar .sb-rail { display: none; }
#hud #dock-left { order: 1; } #hud #dock-main { order: 2; } #hud #dock-right { order: 3; }
#hud #skillbar .sb-group { gap: 6px; align-items: center; }
#hud #skillbar #dock-main { gap: 7px; margin: 0 12px; padding: 0 12px; border-left: 1px solid rgba(242, 237, 227, 0.1); border-right: 1px solid rgba(242, 237, 227, 0.1); }
#hud #skillbar .slot, html.kit #hud #skillbar .slot { width: 40px; height: 40px; border-radius: 3px; border: 1px solid rgba(242, 237, 227, 0.14);
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 70%); box-shadow: none; transition: border-color 0.15s, transform 0.15s; }
#hud #skillbar #dock-main .slot { width: 52px; height: 52px; }
#hud #skillbar .slot canvas, html.kit #hud #skillbar .slot canvas { width: 84%; height: 84%; margin: 8%; border-radius: 2px; }
#hud #skillbar .slot .cd, #hud #skillbar .slot .lock { inset: 0; border-radius: 2px; }
#hud #skillbar .slot:hover { border-color: rgba(201, 169, 110, 0.75); transform: translateY(-2px); filter: none; }
#hud #skillbar .slot .key { left: 0; top: 0; bottom: auto; padding: 0 3px; font: 600 9px/13px var(--sans, Kanit), sans-serif; letter-spacing: 0.04em;
  color: var(--gilt-hi, #e8d3a6); background: rgba(13, 12, 15, 0.78); border-radius: 0 0 2px 0; text-shadow: none; }
#hud #skillbar #dock-main .slot .key { font-size: 10.5px; line-height: 14px; padding: 0 4px; }
#hud #skillbar .slot .count { right: 3px; bottom: 1px; font: 600 10.5px var(--sans, Kanit), sans-serif; color: #f2ede3; }
#hud #skillbar .slot.on { border-color: rgba(125, 220, 138, 0.9); box-shadow: inset 0 0 0 1px rgba(125, 220, 138, 0.5), 0 0 10px rgba(125, 220, 138, 0.35); }
#hud #skillbar .slot.off:not(.empty) { filter: grayscale(0.7) brightness(0.65); }
#hud #skillbar .slot.empty { border-style: dashed; border-color: rgba(242, 237, 227, 0.16); background: none; filter: none; }
/* The EXP line: a thin gold bar at the strip's foot with a light running along it; warm and glowing from 90%, pulsing
   from 98%, a bright flash on each gain. */
#hud #skillbar #exp-line { order: 4; grid-column: 1 / -1; height: 3px; margin: 8px -12px 15px; border-radius: 0; background: rgba(242, 237, 227, 0.07); box-shadow: none; overflow: visible; }
#hud #skillbar #exp-line i { border-radius: 0; background: linear-gradient(90deg, #8a6f3c, var(--gilt, #c9a96e) 70%, var(--gilt-hi, #e8d3a6)); overflow: hidden; }
#hud #skillbar #exp-line i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 248, 225, 0.75), transparent) no-repeat;
  background-size: 60px 100%; animation: exp-run 3.2s linear infinite; }
@keyframes exp-run { from { background-position: -60px 0; } to { background-position: calc(100% + 60px) 0; } }
#hud #skillbar #exp-line span { top: 5px; font: 500 9.5px var(--sans, Kanit), sans-serif; letter-spacing: 0.06em; color: rgba(232, 211, 166, 0.75); text-shadow: none; }
#hud #skillbar #exp-line.near i { background: linear-gradient(90deg, #a8662a, #f0a040 70%, #ffd27a); box-shadow: 0 0 8px rgba(255, 170, 60, 0.7); }
#hud #skillbar #exp-line.near span { color: #ffc46a; }
#hud #skillbar #exp-line.almost i { background: linear-gradient(90deg, #c8743a, #ffb050 60%, #fff0b0); animation: exp-pulse 0.9s ease-in-out infinite; }
#hud #skillbar #exp-line.almost span { color: #ffe08a; animation: exp-pulse 0.9s ease-in-out infinite; }
#hud #skillbar #exp-line.almost span::after { content: ' · ใกล้เลเวลอัป!'; }
@keyframes exp-pulse { 50% { box-shadow: 0 0 14px rgba(255, 200, 90, 0.95); filter: brightness(1.3); } }
#hud #skillbar #exp-line.gain i { animation: exp-gain 0.5s ease-out; }
#hud #skillbar #exp-line.almost.gain i { animation: exp-gain 0.5s ease-out, exp-pulse 0.9s ease-in-out 0.5s infinite; }
@keyframes exp-gain { 0% { filter: brightness(2.2); box-shadow: 0 0 12px rgba(255, 240, 200, 0.9); } }
@media (max-width: 900px) {
  #hud #skillbar { padding: 6px 8px 0; }
  #hud #skillbar .slot, html.kit #hud #skillbar .slot { width: 34px; height: 34px; }
  #hud #skillbar #dock-main .slot { width: 44px; height: 44px; }
  #hud #skillbar #dock-main { margin: 0 8px; padding: 0 8px; gap: 5px; }
  #hud #skillbar #exp-line { margin: 6px -8px 14px; }
}
@media (prefers-reduced-motion: reduce) { #hud #skillbar #exp-line i::after, #hud #skillbar #exp-line.almost i, #hud #skillbar #exp-line.almost span { animation: none; } }
/* The combat-power ranking window (ui renderRanking): rows in four columns, the top three marked in gold, silver and
   bronze, our own row outlined and pinned again at the foot. */
#win-ranking { width: min(640px, calc(100vw - 24px)); }
#win-ranking .rk { display: grid; gap: 6px; }
#win-ranking .rk-head, #win-ranking .rk-row { display: grid; grid-template-columns: 52px minmax(0, 1.4fr) minmax(0, 1fr) 110px; gap: 10px; align-items: center; }
#win-ranking .rk-head { padding: 0 12px 4px; font-size: 11.5px; letter-spacing: 0.08em; color: var(--gilt, #c9a96e); border-bottom: 1px solid var(--hair, rgba(242, 237, 227, 0.08)); }
#win-ranking .rk-head span:last-child, #win-ranking .rk-power { text-align: right; }
#win-ranking .rk-list { display: grid; gap: 3px; }
#win-ranking .rk-row { padding: 7px 12px; border: 1px solid transparent; border-radius: 2px; background: rgba(255, 255, 255, 0.025); }
#win-ranking .rk-row.me { border-color: var(--gilt, #c9a96e); background: rgba(201, 169, 110, 0.08); }
#win-ranking .rk-n { font: 600 16px var(--serif, serif); color: var(--mute, #a59f93); text-align: center; }
#win-ranking .rk-row.top1 .rk-n { color: #f2c94c; } #win-ranking .rk-row.top2 .rk-n { color: #cfd6de; } #win-ranking .rk-row.top3 .rk-n { color: #d39a62; }
#win-ranking .rk-row.top1 { background: linear-gradient(90deg, rgba(242, 201, 76, 0.12), rgba(255, 255, 255, 0.02) 60%); }
#win-ranking .rk-who { display: grid; min-width: 0; }
#win-ranking .rk-who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-ranking .rk-who small, #win-ranking .rk-guild small { color: var(--mute, #a59f93); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-ranking .rk-guild { display: flex; align-items: center; gap: 6px; min-width: 0; }
#win-ranking .rk-power { font: 600 15px var(--serif, serif); color: var(--gilt-hi, #e8d3a6); font-variant-numeric: tabular-nums; }
#win-ranking .rk-mine { border-top: 1px solid var(--hair, rgba(242, 237, 227, 0.08)); padding-top: 6px; }
#win-ranking .rk-foot { text-align: center; font-size: 11px; }
/* Guild phase 2: shop, warehouse, guild boss (2026-11-09) */
#win-guild .gd-coins { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px; border: 1px solid rgba(214,178,106,.28); border-radius: 2px; background: rgba(214,178,106,.05); }
#win-guild .gd-coins b { font-family: 'Noto Serif Thai', serif; color: var(--gilt, #d6b26a); font-size: 18px; }
#win-guild .gd-coins small { flex: 1; min-width: 0; opacity: .65; }
#win-guild .gd-coins .btn { flex: none; }
#win-guild .gd-shop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
#win-guild .gd-good { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 2px; background: rgba(255,255,255,.025); min-height: 48px; }
#win-guild .gd-good.lock { opacity: .45; }
#win-guild .gd-good .ci-icon, #win-guild .gd-good img { width: 34px; height: 34px; flex: none; }
#win-guild .gd-good .gd-mon { width: 40px; height: 40px; flex: none; border-radius: 50%; background: rgba(255,255,255,.05); }
#win-guild .gd-good .gd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#win-guild .gd-good .gd-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
#win-guild .gd-good .gd-main small { opacity: .6; font-size: 11px; }
#win-guild .gd-good .gd-main em { font-style: normal; color: var(--gilt, #d6b26a); font-size: 11px; }
#win-guild .gd-price { color: var(--gilt, #d6b26a); font-weight: 600; white-space: nowrap; font-size: 12px; }
#win-guild .gd-good .bd-btn[disabled] { opacity: .4; cursor: default; }#win-ranking .rk-tabs { margin-bottom: 8px; }
#win-ranking .rk-gname { display: flex; align-items: center; gap: 8px; }
#win-ranking .rk-gname > span { display: flex; flex-direction: column; min-width: 0; }
#win-ranking .rk-power small { opacity: .55; font-weight: 400; font-size: 11px; }
#win-ranking .rk-tabs { display: flex; gap: 18px; border-bottom: 1px solid rgba(214,178,106,.15); }
#win-ranking .rk-tabs button { font: inherit; cursor: pointer; border: 0; border-bottom: 1px solid transparent; }

/* The forge (2026-11-09): pieces on the left, the piece in a ring on the right with now/next, mode, cost, one button. */
#win-shop .shop-wrap.forge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; }
#win-shop .fg-list { max-height: 380px; overflow-y: auto; }
#win-shop .fg-pick { cursor: pointer; }
#win-shop .shop-detail.fg { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 14px 12px; }
#win-shop .fg-ring { position: relative; width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, rgba(214,178,106,.16) 0 45%, rgba(214,178,106,.04) 62%, transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(214,178,106,.45), 0 0 0 7px rgba(214,178,106,.06), inset 0 0 0 12px rgba(0,0,0,.25), inset 0 0 0 13px rgba(214,178,106,.22); }
#win-shop .fg-ring canvas { width: 84px; height: 84px; position: relative; z-index: 1; }
#win-shop .fg-halo { position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed rgba(214,178,106,.35); animation: fg-spin 22s linear infinite; }
#win-shop .fg-ring.forging .fg-halo { animation-duration: 1.2s; border-color: rgba(255,214,140,.8); }
#win-shop .fg-ring.forging canvas { animation: fg-hit .3s ease-in-out 3; }
#win-shop .fg-ring.fg-ok { animation: fg-ok .9s ease-out; }
#win-shop .fg-ring.fg-fail { animation: fg-fail .5s ease-out; }
#win-shop .fg-result { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 2px; z-index: 2; animation: fg-pop .5s ease-out; }
#win-shop .fg-result.ok { color: #1b1408; background: linear-gradient(180deg, #ffe39a, #d9a646); }
#win-shop .fg-result.bad { color: #ffd6d0; background: #5a1e1a; border: 1px solid #a8433a; }
#win-shop .fg-name { font-family: 'Noto Serif Thai', serif; font-size: 16px; font-weight: 700; }
#win-shop .fg-name b { color: var(--gilt, #d6b26a); }
#win-shop .fg-cmp { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; width: 100%; }
#win-shop .fg-cmp > div { display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 2px; font-size: 12px; }
#win-shop .fg-cmp > div.nx { border-color: rgba(214,178,106,.4); }
#win-shop .fg-cmp small { opacity: .6; } #win-shop .fg-cmp b { font-size: 16px; color: var(--gilt, #d6b26a); }
#win-shop .fg-cmp > i { font-style: normal; opacity: .5; }
#win-shop .fg-mode { display: flex; gap: 0; border: 1px solid rgba(214,178,106,.35); border-radius: 2px; overflow: hidden; }
#win-shop .fg-mode button { border: 0; background: none; color: var(--mute, #a59f93); padding: 6px 16px; font: inherit; cursor: pointer; }
#win-shop .fg-mode button.on { background: rgba(214,178,106,.18); color: var(--ink, #ece4d4); }
#win-shop .fg-mode button:disabled { opacity: .35; cursor: default; }
#win-shop .fg-cost { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
#win-shop .fg-cost span { display: inline-flex; align-items: center; gap: 4px; }
#win-shop .fg-cost .ci-icon, #win-shop .fg-cost img { width: 26px; height: 26px; }
#win-shop .fg-cost .no b, #win-shop .fg-cost .no { color: #ff8a7a; }
#win-shop .fg-rate b { color: var(--gilt, #d6b26a); font-size: 16px; }
#win-shop .fg-note { font-size: 12px; opacity: .65; }
#win-shop .fg-go { min-width: 160px; }
@keyframes fg-spin { to { transform: rotate(360deg); } }
@keyframes fg-hit { 50% { transform: translateY(3px) scale(.94) rotate(-6deg); filter: brightness(1.6); } }
@keyframes fg-ok { 0% { box-shadow: 0 0 0 0 rgba(255,214,120,.9); filter: brightness(1.8); } 100% { filter: none; } }
@keyframes fg-fail { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes fg-pop { from { transform: translate(-50%, 6px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #win-shop .fg-halo, #win-shop .fg-ring, #win-shop .fg-ring canvas { animation: none !important; } }
@media (max-width: 700px) { #win-shop .shop-wrap.forge { grid-template-columns: 1fr; } }
/* Enhancement numbers (2026-11-09): +8 ice blue, +12 violet, +15 molten gold with a moving aura. */
.plus-t { font-weight: 800; font-family: Kanit, sans-serif; display: inline-block; position: relative; color: #f3e6c4; }
.plus-t.t-blue { color: #8fe0ff; text-shadow: 0 0 6px rgba(30,155,255,.85), 0 0 12px rgba(30,155,255,.45); }
.plus-t.t-violet { color: #e2a6ff; text-shadow: 0 0 6px rgba(163,44,255,.9), 0 0 14px rgba(163,44,255,.55), 0 0 22px rgba(163,44,255,.3); }
.plus-t.t-gold { background: linear-gradient(180deg, #fffbe0 0%, #ffe066 40%, #ffb800 70%, #c97400 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 4px rgba(255,190,40,.95)) drop-shadow(0 0 10px rgba(255,150,0,.6)); animation: plus-gold 1.6s ease-in-out infinite; }
.plus-t.t-gold::before { content: ""; position: absolute; inset: -60% -45%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(255,214,90,.55) 10%, transparent 14% 33%, rgba(255,240,170,.5) 36%, transparent 40% 60%, rgba(255,200,60,.55) 63%, transparent 67% 85%, rgba(255,235,150,.45) 88%, transparent 92%);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); animation: plus-rays 4s linear infinite; }
.plus-t.t-gold::after { content: "✦"; position: absolute; right: -0.9em; top: -0.55em; font-size: .6em; color: #fff6c8; text-shadow: 0 0 6px #ffd23f; animation: plus-twinkle 1.3s ease-in-out infinite; }
canvas.plus15 { animation: plus15-glow 1.8s ease-in-out infinite; }
@keyframes plus-gold { 50% { filter: drop-shadow(0 0 7px rgba(255,210,70,1)) drop-shadow(0 0 16px rgba(255,150,0,.8)); } }
@keyframes plus-rays { to { transform: rotate(360deg); } }
@keyframes plus-twinkle { 50% { opacity: .25; transform: scale(.6) rotate(45deg); } }
@keyframes plus15-glow { 0%, 100% { filter: drop-shadow(0 0 2px rgba(255,190,40,.6)); } 50% { filter: drop-shadow(0 0 7px rgba(255,200,60,.95)); } }
@media (prefers-reduced-motion: reduce) { .plus-t.t-gold, .plus-t.t-gold::before, .plus-t.t-gold::after, canvas.plus15 { animation: none; } }
/* Forge moments (2026-11-09): hammer blows with sparks, a success burst, a failure crack. */
#win-shop .fg-ring { overflow: visible; }
#win-shop .fg-hammer { position: absolute; width: 54px; height: 54px; right: -6px; top: -14px; z-index: 3; transform-origin: 30% 90%; animation: fg-swing 380ms ease-in 3; pointer-events: none; }
#win-shop .fg-hammer svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
#win-shop .fg-fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
#win-shop .fg-fx i { position: absolute; left: 50%; top: 50%; display: block; }
#win-shop .fg-spark { width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: rgb(var(--rgb)); box-shadow: 0 0 6px 2px rgba(var(--rgb), .9); animation: fg-fly var(--t) cubic-bezier(.2,.7,.4,1) forwards; }
#win-shop .fg-spark.big { width: 6px; height: 6px; margin: -3px; }
#win-shop .fg-flashlet { width: 70px; height: 70px; margin: -35px; border-radius: 50%; background: radial-gradient(circle, rgba(255,240,200,.9), rgba(var(--rgb), .3) 45%, transparent 70%); animation: fg-fade 260ms ease-out forwards; }
#win-shop .fg-flash { width: 220px; height: 220px; margin: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.95), rgba(var(--rgb), .55) 35%, transparent 70%); animation: fg-fade 600ms ease-out forwards; }
#win-shop .fg-shock { width: 40px; height: 40px; margin: -20px; border-radius: 50%; border: 3px solid rgba(var(--rgb), .95); box-shadow: 0 0 12px rgba(var(--rgb), .9); animation: fg-shock 700ms ease-out forwards; }
#win-shop .fg-shock.two { animation-delay: 150ms; opacity: 0; }
#win-shop .fg-rays { width: 240px; height: 240px; margin: -120px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(var(--rgb), .55) 0 4deg, transparent 4deg 22deg);
  -webkit-mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 68%); mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 68%);
  animation: fg-rays 1100ms ease-out forwards; }
#win-shop .fg-fx-fail .fg-flash { background: radial-gradient(circle, rgba(255,120,90,.8), rgba(120,20,10,.5) 40%, transparent 70%); }
#win-shop .fg-crack { width: 96px; height: 96px; margin: -48px; animation: fg-crack 1500ms ease-out forwards; }
#win-shop .fg-crack svg { width: 100%; height: 100%; }
#win-shop .fg-shard { width: 7px; height: 9px; margin: -4px; left: auto; top: auto; background: linear-gradient(135deg, #8c8f99, #3a3c44); clip-path: polygon(50% 0, 100% 60%, 40% 100%, 0 40%); animation: fg-fall var(--t) ease-in forwards; }
#win-shop .fg-smoke { width: 34px; height: 34px; margin: -17px; top: 60%; border-radius: 50%; background: radial-gradient(circle, rgba(60,55,60,.65), transparent 70%); animation: fg-smoke var(--t) ease-out forwards; opacity: 0; }
#win-shop .fg-ring.fg-ok canvas { animation: fg-lift 900ms ease-out; }
#win-shop .fg-ring.fg-fail canvas { animation: fg-dim 1400ms ease-out; }
@keyframes fg-swing { 0% { transform: rotate(-55deg) translate(6px, -6px); } 70% { transform: rotate(18deg); } 100% { transform: rotate(-55deg) translate(6px, -6px); } }
@keyframes fg-fly { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
@keyframes fg-fade { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.1); } }
@keyframes fg-shock { from { opacity: 1; transform: scale(.5); } to { opacity: 0; transform: scale(4.2); } }
@keyframes fg-rays { 0% { opacity: 0; transform: rotate(0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(50deg) scale(1.15); } }
@keyframes fg-crack { 0% { opacity: 0; transform: scale(1.3); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fg-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
@keyframes fg-smoke { 0% { opacity: 0; transform: translateY(0) scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50px) scale(1.8); } }
@keyframes fg-lift { 0% { transform: scale(1); filter: brightness(2.2) drop-shadow(0 0 12px #fff); } 40% { transform: translateY(-8px) scale(1.12); } 100% { transform: none; filter: none; } }
@keyframes fg-dim { 0%, 30% { filter: grayscale(.8) brightness(.55); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) { #win-shop .fg-hammer, #win-shop .fg-fx { display: none; } }
/* Forge failure, redone (2026-11-09: no crack lines): the heat dies out. */
#win-shop .fg-dusk { width: 150px; height: 150px; margin: -75px; border-radius: 50%; background: radial-gradient(circle, rgba(120,18,10,.0) 30%, rgba(150,24,12,.55) 62%, rgba(60,6,4,.0) 74%); animation: fg-dusk 1300ms ease-out forwards; }
#win-shop .fg-implode { width: 150px; height: 150px; margin: -75px; border-radius: 50%; border: 2px solid rgba(255,110,70,.9); box-shadow: 0 0 14px rgba(255,80,40,.8), inset 0 0 14px rgba(255,80,40,.6); animation: fg-implode 650ms cubic-bezier(.5,0,.9,.6) forwards; }
#win-shop .fg-ember { width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #ffb070; box-shadow: 0 0 6px 2px rgba(255,90,40,.85); animation: fg-ember var(--t) cubic-bezier(.3,.5,.6,1) forwards; }
#win-shop .fg-smoke { background: radial-gradient(circle, rgba(140,130,130,.45), transparent 70%); }
#win-shop .fg-ring.fg-fail { animation: fg-fail2 .55s ease-out; }
#win-shop .fg-ring.fg-fail canvas { animation: fg-dim2 1400ms ease-out; }
@keyframes fg-dusk { 0% { opacity: 0; transform: scale(1.15); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(.85); } }
@keyframes fg-implode { 0% { opacity: 0; transform: scale(1.25); } 15% { opacity: 1; } 100% { opacity: 0; transform: scale(.25); } }
@keyframes fg-ember { 0% { transform: translate(0, 0); opacity: 1; background: #fff0c0; }
  35% { transform: translate(var(--dx), var(--dy)); opacity: 1; background: #ff8a40; }
  100% { transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) + var(--fall))); opacity: 0; background: #5a1a10; box-shadow: none; } }
@keyframes fg-fail2 { 15% { transform: translateX(-4px) rotate(-1.5deg); } 35% { transform: translateX(4px) rotate(1.5deg); } 55% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes fg-dim2 { 0% { filter: brightness(1.8) sepia(1) hue-rotate(-30deg) saturate(3); transform: scale(1.06); } 25% { filter: grayscale(.85) brightness(.5); transform: translateY(4px) scale(.96); } 100% { filter: none; transform: none; } }
/* Status radar (2026-11-09): attribute cards on the left, the radar on the right. */
#win-stats .st-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: center; }
#win-stats .st-left { display: grid; gap: 10px; min-width: 0; }
#win-stats .st-radar { display: grid; justify-items: center; gap: 2px; }
#win-stats .st-radar svg { width: 320px; height: 270px; overflow: visible; }
#win-stats .rd-grid { fill: rgba(214,178,106,.035); stroke: rgba(214,178,106,.22); stroke-width: 1; }
#win-stats .rd-axis { stroke: rgba(214,178,106,.18); stroke-width: 1; }
#win-stats .rd-base { fill: none; stroke: rgba(236,228,212,.45); stroke-width: 1; stroke-dasharray: 3 3; }
#win-stats .rd-shape { fill: rgba(214,178,106,.28); stroke: #e6c47a; stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(230,196,122,.45)); animation: rd-in .6s ease-out; transform-origin: 160px 139px; }
#win-stats .rd-dot { fill: #fff3cf; stroke: #c9a24e; stroke-width: 1; }
#win-stats .rd-name { fill: #d9cdb4; font: 600 12px 'IBM Plex Sans Thai', sans-serif; }
#win-stats .rd-val { fill: #e6c47a; font: 600 11px 'IBM Plex Sans Thai', sans-serif; font-variant-numeric: tabular-nums; }
#win-stats .rd-note { opacity: .55; font-size: 11px; }
@keyframes rd-in { from { transform: scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #win-stats .rd-shape { animation: none; } }
@media (max-width: 760px) { #win-stats .st-cols { grid-template-columns: 1fr; } }
/* Broken gear and the break scroll (2026-11-10). */
#win-shop .fg-broken, .fg-broken { color: #ff7a60; font-weight: 600; }
#win-shop .fg-shield { font-size: 12px; padding: 4px 10px; }
#win-shop .fg-shield.on { border-color: #8fd4b8; color: #8fd4b8; }
#win-shop .fg-ring.broken { box-shadow: inset 0 0 0 1px rgba(255,90,60,.5), 0 0 0 7px rgba(255,90,60,.06), inset 0 0 0 12px rgba(0,0,0,.25), inset 0 0 0 13px rgba(255,90,60,.25); }
#win-shop .fg-ring.broken .fg-halo { border-color: rgba(255,90,60,.4); animation-duration: 60s; }
/* Cast / hold bar, readable (user 2026-11-10: "a clear bar, how many seconds"): a small noir panel over the skill bar,
   the action on the left, seconds left on the right, a thick gold bar that glows as it fills. */
#hud #castbar { width: 320px; bottom: 190px; padding: 9px 14px 11px; background: rgba(10, 9, 7, 0.86); border: 1px solid rgba(201, 169, 110, 0.6); border-radius: 2px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55); }
#hud #castbar .cast-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
#hud #castbar .cast-label { margin: 0; color: #f3e6c8; font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
#hud #castbar .cast-time { color: var(--gilt-hi, #f6d98a); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kit #hud #castbar .bar.cast, #hud #castbar .bar.cast { position: relative; height: 12px; aspect-ratio: auto; border-radius: 1px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.kit #hud #castbar .bar.cast i, #hud #castbar .bar.cast i { position: absolute; left: 0; top: 0; bottom: 0; max-width: none; scale: none; border-radius: 0; background: linear-gradient(90deg, #a8843f, #f6d98a); box-shadow: 0 0 10px rgba(246, 217, 138, 0.65); }
/* Personal vault (the keeper in Lanaria): bag and vault side by side as icon grids, one bar under them for the pick. */
#win-vault { width: min(900px, 96vw); }
#win-vault .vt-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#win-vault h4 { margin: 0 0 8px; font: 600 14px var(--serif, serif); color: var(--gilt-hi, #f6d98a); display: flex; justify-content: space-between; align-items: baseline; }
#win-vault h4 small { font: 400 12px var(--sans, sans-serif); color: #9a937f; }
#win-vault .vt-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; align-content: start; min-height: 216px; }
#win-vault .vt-cell { position: relative; aspect-ratio: 1; padding: 2px; border: 1px solid rgba(201, 169, 110, 0.18); border-radius: 2px; background: rgba(255, 255, 255, 0.03); cursor: pointer; }
#win-vault .vt-cell:hover { border-color: rgba(201, 169, 110, 0.55); }
#win-vault .vt-cell.on { border-color: var(--gilt-hi, #f6d98a); box-shadow: 0 0 0 1px var(--gilt-hi, #f6d98a) inset; }
#win-vault .vt-cell canvas { width: 100%; height: 100%; }
#win-vault .vt-cell b { position: absolute; right: 2px; bottom: 0; font: 600 10.5px var(--sans, sans-serif); color: #fff; text-shadow: 0 1px 2px #000; }
#win-vault .vt-bar { margin-top: 12px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid rgba(201, 169, 110, 0.3); min-height: 52px; }
#win-vault .vt-bar canvas { width: 36px; height: 36px; }
#win-vault .vt-bar span { display: grid; flex: 1; min-width: 0; }
#win-vault .vt-bar small { color: #9a937f; }
#win-vault .vt-bar.empty { justify-content: center; }
#win-vault .vt-pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: #c9cde0; }
#win-vault .vt-qty { width: 84px; padding: 5px 8px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(201, 169, 110, 0.45); border-radius: 2px; color: #f3e6c8; font: 600 14px var(--sans, sans-serif); text-align: right; font-variant-numeric: tabular-nums; }
#win-vault .vt-qty:focus { outline: none; border-color: var(--gilt-hi, #f6d98a); }
/* ---------- Lighter panels (user 2026-11-10: "a bit too dark, let the game show through a little"): every theme A
   panel about a fifth more see-through, a soft blur behind keeps the text readable. Delete this block to go back. */
.window, #win-preview { background: rgba(13, 12, 15, 0.8); backdrop-filter: blur(10px); }
#hud #profile, .kit #hud #profile { background: rgba(13, 12, 15, 0.66); }
#hud #quest-panel { background: rgba(13, 12, 15, 0.62); backdrop-filter: blur(6px); }
#hud #chat { background: rgba(13, 12, 15, 0.52); backdrop-filter: blur(4px); }
#hud #target { background: rgba(13, 12, 15, 0.7); }
#hud #bossbar { background: rgba(13, 12, 15, 0.72); }
#hud :is(.pt-head, .pt-card, .pt-wait, .pf-member) { background: rgba(13, 12, 15, 0.64); }
#hud #skillbar { background: rgba(13, 12, 15, 0.6); }
#hud #castbar { background: rgba(10, 9, 7, 0.7); }
.toast { background: rgba(13, 12, 15, 0.8); }
#dialog .dlg-name { background: rgba(13, 12, 15, 0.86); }
:is(#hud #profile, #hud #quest-panel, #hud #chat, #hud #skillbar) :is(b, span, small, p, a, button) { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75); }
/* Crafting, redone (user 2026-11-10: "easy to use, easy to read"): the recipes listed on the left, one card on the right. */
#win-craft { width: min(860px, 96vw); }
#win-craft .cf2 { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; }
#win-craft .cf2-list { display: grid; gap: 4px; align-content: start; }
#win-craft .cf2-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; text-align: left; background: none; border: 1px solid transparent; border-left: 2px solid transparent; border-radius: 2px; color: var(--ink); cursor: pointer; }
#win-craft .cf2-item:hover { background: rgba(255, 255, 255, 0.04); }
#win-craft .cf2-item.on { background: rgba(201, 169, 110, 0.1); border-left-color: var(--gilt); }
#win-craft .cf2-item canvas { width: 40px; height: 40px; flex: none; }
#win-craft .cf2-item span { display: grid; min-width: 0; }
#win-craft .cf2-item b { font-size: 14px; font-weight: 600; }
#win-craft .cf2-item small { font-size: 12px; color: var(--mute); }
#win-craft .cf2-item small.ok { color: #9fe0ae; }
#win-craft .cf2-card { display: grid; gap: 14px; align-content: start; padding: 4px 4px 0 16px; border-left: 1px solid var(--hair); min-width: 0; }
#win-craft .cf2-head { display: flex; gap: 14px; align-items: flex-start; }
#win-craft .cf2-head canvas { width: 72px; height: 72px; flex: none; background: radial-gradient(closest-side, rgba(201, 169, 110, 0.16), transparent); }
#win-craft .cf2-head h3 { margin: 0 0 4px; font: 500 20px var(--serif) !important; color: var(--gilt-hi); }
#win-craft .cf2-head p { margin: 0 0 8px; font-size: 13.5px; color: #ddd6c8; }
#win-craft .cf2-tags { display: flex; flex-wrap: wrap; gap: 6px; }
#win-craft .cf2-tags span { font-size: 12px; padding: 2px 8px; border: 1px solid var(--hair); color: var(--ink); }
#win-craft .cf2-tags span.risk { color: #ffc2a0; border-color: rgba(255, 160, 120, 0.4); }
#win-craft .cf2-need h4 { margin: 0 0 6px; font: 500 13px var(--sans) !important; color: var(--mute); letter-spacing: 0.06em; }
#win-craft .cf2-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid var(--hair); }
#win-craft .cf2-ic { display: flex; gap: 2px; }
#win-craft .cf2-ic .ci-icon { width: 30px; height: 30px; }
#win-craft .cf2-nm { display: grid; min-width: 0; }
#win-craft .cf2-nm b { font-size: 14px; font-weight: 600; }
#win-craft .cf2-nm small { font-size: 12px; color: var(--mute); }
#win-craft .cf2-qty { font: 600 15px var(--sans) !important; font-variant-numeric: tabular-nums; }
#win-craft .cf2-row.ok .cf2-qty { color: #9fe0ae; }
#win-craft .cf2-row.short .cf2-qty { color: #ff9a8a; }
#win-craft .cf2-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-top: 4px; }
#win-craft .cf2-why { color: #ff9a8a; }
#win-craft .cf2-go { display: flex; align-items: center; gap: 6px; }
#win-craft .cf2-n { width: 64px; padding: 5px 8px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(201, 169, 110, 0.45); color: #f3e6c8; text-align: center; font: 600 14px var(--sans) !important; }
#win-craft .cf2-go .btn.primary { min-width: 110px; }
#win-craft .cf2-note { padding: 8px 18px 14px; }#win-craft .cf2-cost { display: block; padding: 6px 8px 0; color: var(--mute); font-size: 12px; }

/* The regional gear bonus line in an item tooltip (GEAR_TRAITS, 2026-11-10). */
.gear-bonus { color: var(--gilt, #c9a45c); font-weight: 600; }


/* A boss's status on the player (DEBUFFS) in the buff row: its colour, its name, seconds left (2026-11-10). */
#buffs .buff.debuff { width: auto; min-width: 58px; padding: 0 7px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--dc); box-shadow: 0 0 8px color-mix(in srgb, var(--dc) 55%, transparent) inset; background: rgba(10, 8, 14, 0.78); animation: debuff-pulse 1s ease-in-out infinite; }
#buffs .buff.debuff i { font-style: normal; font-size: 12px; font-weight: 600; color: var(--dc); line-height: 1; white-space: nowrap; }
#buffs .buff.debuff span { position: static; font: 700 12px/1 var(--num, inherit); color: #fff; background: none; padding: 0; }
@keyframes debuff-pulse { 50% { box-shadow: 0 0 14px color-mix(in srgb, var(--dc) 75%, transparent) inset; } }

/* Presence check (core presenceTick, ui renderPresence): a small noir card in the middle of the screen. */
#presence { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); }
#presence .pc-card { width: min(340px, calc(100vw - 32px)); padding: 18px 20px; background: rgba(12, 11, 9, 0.94); border: 1px solid var(--gilt, #c9a45c); border-radius: 2px; display: grid; gap: 10px; text-align: center; }
#presence .pc-title { font-family: "Noto Serif Thai", serif; font-size: 20px; color: #e8c97a; }
#presence .pc-text, #presence .pc-left { font-size: 13px; color: #cfc6b4; }
#presence .pc-left { color: #b9a98a; }
#presence .pc-code { justify-self: center; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(201, 164, 92, 0.35); }
#presence .pc-row { display: flex; gap: 8px; }
#presence .pc-input { flex: 1; min-width: 0; font-size: 20px; letter-spacing: 6px; text-align: center; padding: 6px; background: #0d0c0a; color: #f2e6c8; border: 1px solid rgba(201, 164, 92, 0.6); border-radius: 2px; }
/* Enhancement guarantee (core enhancePity): this piece's failed tries, a thin gold bar; full = a sure try. */
.fg-pity { position: relative; margin-top: 6px; padding: 4px 8px; font-size: 12px; color: #cfc6b4; border: 1px solid rgba(201, 164, 92, 0.3); border-radius: 2px; overflow: hidden; }
.fg-pity span { position: relative; z-index: 1; }
.fg-pity i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(201, 164, 92, 0.22); }
.fg-pity.sure { color: #f6dc8c; border-color: #e8c97a; box-shadow: 0 0 10px rgba(232, 201, 122, 0.45); }
/* Forge add-ons (user 2026-11-13): one "ตีบวก" button; each scroll is a tick box for the try, greyed with none in the bag. */
.fg-opts { display: grid; gap: 6px; width: 100%; margin-top: 6px; }
.fg-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(201, 164, 92, 0.3); border-radius: 2px; color: #e6dcc6; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.fg-opt img { width: 22px; height: 22px; }
.fg-opt small { color: #a99c82; margin-left: 4px; }
.fg-opt .fg-box { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid #c9a45c; border-radius: 2px; font-style: normal; font-size: 12px; color: #12100c; }
.fg-opt.on { border-color: #e8c97a; background: rgba(201, 164, 92, 0.12); }
.fg-opt.on .fg-box { background: #e8c97a; }
.fg-opt:disabled { opacity: 0.45; cursor: default; }
/* ---- Event dungeons window (renderDungeon) ---- */
#win-dungeon { width: min(860px, 96vw); }
#win-dungeon .dg-body { display: flex; flex-direction: column; gap: 10px; }
#win-dungeon .dg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 8px; border-bottom: 1px solid var(--gilt, rgba(212,175,90,.35)); }
#win-dungeon .dg-top b { color: var(--gold, #e8c46a); font-size: 1.15em; }
#win-dungeon .dg-coin { margin-left: auto; }
#win-dungeon .dg-run { display: flex; justify-content: space-between; padding: 6px 10px; border: 1px solid rgba(232,196,106,.45); border-radius: 2px; background: rgba(232,196,106,.08); }
#win-dungeon .dg-main { display: grid; grid-template-columns: 230px 1fr; gap: 12px; min-height: 0; }
#win-dungeon .dg-list { display: flex; flex-direction: column; gap: 6px; }
#win-dungeon .dg-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; text-align: left; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 2px; color: inherit; cursor: pointer; }
#win-dungeon .dg-row.on { border-color: var(--gilt, #c8a65a); background: rgba(232,196,106,.1); }
#win-dungeon .dg-row canvas { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.35); }
#win-dungeon .dg-row span { display: flex; flex-direction: column; min-width: 0; }
#win-dungeon .dg-row small { opacity: .7; }
#win-dungeon .dg-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#win-dungeon .dg-head { display: flex; gap: 12px; align-items: center; }
#win-dungeon .dg-head canvas { width: 120px; height: 120px; flex: none; border-radius: 2px; background: radial-gradient(circle at 50% 60%, rgba(120,90,200,.25), rgba(0,0,0,.4)); }
#win-dungeon .dg-head small { opacity: .7; }
#win-dungeon .dg-head b { display: block; font-family: 'Noto Serif Thai', serif; font-size: 1.35em; color: var(--gold, #e8c46a); }
#win-dungeon .dg-head p { margin: 4px 0 0; opacity: .85; }
#win-dungeon .dg-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: .92em; }
#win-dungeon .dg-rules i { font-style: normal; display: inline-block; width: 1.4em; color: var(--gold, #e8c46a); }
#win-dungeon .dg-mech { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-left: 2px solid var(--gold, #e8c46a); background: rgba(232,196,106,.06); font-size: .92em; }
#win-dungeon .dg-reward { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#win-dungeon .dg-reward canvas { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; }
#win-dungeon .dg-go { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; margin-top: auto; }
@media (max-width: 640px) { #win-dungeon .dg-main { grid-template-columns: 1fr; } #win-dungeon .dg-list { flex-direction: row; overflow-x: auto; } }#win-dungeon .dg-coin canvas { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; }

/* ---- Dungeon window, ornate (frames painted in GPT: assets/ui/dg-*.png; banners dg-banner-<id>.webp) ---- */
#win-dungeon { width: min(920px, 96vw); background: radial-gradient(120% 80% at 70% 0%, rgba(60,40,90,.35), transparent 60%), rgba(10,9,14,.9); }
#win-dungeon .panel-title { font-family: 'Noto Serif Thai', serif; letter-spacing: .04em; }
#win-dungeon .dg-main { grid-template-columns: 260px 1fr; gap: 16px; }
#win-dungeon .dg-list { gap: 8px; }
#win-dungeon .dg-row { position: relative; height: 70px; padding: 0 18px 0 14px; border: 0; background: none; isolation: isolate; overflow: visible; }
#win-dungeon .dg-row::before { content: ''; position: absolute; inset: 7px 9px; z-index: -2; border-radius: 3px; background: linear-gradient(90deg, rgba(8,7,12,.88) 30%, rgba(8,7,12,.25)), var(--bn) center/cover; filter: saturate(.8) brightness(.8); transition: filter .2s; }
#win-dungeon .dg-row::after { content: ''; position: absolute; inset: 0; z-index: -1; background: url(assets/ui/dg-card.png) center/100% 100% no-repeat; pointer-events: none; }
#win-dungeon .dg-row.on::before, #win-dungeon .dg-row:hover::before { filter: saturate(1.1) brightness(1.05); }
#win-dungeon .dg-row.on::after { background-image: url(assets/ui/dg-card-on.png); filter: drop-shadow(0 0 6px rgba(255,210,120,.55)); }
#win-dungeon .dg-row canvas { width: 46px; height: 46px; border: 1px solid rgba(232,196,106,.6); background: rgba(0,0,0,.5); box-shadow: 0 0 10px rgba(0,0,0,.6); }
#win-dungeon .dg-row b { font-family: 'Noto Serif Thai', serif; text-shadow: 0 1px 3px #000; }
#win-dungeon .dg-row.on b { color: #ffe3a0; }
#win-dungeon .dg-row small { text-shadow: 0 1px 2px #000; }
#win-dungeon .dg-card { position: relative; padding: 14px 16px; border: 1px solid rgba(200,166,90,.35); background: linear-gradient(180deg, rgba(10,8,16,.55), rgba(10,8,16,.92) 45%), var(--bn) top center/cover; border-radius: 3px; }
#win-dungeon .dg-head { gap: 16px; align-items: flex-end; }
#win-dungeon .dg-portrait { position: relative; width: 150px; height: 155px; flex: none; }
#win-dungeon .dg-portrait canvas { position: absolute; inset: 14px 14px 12px; width: calc(100% - 28px); height: calc(100% - 26px); background: radial-gradient(circle at 50% 65%, rgba(140,100,220,.45), rgba(0,0,0,.75)); border-radius: 0; }
#win-dungeon .dg-portrait::after { content: ''; position: absolute; inset: 0; background: url(assets/ui/dg-portrait.png) center/100% 100% no-repeat; filter: drop-shadow(0 4px 8px rgba(0,0,0,.7)); }
#win-dungeon .dg-head b { font-size: 1.6em; text-shadow: 0 2px 6px #000, 0 0 14px rgba(232,196,106,.35); }
#win-dungeon .dg-head small, #win-dungeon .dg-head p { text-shadow: 0 1px 3px #000; }
#win-dungeon .dg-reward { flex-direction: column; align-items: stretch; gap: 6px; }
#win-dungeon .dg-rlabel { font-family: 'Noto Serif Thai', serif; color: var(--gold, #e8c46a); font-size: .95em; padding: 3px 18px; align-self: flex-start; background: url(assets/ui/dg-ribbon.png) center/100% 100% no-repeat; }
#win-dungeon .dg-slots { display: flex; flex-wrap: wrap; gap: 10px; }
#win-dungeon .dg-slot { position: relative; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
#win-dungeon .dg-slot canvas { width: 62px; height: 62px; padding: 9px; box-sizing: border-box; background: url(assets/ui/dg-slot.png) center/100% 100% no-repeat, radial-gradient(circle, rgba(60,50,80,.8), rgba(10,8,14,.95) 70%); }
#win-dungeon .dg-slot.medal canvas { background: url(assets/ui/dg-medal.png) center/100% 100% no-repeat, radial-gradient(circle, rgba(80,60,20,.7), rgba(10,8,14,.95) 65%); border-radius: 50%; }
#win-dungeon .dg-slot small { font-size: .74em; line-height: 1.25; opacity: .9; }
#win-dungeon .dg-gobtn { min-width: 230px; height: 56px; padding: 0 30px; border: 0; cursor: pointer; font: 700 1.1em 'Noto Serif Thai', serif; color: #2a1606; text-shadow: 0 1px 0 rgba(255,240,200,.6); background: url(assets/ui/dg-button.png) center/100% 100% no-repeat; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); transition: filter .15s, transform .15s; }
#win-dungeon .dg-gobtn:hover:not(:disabled) { filter: drop-shadow(0 0 10px rgba(255,210,120,.7)) brightness(1.08); transform: translateY(-1px); }
#win-dungeon .dg-gobtn:disabled { filter: grayscale(.85) brightness(.7); cursor: default; color: #2a2a2a; font-size: .95em; }
#win-dungeon .dg-gobtn.leave { filter: hue-rotate(-40deg) saturate(1.4) drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
#win-dungeon .dg-coin canvas, #win-dungeon .dg-top canvas { background: url(assets/ui/dg-medal.png) center/100% 100% no-repeat; padding: 3px; box-sizing: border-box; width: 28px; height: 28px; }
#win-dungeon .dg-mech { border-left: 0; background: linear-gradient(90deg, rgba(232,196,106,.14), rgba(232,196,106,.02)); border-top: 1px solid rgba(232,196,106,.35); border-bottom: 1px solid rgba(232,196,106,.15); }
#win-dungeon .dg-gobtn { background: url(assets/ui/dg-button.png) center/100% 100% no-repeat, linear-gradient(180deg, #f6dc8e, #c8963c 55%, #8a5a1c) center/90% 62% no-repeat; }
#win-dungeon .dg-gobtn:disabled { color: #e8e0d0; text-shadow: 0 1px 2px #000; }

/* ---- Dungeon window: premium type and a little life (user 2026-11-13: "premium, readable, with flair") ---- */
@keyframes dgShine { 0% { background-position: -160% 0 } 60%, 100% { background-position: 260% 0 } }
@keyframes dgSpin { to { transform: rotate(360deg) } }
@keyframes dgPulse { 0%, 100% { filter: drop-shadow(0 0 6px rgba(255,200,90,.45)) } 50% { filter: drop-shadow(0 0 16px rgba(255,214,120,.95)) } }
@keyframes dgSweep { 0%, 70% { transform: translateX(-130%) skewX(-20deg) } 100% { transform: translateX(230%) skewX(-20deg) } }
#win-dungeon .dg-gold { background: linear-gradient(100deg, #b98a34 0%, #f6dc8e 30%, #fff6d6 42%, #f6dc8e 54%, #c8963c 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: dgShine 4.5s ease-in-out infinite; text-shadow: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.85)); }
#win-dungeon .dg-head b.dg-gold { font-size: 1.9em; letter-spacing: .02em; }
#win-dungeon .dg-tag { display: inline-block; padding: 1px 10px; font-size: .78em; letter-spacing: .08em; color: #f3e2b4; border: 1px solid rgba(232,196,106,.55); background: rgba(20,14,6,.65); opacity: 1; }
#win-dungeon .dg-head p { color: #efe6d4; font-size: 1.02em; }
#win-dungeon .dg-top { gap: 12px 18px; padding: 4px 4px 10px; }
#win-dungeon .dg-runs { display: flex; align-items: baseline; gap: 6px; }
#win-dungeon .dg-runs em { font-style: normal; color: #d9ccae; font-size: .9em; letter-spacing: .05em; }
#win-dungeon .dg-runs b { font: 700 1.9em 'Noto Serif Thai', serif; line-height: 1; color: #ffe08a; text-shadow: 0 0 12px rgba(255,200,90,.55), 0 2px 2px #000; }
#win-dungeon .dg-runs i { font-style: normal; color: #bfb08e; font-size: 1.05em; }
#win-dungeon .dg-note { color: #a89c84; font-size: .85em; }
#win-dungeon .dg-buy { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 18px; cursor: pointer; overflow: hidden;
  font: 600 .95em 'Noto Serif Thai', serif; color: #fff1cc; text-shadow: 0 1px 2px #000;
  background: url(assets/ui/dg-card.png) center/100% 100% no-repeat, linear-gradient(180deg, rgba(60,44,20,.95), rgba(20,14,8,.95)) center/94% 80% no-repeat; border: 0; transition: transform .15s, filter .15s; }
#win-dungeon .dg-buy::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,240,200,.35), transparent); animation: dgSweep 3.5s ease-in-out infinite; pointer-events: none; }
#win-dungeon .dg-buy:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.15) drop-shadow(0 0 8px rgba(255,210,120,.6)); }
#win-dungeon .dg-buy small { padding: 0 6px; border-radius: 8px; background: rgba(0,0,0,.5); color: #d8c8a0; font: 500 .8em 'IBM Plex Sans Thai', sans-serif; }
#win-dungeon .dg-buy:disabled { filter: grayscale(.9) brightness(.7); cursor: default; }
#win-dungeon .dg-buy:disabled::after { display: none; }
#win-dungeon .dg-coin { display: inline-flex; align-items: center; gap: 6px; }
#win-dungeon .dg-coin em { font-style: normal; color: #d9ccae; font-size: .9em; }
#win-dungeon .dg-coin b { font: 700 1.5em 'Noto Serif Thai', serif; }
#win-dungeon .dg-rules { font-size: .98em; gap: 6px 14px; color: #efe6d4; }
#win-dungeon .dg-rules li { text-shadow: 0 1px 2px #000; }
#win-dungeon .dg-rules i { color: #f6d27a; filter: drop-shadow(0 0 4px rgba(255,200,90,.6)); }
#win-dungeon .dg-mech b { font-family: 'Noto Serif Thai', serif; color: #ffe08a; font-size: 1.05em; }
#win-dungeon .dg-mech span { color: #efe6d4; }
#win-dungeon .dg-row b { font-size: 1.05em; }
#win-dungeon .dg-row small { color: #d9ccae; }
/* The reward: the box stars (rays turning behind it, a breathing glow, "one at random"); every slot has light sweep over it. */
#win-dungeon .dg-reward { padding: 10px 12px 12px; border: 1px solid rgba(232,196,106,.3); background: radial-gradient(120% 140% at 12% 50%, rgba(255,190,80,.16), transparent 55%), rgba(8,6,12,.55); }
#win-dungeon .dg-rlabel { display: inline-flex; align-items: center; gap: 10px; padding: 4px 26px; font-size: 1.08em; color: #ffe8b0; text-shadow: 0 1px 2px #000; }
#win-dungeon .dg-rlabel em { font-style: normal; font-size: .72em; padding: 0 7px; color: #2a1606; background: linear-gradient(180deg, #ffe08a, #c8963c); border-radius: 2px; text-shadow: none; animation: dgPulse 1.6s ease-in-out infinite; }
#win-dungeon .dg-slots { align-items: flex-end; gap: 14px; }
#win-dungeon .dg-slot { width: 84px; cursor: default; transition: transform .18s; }
#win-dungeon .dg-slot:hover { transform: translateY(-4px); }
#win-dungeon .dg-slot canvas { width: 66px; height: 66px; position: relative; }
#win-dungeon .dg-slot::before { content: ''; position: absolute; top: 0; left: 50%; width: 66px; height: 66px; margin-left: -33px; overflow: hidden; pointer-events: none; z-index: 2;
  background: linear-gradient(105deg, transparent 35%, rgba(255,248,220,.55) 50%, transparent 65%) no-repeat; background-size: 300% 100%; animation: dgShine 3.8s ease-in-out infinite; mix-blend-mode: screen; }
#win-dungeon .dg-slot small { font-size: .8em; color: #efe6d4; text-shadow: 0 1px 2px #000; }
#win-dungeon .dg-slot.hero { width: 120px; }
#win-dungeon .dg-slot.hero canvas { width: 100px; height: 100px; padding: 13px; animation: dgPulse 2.2s ease-in-out infinite; }
#win-dungeon .dg-slot.hero::before { width: 100px; height: 100px; margin-left: -50px; }
#win-dungeon .dg-slot.hero small { font-family: 'Noto Serif Thai', serif; font-size: .88em; color: #ffe8b0; }
#win-dungeon .dg-rays { position: absolute; top: -22px; left: 50%; width: 144px; height: 144px; margin-left: -72px; z-index: 0; pointer-events: none; border-radius: 50%; opacity: .75;
  background: repeating-conic-gradient(from 0deg, rgba(255,214,120,.42) 0deg 7deg, transparent 7deg 22deg); -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); animation: dgSpin 14s linear infinite; }
#win-dungeon .dg-slot.hero canvas, #win-dungeon .dg-slot.hero small { z-index: 1; }
#win-dungeon .dg-ribbon { position: absolute; top: -6px; right: -4px; z-index: 3; padding: 0 6px; font-size: .7em; color: #fff3d0; background: linear-gradient(180deg, #b8202e, #6a0a14); border: 1px solid #f0c060; transform: rotate(8deg); text-shadow: 0 1px 1px #000; }
#win-dungeon .dg-gobtn:disabled { color: #f0e6d0; text-shadow: 0 1px 3px #000, 0 0 6px #000; font-weight: 600; }
/* Boss heading (user: laid out better): the tag, the name, a fine gold rule, the line about it; centred on the portrait. */
#win-dungeon .dg-head { align-items: center; }
#win-dungeon .dg-id { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
#win-dungeon .dg-id .dg-tag { padding: 0; border: 0; background: none; font-size: .8em; letter-spacing: .14em; color: #cdb98a; text-transform: uppercase; }
#win-dungeon .dg-id b.dg-gold { font-size: 2.1em; line-height: 1.15; }
#win-dungeon .dg-rule { display: block; width: min(320px, 100%); height: 1px; background: linear-gradient(90deg, rgba(246,220,142,.9), rgba(246,220,142,.25) 60%, transparent); }
#win-dungeon .dg-id p { margin: 0; max-width: 46ch; font-size: .98em; line-height: 1.5; color: #e8dfcc; }
/* ---- Dungeon VICTORY (showDungeonResult) ---- */
@keyframes dgvIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes dgvCrest { 0% { transform: translateY(-60px) scale(2.2); opacity: 0; filter: brightness(3) } 55% { transform: translateY(0) scale(.92); opacity: 1; filter: brightness(1.6) } 75% { transform: scale(1.05) } 100% { transform: scale(1); filter: brightness(1) } }
@keyframes dgvFloat { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes dgvFlash { 0% { opacity: 0 } 18% { opacity: .9 } 100% { opacity: 0 } }
@keyframes dgvRays { to { transform: translate(-50%, -50%) rotate(360deg) } }
@keyframes dgvFall { 0% { transform: translateY(-12vh) rotate(var(--r)); opacity: 0 } 10% { opacity: 1 } 100% { transform: translateY(105vh) rotate(calc(var(--r) + 540deg)); opacity: .9 } }
@keyframes dgvPop { 0% { transform: translateY(24px) scale(.3); opacity: 0 } 60% { transform: translateY(-6px) scale(1.12); opacity: 1 } 100% { transform: none; opacity: 1 } }
@keyframes dgvRise { from { transform: translateY(18px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes dgvGlow { 0%, 100% { filter: drop-shadow(0 0 8px rgba(255,200,90,.55)) } 50% { filter: drop-shadow(0 0 22px rgba(255,220,130,1)) } }
@keyframes dgvShine { 0% { background-position: -160% 0 } 60%, 100% { background-position: 260% 0 } }
#dg-victory { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; overflow: hidden; animation: dgvIn .35s ease-out both; font-family: 'IBM Plex Sans Thai', sans-serif; }
#dg-victory.out { animation: dgvIn .3s ease-in reverse both; }
#dg-victory .dgv-shade { position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 38%, rgba(70,40,10,.55), rgba(4,3,8,.92) 70%); }
#dg-victory .dgv-rays { position: absolute; left: 50%; top: 30%; width: 1500px; height: 1500px; transform: translate(-50%, -50%); pointer-events: none; opacity: .5;
  background: repeating-conic-gradient(from 0deg, rgba(255,210,110,.32) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 55%); mask: radial-gradient(circle, #000 8%, transparent 55%); animation: dgvRays 30s linear infinite; }
#dg-victory .dgv-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, #fff8e0, rgba(255,220,140,.4) 30%, transparent 60%); animation: dgvFlash 1.1s ease-out .35s both; pointer-events: none; }
#dg-victory .dgv-confetti { position: absolute; inset: 0; pointer-events: none; }
#dg-victory .dgv-confetti i { position: absolute; top: 0; left: var(--x); width: calc(8px * var(--s)); height: calc(14px * var(--s)); background: hsl(var(--h) 85% 60%);
  box-shadow: 0 0 6px hsl(var(--h) 90% 60% / .6); animation: dgvFall calc(3.6s + var(--d)) linear calc(.6s + var(--d)) infinite both; }
#dg-victory .dgv-confetti i:nth-child(3n) { border-radius: 50%; width: calc(7px * var(--s)); height: calc(7px * var(--s)); background: #ffe08a; }
#dg-victory .dgv-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(760px, 94vw); padding: 0 16px 22px; }
#dg-victory .dgv-crest { width: min(560px, 86vw); margin-bottom: -18px; animation: dgvCrest .9s cubic-bezier(.2,.9,.3,1.2) .2s both; }
#dg-victory .dgv-crest img { display: block; width: 100%; animation: dgvFloat 3.4s ease-in-out 1.2s infinite, dgvGlow 2.6s ease-in-out 1.2s infinite; }
#dg-victory .dgv-name { animation: dgvRise .5s ease-out .8s both; }
#dg-victory .dgv-name span { display: inline-block; padding: 6px 46px; font: 700 1.35em 'Noto Serif Thai', serif; color: #fff1cc; letter-spacing: .04em; text-shadow: 0 2px 3px #000;
  background: url(assets/ui/dg-ribbon.png) center/100% 100% no-repeat; }
#dg-victory .dgv-mid { display: flex; align-items: center; justify-content: center; gap: 34px; animation: dgvRise .5s ease-out .95s both; }
#dg-victory .dgv-hero { position: relative; display: flex; flex-direction: column; align-items: center; }
#dg-victory .dgv-spot { position: absolute; left: 50%; bottom: 34px; width: 170px; height: 220px; transform: translateX(-50%); background: linear-gradient(180deg, transparent, rgba(255,228,160,.28)); clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); }
#dg-victory .dgv-hero::after { content: ''; position: absolute; left: 50%; bottom: 36px; width: 150px; height: 26px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(255,214,120,.55), transparent 70%); }
#dg-victory .dgv-hero canvas { position: relative; z-index: 1; width: 150px; height: 150px; }
#dg-victory .dgv-hero b { font: 700 1.15em 'Noto Serif Thai', serif; color: #fff; text-shadow: 0 2px 3px #000; }
#dg-victory .dgv-hero small { color: #d8c8a0; }
#dg-victory .dgv-stats { display: flex; flex-direction: column; gap: 14px; }
#dg-victory .dgv-stats small { display: block; color: #cdb98a; letter-spacing: .12em; font-size: .8em; }
#dg-victory .dgv-stats b { font: 700 2.4em 'Noto Serif Thai', serif; line-height: 1.05;
  background: linear-gradient(100deg, #b98a34 0%, #f6dc8e 30%, #fff6d6 42%, #f6dc8e 54%, #c8963c 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: dgvShine 4s ease-in-out infinite; filter: drop-shadow(0 2px 2px rgba(0,0,0,.85)); }
#dg-victory .dgv-exp b { font-size: 1.6em; }
#dg-victory .dgv-loot-title { display: flex; align-items: center; gap: 12px; width: 70%; color: #ffe8b0; font: 600 1em 'Noto Serif Thai', serif; letter-spacing: .1em; animation: dgvRise .4s ease-out 1s both; }
#dg-victory .dgv-loot-title::before, #dg-victory .dgv-loot-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(246,220,142,.8), transparent); }
#dg-victory .dgv-loot { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 16px; }
#dg-victory .dgv-slot { position: relative; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; animation: dgvPop .5s cubic-bezier(.2,.9,.3,1.3) both; }
#dg-victory .dgv-slot canvas { width: 76px; height: 76px; padding: 10px; box-sizing: border-box; background: url(assets/ui/dg-slot.png) center/100% 100% no-repeat, radial-gradient(circle, rgba(70,56,90,.85), rgba(10,8,14,.95) 70%); }
#dg-victory .dgv-slot small { font-size: .82em; color: #efe6d4; text-shadow: 0 1px 2px #000; line-height: 1.3; }
#dg-victory .dgv-slot small b { color: #ffe08a; }
#dg-victory .dgv-slot.hero { width: 124px; }
#dg-victory .dgv-slot.hero::before { content: ''; position: absolute; top: -26px; left: 50%; width: 160px; height: 160px; margin-left: -80px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,214,120,.5) 0deg 7deg, transparent 7deg 20deg); -webkit-mask: radial-gradient(circle, #000 22%, transparent 68%); mask: radial-gradient(circle, #000 22%, transparent 68%); animation: dgvRays 10s linear infinite; transform: none; }
#dg-victory .dgv-slot.hero canvas { position: relative; width: 108px; height: 108px; padding: 14px; animation: dgvGlow 2s ease-in-out infinite; }
#dg-victory .dgv-slot.hero small { position: relative; font-family: 'Noto Serif Thai', serif; color: #ffe8b0; font-size: .9em; }
#dg-victory .dgv-slot.rare canvas { animation: dgvGlow 2.4s ease-in-out infinite; }
#dg-victory .dgv-slot.coin canvas { border-radius: 50%; background: url(assets/ui/dg-medal.png) center/100% 100% no-repeat, radial-gradient(circle, rgba(90,66,20,.8), rgba(10,8,14,.95) 65%); }
#dg-victory .dgv-held { margin: 0; color: #ffb36a; font-size: .9em; }
#dg-victory .dgv-ok { margin-top: 8px; min-width: 240px; height: 58px; border: 0; cursor: pointer; font: 700 1.2em 'Noto Serif Thai', serif; color: #2a1606; text-shadow: 0 1px 0 rgba(255,240,200,.6);
  background: url(assets/ui/dg-button.png) center/100% 100% no-repeat, linear-gradient(180deg, #f6dc8e, #c8963c 55%, #8a5a1c) center/90% 62% no-repeat;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.7)); animation: dgvRise .4s ease-out 2.2s both; transition: transform .15s, filter .15s; }
#dg-victory .dgv-ok:hover { transform: translateY(-2px); filter: drop-shadow(0 0 14px rgba(255,210,120,.8)) brightness(1.08); }
/* The dungeon's name sits on the crest's own red ribbon (measured from the art: x 32–69%, y 62–73%). */
#dg-victory .dgv-crest { position: relative; margin-bottom: -6px; }
#dg-victory .dgv-crest .dgv-name { position: absolute; left: 32%; right: 31%; top: 61.5%; height: 11%; display: flex; align-items: center; justify-content: center;
  font: 700 clamp(13px, 2.4vw, 20px) 'Noto Serif Thai', serif; color: #fff4d6; letter-spacing: .03em; white-space: nowrap; text-shadow: 0 2px 2px #4a0008, 0 0 8px rgba(0,0,0,.6); animation: dgvRise .5s ease-out .9s both; }
#dg-victory .dgv-crest img { filter: drop-shadow(0 10px 30px rgba(0,0,0,.6)); }
/* The hero's stage: the canvas inside a fixed box, the spotlight cone and the lit floor fixed to its feet. */
#dg-victory .dgv-spot { display: none; }
#dg-victory .dgv-hero::after { display: none; }
#dg-victory .dgv-stage { position: relative; width: 170px; height: 178px; }
#dg-victory .dgv-stage::before { content: ''; position: absolute; left: 50%; bottom: 10px; width: 180px; height: 210px; transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,236,190,0), rgba(255,226,160,.30)); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
#dg-victory .dgv-stage::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 150px; height: 30px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,226,150,.75), rgba(255,200,90,.25) 45%, transparent 70%); box-shadow: 0 0 0 2px rgba(246,220,142,.35) inset; }
#dg-victory .dgv-stage canvas { position: absolute; left: 50%; bottom: 12px; width: 160px; height: 160px; transform: translateX(-50%); z-index: 1; }
#dg-victory .dgv-hero b { margin-top: 4px; }
#dg-victory .dgv-shade { background: radial-gradient(60% 55% at 50% 38%, rgba(60,36,10,.82), rgba(4,3,8,.96) 70%); }
/* ===================================================================================================================
   Theme B · Ivory & Navy (user picked 2026-11-13 from docs/ui-style-sheet.html): every window on warm ivory paper with
   soft depth, a deep navy title bar, muted-gold hairlines, cream item wells, navy for what is selected. The painted
   pieces are GPT's (assets/ui/b-*.png, cut with scripts/crop-key.mjs). The dungeon window and its victory keep their
   own dark premium look; the admin tools stay plain. Delete this block to go back to theme A.
   =================================================================================================================== */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today){
  --ink: #1f2b45; --mute: #6f6857; --gilt: #a9853c; --gilt-hi: #7a5a16; --gilt-soft: rgba(169, 133, 60, 0.42); --hair: rgba(31, 43, 69, 0.14);
  --gold: #8a6418; --cream: #1f2b45; --muted: #6f6857; --line: rgba(169, 133, 60, 0.42); --line-soft: rgba(31, 43, 69, 0.12); --edge: rgba(31, 43, 69, 0.12); --well: rgba(31, 43, 69, 0.04);
  color: var(--ink); backdrop-filter: none;
  background: radial-gradient(120% 90% at 50% 0%, #fbf6ea, #f1e8d4 70%, #e9dec6);
  border: 14px solid transparent; border-image: url(assets/ui/b-frame.png) 34 fill / 14px / 0 stretch;
  border-radius: 0; box-shadow: 0 26px 70px rgba(20, 24, 36, 0.45), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
}
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title{
  color: #f6efe0 !important; margin: -14px -14px 10px; padding: 14px 24px 13px; border: 0;
  background: url(assets/ui/b-title.png) center/100% 100% no-repeat; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); letter-spacing: 0.04em;
}
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .close{ width: 30px; height: 30px; border-radius: 50%; color: #f6efe0 !important; font-size: 16px;
  background: url(assets/ui/b-close.png) center/100% 100% no-repeat !important; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .close:hover{ filter: drop-shadow(0 0 6px rgba(240, 200, 110, 0.9)); }
/* Text: navy body, warm grey for the quiet lines. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(small, .muted, .small, .sub, .note, .mk-note, .rk-foot){ color: var(--mute); }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(b, strong, h3, h4){ color: var(--ink); }
/* Buttons: cream plates with a navy hairline; the main action a navy plate with a gold rim; ok / go / danger keep their colour in the rim. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn{ background: url(assets/ui/b-btn2.png) center/100% 100% no-repeat !important; border: 0 !important; color: var(--ink) !important; font-weight: 600;
  box-shadow: 0 2px 4px rgba(31, 43, 69, 0.12); transition: transform 0.12s, filter 0.12s; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn:hover:not(:disabled){ transform: translateY(-1px); filter: brightness(1.04) drop-shadow(0 2px 4px rgba(31, 43, 69, 0.25)) !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn.primary{ background: url(assets/ui/b-btn.png) center/100% 100% no-repeat !important; color: #f6efe0 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn.ok{ background: linear-gradient(180deg, #e9f4e6, #d4e9cf) !important; box-shadow: inset 0 0 0 1px #4f8f55 !important; color: #23552b !important; border-radius: 8px; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn.go{ background: linear-gradient(180deg, #2b3d63, #1f2b45) !important; box-shadow: inset 0 0 0 1px #6f8cc4 !important; color: #eef3ff !important; border-radius: 8px; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn.danger{ background: linear-gradient(180deg, #f8e6e2, #f0d2cc) !important; box-shadow: inset 0 0 0 1px #b24f44 !important; color: #8c2b22 !important; border-radius: 8px; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn:disabled{ filter: grayscale(0.6) opacity(0.6) !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn.on:not(.primary){ background: url(assets/ui/b-tab-on.png) center/100% 100% no-repeat !important; color: #f6efe0 !important; }
/* Tabs: cream plates; the open one a navy plate with a gold glow. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button){
  background: url(assets/ui/b-tab.png) center/100% 100% no-repeat !important; border: 0 !important; border-radius: 0; color: var(--ink) !important; padding: 7px 18px 9px !important; font-weight: 600; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.bag-tab.on, .qb-tabs button.on, .mk-seg button.on, .shop-tabs button.on, .tabs button.on){
  background: url(assets/ui/b-tab-on.png) center/100% 100% no-repeat !important; color: #f6efe0 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.bag-tabs, .qb-tabs, .mk-seg){ gap: 8px; border-bottom: 0; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .qb-tabs em{ color: #c9a24e; }
/* Item wells and slots: soft cream wells with a navy rim; the chosen one navy with a gold rim. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.cell, .doll-slot){ background: url(assets/ui/b-slot.png) center/100% 100% no-repeat !important; border-color: transparent !important; border-radius: 6px; box-shadow: none; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.cell.sel, .cell.on, .doll-slot.sel){ background: url(assets/ui/b-slot-on.png) center/100% 100% no-repeat !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .cell b, html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .cell .n{ color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 2px #fff; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.cell.sel, .cell.on) :is(b, .n){ color: #f6efe0; text-shadow: 0 1px 2px #000; }
/* Cards and rows: white-ish paper on the ivory, a muted-gold hairline, a soft shadow. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.qb-card, .bag-detail, .shop-detail, .mk-card, .gd-card, .shop-item, .shop-row, .mk-line, .mk-cell, .gd-row, .gd-task, .gd-banner, .gd-mrow, .bd-row, .gs-card, .qi-row, .cf-card, .vt-box, .attr-card){
  background: rgba(255, 252, 244, 0.72) !important; border: 1px solid rgba(169, 133, 60, 0.32) !important; box-shadow: 0 2px 6px rgba(31, 43, 69, 0.08) !important; border-radius: 6px; color: var(--ink); }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.shop-item.sel, .mk-line.sel, .bd-row.on, .gd-row.on){ background: #1f2b45 !important; color: #f6efe0 !important; border-color: #c9a24e !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.shop-item.sel, .mk-line.sel) :is(b, small, span){ color: #f6efe0 !important; }
/* Inputs and selects. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(input, textarea, select){ background: #fffdf7 !important; color: var(--ink) !important; border: 1px solid rgba(31, 43, 69, 0.25) !important; border-radius: 6px; }
/* Bars and dividers. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(hr, .divider){ border: 0; height: 12px; background: url(assets/ui/b-divider.png) center/100% 100% no-repeat; }
/* The paper doll's stand and the character's dark canvases soften to the page. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .shop-big canvas{ background: radial-gradient(closest-side, rgba(31, 43, 69, 0.12), transparent) !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.shop-who, .dlg-who canvas){ background: #efe5cf !important; border-color: rgba(169, 133, 60, 0.5) !important; }
/* Theme B legibility pass (user 2026-11-13: "no text the same colour as its background"): the light colours made for
   the dark theme, darkened or given a dark plate, found by a contrast scan of every window. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.seg button.on, .mk-find button.on){ background: #1f2b45 !important; color: #f6efe0 !important; border-color: #c9a24e !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.seg button, .mk-find button){ color: var(--ink); }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title :is(.cur, b, span){ color: #f3d68a !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title small{ color: #e2d6b8 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) p{ color: var(--mute); }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .cur{ color: #7a5a16; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .cur.astra{ color: #1f6fa8; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.cf2-row.short .cf2-qty, .cap-d.down, .fg-broken, .muted > span){ color: #b3261e !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.cap-d.up, .login-day.done > i, .qc-state){ color: #2e7d3a !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.gd-title > span, .gd-mhead > span, .rk-head > span, .mk-hint){ color: var(--mute) !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .rk-leader{ color: #9a6a00 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) em{ color: #8a6418; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.qb-tabs button.on em, .tabs button.on em){ color: #f3d68a; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .rk-row.top1 .rk-n{ color: #b8860b !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .rk-row.top2 .rk-n{ color: #5f6f80 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .rk-row.top3 .rk-n{ color: #9a5428 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .ac-val{ color: var(--ink) !important; text-shadow: none !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .sk-key{ background: #1f2b45 !important; color: #f6efe0 !important; }
/* Rarity names and +n tags carry their colour inline (made for dark panels): deepened on the paper, left alone on a
   navy (selected) row. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is([style*="color"], .rarity-tag, .plus-t):not(.sel *, .on *, .cell *, .doll-slot *){ filter: brightness(0.6) saturate(1.5) contrast(1.1); }
/* The waygate's chapter cards: paper like the rest (they were dark tiles). */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .wg-card{ background: rgba(255, 252, 244, 0.85) !important; border: 1px solid rgba(169, 133, 60, 0.35) !important; color: var(--ink); box-shadow: 0 2px 6px rgba(31, 43, 69, 0.1); }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .wg-card.here{ background: #1f2b45 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .wg-card.here :is(b, span, small){ color: #f6efe0 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .wg-chips > span{ background: rgba(31, 43, 69, 0.06); color: var(--ink); }html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .plus-t{ filter: none !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .plus-t.t-plain{ color: #6b5a34 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .plus-t.t-blue{ color: #1f6fa8 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .plus-t:not(.t-plain, .t-blue){ filter: brightness(0.62) saturate(1.4) !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.shop-name, .shop-info) > b:not([style*="color"]){ color: var(--ink) !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .btn.primary .cur.astra{ color: #9fd6ff !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .qb-tabs button:not(.on) em{ color: #8a6418 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .rk-row.top1 .rk-n{ color: #8f6400 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .sel .cap-d.down{ color: #ff9a8a !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .sel .cap-d.up{ color: #9fe3a8 !important; }
/* Theme B: the stat radar (SVG, so its colours are `fill`): navy names, deep-gold numbers, a navy web. */
html:not([data-ui="a"]) #win-stats .rd-grid{ fill: rgba(31, 43, 69, 0.03); stroke: rgba(31, 43, 69, 0.22); }
html:not([data-ui="a"]) #win-stats .rd-axis{ stroke: rgba(31, 43, 69, 0.18); }
html:not([data-ui="a"]) #win-stats .rd-base{ stroke: rgba(31, 43, 69, 0.45); }
html:not([data-ui="a"]) #win-stats .rd-shape{ fill: rgba(31, 43, 69, 0.22); stroke: #1f2b45; filter: none; }
html:not([data-ui="a"]) #win-stats .rd-dot{ fill: #f6efe0; stroke: #1f2b45; }
html:not([data-ui="a"]) #win-stats .rd-name{ fill: #1f2b45; font-size: 13px; font-weight: 700; }
html:not([data-ui="a"]) #win-stats .rd-val{ fill: #7a5a16; font-size: 12.5px; font-weight: 700; }
html:not([data-ui="a"]) #win-stats .rd-note{ opacity: 1; fill: #6f6857; color: #6f6857; }
/* The open tab (user 2026-11-13: "no glow, just show which tab is open"): a plain navy plate with a thin gold edge. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) :is(.bag-tab.on, .qb-tabs button.on, .mk-seg button.on, .shop-tabs button.on, .tabs button.on, .btn.on:not(.primary)){
  background: #1f2b45 !important; box-shadow: inset 0 0 0 1px #b8924a !important; border-radius: 8px !important; filter: none !important; color: #f6efe0 !important; }
/* ---- Personal vault, laid out like the Ivory & Navy mockup (user 2026-11-13: "make it clear"): the bag and the vault
   as two framed panels of ten-wide wells (empty ones shown), deposit / withdraw arrows between, the picked item's bar below. */
#win-vault { width: min(1080px, 97vw); }
#win-vault .vt-cols { display: grid; grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr); gap: 14px; align-items: start; }
#win-vault .vt-panel { padding: 10px 12px 12px; background: rgba(255, 252, 244, 0.7); border: 1px solid rgba(169, 133, 60, 0.35); border-radius: 8px; box-shadow: 0 2px 6px rgba(31, 43, 69, 0.08); }
#win-vault .vt-panel h4 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(169, 133, 60, 0.35); }
#win-vault .vt-panel h4 span { font: 700 18px 'Noto Serif Thai', serif !important; color: #1f2b45; }
#win-vault .vt-panel h4 small { font-size: 13px; color: #1f2b45; font-weight: 600; }
#win-vault .vt-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
#win-vault .vt-cell { position: relative; aspect-ratio: 1; padding: 3px; border: 0; cursor: pointer; background: url(assets/ui/b-slot.png) center/100% 100% no-repeat; }
#win-vault .vt-cell canvas { width: 100%; height: 100%; display: block; }
#win-vault .vt-cell b { position: absolute; right: 3px; bottom: 1px; font: 700 11px 'IBM Plex Sans Thai', sans-serif; color: #1f2b45; text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; }
#win-vault .vt-cell:hover:not(.vt-empty) { transform: translateY(-1px); filter: drop-shadow(0 2px 3px rgba(31, 43, 69, 0.3)); }
#win-vault .vt-cell.on { background-image: url(assets/ui/b-slot-on.png); }
#win-vault .vt-cell.on b { color: #f6efe0; text-shadow: 0 1px 2px #000; }
#win-vault .vt-empty { cursor: default; opacity: 0.75; }
#win-vault .vt-mid { display: flex; flex-direction: column; gap: 12px; align-items: stretch; padding-top: 70px; }
#win-vault .vt-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 0; border-radius: 10px; cursor: pointer;
  background: #1f2b45; box-shadow: inset 0 0 0 2px #b8924a, 0 3px 8px rgba(31, 43, 69, 0.3); color: #f6efe0; }
#win-vault .vt-arrow i { font-style: normal; font-size: 28px; line-height: 1; color: #f3d68a; }
#win-vault .vt-arrow span { font: 700 15px 'Noto Serif Thai', serif !important; }
#win-vault .vt-arrow:disabled { opacity: 0.35; cursor: default; }
#win-vault .vt-arrow:hover:not(:disabled) { filter: brightness(1.15); }
#win-vault .vt-all { margin-top: 6px; white-space: normal; line-height: 1.25 !important; padding: 8px 6px !important; }
#win-vault .vt-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; font-weight: 600; color: #1f2b45; }
#win-vault .vt-rule { display: block; text-align: center; margin-top: 6px; color: #6f6857; font-size: 12px; }
#win-vault .vt-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 14px; background: rgba(255, 252, 244, 0.85); border: 1px solid rgba(169, 133, 60, 0.4); border-radius: 8px; box-shadow: 0 2px 6px rgba(31, 43, 69, 0.08); }
#win-vault .vt-bar.empty { justify-content: center; color: #6f6857; min-height: 56px; }
#win-vault .vt-pick { width: 62px; height: 62px; padding: 5px; flex: none; background: url(assets/ui/b-slot-on.png) center/100% 100% no-repeat; }
#win-vault .vt-pick canvas { width: 100%; height: 100%; }
#win-vault .vt-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
#win-vault .vt-info b { font: 700 17px 'Noto Serif Thai', serif !important; color: #1f2b45; }
#win-vault .vt-info small { color: #6f6857; }
#win-vault .vt-step { display: flex; align-items: center; gap: 4px; }
#win-vault .vt-step .btn { width: 34px; padding: 0 !important; font-size: 18px; }
#win-vault .vt-qty { width: 70px; height: 34px; text-align: center; font-weight: 700; }
@media (max-width: 760px) { #win-vault .vt-cols { grid-template-columns: 1fr; } #win-vault .vt-mid { flex-direction: row; padding-top: 0; } }#win-vault .vt-bar .vt-pick { display: block; flex: none; width: 62px; height: 62px; }
#win-vault .vt-bar .vt-pick canvas { width: 52px; height: 52px; }
#win-vault .vt-bar .vt-step { display: flex; flex: none; flex-direction: row; }
#win-vault .vt-bar .vt-info { display: flex; flex: 1; }
#win-vault .vt-qty { background: #fffdf7 !important; color: #1f2b45 !important; text-align: center; }
/* Vault middle buttons, game style (user 2026-11-13: "less AI, more game"): round navy medallions with a gold ring
   (the kit's close disc) holding a gold arrow, the word under it; "deposit the whole bag" on the kit's navy plate. */
#win-vault .vt-mid { gap: 10px; align-items: center; padding-top: 64px; }
#win-vault .vt-arrow { width: 88px; padding: 0; gap: 4px; background: none !important; box-shadow: none !important; border-radius: 0; color: #1f2b45; transition: transform 0.12s, filter 0.12s; }
#win-vault .vt-arrow i { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; font-size: 26px; font-weight: 700; color: #f3d68a;
  background: url(assets/ui/b-close.png) center/100% 100% no-repeat; filter: drop-shadow(0 3px 4px rgba(31, 43, 69, 0.35)); text-shadow: 0 1px 2px #000; }
#win-vault .vt-arrow span { font: 700 14px 'Noto Serif Thai', serif !important; color: #1f2b45; letter-spacing: 0.04em; }
#win-vault .vt-arrow:hover:not(:disabled) { transform: translateY(-2px); filter: none; }
#win-vault .vt-arrow:hover:not(:disabled) i { filter: drop-shadow(0 0 8px rgba(240, 200, 110, 0.85)); }
#win-vault .vt-arrow:disabled { opacity: 0.38; filter: saturate(0.3); }
#win-vault .vt-all { width: 112px; min-height: 40px; margin-top: 8px; border: 0 !important; box-shadow: none !important; color: #f6efe0 !important;
  background: url(assets/ui/b-btn.png) center/100% 100% no-repeat !important; font: 700 13px 'Noto Serif Thai', serif !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
#win-vault .vt-all:hover:not(:disabled) { filter: brightness(1.12) drop-shadow(0 2px 4px rgba(31, 43, 69, 0.35)) !important; }
#win-vault .vt-all { cursor: pointer; padding: 6px 10px; line-height: 1.25 !important; }
#win-vault .vt-all:disabled { opacity: 0.4; cursor: default; }

/* A window title made of several pieces (the skills window: "Skills · [emblem] class name [class 2]") reads as one line. */
.window > .panel-title .pt-main { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.window > .panel-title .pt-main .c2-emblem { margin: 0; width: 28px; height: 28px; vertical-align: 0; }
.window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title .c2-title { color: #1f2b45 !important; background: linear-gradient(180deg, #f6dc8e, #d4a64a); padding: 1px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 700; vertical-align: 0; }
/* Skill cards in theme B: the name bold navy, the line under it readable, cost and cooldown as quiet chips. */
html:not([data-ui="a"]) #win-skills.window .sk-list b{ font-size: 15px; color: #1f2b45; }
html:not([data-ui="a"]) #win-skills.window .sk-list p, html:not([data-ui="a"]) #win-skills.window .sk-desc{ color: #2c3650 !important; font-size: 13px; line-height: 1.45 !important; }
html:not([data-ui="a"]) #win-skills.window .sk-meta span{ background: rgba(31, 43, 69, 0.07); color: #3b4560; padding: 1px 8px; border-radius: 10px; font-size: 12px; }/* A maxed skill: a quiet gold "MAX" mark instead of a greyed-out button; the cards a little tighter and calmer. */
html:not([data-ui="a"]) #win-skills .sk-max{ display: inline-block; padding: 2px 10px; border-radius: 10px; font: 800 12px 'IBM Plex Sans Thai', sans-serif; letter-spacing: 0.12em;
  color: #7a5a16; background: linear-gradient(180deg, #fbefcc, #efd79a); box-shadow: inset 0 0 0 1px #c9a24e; }
html:not([data-ui="a"]) #win-skills.window .sk-list > *{ background: rgba(255, 252, 244, 0.85) !important; }
/* Title bars: the plate's art trimmed of its empty rows (b-title2.png: navy 0–74, gold line 75–80 of 81), the content
   centred on the navy part, not on the whole plate (user 2026-11-13: "is it centred?"). */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title{ display: flex !important; align-items: center; gap: 10px; min-height: 56px; box-sizing: border-box;
  padding: 10px 18px 15px 24px !important; background-image: url(assets/ui/b-title2.png) !important; line-height: 1 !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title .close{ margin-left: auto; flex: none; position: static !important; transform: none !important; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title .pt-main{ line-height: 1 !important; }
/* The window frame paints over its outer 14px: the title bar sits inside the frame, not under it, so what shows of its navy is what it is centred on. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) > .panel-title{ margin: 0 0 10px !important; }

/* Skill level pips on the ivory card (user 2026-11-13): small solid diamonds that read — gold with a navy edge when
   learnt, a hollow navy outline when not; the level 6 (cooldown only) pip a touch apart. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips{ gap: 4px; align-items: center; margin-left: 8px; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips i{ width: 9px; height: 9px; background: transparent; border: 1.5px solid rgba(31, 43, 69, 0.35); box-shadow: none; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips i.on{ background: linear-gradient(135deg, #f8dc8a, #c48a1e); border-color: #6b4a10; box-shadow: 0 1px 2px rgba(31, 43, 69, 0.35); }
/* Maxed: a navy seal with a gold rim and gold lettering, like the rest of the kit's controls. */
html:not([data-ui="a"]) #win-skills .sk-max{ padding: 4px 12px 3px; border-radius: 4px; font: 800 11.5px 'IBM Plex Sans Thai', sans-serif; letter-spacing: 0.18em;
  color: #f3d68a; background: linear-gradient(180deg, #2b3d63, #1a2440); box-shadow: inset 0 0 0 1px #c9a24e, 0 2px 4px rgba(31, 43, 69, 0.3); text-shadow: 0 1px 1px #000; }
/* Level pips (user 2026-11-13: "no outline, glowing, so a full skill looks cool"): borderless gold diamonds with a warm
   glow; not yet learnt, a faint navy diamond; a maxed skill's row glows brighter and shimmers. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips i{ border: 0 !important; width: 10px; height: 10px; background: rgba(31, 43, 69, 0.16); box-shadow: none; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips i.on{ background: radial-gradient(circle at 35% 35%, #fff6cf, #f6c64a 45%, #d48a12); box-shadow: 0 0 5px rgba(255, 190, 60, 0.85), 0 0 10px rgba(255, 170, 40, 0.45); }
@keyframes pipShine { 0%, 100% { filter: brightness(1) } 50% { filter: brightness(1.35) } }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips:not(:has(i:not(.on))) i{ box-shadow: 0 0 6px rgba(255, 200, 70, 1), 0 0 14px rgba(255, 170, 40, 0.7); animation: pipShine 1.8s ease-in-out infinite; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips:not(:has(i:not(.on))) i:nth-child(2n){ animation-delay: 0.3s; }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips:not(:has(i:not(.on))) i:nth-child(3n){ animation-delay: 0.6s; }
/* Pips, toned down (user 2026-11-13: "too much glow, hurts the eyes"): a soft halo only; a full skill a little warmer,
   a slow gentle shimmer. */
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips i.on{ box-shadow: 0 0 3px rgba(240, 170, 40, 0.45) !important; }
@keyframes pipSoft { 0%, 100% { filter: brightness(1) } 50% { filter: brightness(1.12) } }
html:not([data-ui="a"]) .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today) .pips:not(:has(i:not(.on))) i{ box-shadow: 0 0 4px rgba(240, 170, 40, 0.6) !important; animation: pipSoft 3s ease-in-out infinite !important; }
/* The smith's smelting tab (user 2026-11-13: its own tab, like the mockup): one centred card, shards → furnace → stone. */
#win-shop .shop-wrap.smelt { display: block; }
#win-shop .sm-card { max-width: 640px; margin: 6px auto 0; padding: 22px 26px 20px; text-align: center; background: rgba(255, 252, 244, 0.85); border: 1px solid rgba(169, 133, 60, 0.4); border-radius: 10px; box-shadow: 0 3px 10px rgba(31, 43, 69, 0.1); }
#win-shop .sm-flow { display: flex; align-items: center; justify-content: center; gap: 18px; }
#win-shop .sm-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 150px; }
#win-shop .sm-well { width: 96px; height: 96px; padding: 12px; box-sizing: border-box; background: url(assets/ui/b-slot.png) center/100% 100% no-repeat; }
#win-shop .sm-well canvas { width: 100%; height: 100%; }
#win-shop .sm-item b { font: 700 16px 'Noto Serif Thai', serif !important; color: #1f2b45; }
#win-shop .sm-item small { color: #6f6857; }
#win-shop .sm-fire { display: flex; align-items: center; gap: 6px; margin-bottom: 40px; }
#win-shop .sm-arrow { width: 34px; height: 3px; background: linear-gradient(90deg, rgba(201, 162, 78, 0.2), #c9a24e); position: relative; }
#win-shop .sm-arrow:last-child::after { content: ''; position: absolute; right: -2px; top: -5px; border: 6.5px solid transparent; border-left: 9px solid #c9a24e; border-right: 0; }
@keyframes smFlame { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.06); filter: brightness(1.15); } }
#win-shop .sm-furnace { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 50% 62%, #fff3c0 0 12%, #ffb43a 30%, #e2581c 55%, #3a2a24 72%, #2a2026 100%);
  box-shadow: 0 0 0 3px #1f2b45, 0 0 0 5px #c9a24e, 0 4px 10px rgba(31, 43, 69, 0.35); animation: smFlame 1.6s ease-in-out infinite; }
#win-shop .sm-rule { margin: 14px 0 12px; font: 600 16px 'Noto Serif Thai', serif; color: #1f2b45; }
#win-shop .sm-qty { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; }
#win-shop .sm-qty b { min-width: 64px; padding: 4px 0; border-radius: 6px; background: #fffdf7; box-shadow: inset 0 0 0 1px rgba(31, 43, 69, 0.25); font-size: 17px; color: #1f2b45; }
#win-shop .sm-qty .btn { min-width: 36px; }
#win-shop .sm-acts { display: flex; justify-content: center; gap: 14px; }
#win-shop .sm-acts .btn { min-width: 190px; min-height: 44px; font-size: 15px; }
#win-shop .sm-none { margin: 12px 0 0; color: #8c2b22; font-size: 13px; }
/* Smelting copy: what goes in and what comes out on one line, the odds on their own. */
#win-shop .sm-rule { margin: 16px 0 2px; font: 600 16px 'Noto Serif Thai', serif; color: #1f2b45; }
#win-shop .sm-rule b, #win-shop .sm-odds b { color: #8a6418; font-size: 1.12em; }
#win-shop .sm-odds { margin: 0 0 14px; font: 600 14.5px 'IBM Plex Sans Thai', sans-serif; color: #3b4560; }
/* The forge: a furnace with a ring that flares, sparks that fly out, the result popping up. */
#win-shop .sm-card { position: relative; overflow: hidden; }
#win-shop .sm-forge { position: relative; display: grid; place-items: center; width: 64px; height: 64px; }
#win-shop .sm-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 190, 70, 0); }
#win-shop .sm-sparks { position: absolute; inset: 0; pointer-events: none; }
#win-shop .sm-sparks i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #ffd27a; opacity: 0; }
@keyframes smIn { 0% { transform: translateX(0) scale(1); opacity: 1 } 70% { transform: translateX(150px) scale(0.35) rotate(40deg); opacity: 0.9 } 100% { transform: translateX(160px) scale(0.1); opacity: 0 } }
@keyframes smRoar { 0% { transform: scale(1) } 30% { transform: scale(1.25) } 60% { transform: scale(1.12) } 100% { transform: scale(1.2) } }
@keyframes smRing { 0% { inset: -2px; border-color: rgba(255, 200, 90, 0.9) } 100% { inset: -26px; border-color: rgba(255, 160, 50, 0) } }
@keyframes smSpark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-46px) } }
@keyframes smOut { 0% { transform: translateX(-150px) scale(0.2); opacity: 0 } 60% { transform: translateX(8px) scale(1.15); opacity: 1 } 100% { transform: none; opacity: 1 } }
@keyframes smGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 80, 0) } 40% { box-shadow: 0 0 22px 6px rgba(255, 200, 80, 0.75) } }
@keyframes smPop { 0% { transform: translate(-50%, 10px) scale(0.6); opacity: 0 } 25% { transform: translate(-50%, 0) scale(1.08); opacity: 1 } 80% { opacity: 1 } 100% { transform: translate(-50%, -14px); opacity: 0 } }
@keyframes smChoke { 0%, 100% { filter: none } 40% { filter: grayscale(0.8) brightness(0.6) } }
#win-shop .sm-card.firing .sm-flow .sm-item:first-child .sm-well canvas { animation: smIn 0.8s ease-in forwards; }
#win-shop .sm-card.firing .sm-furnace { animation: smRoar 0.9s ease-out forwards, smFlame 0.25s ease-in-out infinite; }
#win-shop .sm-card.firing .sm-ring { animation: smRing 0.6s ease-out infinite; }
#win-shop .sm-card.firing .sm-sparks i { animation: smSpark 0.7s ease-out var(--d) infinite; }
#win-shop .sm-card.done .sm-flow .sm-item:last-child .sm-well { animation: smGlow 1s ease-out; }
#win-shop .sm-card.done .sm-flow .sm-item:last-child .sm-well canvas { animation: smOut 0.55s cubic-bezier(.2,.9,.3,1.3); }
#win-shop .sm-card.fail .sm-furnace { animation: smChoke 0.9s ease-out; }
#win-shop .sm-pop { position: absolute; left: 50%; top: 40%; padding: 6px 18px; border-radius: 6px; font: 700 18px 'Noto Serif Thai', serif; pointer-events: none; animation: smPop 1.3s ease-out forwards; white-space: nowrap; }
#win-shop .sm-pop.ok { color: #f3d68a; background: #1f2b45; box-shadow: inset 0 0 0 1px #c9a24e, 0 4px 14px rgba(31, 43, 69, 0.35); }
#win-shop .sm-pop.bad { color: #fff; background: #8c2b22; box-shadow: 0 4px 14px rgba(31, 43, 69, 0.35); }
/* ---- Forge panel, made plain to read (user 2026-11-13: "a human sees it and gets it"): now → if it works, in big
   numbers on two plates (the next one in navy); the cost as two labelled plates (what it takes, what you have);
   the scroll option a clear checkbox row. */
#win-shop .shop-detail.fg { gap: 12px; }
#win-shop .fg-cmp { display: grid !important; grid-template-columns: 1fr 34px 1fr; align-items: stretch; gap: 0; width: 100%; }
#win-shop .fg-cmp > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 8px; border: 0 !important; }
#win-shop .fg-cmp > .now { background: rgba(31, 43, 69, 0.06); box-shadow: inset 0 0 0 1px rgba(31, 43, 69, 0.15); }
#win-shop .fg-cmp > .nx { background: #1f2b45; box-shadow: inset 0 0 0 1px #c9a24e, 0 3px 8px rgba(31, 43, 69, 0.25); }
#win-shop .fg-cmp small { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; color: #6f6857 !important; }
#win-shop .fg-cmp > .nx small { color: #d8c79a !important; }
#win-shop .fg-cmp b { font: 800 28px 'Noto Serif Thai', serif !important; line-height: 1.15 !important; color: #1f2b45 !important; }
#win-shop .fg-cmp > .nx b { color: #f3d68a !important; }
#win-shop .fg-cmp span { font-size: 14px; font-weight: 700; color: #1f2b45 !important; }
#win-shop .fg-cmp > .nx span { color: #f6efe0 !important; }
#win-shop .fg-to { align-self: center; justify-self: center; width: 0; height: 0; border: 9px solid transparent; border-left: 13px solid #c9a24e; border-right: 0; font-size: 0; }
#win-shop .fg-cost { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
#win-shop .fg-cost > div { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(255, 252, 244, 0.9); box-shadow: inset 0 0 0 1px rgba(169, 133, 60, 0.45); }
#win-shop .fg-cost > div img, #win-shop .fg-cost > div canvas { width: 34px !important; height: 34px !important; flex: none; }
#win-shop .fg-cost > div span { display: flex; flex-direction: column; line-height: 1.2 !important; text-align: left; }
#win-shop .fg-cost small { font-size: 12px; color: #6f6857; }
#win-shop .fg-cost b { font: 800 17px 'IBM Plex Sans Thai', sans-serif !important; color: #1f2b45; }
#win-shop .fg-cost em { font-style: normal; font-size: 12px; color: #6f6857; }
#win-shop .fg-cost > div.no { background: #fbeae6; box-shadow: inset 0 0 0 1px #c0564a; }
#win-shop .fg-cost > div.no b, #win-shop .fg-cost > div.no em { color: #a32a1e; }
#win-shop .fg-opts { width: 100%; }
#win-shop .fg-opt { display: flex !important; align-items: center; gap: 10px; width: 100%; padding: 8px 12px !important; border-radius: 8px; text-align: left;
  background: rgba(255, 252, 244, 0.9) !important; border: 0 !important; box-shadow: inset 0 0 0 1px rgba(31, 43, 69, 0.2); color: #1f2b45 !important; cursor: pointer; opacity: 1 !important; }
#win-shop .fg-opt:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #c9a24e, 0 2px 6px rgba(31, 43, 69, 0.15); }
#win-shop .fg-opt .fg-box { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 5px; background: #fff; box-shadow: inset 0 0 0 2px #1f2b45; font: 900 14px sans-serif; font-style: normal; color: #fff; }
#win-shop .fg-opt.on { background: #e9eef8 !important; box-shadow: inset 0 0 0 2px #1f2b45; }
#win-shop .fg-opt.on .fg-box { background: #1f2b45; }
#win-shop .fg-opt img { width: 28px; height: 28px; }
#win-shop .fg-opt span { display: flex; flex-direction: column; line-height: 1.25 !important; }
#win-shop .fg-opt span b { font-size: 14px; color: #1f2b45; }
#win-shop .fg-opt span small { font-size: 12px; color: #6f6857; }
#win-shop .fg-opt:disabled { filter: grayscale(0.6); }
#win-shop .fg-opt:disabled span b { color: #8a8475; }
#win-shop .fg-rate { font-size: 15px; color: #1f2b45; }
#win-shop .fg-rate b { font-size: 22px; color: #1f2b45; }
#win-shop .fg-note { color: #6f6857; font-size: 13px; }
/* Forge panel, second pass (user 2026-11-13: "too big, the enhance button looks small and dull; give it VFX and a
   colour that makes you want to press it"): the plates and costs a size down; the button a big molten-gold forge
   button with a light sweeping across it, embers rising and a breathing glow. */
#win-shop .shop-detail.fg { gap: 9px; }
#win-shop .fg-cmp > div { padding: 6px 6px; }
#win-shop .fg-cmp b { font-size: 22px !important; }
#win-shop .fg-cmp span { font-size: 12.5px; }
#win-shop .fg-cmp small { font-size: 11.5px; }
#win-shop .fg-cost > div { padding: 5px 10px; gap: 8px; }
#win-shop .fg-cost > div img, #win-shop .fg-cost > div canvas { width: 26px !important; height: 26px !important; }
#win-shop .fg-cost b { font-size: 15px !important; }
#win-shop .fg-opt { padding: 6px 10px !important; }
#win-shop .fg-rate b { font-size: 19px; }
@keyframes fgBreath { 0%, 100% { box-shadow: 0 0 0 1px #8a5a12, 0 4px 0 #7a4a0c, 0 6px 14px rgba(255, 150, 30, 0.35), 0 0 18px rgba(255, 180, 60, 0.25); }
  50% { box-shadow: 0 0 0 1px #8a5a12, 0 4px 0 #7a4a0c, 0 6px 18px rgba(255, 150, 30, 0.55), 0 0 30px rgba(255, 190, 70, 0.55); } }
@keyframes fgSweep { 0%, 55% { transform: translateX(-160%) skewX(-22deg); } 100% { transform: translateX(260%) skewX(-22deg); } }
@keyframes fgEmber { 0% { transform: translateY(0) scale(1); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-34px) scale(0.4); opacity: 0; } }
#win-shop .fg-go { position: relative; overflow: visible; width: 100%; min-height: 54px !important; margin-top: 4px; border: 0 !important; border-radius: 12px !important;
  background: linear-gradient(180deg, #ffe7a0 0%, #ffbf3c 38%, #f08a12 70%, #c95f08 100%) !important; color: #3a1d02 !important;
  font: 800 20px 'Noto Serif Thai', serif !important; letter-spacing: 0.08em; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.8);
  animation: fgBreath 2.2s ease-in-out infinite; transition: transform 0.12s, filter 0.12s; isolation: isolate; }
#win-shop .fg-go::before { content: ''; position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 240, 0.85) 50%, transparent 65%) no-repeat; background-size: 45% 100%; animation: fgSweep 2.6s ease-in-out infinite; mix-blend-mode: soft-light; }
#win-shop .fg-go::after { content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px; pointer-events: none;
  background: radial-gradient(circle, #ffd27a 0 2px, transparent 3px) 12% 0 / 22% 4px repeat-x; animation: fgEmber 1.6s ease-out infinite; filter: drop-shadow(0 0 3px #ff9a2a); }
#win-shop .fg-go:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08) saturate(1.1); }
#win-shop .fg-go:active:not(:disabled) { transform: translateY(2px); }
#win-shop .fg-go:disabled { animation: none; filter: grayscale(0.8) brightness(0.9); color: #5a4a3a !important; }
#win-shop .fg-go:disabled::before, #win-shop .fg-go:disabled::after { display: none; }
/* ---------- Dungeon rooms and the boss's entrance (2026-11-14) ---------- */
/* Into the next room: up out of black with the room's name and the rooms passed. */
#dg-room { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: #05040a; pointer-events: none;
  animation: dgr-fade 2.4s ease-in forwards; }
#dg-room .dgr-in { text-align: center; color: #f3e6c4; animation: dgr-rise 2.4s ease-out forwards; }
#dg-room small { display: block; font: 600 14px 'Noto Serif Thai', serif; letter-spacing: .3em; color: #b9a46a; }
#dg-room b { display: block; font: 700 44px 'Noto Serif Thai', serif; margin: 6px 0 14px; text-shadow: 0 0 24px rgba(255, 210, 120, .45);
  background: linear-gradient(#fff4cf, #e8b04a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#dg-room .dgr-dots { display: flex; gap: 10px; justify-content: center; }
#dg-room .dgr-dots i { width: 34px; height: 3px; background: rgba(255, 255, 255, .18); }
#dg-room .dgr-dots i.past { background: #b9a46a; }
#dg-room .dgr-dots i.now { background: #ffe08a; box-shadow: 0 0 10px #ffd27a; }
@keyframes dgr-fade { 0%, 45% { background: #05040a; opacity: 1; } 100% { background: rgba(5, 4, 10, 0); opacity: 0; } }
@keyframes dgr-rise { 0% { transform: translateY(14px); opacity: 0; } 18%, 60% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* The boss's entrance cutscene, cut like a film (ui bossIntro, 2026-11-14). Shots are classes on #dg-intro, added in
   turn: (none) the telling · dim · tease (the silhouette) · reveal (the light) · named (the title card) · out. */
#dg-intro { position: fixed; inset: 0; z-index: 95; overflow: hidden; background: #000; color: #ece6f4; --dgc: #9a7cff;
  animation: dgi-in 1.2s ease-out; }
#dg-intro.out { animation: dgi-out .9s ease-in forwards; }
#dg-intro .dgi-stage { position: absolute; inset: 0; overflow: hidden; }
#dg-intro.reveal .dgi-stage { animation: dgi-shake .9s cubic-bezier(.3, .7, .4, 1); }
/* The camera: a slow push in over the whole scene, a little more once the boss is out. */
#dg-intro .dgi-bg { position: absolute; inset: -8%; background: var(--bn) center 40% / cover no-repeat;
  filter: saturate(.55) brightness(.5) contrast(1.15) sepia(.15); transform-origin: 50% 45%;
  animation: dgi-push 30s cubic-bezier(.2, 0, .3, 1) forwards; transition: filter 2.2s ease; }
#dg-intro.dim .dgi-bg { filter: saturate(.4) brightness(.32) contrast(1.2) sepia(.2); }
#dg-intro.tease .dgi-bg { filter: saturate(.3) brightness(.12) contrast(1.3); transition-duration: 1.4s; }
#dg-intro.reveal .dgi-bg { filter: saturate(.75) brightness(.42) contrast(1.25); transition-duration: .2s; }
#dg-intro.named .dgi-bg { filter: saturate(.6) brightness(.28) contrast(1.2) blur(3px); transition-duration: 2s; }
/* Light falling from above: soft shafts, slowly breathing. */
#dg-intro .dgi-rays { position: absolute; inset: 0; mix-blend-mode: screen; opacity: .55; transition: opacity 1.5s; }
#dg-intro .dgi-rays i { position: absolute; top: -20%; width: 18vw; height: 140%; transform-origin: 50% 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--dgc) 55%, #fff) 0%, color-mix(in srgb, var(--dgc) 25%, transparent) 35%, transparent 75%);
  filter: blur(28px); opacity: .5; animation: dgi-ray 7s ease-in-out infinite alternate; }
#dg-intro .dgi-rays i:nth-child(1) { left: 8%; transform: rotate(16deg); animation-delay: -1s; }
#dg-intro .dgi-rays i:nth-child(2) { left: 34%; width: 10vw; transform: rotate(7deg); animation-delay: -3s; }
#dg-intro .dgi-rays i:nth-child(3) { left: 58%; width: 14vw; transform: rotate(-6deg); animation-delay: -5s; }
#dg-intro .dgi-rays i:nth-child(4) { left: 80%; transform: rotate(-15deg); animation-delay: -2s; }
#dg-intro.tease .dgi-rays { opacity: .08; }
#dg-intro.reveal .dgi-rays { opacity: .95; transition-duration: .3s; }
#dg-intro.named .dgi-rays { opacity: .45; }
/* Fog in two depths, drifting different ways. */
#dg-intro .dgi-fog { position: absolute; left: -30%; right: -30%; pointer-events: none; filter: blur(22px); }
#dg-intro .dgi-fog.back { top: 30%; height: 60%; opacity: .55; animation: dgi-drift 26s linear infinite alternate;
  background: radial-gradient(40% 50% at 20% 60%, rgba(150, 140, 170, .35), transparent 70%), radial-gradient(35% 45% at 60% 40%, rgba(120, 110, 150, .3), transparent 70%),
    radial-gradient(40% 50% at 90% 70%, rgba(150, 140, 170, .3), transparent 70%); }
#dg-intro .dgi-fog.front { bottom: -12%; height: 48%; opacity: .8; animation: dgi-drift 18s linear infinite alternate-reverse;
  background: radial-gradient(45% 60% at 25% 70%, rgba(20, 16, 30, .95), transparent 70%), radial-gradient(40% 55% at 70% 80%, rgba(24, 18, 36, .95), transparent 70%),
    radial-gradient(30% 40% at 50% 60%, color-mix(in srgb, var(--dgc) 18%, transparent), transparent 70%); }
/* The boss: low in the frame, looming; first a black shape rimmed in light, then lit. */
#dg-intro .dgi-boss { --band: min(82vh, 100vw / 2.39); position: absolute; left: 50%; bottom: calc((100vh - var(--band)) / 2 - var(--band) * 0.12); width: calc(var(--band) * 1.08); aspect-ratio: 1; transform: translate(-50%, 22%) scale(.92);
  transform-origin: 50% 100%; opacity: 0; transition: transform 2.2s cubic-bezier(.15, .6, .25, 1), opacity 1.6s; }
#dg-intro .dgi-boss canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#dg-intro .dgi-boss .sil { filter: brightness(0) drop-shadow(0 0 2px var(--dgc)) drop-shadow(0 0 14px var(--dgc)) drop-shadow(0 -10px 40px color-mix(in srgb, var(--dgc) 60%, transparent)); }
#dg-intro .dgi-boss .lit { opacity: 0; filter: brightness(1.15) contrast(1.1) drop-shadow(0 0 30px color-mix(in srgb, var(--dgc) 70%, transparent)); transition: opacity .25s; }
#dg-intro.tease .dgi-boss { opacity: 1; transform: translate(-50%, 6%) scale(1); }
#dg-intro.reveal .dgi-boss { transform: translate(-50%, 4%) scale(1.04); transition: transform 6s cubic-bezier(.1, .6, .3, 1); }
#dg-intro.reveal .dgi-boss .lit { opacity: 1; animation: dgi-split .55s steps(4) 1; }
#dg-intro.named .dgi-boss { transform: translate(-50%, 2%) scale(1.08); filter: brightness(.7); transition: transform 6s linear, filter 1.5s; }
/* The shockwave at its feet. */
#dg-intro .dgi-ring { position: absolute; left: 50%; bottom: calc((100vh - min(82vh, 100vw / 2.39)) / 2 + 3vh); width: 20vmin; height: 7vmin; margin-left: -10vmin; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--dgc) 60%, #fff); box-shadow: 0 0 30px var(--dgc), inset 0 0 20px var(--dgc); opacity: 0; }
#dg-intro.reveal .dgi-ring { animation: dgi-ring 1.1s cubic-bezier(.1, .7, .3, 1); }
/* Dust in the air: far motes small and slow, near ones big and out of focus. */
#dg-intro .dgi-motes i { position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%; background: color-mix(in srgb, var(--dgc) 50%, #fff);
  box-shadow: 0 0 6px var(--dgc); opacity: .5; transform: scale(var(--s)); animation: dgi-dust var(--t) ease-in-out var(--d) infinite alternate; }
#dg-intro .dgi-motes i.near { filter: blur(3px); opacity: .35; }
#dg-intro.reveal .dgi-motes i { animation-duration: 1.4s; }
/* The grade: a vignette, cold shadows, the hall's light in the highlights. */
#dg-intro .dgi-grade { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 35%, rgba(0, 0, 0, .55) 75%, rgba(0, 0, 0, .9) 100%),
    linear-gradient(180deg, rgba(10, 14, 30, .35), transparent 40%, rgba(10, 6, 20, .45)); }
#dg-intro .dgi-grain { position: absolute; inset: -50%; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: dgi-grain .5s steps(5) infinite; }
#dg-intro .dgi-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#dg-intro.reveal .dgi-flash { animation: dgi-flash .8s ease-out; }
/* Scope bars (2.39:1) and the chapter card in the top one. */
#dg-intro .dgi-bar { position: absolute; left: 0; right: 0; height: max(0px, calc((100vh - 100vw / 2.39) / 2)); min-height: 9vh; background: #000; z-index: 2; }
#dg-intro .dgi-bar.top { top: 0; animation: dgi-bar-t 1.2s cubic-bezier(.2, .8, .2, 1) both; }
#dg-intro .dgi-bar.bottom { bottom: 0; animation: dgi-bar-b 1.2s cubic-bezier(.2, .8, .2, 1) both; }
#dg-intro .dgi-chapter { position: absolute; left: 34px; bottom: 12px; font: 500 12px 'Noto Serif Thai', serif; letter-spacing: .45em; color: rgba(236, 226, 205, .55);
  opacity: 0; animation: dgi-fade 2s 1s ease forwards; }
#dg-intro .dgi-chapter i { display: inline-block; width: 26px; height: 1px; margin: 0 12px; vertical-align: middle; background: rgba(236, 226, 205, .4); }
/* Subtitles: phrase after phrase out of a blur; the boss's own line bigger, its name above in its light. */
#dg-intro .dgi-sub { position: absolute; left: 50%; bottom: calc(max(9vh, (100vh - 100vw / 2.39) / 2) + 26px); width: min(820px, 86vw); transform: translateX(-50%);
  z-index: 3; text-align: center; opacity: 0; transition: opacity .45s; }
#dg-intro .dgi-sub.on { opacity: 1; }
#dg-intro .dgi-sub p { margin: 0; font: 400 20px/1.7 'Noto Serif Thai', serif; letter-spacing: .03em; color: #ebe6f0; text-shadow: 0 1px 2px #000, 0 0 18px rgba(0, 0, 0, .9); }
#dg-intro .dgi-sub p span { display: inline-block; opacity: 0; filter: blur(8px); animation: dgi-word .9s ease forwards; }
#dg-intro .dgi-sub .who { display: block; min-height: 16px; margin-bottom: 4px; font: 600 12px 'Noto Serif Thai', serif; letter-spacing: .5em; color: var(--dgc); text-shadow: 0 0 10px var(--dgc), 0 1px 2px #000; }
#dg-intro .dgi-sub.boss p { font-size: 25px; font-weight: 600; color: #fff; letter-spacing: .05em; text-shadow: 0 0 22px color-mix(in srgb, var(--dgc) 80%, transparent), 0 2px 3px #000; }
/* The title card. */
#dg-intro .dgi-title { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 3; text-align: center; pointer-events: none; opacity: 0;
  padding: 4vh 0; background: radial-gradient(60% 50% at 50% 50%, rgba(0, 0, 0, .7), transparent 75%); }
#dg-intro.named .dgi-title { animation: dgi-fade .8s ease forwards; }
#dg-intro .dgi-title small { display: flex; align-items: center; justify-content: center; gap: 18px; font: 500 15px 'Noto Serif Thai', serif;
  letter-spacing: .6em; color: color-mix(in srgb, var(--dgc) 55%, #fff); text-shadow: 0 0 14px var(--dgc), 0 1px 2px #000; }
#dg-intro .dgi-title small i { width: 0; height: 1px; background: linear-gradient(90deg, transparent, #e8c46a, transparent); }
#dg-intro.named .dgi-title small i { animation: dgi-rule 1.6s .2s cubic-bezier(.2, .8, .2, 1) forwards; }
#dg-intro.named .dgi-title small span { animation: dgi-track 2.4s .1s cubic-bezier(.2, .8, .2, 1) both; }
#dg-intro .dgi-title b { position: relative; display: block; margin-top: 10px; font: 800 clamp(44px, 7.4vw, 92px)/1.2 'Noto Serif Thai', serif; letter-spacing: .06em;
  background: linear-gradient(100deg, #8a5a1c 0%, #e8c46a 25%, #fff6d8 42%, #e8c46a 55%, #8a5a1c 80%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .9)) drop-shadow(0 0 22px rgba(232, 180, 80, .35)); }
#dg-intro.named .dgi-title b { animation: dgi-name 2.2s .45s cubic-bezier(.15, .8, .25, 1) both, dgi-sheen 3.2s 1.2s ease-in-out forwards; }
#dg-intro .dgi-title em { display: inline-block; margin-top: 14px; font: 600 12px 'IBM Plex Sans Thai', sans-serif; font-style: normal; letter-spacing: .55em;
  color: rgba(255, 228, 200, .75); padding-left: .55em; opacity: 0; }
#dg-intro.named .dgi-title em { animation: dgi-fade 1.2s 1.6s ease forwards; }
#dg-intro .dgi-skip { position: absolute; right: 30px; top: calc(max(9vh, (100vh - 100vw / 2.39) / 2) + 18px); z-index: 4; padding: 6px 4px; cursor: pointer;
  font: 500 13px 'Noto Serif Thai', serif; letter-spacing: .3em; color: rgba(236, 226, 205, .6); background: none; border: 0; border-bottom: 1px solid rgba(232, 196, 106, .35);
  opacity: 0; animation: dgi-fade 1s 1.5s forwards; transition: color .2s, border-color .2s; }
#dg-intro .dgi-skip span { font-size: 10px; letter-spacing: 0; }
#dg-intro .dgi-skip:hover { color: #fff; border-color: #e8c46a; }
@keyframes dgi-in { from { opacity: 0; } }
@keyframes dgi-out { to { opacity: 0; filter: brightness(0); } }
@keyframes dgi-fade { to { opacity: 1; } }
@keyframes dgi-push { from { transform: scale(1.02) translate(1.5%, 1%); } to { transform: scale(1.22) translate(-1%, -2%); } }
@keyframes dgi-ray { from { opacity: .3; } to { opacity: .65; } }
@keyframes dgi-drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes dgi-dust { from { transform: translate(0, 0) scale(var(--s)); } to { transform: translate(3vw, -6vh) scale(var(--s)); } }
@keyframes dgi-grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); } 40% { transform: translate(4%, -4%); } 60% { transform: translate(-3%, -2%); } 80% { transform: translate(5%, 4%); } }
@keyframes dgi-flash { 0% { opacity: 0; } 8% { opacity: .95; } 100% { opacity: 0; } }
@keyframes dgi-shake { 0%, 100% { transform: none; } 10% { transform: translate(-14px, 8px) rotate(-.4deg); } 25% { transform: translate(12px, -9px) rotate(.3deg); }
  40% { transform: translate(-8px, 6px); } 60% { transform: translate(5px, -4px); } 80% { transform: translate(-2px, 2px); } }
@keyframes dgi-split { 0% { filter: brightness(2.2) drop-shadow(-14px 0 0 rgba(255, 30, 70, .75)) drop-shadow(14px 0 0 rgba(30, 220, 255, .75)); }
  60% { filter: brightness(1.4) drop-shadow(-5px 0 0 rgba(255, 30, 70, .5)) drop-shadow(5px 0 0 rgba(30, 220, 255, .5)); }
  100% { filter: brightness(1.15) contrast(1.1) drop-shadow(0 0 30px color-mix(in srgb, var(--dgc) 70%, transparent)); } }
@keyframes dgi-ring { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(9); } }
@keyframes dgi-bar-t { from { transform: translateY(-100%); } }
@keyframes dgi-bar-b { from { transform: translateY(100%); } }
@keyframes dgi-word { to { opacity: 1; filter: blur(0); } }
@keyframes dgi-rule { to { width: min(180px, 14vw); } }
@keyframes dgi-track { from { opacity: 0; letter-spacing: 1.4em; } to { opacity: 1; letter-spacing: .6em; } }
@keyframes dgi-name { 0% { opacity: 0; letter-spacing: .5em; filter: blur(14px) drop-shadow(0 4px 3px rgba(0, 0, 0, .9)); transform: scale(1.08); }
  100% { opacity: 1; letter-spacing: .06em; transform: none; } }
@keyframes dgi-sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
#dg-intro .dgi-sub { padding: 14px 0 10px; background: radial-gradient(50% 60% at 50% 55%, rgba(0, 0, 0, .78), rgba(0, 0, 0, .35) 60%, transparent 100%); }
/* ---------- Each dungeon's own cutscene (src/cutscene.js THEMES) ---------- */
#dg-intro .dgi-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#dg-intro .dgi-cover { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* Library: the name written by a quill, left to right, a bright nib running ahead. */
#dg-intro .dgi-title.quill b { animation: dgi-quill 2.2s .4s cubic-bezier(.4, .1, .4, 1) both, dgi-sheen 3.2s 2.4s ease-in-out forwards; }
#dg-intro .dgi-title.quill b::after { content: ''; position: absolute; top: 18%; width: 10px; height: 64%; border-radius: 50%; background: #fff;
  box-shadow: 0 0 18px 6px var(--dgc), 0 0 40px 10px color-mix(in srgb, var(--dgc) 60%, transparent); animation: dgi-nib 2.2s .4s cubic-bezier(.4, .1, .4, 1) both; }
@keyframes dgi-quill { from { clip-path: inset(0 100% 0 0); opacity: 1; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes dgi-nib { from { left: 0; opacity: 1; } 95% { opacity: 1; } to { left: 100%; opacity: 0; } }
#dg-intro.t-library.tease .dgi-boss .sil { filter: brightness(0) drop-shadow(0 0 3px #b89cff) drop-shadow(0 0 22px #6a3cff); }

/* Circus: spotlights hunting, a velvet curtain shut then torn open, puppet strings, a marquee of bulbs. */
#dg-intro .cz-spot { position: absolute; top: -10%; width: 38vw; height: 130%; transform-origin: 50% 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background: conic-gradient(from 168deg at 50% 0, transparent 0deg, rgba(255, 240, 210, .55) 10deg, rgba(255, 240, 210, .55) 14deg, transparent 24deg); filter: blur(6px);
  animation: cz-sweep 6s ease-in-out infinite alternate; }
#dg-intro .cz-spot.a { left: -6%; } #dg-intro .cz-spot.b { left: 31%; animation-delay: -2s; animation-duration: 5s; } #dg-intro .cz-spot.c { right: -6%; animation-delay: -4s; animation-duration: 7s; }
#dg-intro.cz-hunt .cz-spot { animation-duration: 1.4s; }
#dg-intro.cz-open .cz-spot { animation: none; opacity: .9; transition: transform .25s; }
#dg-intro.cz-open .cz-spot.a { transform: rotate(-24deg); } #dg-intro.cz-open .cz-spot.b { transform: rotate(0); } #dg-intro.cz-open .cz-spot.c { transform: rotate(24deg); }
@keyframes cz-sweep { from { transform: rotate(-32deg); } to { transform: rotate(32deg); } }
#dg-intro .cz-curtain { position: absolute; top: 0; bottom: 0; width: 52%; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .3), transparent 20%, transparent 80%, rgba(0, 0, 0, .5)),
    repeating-linear-gradient(90deg, #4a0612 0, #8e0e26 3vw, #c4213f 4.6vw, #8e0e26 6.2vw, #4a0612 9vw);
  box-shadow: inset 0 -40px 60px rgba(0, 0, 0, .6); transition: transform 1.3s cubic-bezier(.6, 0, .4, 1); }
#dg-intro .cz-curtain.l { left: 0; transform: translateX(-102%); border-right: 6px solid #e8c46a; }
#dg-intro .cz-curtain.r { right: 0; transform: translateX(102%); border-left: 6px solid #e8c46a; }
#dg-intro.cz-shut .cz-curtain { transform: none; }
#dg-intro.cz-open .cz-curtain { transition: transform .45s cubic-bezier(.5, 0, .2, 1); }
#dg-intro.cz-open .cz-curtain.l { transform: translateX(-102%) skewX(-6deg); } #dg-intro.cz-open .cz-curtain.r { transform: translateX(102%) skewX(6deg); }
#dg-intro.t-circus.tease:not(.reveal) .dgi-boss { opacity: 0; }
#dg-intro .cz-strings { position: absolute; left: 50%; top: 0; width: min(60vh, 560px); height: 46%; transform: translateX(-50%); pointer-events: none; }
#dg-intro .cz-strings i { position: absolute; top: 0; width: 1.5px; height: 100%; background: linear-gradient(#e8c46a, rgba(232, 196, 106, .2)); transform: scaleY(0); transform-origin: 50% 0;
  box-shadow: 0 0 6px rgba(255, 220, 140, .8); }
#dg-intro .cz-strings i:nth-child(1) { left: 6%; height: 80%; } #dg-intro .cz-strings i:nth-child(2) { left: 26%; height: 96%; } #dg-intro .cz-strings i:nth-child(3) { left: 50%; height: 60%; }
#dg-intro .cz-strings i:nth-child(4) { left: 74%; height: 92%; } #dg-intro .cz-strings i:nth-child(5) { left: 94%; height: 78%; }
#dg-intro.cz-open .cz-strings i { animation: cz-drop .7s .35s cubic-bezier(.3, 1.4, .5, 1) forwards; }
#dg-intro.cz-open .cz-strings i:nth-child(2n) { animation-delay: .5s; }
@keyframes cz-drop { to { transform: scaleY(1); } }
#dg-intro .dgi-title.marquee { background: none; }
#dg-intro .dgi-title.marquee b { display: inline-block; padding: 8px 46px 12px; border: 3px solid #e8c46a; border-radius: 10px;
  background-color: rgba(40, 6, 14, .82); background-image: linear-gradient(100deg, #8a5a1c 0%, #e8c46a 25%, #fff6d8 42%, #e8c46a 55%, #8a5a1c 80%);
  box-shadow: 0 0 0 4px #4a0612, 0 0 30px rgba(255, 80, 120, .5), inset 0 0 0 2px #4a0612; animation: cz-marquee 1.1s .3s cubic-bezier(.3, 1.6, .5, 1) both, dgi-sheen 3s 1.2s forwards; }
#dg-intro .dgi-title.marquee b { -webkit-background-clip: text; background-clip: text; }
#dg-intro .dgi-title.marquee::before { content: ''; position: absolute; left: 50%; top: 50%; width: min(78vw, 900px); height: 150px; transform: translate(-50%, -38%); border-radius: 14px; pointer-events: none;
  background: radial-gradient(circle, #fff6c8 0 3px, #ffc64a 4px, transparent 6px) 0 0 / 26px 26px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 10px; animation: cz-bulbs .35s steps(2) infinite; filter: drop-shadow(0 0 6px #ffc64a); }
@keyframes cz-marquee { from { opacity: 0; transform: scale(.3) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes cz-bulbs { 50% { background-position: 13px 13px; } }

/* Tide: light through water, the water rising over everything, a wave crashing, the name rippling. */
#dg-intro .td-caustic { position: absolute; inset: -20%; pointer-events: none; mix-blend-mode: screen; opacity: .22;
  background: radial-gradient(circle at 30% 40%, rgba(140, 230, 255, .5) 0 2%, transparent 6%) 0 0 / 14vw 10vw,
    radial-gradient(circle at 70% 60%, rgba(140, 230, 255, .4) 0 1.5%, transparent 5%) 0 0 / 11vw 9vw;
  animation: td-caustic 7s linear infinite; filter: blur(2px); }
@keyframes td-caustic { to { transform: translate(6vw, 4vw) rotate(4deg); } }
#dg-intro .td-water { position: absolute; left: 0; right: 0; bottom: 0; height: 0; pointer-events: none; transition: height 4.5s cubic-bezier(.3, 0, .4, 1);
  background: linear-gradient(180deg, rgba(60, 170, 220, .38), rgba(8, 40, 80, .82)); backdrop-filter: blur(2px) hue-rotate(-10deg); }
#dg-intro .td-water svg { position: absolute; left: 0; bottom: 100%; width: 200%; height: 46px; margin-bottom: -1px; fill: rgba(60, 170, 220, .38); animation: td-wave 3s linear infinite; }
@keyframes td-wave { to { transform: translateX(-50%); } }
#dg-intro.td-rise .td-water { height: 58%; }
#dg-intro.td-deep .td-water { height: 108%; transition-duration: 2.2s; }
#dg-intro.t-tide.reveal .td-water { height: 0; transition: height 1s cubic-bezier(.6, 0, .4, 1) .3s; }
#dg-intro.t-tide .dgi-grade { background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 35%, rgba(0, 10, 25, .6) 75%, rgba(0, 6, 18, .92) 100%), linear-gradient(180deg, rgba(10, 60, 90, .3), transparent 40%, rgba(0, 20, 40, .5)); }
#dg-intro.t-tide.tease .dgi-boss { transform: translate(-50%, 2%) scale(1); transition-duration: 2.4s; }
#dg-intro .dgi-title.ripple b { animation: td-ripple 2.6s .3s cubic-bezier(.2, .8, .3, 1) both, dgi-sheen 3s 1.5s forwards;
  background-image: linear-gradient(100deg, #1a6a9a 0%, #8fe6ff 30%, #ffffff 45%, #8fe6ff 58%, #1a6a9a 85%); filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .9)) drop-shadow(0 0 22px rgba(80, 200, 255, .5)); }
@keyframes td-ripple { 0% { opacity: 0; filter: blur(10px); transform: scaleY(1.6) skewX(18deg); } 25% { opacity: 1; transform: scaleY(.85) skewX(-10deg); } 45% { transform: scaleY(1.08) skewX(6deg); }
  65% { filter: blur(0); transform: scaleY(.96) skewX(-3deg); } 100% { transform: none; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .9)) drop-shadow(0 0 22px rgba(80, 200, 255, .5)); } }

/* Foundry: gears, a red alarm sweeping, hazard tape, iron shutters, the name stamped into a plate. */
#dg-intro .fd-gear { position: absolute; border-radius: 50%; pointer-events: none; opacity: .55;
  background: radial-gradient(circle, #120c08 0 22%, #4a3a2c 23% 30%, transparent 31%), radial-gradient(circle, #5c4a38 0 62%, transparent 63%),
    repeating-conic-gradient(#5c4a38 0 9deg, transparent 9deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 70%, transparent 71%); mask: radial-gradient(circle, #000 0 70%, transparent 71%);
  filter: drop-shadow(0 0 20px rgba(255, 120, 40, .3)); animation: fd-turn 14s linear infinite; }
#dg-intro .fd-gear.g1 { width: 46vh; height: 46vh; left: -14vh; top: 4vh; }
#dg-intro .fd-gear.g2 { width: 30vh; height: 30vh; left: 24vh; top: -8vh; animation-direction: reverse; animation-duration: 9s; }
#dg-intro .fd-gear.g3 { width: 54vh; height: 54vh; right: -18vh; bottom: -10vh; animation-duration: 18s; }
#dg-intro.fd-warn .fd-gear { animation-duration: 3s; }
@keyframes fd-turn { to { transform: rotate(360deg); } }
#dg-intro .fd-alarm { position: absolute; inset: -40%; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity .6s;
  background: conic-gradient(from 0deg, rgba(255, 30, 20, .55) 0deg, transparent 40deg, transparent 180deg, rgba(255, 30, 20, .55) 180deg, transparent 220deg); animation: fd-turn 1.6s linear infinite; }
#dg-intro.fd-warn .fd-alarm { opacity: .5; }
#dg-intro.reveal .fd-alarm { opacity: 0; }
#dg-intro .fd-tape { position: absolute; left: -5%; right: -5%; height: 34px; overflow: hidden; pointer-events: none; opacity: 0; transform: rotate(-2deg);
  background: repeating-linear-gradient(-45deg, #f2c21a 0 22px, #141414 22px 44px); box-shadow: 0 4px 12px rgba(0, 0, 0, .6); transition: opacity .4s; }
#dg-intro .fd-tape.top { top: calc(max(9vh, (100vh - 100vw / 2.39) / 2) + 22px); } #dg-intro .fd-tape.bottom { bottom: calc(max(9vh, (100vh - 100vw / 2.39) / 2) + 22px); transform: rotate(1.5deg); }
#dg-intro .fd-tape span { position: absolute; top: 5px; white-space: nowrap; font: 800 18px 'IBM Plex Sans Thai', sans-serif; letter-spacing: .3em; color: #141414; background: #f2c21a; padding: 0 14px; animation: fd-scroll 6s linear infinite; }
#dg-intro .fd-tape span::before { content: 'WARNING · อันตราย · WARNING · อันตราย · WARNING · อันตราย · WARNING · อันตราย · '; }
#dg-intro .fd-tape.bottom span { animation-direction: reverse; }
#dg-intro.fd-warn .fd-tape { opacity: .9; }
#dg-intro.named .fd-tape { opacity: 0; }
@keyframes fd-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
#dg-intro .fd-shutter { position: absolute; left: 0; right: 0; height: 51%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, #8a8a90 0 3px, transparent 4px) 22px 22px / 64px 64px, repeating-linear-gradient(180deg, #3a3a40 0 10px, #2a2a30 10px 46px), #2e2e34;
  box-shadow: 0 0 0 3px #111, 0 0 50px rgba(0, 0, 0, .8); transition: transform 1s cubic-bezier(.7, 0, .3, 1); }
#dg-intro .fd-shutter.t { top: 0; transform: translateY(-104%); border-bottom: 10px solid #f2c21a; }
#dg-intro .fd-shutter.b { bottom: 0; transform: translateY(104%); border-top: 10px solid #f2c21a; }
#dg-intro.fd-shut .fd-shutter { transform: none; transition-delay: .9s; }
#dg-intro.fd-open .fd-shutter { transition: transform .32s cubic-bezier(.5, 0, .2, 1); transition-delay: 0s; }
#dg-intro.fd-open .fd-shutter.t { transform: translateY(-104%); box-shadow: 0 30px 80px rgba(255, 110, 30, .9); }
#dg-intro.fd-open .fd-shutter.b { transform: translateY(104%); box-shadow: 0 -30px 80px rgba(255, 110, 30, .9); }
#dg-intro .dgi-title.stamp b { display: inline-block; padding: 6px 40px 12px; border: 4px solid #6a5a48; border-radius: 4px; letter-spacing: .1em;
  background-color: #1c1612; box-shadow: inset 0 0 0 3px #2c241c, inset 0 0 30px rgba(0, 0, 0, .9), 0 0 40px rgba(255, 120, 40, .45);
  background-image: linear-gradient(180deg, #fff2c0 0%, #ffb347 45%, #c9561e 100%); -webkit-background-clip: text; background-clip: text;
  animation: fd-stamp .7s .1s cubic-bezier(.5, 0, .7, 1.3) both; }
@keyframes fd-stamp { 0% { opacity: 0; transform: scale(3.2) rotate(-4deg); filter: blur(8px); } 80% { opacity: 1; transform: scale(.94); filter: blur(0); } 100% { opacity: 1; transform: none; } }
#dg-intro.t-foundry .dgi-title.stamp { animation: dgi-fade .1s forwards, fd-thud .5s .7s; }
@keyframes fd-thud { 0%, 100% { transform: translateY(-50%); } 30% { transform: translateY(calc(-50% + 10px)); } 60% { transform: translateY(calc(-50% - 4px)); } }

/* Dream: the frame split into two mirrored dreams, the boss twice walking in, glass breaking, a reflection. */
#dg-intro .dr-mirror { position: absolute; inset: -8%; pointer-events: none; opacity: 0; transition: opacity 2s;
  background: var(--bn) center 40% / cover no-repeat; transform: scaleX(-1); clip-path: inset(0 50% 0 0);
  filter: invert(.88) hue-rotate(160deg) saturate(1.4) brightness(.55) contrast(1.2); }
#dg-intro .dr-seam { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; opacity: 0; pointer-events: none;
  background: linear-gradient(transparent, #fff 20%, #fff 80%, transparent); box-shadow: 0 0 20px 4px var(--dgc), 0 0 60px 10px color-mix(in srgb, var(--dgc) 50%, transparent); transition: opacity 1.4s; }
#dg-intro.dr-split .dr-mirror, #dg-intro.dr-split .dr-seam { opacity: 1; }
#dg-intro.reveal .dr-mirror, #dg-intro.reveal .dr-seam { opacity: 0; transition-duration: .3s; }
#dg-intro .dr-twin { position: absolute; bottom: calc((100vh - min(82vh, 100vw / 2.39)) / 2 - min(82vh, 100vw / 2.39) * 0.1); width: calc(min(82vh, 100vw / 2.39) * .9); aspect-ratio: 1;
  opacity: 0; pointer-events: none; transition: left 2.2s cubic-bezier(.3, 0, .3, 1), opacity 1.2s; }
#dg-intro .dr-twin canvas { width: 100%; height: 100%; filter: brightness(0) drop-shadow(0 0 3px var(--dgc)) drop-shadow(0 0 18px var(--dgc)); }
#dg-intro .dr-twin.l { left: 2%; } #dg-intro .dr-twin.r { left: calc(98% - min(82vh, 100vw / 2.39) * .9); transform: scaleX(-1); }
#dg-intro .dr-twin.r canvas { filter: brightness(0) invert(1) drop-shadow(0 0 3px #fff) drop-shadow(0 0 18px var(--dgc)); opacity: .8; }
#dg-intro.dr-twins .dr-twin { opacity: 1; }
#dg-intro.dr-twins .dr-twin.l { left: calc(32% - min(82vh, 100vw / 2.39) * .45); } #dg-intro.dr-twins .dr-twin.r { left: calc(68% - min(82vh, 100vw / 2.39) * .45); }
#dg-intro.dr-merge .dr-twin { left: calc(50% - min(82vh, 100vw / 2.39) * .45) !important; opacity: 0; transition-duration: .25s; }
#dg-intro.t-dream.tease:not(.reveal) .dgi-boss { opacity: 0; }
#dg-intro.t-dream.reveal .dgi-boss::after { content: ''; }
#dg-intro .dgi-title.mirror b::after { content: attr(data-t); position: absolute; left: 0; right: 0; top: 92%; transform: scaleY(-1); opacity: .35;
  background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; filter: blur(1.5px);
  -webkit-mask: linear-gradient(to top, #000, transparent 70%); mask: linear-gradient(to top, #000, transparent 70%); }
#dg-intro .dgi-title.mirror b { animation: dr-name 2.4s .4s cubic-bezier(.2, .8, .25, 1) both, dgi-sheen 3.2s 1.4s forwards; }
@keyframes dr-name { 0% { opacity: 0; letter-spacing: .5em; transform: scaleX(-1); filter: blur(12px); } 50% { transform: scaleX(1); } 100% { opacity: 1; letter-spacing: .06em; transform: none; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .9)) drop-shadow(0 0 22px rgba(200, 160, 255, .5)); } }
#dg-intro .cz-curtain, #dg-intro .fd-shutter { z-index: 3; }
#dg-intro .dgi-boss { z-index: 2; }
#dg-intro .dgi-title.marquee b, #dg-intro .dgi-title.stamp b { border: 0; box-shadow: none; background-color: transparent; }
#dg-intro .dgi-title.marquee b::before, #dg-intro .dgi-title.stamp b::before { content: ''; position: absolute; inset: 0; z-index: -1; }
#dg-intro .dgi-title.marquee b::before { border: 3px solid #e8c46a; border-radius: 10px; background: rgba(40, 6, 14, .88); box-shadow: 0 0 0 4px #4a0612, 0 0 30px rgba(255, 80, 120, .5), inset 0 0 0 2px #4a0612; }
#dg-intro .dgi-title.stamp b::before { border: 4px solid #6a5a48; border-radius: 4px; background: #1c1612; box-shadow: inset 0 0 0 3px #2c241c, inset 0 0 30px rgba(0, 0, 0, .9), 0 0 40px rgba(255, 120, 40, .45); }#dg-intro.t-library.tease:not(.reveal) .dgi-bg { filter: saturate(.5) brightness(.42) contrast(1.2); }#dg-intro .cz-spot { opacity: .9; filter: blur(2px);
  background: conic-gradient(from 168deg at 50% 0, transparent 0deg, rgba(255, 244, 220, .12) 7deg, rgba(255, 246, 225, .62) 10deg, rgba(255, 246, 225, .62) 14deg, rgba(255, 244, 220, .12) 17deg, transparent 24deg); }
#dg-intro.t-circus .dgi-bg { filter: saturate(.7) brightness(.36) contrast(1.2); }#dg-intro .dgi-bar { z-index: 6; } #dg-intro .dgi-sub, #dg-intro .dgi-title { z-index: 7; } #dg-intro .dgi-skip { z-index: 8; }
#dg-intro .cz-curtain.l { background: radial-gradient(60% 55% at 100% 55%, rgba(255, 220, 190, .32), transparent 70%), linear-gradient(180deg, rgba(0, 0, 0, .3), transparent 20%, transparent 80%, rgba(0, 0, 0, .55)),
    repeating-linear-gradient(90deg, #4a0612 0, #8e0e26 3vw, #c4213f 4.6vw, #8e0e26 6.2vw, #4a0612 9vw); }
#dg-intro .cz-curtain.r { background: radial-gradient(60% 55% at 0% 55%, rgba(255, 220, 190, .32), transparent 70%), linear-gradient(180deg, rgba(0, 0, 0, .3), transparent 20%, transparent 80%, rgba(0, 0, 0, .55)),
    repeating-linear-gradient(90deg, #4a0612 0, #8e0e26 3vw, #c4213f 4.6vw, #8e0e26 6.2vw, #4a0612 9vw); }
/* ---------- The dungeon window's tabs and coin shop (ui renderDgShop, 2026-11-14) ---------- */
#win-dungeon .dg-tabs { display: inline-flex; gap: 4px; margin-left: 18px; vertical-align: middle; }
#win-dungeon .dg-tabs button { padding: 4px 14px; font: 600 13px 'IBM Plex Sans Thai', sans-serif; color: #b8ab8e; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
#win-dungeon .dg-tabs button.on { color: #f6dc8e; border-bottom-color: #e8c46a; }
#win-dungeon .dg-tabs button:hover { color: #fff1c0; }
#win-dungeon .ds-body .dg-coin { order: -1; margin-left: 0; }
#win-dungeon .ds-body .dg-note { color: #a89d86; font-size: 12px; }
#win-dungeon .ds-group { margin-top: 10px; }
#win-dungeon .ds-group h4 { margin: 0 0 6px; font: 600 13px 'Noto Serif Thai', serif; letter-spacing: .2em; color: #d9c58e; display: flex; align-items: center; gap: 10px; }
#win-dungeon .ds-group h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(232, 196, 106, .4), transparent); }
#win-dungeon .ds-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#win-dungeon .ds-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 7px; text-align: center;
  background: linear-gradient(180deg, rgba(40, 32, 52, .75), rgba(14, 12, 20, .85)); border: 1px solid rgba(232, 196, 106, .28); border-radius: 3px; transition: border-color .15s, transform .15s; }
#win-dungeon .ds-card:hover { border-color: rgba(246, 220, 142, .7); transform: translateY(-1px); }
#win-dungeon .ds-card.wings { background: radial-gradient(80% 60% at 50% 30%, rgba(150, 110, 220, .28), transparent 70%), linear-gradient(180deg, rgba(40, 32, 52, .8), rgba(14, 12, 20, .9)); border-color: rgba(190, 150, 255, .45); }
#win-dungeon .ds-card.off { opacity: .62; }
#win-dungeon .ds-pic { position: relative; width: 52px; height: 52px; }
#win-dungeon .ds-pic canvas { width: 52px; height: 52px; }
#win-dungeon .ds-pic em { position: absolute; right: -4px; bottom: -2px; font: 700 11px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
#win-dungeon .ds-card b { font: 600 12px/1.3 'IBM Plex Sans Thai', sans-serif; color: #efe6d2; min-height: 2.6em; display: flex; align-items: center; }
#win-dungeon .ds-price { display: inline-flex; align-items: center; gap: 4px; font: 700 14px 'IBM Plex Sans Thai', sans-serif; color: #f6dc8e; }
#win-dungeon .ds-price canvas { width: 18px; height: 18px; }
#win-dungeon .ds-left { font-size: 11px; color: #a89d86; }
#win-dungeon .ds-qty { display: inline-flex; align-items: center; gap: 2px; }
#win-dungeon .ds-qty button { width: 20px; height: 20px; padding: 0; font: 600 13px/1 sans-serif; color: #e8dcc0; background: rgba(255, 255, 255, .06); border: 1px solid rgba(232, 196, 106, .3); border-radius: 2px; cursor: pointer; }
#win-dungeon .ds-qty button:disabled { opacity: .35; cursor: default; }
#win-dungeon .ds-qty i { min-width: 22px; font-style: normal; font-size: 12px; color: #fff; }
#win-dungeon .ds-buy { width: 100%; margin-top: 2px; padding: 4px 0; font: 600 12px 'IBM Plex Sans Thai', sans-serif; color: #1a1408; cursor: pointer;
  background: linear-gradient(180deg, #f6dc8e, #c8963c); border: 1px solid #f6dc8e; border-radius: 2px; }
#win-dungeon .ds-buy:hover:not(:disabled) { filter: brightness(1.1); }
#win-dungeon .ds-buy:disabled { color: #a89d86; background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); cursor: default; }
@media (max-width: 640px) { #win-dungeon .ds-row { grid-template-columns: repeat(3, 1fr); } }#win-dungeon .ds-card { display: grid; grid-template-columns: 44px 1fr; grid-template-areas: 'pic name' 'pic price' 'qty buy'; column-gap: 8px; row-gap: 2px;
  align-items: center; justify-items: start; text-align: left; padding: 7px 8px; }
#win-dungeon .ds-pic { grid-area: pic; width: 44px; height: 44px; }
#win-dungeon .ds-pic canvas { width: 44px; height: 44px; }
#win-dungeon .ds-card b { grid-area: name; min-height: 0; font-size: 12px; line-height: 1.25; }
#win-dungeon .ds-price { grid-area: price; font-size: 13px; }
#win-dungeon .ds-price canvas { width: 16px; height: 16px; }
#win-dungeon .ds-left { grid-column: 1 / -1; grid-row: 3; justify-self: start; display: none; }
#win-dungeon .ds-qty { grid-area: qty; }
#win-dungeon .ds-buy { grid-area: buy; width: 100%; margin: 0; padding: 3px 0; }
#win-dungeon .ds-card:not(:has(.ds-qty)) .ds-buy { grid-column: 1 / -1; }
#win-dungeon .ds-price small { margin-left: 6px; font: 400 11px 'IBM Plex Sans Thai', sans-serif; color: #a89d86; }
#win-dungeon .ds-group { margin-top: 8px; }
#win-dungeon .ds-row { gap: 6px; }#win-dungeon .ds-card { grid-template-columns: 66px 1fr; }
#win-dungeon .ds-pic { justify-self: center; }#win-dungeon .ds-price { flex-wrap: wrap; row-gap: 0; }
#win-dungeon .ds-price small { flex-basis: 100%; margin-left: 0; white-space: nowrap; line-height: 1.2; }#win-dungeon .ds-body .dg-coin { order: 0; margin-left: auto; }
/* The big way into the dungeon shop (top right of the dungeon page) and back out of it. */
#win-dungeon .dg-shopbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; cursor: pointer;
  background: linear-gradient(180deg, rgba(90, 50, 30, .55), rgba(30, 18, 14, .8)); border: 1px solid #c8963c; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 16px rgba(232, 180, 80, .25), inset 0 1px 0 rgba(255, 230, 160, .25); transition: transform .15s, box-shadow .15s; }
#win-dungeon .dg-shopbtn:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 26px rgba(255, 200, 100, .5), inset 0 1px 0 rgba(255, 230, 160, .35); }
#win-dungeon .dg-shopbtn .ds-ico { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); animation: ds-bob 2.4s ease-in-out infinite; }
#win-dungeon .dg-shopbtn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
#win-dungeon .dg-shopbtn b { font: 700 15px 'Noto Serif Thai', serif; letter-spacing: .03em;
  background: linear-gradient(180deg, #fff2c0, #e8b44a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#win-dungeon .dg-shopbtn small { display: inline-flex; align-items: center; gap: 4px; font: 600 12px 'IBM Plex Sans Thai', sans-serif; color: #f6dc8e; }
#win-dungeon .dg-shopbtn small canvas { width: 16px; height: 16px; padding: 0; background: none; }
#win-dungeon .dg-shopbtn > i { font: 400 22px/1 serif; font-style: normal; color: #e8c46a; margin-left: 2px; }
@keyframes ds-bob { 50% { transform: translateY(-2px) rotate(-3deg); } }
#win-dungeon .ds-title { display: inline-flex; align-items: center; gap: 8px; }
#win-dungeon .ds-title .ds-ico { width: 30px; height: 30px; }
#win-dungeon .dg-back { padding: 5px 12px; font: 600 13px 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(232, 196, 106, .4); border-radius: 3px; }
#win-dungeon .dg-back:hover { color: #fff; border-color: #e8c46a; }
/* A gear piece out of a box glows by its grade (ui GRADE_AURA, user 2026-11-14): PRIME grey, NOVA blue, APEX orange,
   OMEGA red — the higher, the brighter and livelier the frame's aura. */
#chest-open .co-card.g-prime, #chest-open .co-got.g-prime { box-shadow: 0 0 10px color-mix(in srgb, var(--cc) 70%, transparent), inset 0 0 12px color-mix(in srgb, var(--cc) 40%, transparent); }
#chest-open .co-card.g-nova, #chest-open .co-got.g-nova { box-shadow: 0 0 18px var(--cc), inset 0 0 16px color-mix(in srgb, var(--cc) 50%, transparent); }
#chest-open .co-card.g-apex, #chest-open .co-got.g-apex { box-shadow: 0 0 26px var(--cc), 0 0 48px color-mix(in srgb, var(--cc) 55%, transparent), inset 0 0 20px color-mix(in srgb, var(--cc) 60%, transparent); animation: co-aura 1.4s ease-in-out infinite; }
#chest-open .co-card.g-omega, #chest-open .co-got.g-omega { box-shadow: 0 0 32px var(--cc), 0 0 70px color-mix(in srgb, var(--cc) 70%, transparent), inset 0 0 26px color-mix(in srgb, var(--cc) 70%, transparent); animation: co-aura 0.8s ease-in-out infinite; }
#chest-open .co-card.g-omega::before { animation-duration: 1.2s !important; }
@keyframes co-aura { 50% { filter: brightness(1.25) saturate(1.2); } }
#chest-open.co-open.g-prime .co-glow, #chest-open.co-open.g-nova .co-glow, #chest-open.co-open.g-apex .co-glow, #chest-open.co-open.g-omega .co-glow { background: radial-gradient(circle, color-mix(in srgb, var(--tc) 75%, transparent), transparent 65%); }
#chest-open.co-open.g-omega .co-stage { animation: co-omega 0.9s ease-in-out infinite; }
@keyframes co-omega { 50% { filter: drop-shadow(0 0 30px #ff3434); } }
/* A dungeon's own gear (ui drawIcon): a soft breathing glow of the dungeon's colour round the icon wherever it shows. */
canvas.dg-gear { filter: drop-shadow(0 0 3px var(--dgc)) drop-shadow(0 0 1px var(--dgc)); animation: dg-gear-breathe 2.4s ease-in-out infinite; }
@keyframes dg-gear-breathe { 50% { filter: drop-shadow(0 0 6px var(--dgc)) drop-shadow(0 0 2px var(--dgc)); } }.dg-tip { margin: 4px 0 2px; padding: 3px 8px; font-weight: 600; font-size: 12px; color: #fff; border-left: 3px solid var(--dgc); background: linear-gradient(90deg, color-mix(in srgb, var(--dgc) 35%, transparent), transparent); }
.dg-tip small { display: block; font-weight: 400; opacity: .8; }
/* The magnifier on a dungeon's box, and what the box can hold (ui dgBoxView). */
#win-dungeon .dg-peek { position: absolute; top: 18px; right: 8px; z-index: 4; width: 28px; height: 28px; padding: 5px; cursor: pointer; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a2c52, #120e18); border: 1.5px solid #e8c46a; box-shadow: 0 0 10px rgba(232, 196, 106, .5), 0 2px 4px #000; transition: transform .15s, box-shadow .15s; }
#win-dungeon .dg-peek svg { width: 100%; height: 100%; fill: none; stroke: #ffe8b0; stroke-width: 2.6; stroke-linecap: round; }
#win-dungeon .dg-peek:hover { transform: scale(1.12); box-shadow: 0 0 16px rgba(255, 220, 140, .9), 0 2px 4px #000; }
#win-dungeon .dg-boxview { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(6, 4, 10, .72); backdrop-filter: blur(2px); }
#win-dungeon .dbv-card { width: min(640px, 94%); max-height: 92%; overflow: hidden; padding: 14px 16px 16px; background: linear-gradient(180deg, #1d1726, #100c16); border: 1px solid rgba(232, 196, 106, .55);
  border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 230, 160, .15); }
#win-dungeon .dbv-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(232, 196, 106, .3); }
#win-dungeon .dbv-head canvas { width: 44px; height: 44px; }
#win-dungeon .dbv-head small { display: block; font-size: 11px; color: #a89d86; letter-spacing: .1em; }
#win-dungeon .dbv-head b { font: 700 17px 'Noto Serif Thai', serif; color: #f6dc8e; }
#win-dungeon .dbv-x { margin-left: auto; background: none; border: 0; color: #c9bfa6; font-size: 16px; cursor: pointer; }
#win-dungeon .dbv-card h4 { margin: 10px 0 6px; font: 600 13px 'Noto Serif Thai', serif; color: #e8dcc0; }
#win-dungeon .dbv-card h4 small { font: 400 11px 'IBM Plex Sans Thai', sans-serif; color: #a89d86; margin-left: 6px; }
#win-dungeon .dbv-grade { margin-bottom: 5px; padding: 4px 6px; border-left: 3px solid var(--cc); background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 16%, transparent), transparent 70%); }
#win-dungeon .dbv-gh { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
#win-dungeon .dbv-gh b { color: var(--cc); letter-spacing: .12em; text-shadow: 0 0 8px color-mix(in srgb, var(--cc) 60%, transparent); }
#win-dungeon .dbv-gh span { color: #c9bfa6; }
#win-dungeon .dbv-gh em { margin-left: auto; font-style: normal; font-weight: 700; color: #fff; }
#win-dungeon .dbv-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 3px; }
#win-dungeon .dbv-ic { position: relative; display: block; aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cc, #e8c46a) 35%, transparent); }
#win-dungeon .dbv-ic canvas { width: 100%; height: 100%; filter: none; animation: none; }
#win-dungeon .dbv-ic em { position: absolute; right: 1px; bottom: 0; font: 700 10px sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
#win-dungeon .dbv-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
#win-dungeon .dbv-line { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; font-size: 13px; color: #e8dcc0; }
#win-dungeon .dbv-line em { font-style: normal; font-weight: 700; color: #f6dc8e; }
#win-dungeon .dbv-row { grid-template-columns: repeat(12, minmax(0, 1fr)); }
#win-dungeon .dbv-grade { min-width: 0; }

/* The box view's four sets, each a figure wearing its grade (ui dgBoxView), a click opens its twelve pieces. */
#win-dungeon .dbv-sets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#win-dungeon .dbv-set { position: relative; display: grid; justify-items: center; gap: 1px; padding: 8px 6px 7px; cursor: pointer; color: #e8dcc0; text-align: center;
  background: radial-gradient(90% 70% at 50% 35%, color-mix(in srgb, var(--cc) 26%, transparent), transparent 70%), linear-gradient(180deg, #1a1522, #0f0b14);
  border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent); border-top: 3px solid var(--cc); border-radius: 3px; transition: transform .15s, box-shadow .15s; }
#win-dungeon .dbv-set:hover { transform: translateY(-2px); box-shadow: 0 0 14px color-mix(in srgb, var(--cc) 55%, transparent); }
#win-dungeon .dbv-set.on { box-shadow: 0 0 18px var(--cc), inset 0 0 18px color-mix(in srgb, var(--cc) 30%, transparent); }
#win-dungeon .dbv-set.g-omega { animation: co-aura 1.2s ease-in-out infinite; }
#win-dungeon .dbv-set b { font: 700 12px 'IBM Plex Sans Thai', sans-serif; letter-spacing: .18em; color: var(--cc); text-shadow: 0 0 8px color-mix(in srgb, var(--cc) 60%, transparent); }
#win-dungeon .dbv-set span { font-size: 11.5px; color: #c9bfa6; line-height: 1.3; }
#win-dungeon .dbv-set em { font: 700 15px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #fff; }
#win-dungeon .dbv-doll { position: relative; width: 116px; height: 112px; margin-bottom: 2px; }
#win-dungeon .dbv-doll canvas { position: absolute; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
#win-dungeon .dbv-doll .dd-cape { width: 74px; height: 74px; left: 21px; top: 22px; opacity: .85; z-index: 0; }
#win-dungeon .dbv-doll .dd-armor { width: 60px; height: 60px; left: 28px; top: 28px; z-index: 2; }
#win-dungeon .dbv-doll .dd-head { width: 42px; height: 42px; left: 37px; top: 0; z-index: 3; }
#win-dungeon .dbv-doll .dd-weapon { width: 54px; height: 54px; left: -6px; top: 16px; z-index: 4; transform: rotate(-12deg); }
#win-dungeon .dbv-doll .dd-gloves { width: 34px; height: 34px; left: 4px; top: 70px; z-index: 3; }
#win-dungeon .dbv-doll .dd-acc { width: 34px; height: 34px; right: 0; top: 34px; z-index: 3; }
#win-dungeon .dbv-doll .dd-boots { width: 38px; height: 38px; left: 39px; top: 76px; z-index: 3; }
#win-dungeon .dbv-pieces { margin-top: 8px; padding: 6px 8px; border-left: 3px solid var(--cc); background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 14%, transparent), transparent 70%); }
#win-dungeon .dbv-ph { font-size: 12px; color: #c9bfa6; margin-bottom: 4px; }
#win-dungeon .dbv-ph b { color: var(--cc); letter-spacing: .12em; }
/* The box's super rare (a dungeon's wings): a deep gold aura that breathes, and its tag. */
#win-dungeon .dbv-line.super { padding: 3px 6px; margin: -3px -6px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 200, 70, .22), rgba(255, 200, 70, .04)); box-shadow: inset 0 0 0 1px rgba(255, 210, 110, .55); }
#win-dungeon .dbv-line.super .dbv-ic { box-shadow: 0 0 10px #ffc23a, 0 0 22px rgba(255, 190, 60, .75), inset 0 0 10px rgba(255, 210, 110, .6);
  background: radial-gradient(circle, rgba(255, 214, 120, .45), rgba(60, 40, 10, .6)); animation: dbv-gold 1.6s ease-in-out infinite; }
#win-dungeon .dbv-line.super b { color: #ffe08a; text-shadow: 0 0 8px rgba(255, 200, 80, .6); }
#win-dungeon .dbv-line.super em { color: #ffd34a; }
#win-dungeon .dbv-sr { display: inline-block; margin-left: 6px; padding: 0 5px; vertical-align: 1px; font: 800 9px/15px 'IBM Plex Sans Thai', sans-serif; font-style: normal; letter-spacing: .12em;
  color: #2a1a00; background: linear-gradient(180deg, #fff3b0, #ffc23a 55%, #c98a10); border-radius: 2px; box-shadow: 0 0 8px rgba(255, 200, 60, .8); text-shadow: none; }
@keyframes dbv-gold { 50% { box-shadow: 0 0 16px #ffd35a, 0 0 34px rgba(255, 200, 70, .95), inset 0 0 12px rgba(255, 220, 130, .8); } }
/* A dungeon boss's dear junk out of its box (×1 · ×2 · ×3): gold, deeper and livelier the more. */
#chest-open .co-card .co-n { position: absolute; right: 4px; bottom: 2px; font: 800 14px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #fff; text-shadow: 0 0 6px var(--cc), 0 1px 2px #000; }
#chest-open .co-card.t-rare { box-shadow: 0 0 16px var(--cc), inset 0 0 14px color-mix(in srgb, var(--cc) 50%, transparent); }
#chest-open.jk-2 .co-stage { animation: co-omega 1.2s ease-in-out infinite; }
#chest-open.jk-3 .co-stage { animation: co-omega 0.7s ease-in-out infinite; }
#chest-open.jk-3 .co-rays { animation-duration: .6s, 6s; }
/* Boss junk: one row, the piece once, then ×1 · ×2 · ×3 as pills. */
#win-dungeon .dbv-junk { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 8px;
  border-radius: 3px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px rgba(232, 196, 106, .22); }
#win-dungeon .dbv-junk > .dbv-ic { box-shadow: 0 0 6px color-mix(in srgb, var(--cc) 60%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--cc) 50%, transparent); }
#win-dungeon .dbv-jn { display: grid; line-height: 1.25 !important; min-width: 0; }
#win-dungeon .dbv-jn b { font-size: 13px; color: #e8dcc0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-dungeon .dbv-jn small { font-size: 11px; color: #a89d86; }
#win-dungeon .dbv-jx { display: flex; gap: 6px; }
#win-dungeon .dbv-jp { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border-radius: 2px;
  background: color-mix(in srgb, var(--cc) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cc) 50%, transparent); }
#win-dungeon .dbv-jp b { font: 800 13px 'IBM Plex Sans Thai', sans-serif; color: var(--cc); }
#win-dungeon .dbv-jp em { font-style: normal; font-weight: 700; font-size: 12px; color: #f3ead2; }
/* The super rare wings: their own banner, a big icon on turning rays, gold that breathes. */
#win-dungeon .dbv-super { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  margin-top: 12px; padding: 8px 14px 8px 10px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(100deg, rgba(255, 196, 60, .30), rgba(120, 70, 10, .25) 45%, rgba(30, 20, 8, .2));
  box-shadow: inset 0 0 0 1px rgba(255, 214, 120, .8), 0 0 18px rgba(255, 190, 60, .35); animation: dbv-banner 2.4s ease-in-out infinite; }
#win-dungeon .dbv-super::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 245, 200, .28) 50%, transparent 65%); background-size: 250% 100%; animation: dbv-sheen 3.2s linear infinite; }
#win-dungeon .dbv-sart { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
#win-dungeon .dbv-sart canvas { position: relative; width: 64px; height: 64px; filter: drop-shadow(0 0 6px #ffd35a) drop-shadow(0 0 14px rgba(255, 190, 60, .8)); animation: dbv-float 2.4s ease-in-out infinite; }
#win-dungeon .dbv-rays { position: absolute; inset: -18px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 220, 120, .55) 0 8deg, transparent 8deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%); animation: dbv-spin 9s linear infinite; }
#win-dungeon .dbv-stxt { display: grid; gap: 2px; line-height: 1.3 !important; min-width: 0; justify-items: start; }
#win-dungeon .dbv-stxt .dbv-sr { margin: 0; }
#win-dungeon .dbv-stxt b { font: 700 17px 'Noto Serif Thai', serif; color: #ffe08a; text-shadow: 0 0 10px rgba(255, 200, 80, .7); }
#win-dungeon .dbv-stxt small { font-size: 11px; color: #e6d3a4; }
#win-dungeon .dbv-super > em { position: relative; display: grid; justify-items: end; font: 800 22px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #ffd34a;
  text-shadow: 0 0 10px rgba(255, 200, 60, .8); line-height: 1.1 !important; }
#win-dungeon .dbv-super > em small { font: 400 11px 'IBM Plex Sans Thai', sans-serif; color: #e6d3a4; text-shadow: none; }
@keyframes dbv-banner { 50% { box-shadow: inset 0 0 0 1px #ffe39a, 0 0 28px rgba(255, 200, 70, .6); } }
@keyframes dbv-sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes dbv-spin { to { transform: rotate(360deg); } }
@keyframes dbv-float { 50% { transform: translateY(-3px); } }
/* ---------- The world boss (RULES.worldBoss): the crater panel under the minimap, the meteor icon ---------- */
.mt-ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
#win-dungeon .ds-title .mt-ico { width: 26px; height: 26px; margin-right: 6px; }
#win-dungeon .mt-body .dg-coin .mt-ico { width: 22px; height: 22px; }
#win-dungeon .mt-live { color: #7fe0ff; }
#hud #wbhud { position: absolute; top: 236px; right: 12px; width: 268px; padding: 10px 12px; display: grid; gap: 7px;
  background: linear-gradient(180deg, rgba(14, 18, 44, .86), rgba(8, 10, 24, .82)); border: 1px solid rgba(106, 216, 255, .45); border-radius: 2px;
  box-shadow: 0 0 18px rgba(60, 140, 255, .18); color: #e4ecff; font: 12.5px/1.35 'IBM Plex Sans Thai', sans-serif; pointer-events: none; }
#wbhud .wb-head { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; }
#wbhud .wb-head b { font: 600 13.5px 'Noto Serif Thai', serif; color: #bfeaff; }
#wbhud .wb-head span { grid-column: 1; color: #9fb0d8; font-size: 12px; }
#wbhud .wb-head em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 700 18px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #fff; font-variant-numeric: tabular-nums; }
#wbhud .wb-bar { position: relative; height: 6px; background: rgba(255, 255, 255, .08); border-radius: 1px; overflow: hidden; }
#wbhud .wb-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3a5ad8, #6ad8ff); transition: width .4s; }
#wbhud .wb-bar.big { height: 20px; }
#wbhud .wb-bar.big span { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 8px; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
#wbhud .wb-bar.big b { margin-left: 4px; }
#wbhud .wb-row { display: flex; justify-content: space-between; gap: 8px; color: #b8c4e4; }
#wbhud .wb-row b { color: #fff; font-weight: 600; }
#wbhud .wb-me { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: 12px; color: #b8c4e4; }
#wbhud .wb-me .wb-bar { grid-column: 1 / -1; grid-row: 2; }
#wbhud .wb-me em { font-style: normal; font-variant-numeric: tabular-nums; }
#wbhud .wb-me.ok { color: #8ff0b0; }
#wbhud .wb-me.ok .wb-bar i { background: linear-gradient(90deg, #2f9a5a, #8ff0b0); }
#wbhud .wb-mech { display: grid; gap: 4px; padding: 6px 8px; border-left: 2px solid #6ad8ff; background: rgba(106, 216, 255, .1); animation: wb-pulse 1s ease-in-out infinite; }
#wbhud .wb-mech b { color: #fff; font-size: 13px; }
#wbhud .wb-mech span { color: #cfe0ff; font-size: 12px; }
#wbhud .wb-mech.doom { border-color: #a07aff; background: rgba(122, 106, 255, .18); }
#wbhud .wb-mech.shell { border-color: #f4f8ff; }
#wbhud .wb-spots { display: flex; gap: 5px; }
#wbhud .wb-spots i { flex: 1; text-align: center; font-style: normal; font-size: 11.5px; padding: 1px 0; background: rgba(255, 90, 90, .22); color: #ffd0d0; }
#wbhud .wb-spots i.ok { background: rgba(120, 240, 170, .25); color: #c8ffd8; }
@keyframes wb-pulse { 50% { background-color: rgba(106, 216, 255, .2); } }
@media (max-width: 900px) { #hud #wbhud { top: auto; bottom: 150px; width: 230px; } }/* Guild hall system (2026-11-15): ten tabs fit one row; the quests, buildings and the weekly ladder. */
#win-guild { width: min(940px, 97vw); }
#win-guild .mk-seg { flex-wrap: wrap; gap: 4px !important; }
#win-guild .mk-seg button { padding: 6px 11px 7px !important; font-size: 12.5px; }
#win-guild .gd-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 3px; border-radius: 8px; background: #b3261e; color: #fff !important; font: 700 10px/1 Kanit, sans-serif; font-style: normal; }
#win-guild .gd-levels.ten { grid-template-columns: 1fr 1fr; gap: 2px 8px; }
#win-guild .gd-levels.ten div { grid-template-columns: 40px 44px minmax(0, 1fr) 70px; padding: 3px 8px; gap: 4px; font-size: 11.5px; }
#win-guild .gd-quest { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(169, 133, 60, 0.32); border-radius: 6px; background: rgba(255, 252, 244, 0.72); }
#win-guild .gd-quest .gd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#win-guild .gd-quest.done { opacity: .7; }
#win-guild .gd-qbar { position: relative; height: 14px; border-radius: 7px; background: rgba(31, 43, 69, 0.1); overflow: hidden; }
#win-guild .gd-qbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a9853c, #d8b45e); border-radius: 7px; }
#win-guild .gd-quest.done .gd-qbar i { background: linear-gradient(90deg, #3f8a4a, #6cbf74); }
#win-guild .gd-qbar span { position: relative; display: block; text-align: center; font: 600 10.5px/14px Kanit, sans-serif; color: var(--ink, #1f2b45); font-variant-numeric: tabular-nums; }
#win-guild .gd-qrw { flex: none; display: flex; flex-direction: column; align-items: flex-end; width: 130px; text-align: right; }
#win-guild .gd-qrw small { font-size: 11px; }
#win-guild .bd-done { color: #2e7d3a; font: 600 12px Kanit, sans-serif; }
#win-guild .gd-blds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#win-guild .gd-bld { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 8px; align-items: center; padding: 6px 8px; border: 1px solid rgba(169, 133, 60, 0.32); border-radius: 6px; background: rgba(255, 252, 244, 0.72); }
#win-guild .gd-bld canvas { grid-row: span 2; width: 64px; height: 64px; border-radius: 6px; background: radial-gradient(closest-side, rgba(31, 43, 69, 0.12), transparent); }
#win-guild .gd-bld .gd-main { display: flex; flex-direction: column; min-width: 0; }
#win-guild .gd-bld .gd-main b { font-size: 13px; }
#win-guild .gd-bld .gd-main small { font-size: 10.5px; line-height: 1.35; }
#win-guild .gd-bld .gd-main small.ok { color: #2e7d3a; }
#win-guild .gd-bld .bd-btn { justify-self: end; }
#win-guild .gd-bld.g3 { border-color: #c9a24e !important; box-shadow: 0 0 0 1px rgba(201, 162, 78, .35) inset; }
#win-guild .gd-ladder { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
#win-guild .gd-step { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid rgba(169, 133, 60, 0.28); border-radius: 6px; background: rgba(255, 252, 244, 0.6); min-height: 48px; }
#win-guild .gd-step .gd-sn { width: 22px; text-align: center; font: 600 15px 'Noto Serif Thai', serif; color: #8a6418; }
#win-guild .gd-step .gd-mon { width: 40px; height: 40px; flex: none; border-radius: 50%; background: rgba(31, 43, 69, .07); }
#win-guild .gd-step .gd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#win-guild .gd-step .gd-main b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-step .gd-main small { font-size: 10.5px; }
#win-guild .gd-step .gd-price { font-size: 11px; white-space: nowrap; }
#win-guild .gd-step.done { background: rgba(63, 138, 74, .08); border-color: rgba(63, 138, 74, .4); }
#win-guild .gd-step.now { background: #1f2b45; border-color: #c9a24e; }
#win-guild .gd-step.now :is(b, small, em, span, .gd-sn) { color: #f6efe0 !important; }
#win-guild .gd-step.lock { opacity: .45; }
#win-guild .gd-bld .gd-main small { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
#win-guild .gd-card .gd-good { min-height: 38px; padding: 3px 8px; }
#win-guild .gd-card .gd-good .ci-icon, #win-guild .gd-card .gd-good img { width: 28px; height: 28px; }
#win-guild .gd-split.even { grid-template-columns: 1fr 1fr; }
#win-guild .gd-split.even .gd-qrw { width: 112px; }
#win-guild .gd-rise { position: relative; height: 16px; margin-top: 3px; border-radius: 8px; background: rgba(31, 43, 69, 0.12); overflow: hidden; }
#win-guild .gd-rise i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; background: repeating-linear-gradient(135deg, #c9a24e 0 8px, #e2c27a 8px 16px); animation: gd-rise 1.2s linear infinite; background-size: 22px 22px; }
#win-guild .gd-rise span { position: relative; display: block; text-align: center; font: 600 10.5px/16px Kanit, sans-serif; color: var(--ink, #1f2b45); }
@keyframes gd-rise { to { background-position: 22px 0; } }
/* Dungeon clear grade (RULES.dungeon.grades): a big letter, S gold, A silver, B bronze. */
#dg-victory .dgv-grade { display: flex; align-items: center; gap: 10px; }
#dg-victory .dgv-grade b { font: 800 3.4em 'Noto Serif Thai', serif !important; line-height: 1; background: linear-gradient(180deg, #fff6c8, #f2c24e 55%, #a8701a); -webkit-background-clip: text; background-clip: text; color: transparent !important; filter: drop-shadow(0 0 10px rgba(255, 200, 90, .55)); animation: dgv-grade .7s 1s both cubic-bezier(.2, 1.6, .4, 1); }
#dg-victory .dgv-grade.g-A b { background-image: linear-gradient(180deg, #ffffff, #c8d3e2 55%, #6f7f96); filter: drop-shadow(0 0 8px rgba(200, 220, 255, .45)); }
#dg-victory .dgv-grade.g-B b { background-image: linear-gradient(180deg, #ffe0c4, #c98a52 55%, #7a4a22); filter: drop-shadow(0 0 6px rgba(220, 150, 90, .4)); }
@keyframes dgv-grade { from { transform: scale(2.4); opacity: 0; } to { transform: none; opacity: 1; } }
/* The clear grades under the coin medal: letter badge, time, coins in this dungeon (RULES.dungeon.grades). */
#win-dungeon .dg-grades { display: grid; gap: 3px; width: 100%; margin-top: 6px; }
#win-dungeon .dg-gr { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 6px; padding: 2px 6px 2px 3px; border-radius: 3px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(214, 178, 106, .18); font-style: normal; }
#win-dungeon .dg-gr b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 3px; font: 800 11px/1 'Noto Serif Thai', serif; color: #1a1408;
  background: linear-gradient(180deg, #fff3c4, #e8b84a 55%, #a8701a); box-shadow: 0 0 6px rgba(255, 200, 90, .35); }
#win-dungeon .dg-gr.g-A b { background: linear-gradient(180deg, #ffffff, #c8d3e2 55%, #7d8ca2); box-shadow: none; }
#win-dungeon .dg-gr.g-B b { background: linear-gradient(180deg, #ffe0c4, #c98a52 55%, #7a4a22); box-shadow: none; }
#win-dungeon .dg-gr i { font-style: normal; font-size: 10.5px; color: #cdb98a; text-align: left; white-space: nowrap; }
#win-dungeon .dg-gr em { font-style: normal; font: 700 11px/1 Kanit, sans-serif; color: #f3d68a; font-variant-numeric: tabular-nums; }
#win-guild .gd-rename { display: flex; gap: 6px; align-items: center; }
#win-guild .gd-rename input { flex: 1; min-width: 0; padding: 5px 8px; }
/* ===== HUD profile, class 2 (user 2026-11-15, rebuilt after "not pretty": a hero portrait, a gold level badge under it,
   the class on a title ribbon, no boxed panel). Art GPT: assets/ui/c2-face.png (winged portrait frame), c2-level.png
   (badge), c2-ribbon.png (title bar). One colour per class on purpose: class 3 goes further (two colours, particles,
   a moving rim). */
#hud .pf-face { position: relative; flex: none; display: block; line-height: 0; font-size: 0; }
#hud #profile.c2 { --c2: #ffb84a; --c2-hi: #fff3cf; --c2-lo: #b0661a; }
#hud #profile.c2[data-cls="arcane"] { --c2: #a48cff; --c2-hi: #f1ecff; --c2-lo: #6a55db; }
#hud #profile.c2[data-cls="hunter"] { --c2: #5be284; --c2-hi: #e6ffec; --c2-lo: #2a9a4a; }
#hud #profile.c2[data-cls="guardian"] { --c2: #ff6a52; --c2-hi: #ffe4dc; --c2-lo: #c2382b; }
#hud #profile.c2[data-cls="cleric"] { --c2: #86d6ff; --c2-hi: #ffffff; --c2-lo: #3b8cc4; }
#hud #profile.c2[data-cls="assassin"] { --c2: #45e2d2; --c2-hi: #e4fffb; --c2-lo: #1f9c90; }
#hud #profile.c2, .kit #hud #profile.c2 { width: 326px; margin: 32px 0 0 34px; padding: 0; gap: 24px; align-items: flex-start;
  background: none; border: 0; box-shadow: none; backdrop-filter: none; overflow: visible; }
#hud:has(#profile.c2) #buffs { top: 160px; }
/* The portrait fills the frame's window (354×305 in the art at ×0.2147); the winged frame over it; the class aura behind. */
#hud #profile.c2 #portrait { position: relative; left: 0; top: 0; margin: 0; width: 100px; height: 100px; z-index: 1;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; clip-path: inset(11px 10px);
  background: radial-gradient(75% 70% at 50% 40%, color-mix(in srgb, var(--c2) 40%, #2a2530), #110f15 80%) !important; }
#hud #profile.c2 .pf-face { isolation: isolate; }
#hud #profile.c2 .pf-face::before { content: ""; position: absolute; inset: -26px -30px -22px -30px; z-index: 0; pointer-events: none; border-radius: 45%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c2) 85%, transparent), transparent 80%); filter: blur(7px); animation: c2-aura 3s ease-in-out infinite; }
#hud #profile.c2 .pf-face::after { content: ""; position: absolute; left: -27px; top: -20.2px; width: 154.1px; height: 133.2px; z-index: 2; pointer-events: none;
  background: url(assets/ui/c2-face.png) 0 0 / 100% 100% no-repeat; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--c2) 75%, transparent)) drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
@keyframes c2-aura { 0%, 100% { opacity: .5; transform: scale(.93); } 50% { opacity: .95; transform: scale(1.07); } }
/* The level: a winged gold badge hung over the bottom of the portrait frame, the number cast in the class colour. */
#hud #profile.c2 .pf-lv, .kit #hud #profile.c2 .pf-lv { position: absolute; left: 13px; top: 86px; right: auto; width: 74px; height: 38px; z-index: 4; display: grid; place-items: center;
  padding: 3px 0 0; gap: 0; background: url(assets/ui/c2-level.png) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .75)); }
#hud #profile.c2 .pf-lv small { display: none !important; }
#hud #profile.c2 .pf-lv b { font: 800 17px/1 'Noto Serif Thai', Georgia, serif !important; letter-spacing: .01em; translate: 0 2px; color: transparent !important;
  background: linear-gradient(100deg, transparent 0 40%, rgba(255, 255, 255, .9) 50%, transparent 60% 100%) 0 0 / 260% 100% no-repeat,
    linear-gradient(180deg, var(--c2-hi) 0%, var(--c2) 52%, var(--c2-lo) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: .5px rgba(0, 0, 0, .6); text-shadow: none !important; animation: c2-shine 4.5s ease-in-out infinite;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--c2) 70%, transparent)); }
@keyframes c2-shine { 0%, 60% { background-position: 130% 0, 0 0; } 100% { background-position: -30% 0, 0 0; } }
/* Name, title ribbon, bars: no box, a dark wash fading out to the right so it reads over the world. */
/* The name plate: one solid dark plate edged in gold, its left end tucked under the portrait's right wing and its right
   end pointed like the ribbon's tips (user 2026-11-15: the fading wash "looked cut off from the portrait"). */
#hud #profile.c2 .pf-body { flex: 1; min-width: 0; gap: 4px; padding: 6px 24px 7px 36px; margin: 6px 0 0 -30px; position: relative; z-index: 1;
  isolation: isolate; background: none; border-radius: 0; }
#hud #profile.c2 .pf-body::before, #hud #profile.c2 .pf-body::after { content: ""; position: absolute; pointer-events: none; z-index: -1;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); }
#hud #profile.c2 .pf-body::before { inset: 0; background: linear-gradient(90deg, #7a5f26, #f0cd78 28%, #a9832f 62%, #f3d98f 92%, #8a6a28); }
#hud #profile.c2 .pf-body::after { inset: 1.5px 2px 1.5px 0;
  background: radial-gradient(60% 120% at 35% -20%, color-mix(in srgb, var(--c2) 22%, transparent), transparent 70%),
    linear-gradient(180deg, #2a2430 0%, #17131b 55%, #0e0c12 100%); }
#hud #profile.c2 .pf-face { z-index: 2; }
#hud #profile.c2 .pf-name, .kit #hud #profile.c2 .pf-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 0 !important; margin: 0; }
#hud #profile.c2 #pf-emblem { position: static; width: 22px; height: 22px; flex: none; margin: -2px -2px -2px -4px; filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 4px color-mix(in srgb, var(--c2) 60%, transparent)); }
#hud #profile.c2 .pf-body:has(#pf-emblem) .pf-name { margin-left: 0; }
#hud #profile.c2 .pf-name b { font-size: 17px !important; font-weight: 600 !important; color: #fff6e2 !important; text-shadow: 0 1px 2px #000; }
/* The class title on its ribbon: the whole width under the name. */
#hud #profile.c2 .pf-name small { flex-basis: 100%; box-sizing: border-box; height: 19px; display: flex; align-items: center; justify-content: center;
  border-style: solid; border-width: 0 16px; border-image: url(assets/ui/c2-ribbon.png) 0 190 fill / 0 16px stretch;
  font: 600 11px/1 'Noto Serif Thai', Georgia, serif !important; letter-spacing: .06em; color: var(--c2-hi) !important;
  text-shadow: 0 0 6px color-mix(in srgb, var(--c2) 85%, transparent), 0 1px 1px #000; white-space: nowrap; overflow: hidden; }
#hud #profile.c2 .bar, .kit #hud #profile.c2 .bar { border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(214, 178, 106, .35); }
@media (prefers-reduced-motion: reduce) { #hud #profile.c2 .pf-face::before, #hud #profile.c2 .pf-lv b { animation: none !important; } }
@media (max-width: 700px) { #hud #profile.c2, .kit #hud #profile.c2 { width: 240px; margin: 26px 0 0 30px; } }
/* ===== K window: class 3 (src/class3.js) — the two branches, the class tree, and the class-3 tags. ===== */
.sk-tag.c3 { background: linear-gradient(180deg, #3a2a6a, #22163f); color: #e8dcff; border-color: #8f74ff; }
.c3-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.c3-branch { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid rgba(169, 133, 60, .35); border-radius: 6px; background: rgba(255, 252, 244, .72); min-width: 0; }
.c3-branch.on { border-color: #c9a24e; box-shadow: 0 0 0 1px rgba(201, 162, 78, .45) inset; }
.c3-bhead { display: flex; align-items: center; gap: 10px; }
.c3-bhead canvas { width: 46px; height: 46px; flex: none; }
.c3-bhead b { display: block; font: 600 16px 'Noto Serif Thai', serif; }
.c3-bhead small { color: var(--mute, #6f6857); }
.c3-branch p { margin: 0; font-size: 12px; line-height: 1.45; }
.c3-branch .c3-look { color: var(--mute, #6f6857); font-size: 11px; }
.c3-bars { display: grid; grid-template-columns: 62px 1fr; gap: 3px 8px; align-items: center; font-size: 11px; }
.c3-bars b { font-weight: 500; color: var(--mute, #6f6857); }
.c3-bars span { height: 6px; border-radius: 3px; background: rgba(31, 43, 69, .12); overflow: hidden; }
.c3-bars i { display: block; height: 100%; background: linear-gradient(90deg, #a9853c, #e2c27a); border-radius: 3px; }
.c3-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; font-size: 11.5px; }
.c3-skills span { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c3-skills canvas { width: 20px; height: 20px; flex: none; }
.c3-skills b { color: #8a6418; font-size: 10px; }
.c3-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.c3-here { font: 600 12px Kanit, sans-serif; color: #2e7d3a; }
.c3-tree { display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; align-items: center; gap: 8px; margin-bottom: 10px; }
.c3-arrow { font-style: normal; font-size: 22px; color: #a9853c; }
.c3-fork { display: grid; gap: 6px; }
.c3-node { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid rgba(169, 133, 60, .35); border-radius: 5px; background: rgba(255, 252, 244, .72); text-align: left; font: inherit; color: inherit; }
button.c3-node { cursor: pointer; }
.c3-node b { font: 600 14px 'Noto Serif Thai', serif; }
.c3-node small { font-size: 11px; color: var(--mute, #6f6857); }
.c3-node.done { border-color: rgba(63, 138, 74, .6); }
.c3-node.sel { background: #1f2b45; border-color: #c9a24e; }
.c3-node.sel :is(b, small) { color: #f6efe0 !important; }
@media (max-width: 720px) { .c3-pair { grid-template-columns: 1fr; } .c3-tree { grid-template-columns: 1fr; } .c3-arrow { display: none; } }
/* K window, class 3: nine cards fit without scrolling (the next level is the card's tooltip). */
.sk-list.c3list { gap: 6px; }
.sk-list.c3list .sk-next { display: none; }
.sk-list.c3list .sk-card { padding-block: 6px; }
.sk-list.c3list .sk-desc { font-size: 11.5px; line-height: 1.35; }
.sk-list.c3list .sk-icon canvas { width: 44px; height: 44px; }
/* ===== K window: class path (class 1 → class 2 → two branches side by side, user 2026-11-15). ===== */
.c3p { display: grid; gap: 10px; grid-column: 1 / -1; min-width: 0; }
.c3p-path { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; background: rgba(31, 43, 69, .05); }
.c3p-step { display: flex; align-items: center; gap: 6px; opacity: .55; }
.c3p-step.done { opacity: 1; }
.c3p-step canvas { width: 34px; height: 39px; }
.c3p-step b { display: block; font: 600 13px 'Noto Serif Thai', serif; }
.c3p-step small, .c3p-fork small { font-size: 10.5px; color: var(--mute, #6f6857); }
.c3p-line { flex: 1; height: 2px; min-width: 18px; background: rgba(31, 43, 69, .18); border-radius: 1px; }
.c3p-line.done { background: linear-gradient(90deg, #a9853c, #e2c27a); }
.c3p-fork { display: grid; text-align: center; padding: 4px 12px; border: 1px dashed #b8924a; border-radius: 5px; }
.c3p-fork b { font: 600 13px 'Noto Serif Thai', serif; color: #8a6418; }
.c3p-intro { margin: 0; font-size: 11.5px; color: var(--mute, #6f6857); text-align: center; }
.c3p-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.c3p-vs { align-self: center; font: 800 15px 'Noto Serif Thai', serif; font-style: normal; color: #a9853c; }
.c3p-col { display: grid; gap: 8px; align-content: start; padding: 10px 12px; border: 1px solid rgba(169, 133, 60, .35); border-radius: 8px; background: rgba(255, 252, 244, .78); min-width: 0; }
.c3p-col.on { border-color: #c9a24e; box-shadow: 0 0 0 2px rgba(201, 162, 78, .35) inset; }
.c3p-col header { display: flex; gap: 10px; align-items: flex-end; }
.c3p-look { width: 74px; height: 88px; flex: none; border-radius: 6px; background: radial-gradient(closest-side, rgba(31, 43, 69, .14), transparent); }
.c3p-col header small { color: #8a6418; font-weight: 600; letter-spacing: .06em; font-size: 10.5px; }
.c3p-col header b { display: block; font: 700 18px 'Noto Serif Thai', serif; line-height: 1.2; }
.c3p-role { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 99px; background: #1f2b45; color: #f3d68a !important; font-size: 10.5px; }
.c3p-col p { margin: 0; font-size: 11.5px; line-height: 1.45; min-height: 3em; }
.c3p-bars { display: grid; grid-template-columns: max-content 1fr; gap: 3px 8px; align-items: center; font-size: 11px; }
.c3p-bars b { white-space: nowrap; font-weight: 500; color: var(--mute, #6f6857); }
.c3p-bars span { height: 6px; border-radius: 3px; background: rgba(31, 43, 69, .12); overflow: hidden; }
.c3p-bars i { display: block; height: 100%; border-radius: 3px; background: rgba(31, 43, 69, .35); }
.c3p-bars i.up { background: linear-gradient(90deg, #a9853c, #e2c27a); }
.c3p-skills { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.c3p-sk { position: relative; aspect-ratio: 1; cursor: help; }
.c3p-sk canvas { width: 100%; height: 100%; display: block; }
.c3p-sk em { position: absolute; left: 1px; top: 0; font: 700 9px Kanit, sans-serif; font-style: normal; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.c3p-pas { display: flex; align-items: center; gap: 6px; cursor: help; }
.c3p-pas canvas { width: 28px; height: 28px; }
.c3p-pas small { display: block; font-size: 9.5px; color: var(--mute, #6f6857); }
.c3p-pas b { font-size: 12px; }
.c3p-col footer { display: flex; gap: 6px; flex-wrap: wrap; }
.c3p-here { font: 600 12px Kanit, sans-serif; color: #2e7d3a; }
@media (max-width: 720px) { .c3p-cols { grid-template-columns: 1fr; } .c3p-vs { display: none; } .c3p-skills { grid-template-columns: repeat(4, 1fr); } }
/* K window: the class path button in the title bar, beside the close button. */
.window > .panel-title .sk-treebtn { margin-left: auto; margin-right: 10px; padding: 4px 14px; border-radius: 99px; cursor: pointer;
  font: 600 12.5px 'Noto Serif Thai', serif; color: #f3d68a !important; background: rgba(255, 255, 255, .08); border: 1px solid rgba(243, 214, 138, .65); }
.window > .panel-title .sk-treebtn:hover, .window > .panel-title .sk-treebtn.on { background: rgba(243, 214, 138, .2); }
.window > .panel-title:has(.sk-treebtn) .pt-main { flex: 1; min-width: 0; }
.window > .panel-title .sk-treebtn { margin: 0 10px 0 auto !important; flex: none; }

/* The class-3 branch choice in the master's dialog (two ways side by side). */
.c3pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.c3pick-card { border: 1px solid rgba(214, 178, 108, 0.35); border-radius: 2px; padding: 6px 8px; background: rgba(0, 0, 0, 0.18); }
.c3pick-card b { display: block; color: var(--gilt, #d6b26c); font-size: 13.5px; }
.c3pick-card small { display: block; opacity: 0.75; font-size: 11.5px; }
.c3pick-card p { margin: 4px 0 0; font-size: 12px; line-height: 1.4; }
.c3p-quest { font-size: 11.5px; opacity: 0.85; }
/* A title above the name (class-3 legend walks). */
.st-title { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.st-title select { flex: 1; background: rgba(0, 0, 0, 0.25); color: inherit; border: 1px solid rgba(214, 178, 108, 0.4); border-radius: 2px; padding: 2px 4px; font: inherit; }

/* ===== HUD profile, class 3 (user 2026-11-15 "ทำ HUD คลาส 3"): what class 2 kept back — two colours per branch
   (--c3a, --c3b), a rim of light turning behind the frame, sparks drifting up, the crown's crystals and the gem lit in
   the branch's colours. Art GPT: assets/ui/c3-face.png (835×787, portrait window 191–619 × 218–650), c3-level.png,
   c3-ribbon.png (scripts/class3-hud-cut.mjs). The class-2 rules still apply (#profile is .c2 too); these override. */
#hud #profile.c3 { --c3a: #9fd6ff; --c3b: #ffcc55; --c2: var(--c3a); --c2-hi: #ffffff; --c2-lo: var(--c3b); }
#hud #profile.c3[data-br="bladeb"] { --c3a: #ff8a2a; --c3b: #ff2f4a; }
#hud #profile.c3[data-br="arcanea"] { --c3a: #ffd67a; --c3b: #6ad8ff; }
#hud #profile.c3[data-br="arcaneb"] { --c3a: #ff5a3a; --c3b: #4ab8ff; }
#hud #profile.c3[data-br="huntera"] { --c3a: #6affc0; --c3b: #ffe07a; }
#hud #profile.c3[data-br="hunterb"] { --c3a: #8ae35a; --c3b: #d8b25a; }
#hud #profile.c3[data-br="guardiana"] { --c3a: #fff0b8; --c3b: #ffc040; }
#hud #profile.c3[data-br="guardianb"] { --c3a: #ff4d3a; --c3b: #ffc040; }
#hud #profile.c3[data-br="clerica"] { --c3a: #8fd8ff; --c3b: #fff0b8; }
#hud #profile.c3[data-br="clericb"] { --c3a: #ffcf4a; --c3b: #ff7a3a; }
#hud #profile.c3[data-br="assassina"] { --c3a: #7aff6a; --c3b: #b04aff; }
#hud #profile.c3[data-br="assassinb"] { --c3a: #3ad8ff; --c3b: #ff3a5a; }
#hud #profile.c3, .kit #hud #profile.c3 { margin: 40px 0 0 38px; gap: 30px; }
#hud:has(#profile.c3) #buffs { top: 178px; }
/* The portrait shows 84×84 (the window at ×0.1958); the frame hung round it. */
#hud #profile.c3 #portrait { clip-path: inset(8px);
  background: radial-gradient(75% 70% at 50% 40%, color-mix(in srgb, var(--c3a) 38%, #2a2530), color-mix(in srgb, var(--c3b) 18%, #110f15) 85%) !important; }
#hud #profile.c3 .pf-face::after { left: -29.4px; top: -34.7px; width: 163.5px; height: 154.1px; background-image: url(assets/ui/c3-face.png);
  filter: drop-shadow(0 0 3px rgba(255, 205, 90, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
#hud #profile.c3 .pf-face::before { inset: -40px -46px -34px -46px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c3a) 70%, transparent), color-mix(in srgb, var(--c3b) 45%, transparent) 55%, transparent 82%); }
/* The rim: two colours chasing each other round, behind the frame, a soft ring. */
#hud #profile .c3-rim, #hud #profile .c3-gem, #hud #profile .c3-spark { display: none; }
#hud #profile.c3 .c3-rim { display: block; position: absolute; left: -36px; top: -36px; width: 172px; height: 172px; z-index: 0; pointer-events: none; border-radius: 50%;
  background: conic-gradient(var(--c3a), transparent 18%, var(--c3b) 33%, transparent 50%, var(--c3a) 66%, transparent 83%, var(--c3a));
  -webkit-mask: radial-gradient(closest-side, transparent 55%, #000 66%, #000 88%, transparent 100%); mask: radial-gradient(closest-side, transparent 55%, #000 66%, #000 88%, transparent 100%);
  filter: blur(2px); opacity: 1; animation: c3-turn 6s linear infinite; }
@keyframes c3-turn { to { transform: rotate(1turn); } }
/* The crystals of the crown and the gem below: lit in the branch's colours, breathing. */
#hud #profile.c3 .c3-gem { display: block; position: absolute; z-index: 3; pointer-events: none; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, var(--c3a), color-mix(in srgb, var(--c3b) 60%, transparent) 55%, transparent); animation: c3-gem 2.4s ease-in-out infinite; }
#hud #profile.c3 .c3-gem.crown { left: 31px; top: -36px; width: 38px; height: 26px; }
#hud #profile.c3 .c3-gem.drop { left: 41px; top: 101px; width: 18px; height: 18px; animation-delay: -1.2s;
  background: radial-gradient(closest-side, var(--c3b), color-mix(in srgb, var(--c3a) 60%, transparent) 55%, transparent); }
@keyframes c3-gem { 0%, 100% { opacity: .45; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } }
/* Sparks drifting up round the frame, the two colours by turns. */
#hud #profile.c3 .c3-spark { display: block; position: absolute; bottom: 4px; width: 3px; height: 3px; border-radius: 50%; z-index: 3; pointer-events: none;
  background: var(--c3a); box-shadow: 0 0 6px 1px var(--c3a); opacity: 0; animation: c3-spark 3.2s ease-out infinite; }
#hud #profile.c3 .c3-spark:nth-child(even) { background: var(--c3b); box-shadow: 0 0 6px 1px var(--c3b); }
@keyframes c3-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), -120px) scale(1.2); } }
/* The level badge under the frame, its number in the two colours. */
#hud #profile.c3 .pf-lv, .kit #hud #profile.c3 .pf-lv { left: 6px; top: 108px; width: 88px; height: 34px; padding: 0; background-image: url(assets/ui/c3-level.png); }
#hud #profile.c3 .pf-lv b { font-size: 16px !important; background: linear-gradient(100deg, transparent 0 40%, rgba(255, 255, 255, .95) 50%, transparent 60% 100%) 0 0 / 260% 100% no-repeat,
  linear-gradient(180deg, #ffffff 0%, var(--c3a) 60%, color-mix(in srgb, var(--c3a) 55%, var(--c3b)) 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c3a) 80%, transparent)) drop-shadow(0 0 6px color-mix(in srgb, var(--c3b) 50%, transparent)); }
/* The name plate: its gold edge runs in the branch's colours; the class title on the class-3 ribbon, its letters two-tone. */
#hud #profile.c3 .pf-body { margin-left: -34px; }
#hud #profile.c3 .pf-body::before { background: linear-gradient(90deg, color-mix(in srgb, var(--c3b) 60%, #7a5f26), #f0cd78 22%, var(--c3a) 50%, #f3d98f 78%, color-mix(in srgb, var(--c3b) 60%, #8a6a28));
  background-size: 200% 100%; animation: c3-edge 5s linear infinite; }
@keyframes c3-edge { to { background-position: 200% 0; } }
#hud #profile.c3 .pf-body::after { background: radial-gradient(60% 120% at 30% -20%, color-mix(in srgb, var(--c3a) 24%, transparent), transparent 70%),
  radial-gradient(50% 120% at 85% 130%, color-mix(in srgb, var(--c3b) 20%, transparent), transparent 70%), linear-gradient(180deg, #2a2430 0%, #17131b 55%, #0e0c12 100%); }
#hud #profile.c3 .pf-name small { border-width: 0 16px; border-image: url(assets/ui/c3-ribbon.png) 0 100 fill / 0 16px stretch; color: #ffffff !important;
  /* (Two-tone by its glow: clipped-text gradients go under a border-image fill and vanish.) */
  font-weight: 700 !important; text-shadow: 0 0 4px var(--c3a), 0 0 2px var(--c3b), 0 1px 1px #000 !important; }
#hud #profile.c3 #pf-emblem { width: 24px; height: 24px; filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 4px color-mix(in srgb, var(--c3a) 70%, transparent)); }
@media (prefers-reduced-motion: reduce) { #hud #profile.c3 .c3-rim, #hud #profile.c3 .c3-gem, #hud #profile.c3 .c3-spark, #hud #profile.c3 .pf-body::before { animation: none !important; } }

/* ===== The class symbol before the name (classes 2 and 3, user 2026-11-15 "ออร่าเคลื่อนไหวรอบไอคอน ไม่เวอร์ พอเห็น"):
   a faint ring of the class colours turning round it, one spark orbiting, the symbol's own glow breathing. The canvas
   sits in .pf-sym (ui paintProfile) because a canvas has no ::before/::after. */
#hud #profile .pf-sym { --sa: #ffd27a; --sb: #fff3cf; position: relative; display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; margin: -2px -1px -2px -4px; }
#hud #profile.c2 .pf-sym { --sa: var(--c2); --sb: var(--c2-hi); }
#hud #profile.c3 .pf-sym { --sa: var(--c3a); --sb: var(--c3b); width: 24px; height: 24px; }
#hud #profile .pf-sym #pf-emblem, #hud #profile.c2 .pf-sym #pf-emblem, #hud #profile.c3 .pf-sym #pf-emblem { position: relative; z-index: 1; width: 100%; height: 100%; margin: 0;
  filter: drop-shadow(0 1px 1px #000); }
@keyframes sym-glow {
  from { filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 2px color-mix(in srgb, var(--sa) 55%, transparent)); }
  to { filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 5px color-mix(in srgb, var(--sb) 80%, transparent)); } }
#hud #profile .pf-sym::before, #hud #profile .pf-sym::after { display: none !important; }
/* (The aura canvas, ui symAura: 64 px symbol + 22 px each side, drawn over the symbol's box.) */
#hud #profile .pf-sym .pf-aura { position: absolute; left: 50%; top: 50%; width: 170%; height: 170%; translate: -50% -50%; z-index: 2; pointer-events: none; }
#hud #profile .pf-sym .pf-aura.back { z-index: 0; }
#hud #profile .pf-sym::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none; z-index: 0; opacity: .7;
  background: conic-gradient(var(--sa), transparent 28%, var(--sb) 50%, transparent 78%, var(--sa));
  -webkit-mask: radial-gradient(closest-side, transparent 66%, #000 76%, #000 86%, transparent 100%); mask: radial-gradient(closest-side, transparent 66%, #000 76%, #000 86%, transparent 100%);
  filter: blur(1px); animation: sym-turn 4.5s linear infinite; }
#hud #profile .pf-sym::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; pointer-events: none; z-index: 2;
  background: #fff; box-shadow: 0 0 4px 1px var(--sb); animation: sym-orbit 3.2s linear infinite; }
@keyframes sym-turn { to { transform: rotate(1turn); } }
@keyframes sym-orbit { from { transform: rotate(0) translateY(-14px) scale(.8); opacity: .9; } 50% { opacity: .4; } to { transform: rotate(1turn) translateY(-14px) scale(.8); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { #hud #profile .pf-sym::before, #hud #profile .pf-sym::after, #hud #profile .pf-sym #pf-emblem { animation: none !important; } }

/* ===== Class 3 HUD, round 2 (user 2026-11-15: "the aura is a plain circle, the level has no texture, the class ribbon is
   smaller than its text"): the round blob and ring are gone for the frame's own wing-shaped aura (ui frameAura, two
   canvases), the level number cast in the frame's gold, the ribbon's dark band grows with its text. */
#hud #profile.c3 .pf-face::before, #hud #profile.c3 .c3-rim { display: none !important; }
#hud #profile .pf-faura { position: absolute; pointer-events: none; z-index: 0; }
#hud #profile:not(.c3) .pf-faura { display: none; }
/* The level: gold metal from the frame's own art, a dark edge, the branch's glow behind. */
#hud #profile.c3 .pf-lv b { font: 800 19px/1 'Noto Serif Thai', Georgia, serif !important; letter-spacing: .02em; translate: 0 1px;
  /* (Brushed gold: a cast-metal gradient with fine vertical grain over it.) */
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 1px, rgba(120, 70, 0, .12) 1px 2px, transparent 2px 3px),
    linear-gradient(180deg, #fffbe6 0%, #ffe48a 28%, #e0a42a 52%, #fff2b0 66%, #c9821c 84%, #8a5210 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-stroke: .7px rgba(40, 18, 0, .85); animation: none;
  filter: drop-shadow(0 0 1px #2a1400) drop-shadow(0 0 4px color-mix(in srgb, var(--c3a) 90%, transparent)) drop-shadow(0 0 7px color-mix(in srgb, var(--c3b) 70%, transparent)); }
/* The ribbon: sliced so the wing ends keep their shape and the dark band (rows 46–86 of 118) stretches to the text. */
#hud #profile.c3 .pf-name small { height: auto; min-height: 0; padding: 1px 6px; flex: 0 0 auto; width: max-content; min-width: 100%; overflow: visible; line-height: 15px; font-size: 11.5px !important;
  border-style: solid; border-width: 7.8px 16px 5.4px; border-image: url(assets/ui/c3-ribbon.png) 46 95 32 95 fill / 7.8px 16px 5.4px stretch; }

/* ===== Class 3 HUD, round 3 (user 2026-11-15: "the number spills out of the frame; a chunky, heavier font with a faint
   diamond texture; class 3 letters all gold"). The badge art (c3-level.png 617×238, shown 88×34) has its dark window at
   rows 89–179 = 12.7–25.6 px of the 34: the number is sized and lowered to sit inside it (Kanit 800, digits ~10.5 px). */
#hud #profile.c3 .pf-lv, .kit #hud #profile.c3 .pf-lv { display: flex !important; align-items: center; justify-content: center; }
#hud #profile.c3 .pf-lv b { position: static; display: block; translate: 0 2px; font: 800 15px/1 Kanit, sans-serif !important; letter-spacing: .04em;
  /* Gold, with a faint diamond lattice cut into it (two crossing hairline grids) and a facet shine across the top. */
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .28) 0 .6px, transparent .6px 4px),
    repeating-linear-gradient(-45deg, rgba(120, 66, 0, .22) 0 .6px, transparent .6px 4px),
    linear-gradient(180deg, #fffbe8 0%, #ffe796 30%, #f2b93a 50%, #fff0b0 62%, #d08a1c 82%, #9a5c12 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-stroke: .6px rgba(46, 22, 0, .9);
  filter: drop-shadow(0 1px 0 #2a1400) drop-shadow(0 0 3px rgba(255, 200, 90, .55)); animation: none; }
/* Every class-3 letter in gold: the name and the class title on the ribbon. (The ribbon can't take clipped-text
   gradients, they go under its border-image fill, so it is a flat gold with a dark edge.) */
#hud #profile.c3 .pf-name b { background: linear-gradient(180deg, #fff6d0 0%, #ffe08a 45%, #e0a83a 75%, #b87a1e 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent !important; -webkit-text-stroke: .4px rgba(40, 18, 0, .7); text-shadow: none !important; filter: drop-shadow(0 1px 1px #000); }
#hud #profile.c3 .pf-name small { color: #ffd870 !important; text-shadow: 0 1px 1px #2a1400, 0 0 1px #2a1400, 0 0 5px rgba(255, 190, 70, .55) !important; }
/* Round 4 (user: "the number doesn't fill the frame, looks off"): placed by measurement, not by eye. Window = x 16.4–71.6,
   y 12.7–25.6 of the 88×34 badge (centre 44, 19.15). Kanit 800 digits are 0.69em tall and their ink centre sits 0.03em
   below the line-box centre, so 17.5px digits (12px tall, 93% of the window) are boxed at top 19.15 − 8.75 − 0.5 = 9.9px. */
#hud #profile.c3 .pf-lv b { position: absolute; left: 0; right: 0; top: 9.9px; translate: none; text-align: center;
  font: 800 17.5px/17.5px Kanit, sans-serif !important; letter-spacing: .05em; padding-left: .05em; -webkit-text-stroke: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .3) 0 .7px, transparent .7px 4.5px),
    repeating-linear-gradient(-45deg, rgba(110, 60, 0, .25) 0 .7px, transparent .7px 4.5px),
    linear-gradient(180deg, #fffcec 0%, #ffe9a0 26%, #f5bf45 48%, #fff2b8 60%, #d8921f 80%, #a8661a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent !important;
  filter: drop-shadow(0 0 .6px #2a1400) drop-shadow(0 1px 0 #1e0e00) drop-shadow(0 0 3px rgba(255, 205, 100, .5)); }
/* Round 5 (user: "the font's texture should be diamond"): the digits cut like a diamond. Hard-edged facet planes
   (white, ice blue, steel lilac) at two angles, about one digit wide, so each numeral reads as faceted crystal; a
   glint sweeps across now and then; a dark rim and a cold glow keep it legible on the navy window. */
#hud #profile.c3 .pf-lv b {
  background:
    linear-gradient(105deg, transparent 0 42%, rgba(255, 255, 255, .95) 48%, transparent 54% 100%) -120% 0 / 300% 100% no-repeat,
    linear-gradient(135deg, rgba(255, 255, 255, .55) 0 18%, transparent 18% 38%, rgba(255, 255, 255, .45) 38% 46%, transparent 46% 70%, rgba(255, 255, 255, .5) 70% 78%, transparent 78%) 0 0 / 9px 100%,
    linear-gradient(180deg, #ffffff 0 22%, #d9ecff 22% 40%, #9ec4f0 40% 52%, #f2f9ff 52% 66%, #b7cff2 66% 82%, #7e9fd6 82% 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent !important;
  filter: drop-shadow(0 0 .6px #0a1430) drop-shadow(0 1px 0 #06102a) drop-shadow(0 0 3px rgba(170, 215, 255, .75));
  animation: c3-diamond 3.6s ease-in-out infinite; }
@keyframes c3-diamond { 0%, 55% { background-position: -120% 0, 0 0, 0 0; } 85%, 100% { background-position: 220% 0, 0 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { #hud #profile.c3 .pf-lv b { animation: none; } }
/* Class 2 ribbon (user 2026-11-15, pointed at it): the whole 172-px-tall art was squeezed into 19 px, so its dark band
   (rows 33–134) was only ~11 px and the class title touched the gold edges. Sliced like the class-3 one: the gold edges
   keep their thickness, the dark band grows to the text (c2-ribbon.png 1218×172, end caps 190 px). */
#hud #profile.c2 .pf-name small { height: auto; min-height: 0; padding: 1px 8px; line-height: 15px !important;
  border-width: 2.8px 16px 3.2px; border-image: url(assets/ui/c2-ribbon.png) 33 190 38 190 fill / 2.8px 16px 3.2px stretch; }
/* Class tree: the skill tooltip's power line (ui c3SkillTip). */
.c3t-dmg { margin-top: 4px; color: #ffe08a; } .c3t-dmg b { color: #fff3c4; font-size: 1.08em; }
.tooltip .c3t-dmg b { display: inline; margin: 0; }
/* Tooltips see-through (user 2026-11-15: "the text box's background a bit lighter"), the game showing behind a soft
   blur; a text shadow keeps the words readable on whatever is under them. */
.tooltip.panel { background: linear-gradient(180deg, rgba(24, 28, 42, .62), rgba(12, 14, 24, .7)) !important; backdrop-filter: blur(4px); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.tooltip.panel, .tooltip.panel * { text-shadow: 0 1px 2px rgba(0, 0, 0, .85); }
/* M window (user 2026-11-15: the town as a picture with icon pins, no pile of words): the help in one quiet line by
   the title; the map itself fills the window. */
#win-map .map-hint { margin-left: auto; margin-right: 10px; font: 400 12px Kanit, sans-serif; color: rgba(232, 222, 200, .7); letter-spacing: 0; }
#win-map #worldmap { display: block; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(227, 194, 126, .35), 0 6px 20px rgba(0, 0, 0, .35); cursor: crosshair; }
/* ===== World map (G, user 2026-11-15: every map on one map, its monsters, the way there, walk not warp) ===== */
#win-waygate { width: min(1180px, calc(100vw - 40px)); max-height: calc(100vh - 40px); }
#win-waygate .wm-hint { margin-left: auto; margin-right: 10px; font: 400 12px Kanit, sans-serif; opacity: .7; letter-spacing: 0; }
#win-waygate .wm-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, 1fr); gap: 14px; padding: 12px; min-height: 0; }
.wm-grid { position: relative; display: grid; gap: 3px; background: radial-gradient(120% 90% at 50% 50%, #1d3a5a, #0b1626); border-radius: 8px; padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(227, 194, 126, .35), inset 0 0 40px rgba(0, 0, 0, .5); max-height: calc(100vh - 150px); align-self: start; }
.wm-roads { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); pointer-events: none; z-index: 2; }
.wm-roads line { stroke: rgba(255, 226, 150, .55); stroke-width: .35; stroke-dasharray: .9 .7; vector-effect: non-scaling-stroke; stroke-width: 2px; }
.wm-roads line.lit { stroke: #7dff6a; stroke-width: 3px; stroke-dasharray: 6 4; filter: drop-shadow(0 0 3px #3cff40); animation: wm-flow 1s linear infinite; }
@keyframes wm-flow { to { stroke-dashoffset: -20; } }
.wm-cell { position: relative; border: 0; padding: 0; border-radius: 4px; overflow: visible; cursor: pointer; background: #22301c var(--img) center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4); transition: transform .12s, box-shadow .12s; }
.wm-cell:hover { transform: scale(1.04); z-index: 3; box-shadow: 0 0 0 2px #ffe08a, 0 4px 12px rgba(0, 0, 0, .5); }
.wm-cell.path { box-shadow: 0 0 0 2px rgba(125, 255, 106, .75), 0 2px 6px rgba(0, 0, 0, .4); }
.wm-cell.on { z-index: 3; box-shadow: 0 0 0 3px #ffd34a, 0 0 18px 4px rgba(255, 200, 60, .65); }
.wm-name { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  padding: 1px 7px 2px; border-radius: 3px; background: linear-gradient(180deg, #5a3a1a, #2e1c0c); border: 1px solid #d8aa52; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); white-space: nowrap; }
.wm-name b { font: 600 11px Kanit, sans-serif; color: #fff1cc; line-height: 1.15; } .wm-name small { font: 500 9px Kanit, sans-serif; color: #ffd98a; line-height: 1.1; }
.wm-you { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); z-index: 4; font: 600 10px Kanit, sans-serif; font-style: normal; color: #fff; white-space: nowrap;
  background: #1f6fd8; border: 1px solid #bfe0ff; border-radius: 3px; padding: 0 6px; box-shadow: 0 0 8px rgba(80, 160, 255, .8); }
.wm-info { display: flex; flex-direction: column; gap: 9px; min-width: 0; min-height: 0; }
.wm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.wm-head b { display: block; font: 600 22px 'Noto Serif Thai', Georgia, serif; color: #ffe08a; line-height: 1.2; } .wm-head small { color: #b9ad94; font-size: 12.5px; }
.wm-lv { font: 600 14px Kanit, sans-serif; color: #1a1206; background: linear-gradient(180deg, #ffe9a8, #d9a43c); border-radius: 3px; padding: 2px 9px; white-space: nowrap; }
.wm-pic { aspect-ratio: 4 / 3; max-height: 210px; border-radius: 6px; background: #22301c var(--img) center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(227, 194, 126, .4); }
.wm-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: start; font-size: 13px; } .wm-row.col { grid-template-columns: 1fr; }
.wm-row > label { color: #b9ad94; padding-top: 3px; }
.wm-row > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wm-chip { display: inline-flex; align-items: center; gap: 5px; font: 500 12px Kanit, sans-serif; color: #f3ead6; background: rgba(255, 255, 255, .06); border: 1px solid rgba(227, 194, 126, .45);
  border-radius: 3px; padding: 1px 7px; cursor: pointer; } .wm-chip:hover { background: rgba(255, 220, 140, .16); }
.wm-chip i { width: 8px; height: 8px; border-radius: 50%; background: #e0605a; } .wm-chip.town i { background: #ffd34a; } .wm-chip.road i { background: #8fd4ff; }
.wm-chip small { color: #c9b98f; } .wm-arrow { color: #7dff6a; font-style: normal; font-weight: 700; }
.wm-mons { display: grid !important; grid-template-columns: 1fr 1fr; gap: 5px !important; }
.wm-mon { display: flex; align-items: center; gap: 7px; padding: 4px 7px 4px 4px; border-radius: 4px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(227, 194, 126, .2); min-width: 0; }
.wm-mon canvas { width: 34px; height: 34px; border-radius: 50%; background: #1a1620; flex: none; box-shadow: 0 0 0 1px rgba(227, 194, 126, .45); }
.wm-mon span { min-width: 0; flex: 1; } .wm-mon b { display: block; font: 600 12.5px Kanit, sans-serif; color: #f3ead6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-mon small { font-size: 10.5px; color: #b9ad94; } .wm-mon em { font-style: normal; font: 600 12px Kanit, sans-serif; color: #ffd98a; }
.wm-mon.boss, .wm-mon.mvp { grid-column: 1 / -1; } .wm-mon.boss { border-color: rgba(208, 107, 255, .6); background: rgba(160, 80, 255, .1); }
.wm-mon.mvp { border-color: rgba(255, 200, 60, .75); background: rgba(255, 190, 40, .1); }
.wm-mon em.tag { background: #7a2ac0; color: #fff; padding: 0 6px; border-radius: 3px; font-size: 10.5px; } .wm-mon.mvp em.tag { background: linear-gradient(180deg, #ffe08a, #c98a1c); color: #1a1206; }
.wm-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wm-warn { color: #ff9a7a; font-size: 12.5px; } .wm-go { min-width: 150px; font-size: 15px !important; padding: 7px 16px !important; }
/* (World map: the tiles under the road lines; their names in their own colours whatever the window's button styles.) */
.wm-cell { z-index: 1; font: inherit; }
.wm-cell:hover, .wm-cell.on { z-index: 3; }
.wm-name b { color: #fff1cc !important; text-shadow: 0 1px 1px #000; } .wm-name small { color: #ffd98a !important; }

/* World map round 2 (user 2026-11-15: each zone's main maps only, no counts, a monster's picture walks to it): tiles
   framed in their zone's colour, towns marked, the zones named under the map, monsters as buttons. */
.wm-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wm-cell { box-shadow: 0 0 0 2px var(--zone), 0 2px 6px rgba(0, 0, 0, .45); }
.wm-cell.town { box-shadow: 0 0 0 3px var(--zone), 0 0 0 4px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .5); }
.wm-cell.path { box-shadow: 0 0 0 3px #7dff6a, 0 2px 6px rgba(0, 0, 0, .4); }
.wm-cell.on { box-shadow: 0 0 0 3px #ffd34a, 0 0 18px 4px rgba(255, 200, 60, .65); }
.wm-town { position: absolute; right: 4%; top: 5%; z-index: 4; font: 600 9.5px Kanit, sans-serif; font-style: normal; color: #1a1206; background: linear-gradient(180deg, #ffe9a8, #d9a43c);
  border-radius: 2px; padding: 0 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.wm-zones { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 12px Kanit, sans-serif; color: #e8dfca; }
.wm-zones span { display: inline-flex; align-items: center; gap: 5px; } .wm-zones i { width: 10px; height: 10px; border-radius: 2px; background: var(--zone); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.wm-zones small { color: #b9ad94; }
.wm-row label small { color: #8f846c; font-size: 11px; }
button.wm-mon { cursor: pointer; font: inherit; color: inherit; text-align: left; transition: background .12s, border-color .12s, transform .12s; }
button.wm-mon:hover { background: rgba(255, 220, 140, .14); border-color: #ffd34a; transform: translateY(-1px); }
.wm-mon em.go { font: 600 11px Kanit, sans-serif; color: #7dff6a; opacity: 0; transition: opacity .12s; } button.wm-mon:hover em.go { opacity: 1; }
.wm-left .wm-grid { width: 100%; box-sizing: border-box; }

/* World map round 3 (user 2026-11-15 "do all of it"): the land of each zone over the sea, a compass, tiles that tell
   what suits the player's level, quests, bosses and party there, fog where they have not been; drops and walk time. */
.wm-left .wm-grid { gap: 9px; padding: 14px; background: radial-gradient(130% 100% at 50% 40%, #1f4f78 0%, #143654 45%, #0a1c30 100%); overflow: hidden; }
.wm-sea { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background: repeating-radial-gradient(circle at 30% 40%, transparent 0 14px, rgba(160, 210, 255, .12) 15px 16px, transparent 17px 30px); }
.wm-land { position: relative; z-index: 0; margin: -16%; border-radius: 34%; background: color-mix(in srgb, var(--zone) 55%, #6b5a36); filter: blur(9px); opacity: .85; pointer-events: none; }
.wm-roads { z-index: 2; }
.wm-cell { z-index: 1; border-radius: 6px; }
.wm-cell.fog { background: #20262e var(--img) center / cover no-repeat; }
.wm-cell.fog::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 50% 45%, rgba(40, 46, 56, .55), rgba(14, 16, 22, .9));
  backdrop-filter: blur(3px); z-index: 1; }
.wm-cell.rec { box-shadow: 0 0 0 3px #6dff7a, 0 0 14px 3px rgba(80, 255, 100, .55); }
.wm-cell.hard::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(255, 90, 80, .85), inset 0 0 18px rgba(255, 60, 50, .45); pointer-events: none; z-index: 2; }
.wm-cell.on { box-shadow: 0 0 0 3px #ffd34a, 0 0 18px 4px rgba(255, 200, 60, .7); }
.wm-rec { position: absolute; left: 50%; top: 6%; transform: translateX(-50%); z-index: 4; font: 600 10px Kanit, sans-serif; font-style: normal; color: #062a0a; white-space: nowrap;
  background: linear-gradient(180deg, #c8ffb8, #5fe06a); border-radius: 3px; padding: 0 6px; box-shadow: 0 0 8px rgba(90, 255, 110, .8); }
.wm-marks { position: absolute; left: 4%; top: 5%; z-index: 4; display: flex; gap: 2px; pointer-events: auto; }
.wm-marks i { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font: 800 11px Kanit, sans-serif; font-style: normal; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.wm-q { background: radial-gradient(circle at 40% 35%, #ffe680, #f0a020); color: #3a2200; border: 1px solid #fff2b0; }
.wm-b { background: radial-gradient(circle at 40% 35%, #e0b8ff, #8a3ad8); color: #fff; border: 1px solid #f0dcff; font-size: 10px !important; }
.wm-b.mvp { background: radial-gradient(circle at 40% 35%, #fff0b0, #d8961c); color: #3a1e00; border-color: #fff4c8; }
.wm-pt { background: radial-gradient(circle at 40% 35%, #b8ffd0, #2fb860); color: #032a12; border: 1px solid #e0ffe8; }
.wm-compass { position: absolute; right: 10px; bottom: 10px; width: 52px; height: 52px; z-index: 2; pointer-events: none; overflow: visible; opacity: .85; }
.wm-compass circle { fill: rgba(10, 20, 34, .55); stroke: #d8b25a; stroke-width: 1.2; }
.wm-compass path { fill: #b89040; } .wm-compass path.n { fill: #ffe28a; }
.wm-compass text { fill: #ffe28a; font: 700 7px Kanit, sans-serif; text-anchor: middle; }
.wm-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 400 11.5px Kanit, sans-serif; color: #b9ad94; }
.wm-key { display: inline-flex; align-items: center; gap: 5px; } .wm-key b { color: #ffd98a; }
.wm-key i { width: 12px; height: 12px; border-radius: 3px; } .k-rec { box-shadow: 0 0 0 2px #6dff7a; } .k-hard { box-shadow: inset 0 0 0 2px #ff5a50; } .k-fog { background: #262c36; box-shadow: 0 0 0 1px #556; }
.wm-lv.rec { background: linear-gradient(180deg, #c8ffb8, #5fe06a); } .wm-lv.hard { background: linear-gradient(180deg, #ffc0b0, #e05a40); color: #2a0600; }
.wm-fit { font: 500 12.5px Kanit, sans-serif; padding: 3px 9px; border-radius: 3px; margin-top: -4px; }
.wm-fit.rec { color: #b8ffb0; background: rgba(80, 220, 90, .12); border: 1px solid rgba(110, 255, 120, .45); }
.wm-fit.hard { color: #ffb0a0; background: rgba(255, 80, 60, .12); border: 1px solid rgba(255, 110, 90, .45); }
.wm-pic.fog { position: relative; filter: blur(5px) brightness(.45) saturate(.4); }
.wm-pic.fog span { position: absolute; inset: 0; display: grid; place-items: center; filter: none; color: #fff; font: 600 15px Kanit, sans-serif; }
.wm-drops { display: flex !important; flex-wrap: wrap; gap: 4px !important; }
.wm-drops i { width: 34px; height: 34px; border-radius: 4px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(227, 194, 126, .35); display: grid; place-items: center; }
.wm-drops canvas { width: 30px; height: 30px; }
.wm-time { font: 500 13px Kanit, sans-serif; color: #c9e8ff; }
.wm-left .wm-grid { gap: 15px; padding: 20px; }
.wm-land { margin: -34%; border-radius: 40%; filter: blur(13px); opacity: .95; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--zone) 70%, #7a6a40) 40%, color-mix(in srgb, var(--zone) 45%, #3a3020) 75%, transparent 100%); }
.wm-cell { border-radius: 8px; }
.wm-cell.fog .wm-b { display: none; }
/* Dungeon boss portrait (user 2026-11-15 "the picture spills out of the frame, every dungeon"): the picture fills
   only the frame's opening, measured on dg-portrait.png (455×470: opening x 63–393, y 93–399 = 13.8% / 19.8% / 13.6% /
   15.1% from the edges), so nothing shows through the crest's gaps above it. */
#win-dungeon .dg-portrait canvas { inset: 19.8% 13.6% 15.1% 13.8%; width: auto; height: auto; }
#win-dungeon .dg-portrait canvas { object-fit: cover; object-position: 50% 30%; }
#win-dungeon .dg-portrait canvas { width: 72.6%; height: 65.1%; right: auto; bottom: auto; }

/* =====================================================================================================================
   Theme C · pilot on the bag and stats windows (user 2026-11-15: "not plain, yet easy to use" — rich window chrome,
   calm insides). Pieces from GPT (art/source/ui-c-frame-kit.png, ui-c-icons.png, cut with scripts/crop-key.mjs):
   c-frame (navy + gold, compass-star crests), c-title (plate with hanging banners), c-ribbon (section header),
   c-card, c-slot / c-slot-on, c-btn (primary) c-btn2 (secondary) c-btn-danger c-btn-off, c-tab-on / c-tab, c-close,
   c-plus / c-minus; icons ci-*. Three layers: navy-gold frame → ivory parchment → lighter cards with navy text; a
   ribbon names each zone; every stat row has its own icon; an empty gear slot shows what goes in it.
   ===================================================================================================================== */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){
  --c-ink: #1d2a4a; --c-mute: #6c6350; --c-navy: #1f3566; --c-gold: #b8892c;
  border: 34px solid transparent; border-image: url(assets/ui/c-frame.png) 60 fill / 34px / 6px stretch;
  background: none; box-shadow: 0 28px 70px rgba(10, 14, 28, .55); border-radius: 0; padding: 0; overflow: visible;
}
/* The title: the navy plate across the top with its two hanging banners, the name in light serif. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title{
  position: relative; margin: -40px -24px 14px; padding: 18px 64px 30px; min-height: 0; border: 0;
  background: url(assets/ui/c-title.png) center top / 100% 100% no-repeat; color: #f6ecd2 !important;
  font: 600 20px 'Noto Serif Thai', Georgia, serif; letter-spacing: .04em; text-shadow: 0 2px 3px rgba(0, 0, 0, .55); justify-content: center;
}
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .close{
  position: absolute; right: 2px; top: 6px; width: 40px; height: 40px; border: 0; border-radius: 50%; font-size: 0 !important; color: transparent !important;
  background: url(assets/ui/c-close.png) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); transition: transform .12s;
}
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .close:hover{ transform: scale(1.08); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .body{ padding: 2px 6px 6px; color: var(--c-ink); }
/* Section ribbons: a navy band with a gold star on the left, light letters. */
html:not([data-ui="a"],[data-ui="b"]) .c-rib{ display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 16px 0 34px; margin: 2px 0 8px;
  background: url(assets/ui/c-ribbon.png) center / 100% 100% no-repeat; color: #f6ecd2; font: 600 13.5px 'Noto Serif Thai', Georgia, serif; letter-spacing: .03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
html:not([data-ui="a"],[data-ui="b"]) .c-rib small{ margin-left: auto; font: 500 11.5px Kanit, sans-serif; color: #e3cf96; letter-spacing: 0; }
/* Cards: lighter than the parchment, a gold hairline. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-card{ border: 12px solid transparent; border-image: url(assets/ui/c-card.png) 22 fill / 12px stretch; padding: 4px 6px; }
/* Buttons by state. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn{ border: 10px solid transparent !important; border-image: url(assets/ui/c-btn2.png) 26 fill / 10px stretch !important; background: none !important;
  color: var(--c-ink) !important; font-weight: 600; padding: 0 8px !important; min-height: 32px; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.primary{ border-image-source: url(assets/ui/c-btn.png) !important; color: #f6ecd2 !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.danger{ border-image-source: url(assets/ui/c-btn-danger.png) !important; color: #fff1e8 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn:disabled{ border-image-source: url(assets/ui/c-btn-off.png) !important; color: #f0f0f0 !important; opacity: .85; text-shadow: none; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn:hover:not(:disabled){ filter: brightness(1.08); }
/* Tabs. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-tab{ border: 10px solid transparent; border-bottom-width: 6px; border-image: url(assets/ui/c-tab.png) 24 24 12 fill / 10px 10px 6px stretch;
  background: none !important; color: var(--c-ink) !important; font: 600 13px Kanit, sans-serif; padding: 0 12px; min-width: 96px; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-tab.on{ border-image-source: url(assets/ui/c-tab-on.png); color: #f6ecd2 !important; }
/* Item slots: the cream well; the chosen one glows gold. */
html:not([data-ui="a"],[data-ui="b"]) #win-bag .cell, html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-slot{ border: 8px solid transparent !important; border-image: url(assets/ui/c-slot.png) 22 fill / 8px stretch !important;
  background: none !important; box-shadow: none !important; border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .cell.sel, html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-slot.sel{ border-image-source: url(assets/ui/c-slot-on.png) !important; filter: drop-shadow(0 0 6px rgba(255, 200, 70, .7)); }
/* An empty gear slot shows a faded picture of what goes in it. */
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-slot.empty[data-kind] canvas{ background: var(--sil) center / 74% no-repeat; opacity: .9; }
/* Each stat row: its own icon, the name, the value. */
html:not([data-ui="a"],[data-ui="b"]) .sti{ width: 22px; height: 22px; flex: none; background: var(--ic) center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats .st{ display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 4px; background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(184, 137, 44, .28); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats .st span{ flex: 1; color: var(--c-mute); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats .st b{ color: var(--c-ink); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats{ gap: 4px 8px !important; }
/* Stats window: each attribute card with its icon and the +/− look. */
html:not([data-ui="a"],[data-ui="b"]) #win-stats .attr-card{ border: 12px solid transparent !important; border-image: url(assets/ui/c-card.png) 22 fill / 12px stretch !important; background: none !important; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .attr-card .ac-name{ display: flex; align-items: center; gap: 8px; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .attr-card .ac-name .sti{ width: 34px; height: 34px; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts{ border: 12px solid transparent; border-image: url(assets/ui/c-card.png) 22 fill / 12px stretch; background: none; }

/* Filters with their icons (the gear-shaped silhouettes darkened so they read on ivory). */
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button{ display: inline-flex; align-items: center; gap: 4px; }
html:not([data-ui="a"],[data-ui="b"]) .fi{ width: 18px; height: 18px; flex: none; background: var(--ic) center / contain no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button .fi[style*="sil-"]{ filter: brightness(.5) sepia(.4); }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button.on{ background: #1f3566 !important; color: #f6ecd2 !important; border-color: #b8892c !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button.on .fi[style*="sil-"]{ filter: brightness(1.6); }
/* Theme C fixes: the title is the plate (stretched only in its plain middle) with the two banners hanging from it;
   the close gem beats theme B's !important; ribbons leave room for their star; tighter rows so it all fits. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title{
  background: none !important; border: 0 solid transparent !important; border-width: 0 70px !important;
  border-image: url(assets/ui/c-title-plate.png) 0 120 fill / 0 70px stretch !important;
  margin: -44px -30px 26px !important; padding: 14px 40px 16px !important; overflow: visible !important; z-index: 2;
}
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title::before, html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title::after{
  content: ''; position: absolute; top: calc(100% - 10px); width: 30px; height: 54px; background: url(assets/ui/c-banner.png) center / contain no-repeat;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); pointer-events: none; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title::before{ left: -42px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title::after{ right: -42px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .close{
  position: absolute !important; right: -50px !important; top: 50% !important; transform: translateY(-50%) !important; width: 42px !important; height: 42px !important;
  background: url(assets/ui/c-close.png) center / contain no-repeat !important; font-size: 0 !important; margin: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .close:hover{ transform: translateY(-50%) scale(1.08) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-rib{ padding-left: 42px; height: 28px; margin: 0 0 6px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats .st{ padding: 2px 7px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats .sti{ width: 20px; height: 20px; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-slot small{ font-size: 9.5px; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-slot.empty small{ display: none; }
/* Ribbons keep their star the same size whatever the width (9-slice: star end fixed, the band stretches). */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-rib{ background: none; border: 0 solid transparent; border-image: url(assets/ui/c-ribbon.png) 0 40 0 95 fill / 0 16px 0 38px stretch; padding-left: 44px; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .st-left > .c-rib:first-child, html:not([data-ui="a"],[data-ui="b"]) #win-stats .st-right > .c-rib{ margin-top: 22px; }
/* =====================================================================================================================
   Theme C · every window (user 2026-11-15 "ขยายทุกหน้าต่าง"): theme B's plates swapped for the C kit, 9-sliced so the
   corners never stretch. Dungeon, world map (G) and admin keep their own looks.
   ===================================================================================================================== */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button){
  background: none !important; border: 10px solid transparent !important; border-bottom-width: 6px !important; border-radius: 0 !important; box-shadow: none !important;
  border-image: url(assets/ui/c-tab.png) 24 24 12 fill / 10px 10px 6px stretch !important; padding: 0 12px !important; min-height: 30px; color: var(--c-ink, #1d2a4a) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab.on, .qb-tabs button.on, .mk-seg button.on, .shop-tabs button.on, .tabs button.on){
  border-image-source: url(assets/ui/c-tab-on.png) !important; background: none !important; color: #f6ecd2 !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.on:not(.primary){ border-image-source: url(assets/ui/c-tab-on.png) !important; background: none !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.go{ border-image-source: url(assets/ui/c-btn.png) !important; color: #f6ecd2 !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.ok{ border-image-source: url(assets/ui/c-btn2.png) !important; color: #23552b !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.ok::first-letter{ color: inherit; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell, .doll-slot){ border: 8px solid transparent !important; border-image: url(assets/ui/c-slot.png) 22 fill / 8px stretch !important;
  background: none !important; box-shadow: none !important; border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell.sel, .cell.on, .doll-slot.sel){ border-image-source: url(assets/ui/c-slot-on.png) !important; filter: drop-shadow(0 0 6px rgba(255, 200, 70, .7)); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.qb-card, .bag-detail, .shop-detail, .mk-card, .gd-card, .cf-card, .vt-box, .gs-card){
  border: 12px solid transparent !important; border-image: url(assets/ui/c-card.png) 22 fill / 12px stretch !important; background: none !important; box-shadow: 0 2px 6px rgba(31, 43, 69, .08) !important; border-radius: 0 !important; }
/* Section headers inside windows read as ribbons. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.gd-card-title, .rk-head, .ev-head, .vt-panel > h4){
  border: 0 solid transparent !important; border-image: url(assets/ui/c-ribbon.png) 0 40 0 95 fill / 0 16px 0 38px stretch !important; background: none !important;
  min-height: 28px; padding: 3px 16px 3px 44px !important; color: #f6ecd2 !important; font-family: 'Noto Serif Thai', Georgia, serif; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.gd-card-title, .rk-head, .ev-head, .vt-panel > h4) :is(b, span, small, em, strong){ color: inherit !important; }
/* Room under the title for its hanging star before the first row. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title{ margin-bottom: 34px !important; }
/* Daily check-in days: light cards, today navy with a gold rim. */
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day{ border: 10px solid transparent !important; border-image: url(assets/ui/c-card.png) 22 fill / 10px stretch !important; background: none !important; box-shadow: none !important; color: var(--c-ink, #1d2a4a) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day :is(small, span, em){ color: #1d2a4a !important; text-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day.today{ border-image: url(assets/ui/c-slot-on.png) 22 fill / 10px stretch !important; filter: drop-shadow(0 0 6px rgba(255, 200, 70, .7)); }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day.today :is(small, span, em){ color: #fff4d6 !important; text-shadow: 0 1px 2px #000 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day.today :is(small, span, em){ color: #5a3d06 !important; text-shadow: none !important; font-weight: 700; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-cell{ border: 6px solid transparent; border-image: url(assets/ui/c-slot.png) 22 fill / 6px stretch; background: none; padding: 0; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-cell.on{ border-image-source: url(assets/ui/c-slot-on.png); background: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-pick{ border: 8px solid transparent; border-image: url(assets/ui/c-slot-on.png) 22 fill / 8px stretch; background: none; padding: 0; }
/* The frame hangs 16px outside the window so the content keeps (almost) theme B's width. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){ border-width: 22px !important; border-image: url(assets/ui/c-frame.png) 60 fill / 34px / 14px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title{ margin: -34px -18px 34px !important; }
/* Windows that were already tight get the room the frame took. */
html:not([data-ui="a"],[data-ui="b"]) #win-settings{ width: 480px; }
html:not([data-ui="a"],[data-ui="b"]) #win-help{ width: 760px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) a.btn{ display: inline-flex; align-items: center; margin: 2px 2px; white-space: nowrap; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn{ white-space: nowrap; }
/* Stats window: gear bonuses sit under the radar in one column; the radar a little smaller so it all fits. */
html:not([data-ui="a"],[data-ui="b"]) #win-stats .st-bonus{ grid-template-columns: 1fr !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .st-right .c-rib + .st-bonus{ margin-top: 0; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .st-right > .c-rib:not(:first-child){ margin-top: 6px !important; }
/* Centred (not lifted) and kept 40px off both screen edges: the frame hangs outside and the title plate rises above. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){ transform: translate(-50%, -50%); max-height: calc(100vh - 80px); }
/* =====================================================================================================================
   Theme C · polish pass (user 2026-11-15 review: icons small, labels half in / half under slots, text off-centre,
   gold lines cutting through everything, the chosen shop row's name invisible, a plain white amount box).
   ===================================================================================================================== */
/* Item wells: calm recessed beige, thin warm rim; gold only on the chosen one; rarity tints the rim. Icons fill them. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell, .doll-slot){
  border: 1px solid rgba(146, 108, 46, .42) !important; border-image: none !important; border-radius: 6px !important;
  background: linear-gradient(180deg, #e9dcc0, #f3e9d3) !important; box-shadow: inset 0 2px 4px rgba(70, 50, 20, .22), 0 1px 0 rgba(255, 255, 255, .7) !important; filter: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell, .doll-slot)[class*="r-"]{ border-color: color-mix(in srgb, var(--rc) 75%, #6b5020) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent), inset 0 0 12px color-mix(in srgb, var(--rc) 30%, transparent), 0 1px 0 rgba(255, 255, 255, .7) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell.sel, .cell.on, .doll-slot.sel){ border: 2px solid #d9a92e !important;
  box-shadow: 0 0 0 1px #7a5410, 0 0 10px rgba(255, 196, 60, .75), inset 0 0 10px rgba(255, 215, 120, .45) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .cell canvas{ width: 86%; height: 86%; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .doll-slot canvas{ width: 84%; height: 84%; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .cell .n{ right: 3px; bottom: 1px; font: 700 11.5px Kanit, sans-serif; color: #1d2a4a !important;
  text-shadow: 0 0 2px #fff8e6, 0 0 2px #fff8e6, 0 0 3px #fff8e6 !important; }
/* Worn slots: no label inside (it is the hover title); the + level a small navy badge in the corner. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .doll-slot small{ display: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .doll-slot .ds-plus{ position: absolute; top: -5px; right: -5px; min-width: 20px; padding: 0 4px; border-radius: 9px; background: #1f3566; border: 1px solid #d9a92e;
  color: #ffe9a8; font: 700 10.5px/16px Kanit, sans-serif; font-style: normal; text-align: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); z-index: 2; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .doll-slot.empty[data-kind] canvas{ background: var(--sil) center / 70% no-repeat; opacity: .55; }
/* Tabs and buttons: text centred both ways. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button){
  display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; border-width: 8px 10px !important; border-image-width: 8px 10px !important; min-height: 34px; line-height: 1.2 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn{ display: inline-flex; align-items: center; justify-content: center; line-height: 1.2 !important; }
/* The chosen shop / market row: light text on navy, every line. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-item.sel, .mk-line.sel) :is(b, small, span, em, .gold){ color: #f6ecd2 !important; filter: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-item.sel, .mk-line.sel) .cap-d{ color: #9fe3a8 !important; }
/* Amount box: an ivory recessed field matching the buttons beside it. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .qty{ display: grid; grid-template-columns: 40px 1fr 40px; gap: 6px; align-items: stretch; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .qty .btn{ min-height: 36px; padding: 0 !important; font-size: 18px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .qty input{ height: 36px; box-sizing: border-box; border: 1px solid rgba(146, 108, 46, .55) !important; border-radius: 6px !important;
  background: linear-gradient(180deg, #e9dcc0, #f6eedc) !important; box-shadow: inset 0 2px 4px rgba(70, 50, 20, .2) !important; font: 700 16px Kanit, sans-serif !important; color: #1d2a4a !important; text-align: center; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .qty-presets{ display: grid; grid-template-columns: repeat(3, 1fr) 1.7fr; gap: 6px; margin-top: 8px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .qty-presets .btn{ min-width: 0; padding: 0 4px !important; font-size: 12px !important; overflow: hidden; }

/* =====================================================================================================================
   Theme C v2 (user 2026-11-15 "not pretty, too little ornament … generate as much as you need"): rebuilt from a GPT
   mockup of the bag (art/source/ui-c2-mock-bag.png) and its parts sheet (ui-c2-kit.png → scripts/ui-c2-kit-crop.json,
   the niche via cut-near-key, the watermark recoloured): a thick navy top band holding the title, a compass-star crest
   on the top edge, filigree corners with gems; inside, ivory parchment with a faint compass watermark. Filled item
   wells are navy so the icons pop, empty ones beige; gold glows only on the chosen one; rarity is a coloured inner ring.
   ===================================================================================================================== */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){
  border-style: solid !important; border-color: transparent !important; border-width: 60px 16px 18px !important;
  border-image: url(assets/ui/c2-frame.png) 115 110 100 110 fill / 60px 56px 52px 56px / 0 stretch !important;
  padding: 6px 14px 12px !important; overflow: visible !important;
  background: none !important; box-shadow: 0 30px 80px rgba(8, 12, 26, .6) !important; }
/* The faint compass watermark in the parchment (behind everything). */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today)::before{
  content: ''; position: absolute; z-index: -1; pointer-events: none; left: 50%; top: 50%; width: min(70%, 420px); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: url(assets/ui/c2-watermark.png) center / contain no-repeat; opacity: .13; }
/* The title sits in the navy band, centred, light serif; the crest crowns the top edge; close is the red gem in the band. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title{
  position: absolute !important; left: 0; right: 0; top: -56px; height: 50px; margin: 0 !important; padding: 0 70px !important; z-index: 3;
  display: flex !important; align-items: center; justify-content: center; gap: 10px;
  border: 0 !important; border-image: none !important; background: none !important; min-height: 0;
  font: 600 22px/1 'Noto Serif Thai', Georgia, serif !important; letter-spacing: .05em; color: #fbefd0 !important;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45), 0 0 14px rgba(255, 210, 120, .25) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title::before{
  content: '' !important; position: absolute; left: 50%; top: -44px; width: 220px; height: 70px; transform: translateX(-50%); pointer-events: none;
  background: url(assets/ui/c2-crest.png) center / contain no-repeat !important; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)) !important; border: 0; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title::after{ content: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .close{
  position: absolute !important; right: 12px !important; left: auto !important; top: 50% !important; transform: translateY(-50%) !important; width: 38px !important; height: 38px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .close:hover{ transform: translateY(-50%) scale(1.08) !important; }
/* Things that ride on the right of a title (money, sub-buttons) sit left of the close gem. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title :is(.bag-money, .title-actions, .sk-treebtn){ position: absolute; right: 62px; top: 50%; transform: translateY(-50%); margin: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .bag-money > span{ display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px 0 6px;
  border: 0 solid transparent; border-image: url(assets/ui/c2-coin.png) 30 40 fill / 14px 18px stretch; font: 600 13px Kanit, sans-serif; color: #f6ecd2 !important; text-shadow: 0 1px 2px #000; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .bag-money .cur{ color: #f6ecd2 !important; filter: none !important; }

/* Item wells. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell, .doll-slot){
  border: 0 !important; border-radius: 8px !important; box-shadow: none !important; filter: none !important;
  background: url(assets/ui/c2-slot-empty.png) center / 100% 100% no-repeat !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell.filled, .cell.av, .doll-slot:not(.empty)){ background-image: url(assets/ui/c2-slot.png) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell.sel, .cell.on, .doll-slot.sel){ background-image: url(assets/ui/c2-slot-on.png) !important; background-size: 112% 112% !important;
  filter: drop-shadow(0 0 5px rgba(255, 200, 70, .6)) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell, .doll-slot) > canvas{ position: relative; z-index: 1; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell, .doll-slot)[class*="r-"]::after{
  content: ''; position: absolute; inset: 3px; border-radius: 6px; pointer-events: none; z-index: 0;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rc) 85%, transparent), inset 0 0 12px color-mix(in srgb, var(--rc) 55%, transparent); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .cell .n{ z-index: 2; color: #fff !important; font: 700 12px Kanit, sans-serif !important;
  text-shadow: 0 0 2px #0b1430, 0 0 2px #0b1430, 0 1px 2px #000 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .doll-slot.empty[data-kind] canvas{ background: var(--sil) center / 64% no-repeat; opacity: .45; }
html:not([data-ui="a"],[data-ui="b"]) .doll-slot .ds-plus{ border: 0; background: url(assets/ui/c2-badge.png) center / 100% 100% no-repeat; padding: 0 6px; top: -6px; right: -7px; font-size: 10.5px; line-height: 17px; }

/* Cards with filigree corners; stat rows; filter pills; ornamental divider. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.qb-card, .bag-detail, .shop-detail, .mk-card, .gd-card, .cf-card, .vt-box, .gs-card){
  border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 22px 26px stretch !important; background: none !important; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats .st{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-row.png) 30 40 fill / 10px 14px stretch !important;
  background: none !important; border-radius: 0 !important; min-height: 26px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(hr, .divider){ height: 18px; background: url(assets/ui/c2-divider.png) center / contain no-repeat !important; border: 0; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-filters button{
  border: 0 solid transparent !important; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 12px 16px stretch !important; background: none !important; border-radius: 0 !important;
  height: 30px; padding: 0 12px !important; color: #1d2a4a !important; font: 600 12.5px Kanit, sans-serif !important; display: inline-flex !important; align-items: center; gap: 5px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-filters button.on{ border-image-source: url(assets/ui/c2-pill-on.png) !important; color: #f6ecd2 !important; }

/* The bag's figure: the arched niche with its pedestal, the level under it; the power on the gold plaque; three chips. */
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll{ grid-template-columns: 56px 1fr 56px; gap: 10px; align-items: stretch; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-col{ justify-content: space-between; gap: 8px; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-slot{ width: 56px; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-niche{ position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 260px;
  background: url(assets/ui/c2-niche.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-niche .doll-look{ position: absolute; left: 4%; right: 4%; bottom: 7%; width: 92%; aspect-ratio: 1; border: 0 !important; background: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-who{ position: absolute; top: 10%; left: 0; right: 0; text-align: center; font: 600 12px Kanit, sans-serif; color: #e9dcff; text-shadow: 0 1px 2px #000; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-who em{ font-style: normal; color: #ffd36a; margin-right: 3px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .power{ display: flex; align-items: center; justify-content: center; gap: 10px; height: 36px; margin: 10px auto 2px; width: 78%;
  background: url(assets/ui/c2-plaque.png) center / 100% 100% no-repeat; padding: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .power small{ display: inline; font: 600 13px 'Noto Serif Thai', serif !important; letter-spacing: .02em !important; color: #5a3d06 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .power small::before, html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .power small::after{ content: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .power b{ display: inline; margin: 0 !important; font: 700 20px/1 'Noto Serif Thai', serif !important; color: #3d2803 !important; text-shadow: 0 1px 0 rgba(255, 245, 210, .7) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .trio{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border: 0 !important; padding: 0 !important; margin: 6px 0 2px; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .trio span{ display: flex; align-items: center; justify-content: center; gap: 4px; height: 30px; padding: 0 6px;
  border: 0 solid transparent; border-image: url(assets/ui/c2-row.png) 30 40 fill / 10px 14px stretch; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .trio span::before{ content: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .trio .tri-ic{ width: 18px; height: 18px; flex: none; background: var(--ic) center / contain no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .trio small{ font: 500 11.5px Kanit, sans-serif !important; letter-spacing: 0 !important; color: #5f5640 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .trio b{ display: inline; font: 700 13.5px Kanit, sans-serif !important; color: #1d2a4a !important; text-shadow: none !important; }
/* Bag proportions (mockup: figure column ~36%): room for the 2-column stats; one row of filters, gear kinds as icons. */
html:not([data-ui="a"],[data-ui="b"]) #win-bag{ width: 1000px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-wrap{ grid-template-columns: 340px 1fr !important; gap: 18px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-left{ border-right: 0 !important; padding-right: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters{ flex-wrap: nowrap !important; gap: 5px !important; align-items: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button.icon-only{ width: 34px; padding: 0 !important; justify-content: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button.icon-only span{ display: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button .fi{ width: 18px; height: 18px; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters button.on .fi[style*="sil-"]{ filter: brightness(2.2) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-filters .sort{ margin-left: auto; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-grid{ gap: 5px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-rib small{ color: #ecd9a6 !important; filter: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-right{ display: flex; flex-direction: column; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-right .bag-detail{ flex: 1; margin-top: 12px; }
/* The picked item's card: icon well · name and lines · actions stacked on the right. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-detail:not(.muted){ display: grid !important; grid-template-columns: auto 1fr auto; align-items: center !important; gap: 16px; padding: 8px 10px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bd-well{ width: 84px; height: 84px; display: grid; place-items: center; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bd-well canvas{ width: 76%; height: 76%; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-detail .bd-info{ align-self: center; font-size: 12.5px; line-height: 1.5; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-detail .bd-info > b:first-child, html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-detail .bd-info .tip-name{ font: 600 17px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-detail .acts{ flex-direction: column; gap: 8px; align-self: center; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-detail .acts .btn{ min-width: 120px; min-height: 36px; font-size: 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-detail.muted{ display: grid !important; place-items: center; color: #8a7a58 !important; }
/* More cards and rows on the same pieces. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.attr-card, .pts, .sk-card, .soc-card, .auto-row, .qcard, .mail-read, .st-title){
  border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 18px 22px stretch !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-item, .mk-line, .gd-row, .gd-task, .rk-row, .mail-item, .bd-row, .qi-row, .shop-row, .set-row){
  border: 0 solid transparent !important; border-image: url(assets/ui/c2-row.png) 30 40 fill / 10px 14px stretch !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-item.sel, .mk-line.sel, .gd-row.on, .bd-row.on, .mail-item.on, .mail-item.sel){
  border-image: url(assets/ui/c2-pill-on.png) 30 40 fill / 10px 14px stretch !important; background: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .sk-card.passive{ border-image-source: url(assets/ui/c2-card.png) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title::before{ top: -50px !important; height: 58px !important; width: 190px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title{ padding-top: 10px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.auto-row, .qcard, .sk-card, .soc-card){ padding: 10px 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .pt-main{ flex: none !important; margin: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title > .btn:not(.close){ position: absolute; right: 62px; top: 50%; transform: translateY(-50%); margin: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .map-hint{ position: absolute; left: 24px; top: 50%; transform: translateY(-50%); font: 500 11.5px Kanit, sans-serif; color: #c9bfa6 !important; letter-spacing: 0; text-shadow: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-cell{ border: 0 !important; border-image: none !important; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat !important; padding: 4px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-cell.vt-empty{ background-image: url(assets/ui/c2-slot-empty.png) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-cell.on{ background-image: url(assets/ui/c2-slot-on.png) !important; background-size: 112% 112% !important; filter: drop-shadow(0 0 5px rgba(255, 200, 70, .6)); }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-cell .n, html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-cell b{ color: #fff !important; text-shadow: 0 0 2px #0b1430, 0 0 2px #0b1430, 0 1px 2px #000 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-pick{ border: 0 !important; border-image: none !important; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat !important; }
/* Text fields: the same recessed ivory well as the amount box. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(input[type="text"], input[type="search"], input:not([type]), input[type="number"], textarea, select){
  border: 1px solid rgba(146, 108, 46, .55) !important; border-radius: 6px !important; background: linear-gradient(180deg, #e9dcc0, #f6eedc) !important;
  box-shadow: inset 0 2px 4px rgba(70, 50, 20, .2) !important; color: #1d2a4a !important; min-height: 32px; padding: 0 10px; }
/* The avatar tab's look / stats switch rides at the right end of its ribbon as two small pills. */
html:not([data-ui="a"],[data-ui="b"]) #win-bag .c-rib .seg{ margin-left: auto; display: inline-flex; gap: 4px; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .c-rib .seg button{ height: 22px; padding: 0 10px; border: 0 solid transparent !important; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 8px 12px stretch !important;
  background: none !important; color: #1d2a4a !important; font: 600 11.5px Kanit, sans-serif; text-shadow: none; display: inline-flex; align-items: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .c-rib .seg button.on{ border-image-source: url(assets/ui/c2-pill-on.png) !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-col{ justify-content: flex-start !important; gap: 10px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-col:only-child, html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll{ align-items: start; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft :is(.cf2-item, .cf2-row){ border: 0 solid transparent !important; border-image: url(assets/ui/c2-row.png) 30 40 fill / 10px 14px stretch !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; margin-bottom: 4px; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-head{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 18px 22px stretch !important; background: none !important; padding: 10px 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-head canvas{ background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat !important; padding: 8px; box-sizing: border-box; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-head :is(h3, p, b, small, span){ color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-head p{ color: #5f5640 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item.on{ border-image-source: url(assets/ui/c2-pill-on.png) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item.on :is(b, small, span){ color: #f6ecd2 !important; }

/* ---- Theme C v2 · skills window (mockup art/source/ui-c2-mock-skills.png): the class tabs; the points on the gold
   plaque with gold rules either side; filigree cards: icon in a navy well with its key number, bold name, gold diamond
   pips, description, the green next-level line, MP / cooldown as small ivory chips, the learn button on the right. */
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-tabs{ gap: 10px; margin: 0 0 8px; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-tabs button{ flex: 1; height: 36px; padding: 0 12px !important; border: 0 solid transparent !important; border-radius: 0 !important; background: none !important; box-shadow: none !important;
  border-image: url(assets/ui/c2-pill.png) 30 40 fill / 12px 16px stretch !important; color: #1d2a4a !important; font: 600 14px 'Noto Serif Thai', serif !important;
  display: inline-flex; align-items: center; justify-content: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-tabs button.on{ border-image-source: url(assets/ui/c2-pill-on.png) !important; color: #f6ecd2 !important; text-shadow: 0 1px 2px #000; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts{ position: relative; display: flex !important; align-items: center; justify-content: center; gap: 10px; width: 46%; min-width: 300px; height: 38px; margin: 2px auto 10px !important;
  border: 0 !important; border-image: none !important; background: url(assets/ui/c2-plaque.png) center / 100% 100% no-repeat !important; padding: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::before, html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::after{ content: ''; position: absolute; top: 50%; width: 46%; height: 18px; transform: translateY(-50%);
  background: url(assets/ui/c2-divider.png) center / 100% 100% no-repeat; opacity: .9; pointer-events: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::before{ right: calc(100% + 6px); clip-path: inset(0 50% 0 0); width: 92%; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::after{ left: calc(100% + 6px); clip-path: inset(0 0 0 50%); width: 92%; left: calc(100% - 46% + 6px); }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts small{ font: 600 14px 'Noto Serif Thai', serif !important; color: #4a3204 !important; letter-spacing: 0; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts b{ font: 700 20px/1 'Noto Serif Thai', serif !important; color: #3a2602 !important; text-shadow: 0 1px 0 rgba(255, 245, 210, .8) !important; animation: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts span{ display: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-card{ grid-template-columns: 76px 1fr auto !important; gap: 14px !important; padding: 10px 16px 10px 12px !important; align-items: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-icon{ width: 76px !important; height: 76px !important; padding: 7px !important; border-radius: 0 !important; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-key{ left: -6px !important; top: -6px !important; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 5px;
  background: url(assets/ui/c2-badge.png) center / 100% 100% no-repeat !important; color: #fff3cf !important; font: 700 13px 'Noto Serif Thai', serif !important; border-radius: 0 !important; text-shadow: 0 1px 2px #000 !important; z-index: 2; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-head{ flex-wrap: wrap; row-gap: 2px; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-head b{ font: 700 16px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pips{ flex-basis: 100%; margin: 2px 0 0 !important; gap: 5px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pips i{ width: 11px !important; height: 11px !important; rotate: 45deg; border: 1.5px solid #b8892c !important; background: #fbf3dd !important; box-shadow: none !important; animation: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pips i.on{ background: linear-gradient(135deg, #fff1b0, #f2b836 55%, #b5730e) !important; border-color: #8a5a0c !important; box-shadow: 0 1px 2px rgba(120, 70, 0, .45) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-desc{ color: #2c3650 !important; font-size: 13px !important; margin: 4px 0 1px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-next{ color: #2f7a35 !important; font-size: 12.5px !important; font-weight: 600; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-next span{ color: #2f7a35 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-meta{ gap: 6px !important; margin-top: 6px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-meta span{ height: 22px; display: inline-flex; align-items: center; padding: 0 10px !important; border: 0 solid transparent !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-pill.png) 30 40 fill / 8px 12px stretch !important; background: none !important; color: #1d2a4a !important; font: 600 12px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-act .btn{ min-width: 108px; min-height: 40px; font: 600 15px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-act .sk-max{ display: inline-flex; align-items: center; justify-content: center; min-width: 108px; height: 38px; border: 0 solid transparent;
  border-image: url(assets/ui/c2-plaque.png) 20 40 fill / 10px 16px stretch; color: #4a3204 !important; font: 700 14px 'Noto Serif Thai', serif; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-tag{ display: inline-flex; align-items: center; height: 20px; padding: 0 12px !important; border-radius: 0 !important; border: 0 solid transparent;
  border-image: url(assets/ui/c2-plaque.png) 20 40 fill / 8px 12px stretch; background: none !important; color: #4a3204 !important; font: 700 11.5px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::before, html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::after{ width: 220px !important; clip-path: none !important; background-size: 200% 100% !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::before{ right: calc(100% + 4px) !important; left: auto !important; background-position: left center !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pts::after{ left: calc(100% + 4px) !important; background-position: right center !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills{ width: min(1100px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-list{ gap: 8px 12px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-card{ grid-template-columns: 64px 1fr auto !important; gap: 12px !important; padding: 8px 14px 8px 10px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-icon{ width: 64px !important; height: 64px !important; padding: 6px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-head{ flex-wrap: nowrap; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pips{ flex-basis: auto; margin: 0 0 0 6px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-desc{ margin: 2px 0 0 !important; line-height: 1.35 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-next{ line-height: 1.35 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-meta{ margin-top: 4px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-act .btn{ min-width: 96px; min-height: 36px; }
html:not([data-ui="a"],[data-ui="b"]) #win-skills .pips i:not(.on){ background: #eadcb8 !important; box-shadow: inset 0 0 0 1.5px #b8892c !important; }

/* ---- Theme C v2 · NPC shop (mockup art/source/ui-c2-mock-shop.png): round portrait in a gold ring beside a speech
   bubble; wide tabs; a ribbon over the list; rows = icon in a navy well · bold name + grey line · "มี n" over the price;
   the chosen row navy; the detail card centred (big icon well, name, line, stepper, presets, total, one big button). */
html:not([data-ui="a"],[data-ui="b"]) #win-shop{ width: min(1040px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-top{ display: flex; align-items: center; gap: 14px; margin: 0 0 8px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-who{ width: 78px !important; height: 78px !important; flex: none; border-radius: 50% !important; border: 3px solid #d9a92e !important;
  box-shadow: 0 0 0 2px #7a5410, 0 0 0 5px #f0c75a, 0 3px 8px rgba(0, 0, 0, .35) !important; background: radial-gradient(circle at 50% 35%, #5b6fa8, #1f3566) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-top .dlg-text{ position: relative; flex: 1; margin: 0 0 0 8px !important; padding: 10px 18px !important; font: 600 14.5px 'Noto Serif Thai', serif !important; color: #1d2a4a !important;
  border: 0 solid transparent; border-image: url(assets/ui/c2-row.png) 30 40 fill / 12px 16px stretch; background: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-top .dlg-text::before{ content: ''; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%) rotate(45deg);
  background: #fbf1da; border-left: 2px solid #c99a33; border-bottom: 2px solid #c99a33; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop > .body > .bag-tabs{ display: flex; gap: 10px; margin: 0 0 10px 92px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop > .body > .bag-tabs .bag-tab{ flex: 1; height: 36px; border: 0 solid transparent !important; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 12px 16px stretch !important;
  background: none !important; color: #1d2a4a !important; font: 600 15px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop > .body > .bag-tabs .bag-tab.on{ border-image-source: url(assets/ui/c2-pill-on.png) !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-wrap:not(.forge):not(.smelt){ grid-template-columns: 1.45fr 1fr !important; gap: 16px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-left > .c-rib{ margin-bottom: 8px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-items{ gap: 6px !important; max-height: 470px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-item{ grid-template-columns: 58px 1fr auto !important; gap: 12px !important; padding: 6px 14px 6px 8px !important; min-height: 64px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-item > canvas{ width: 54px !important; height: 54px !important; padding: 6px; box-sizing: border-box; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-name b{ font: 700 15px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; filter: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-name small{ font-size: 12px !important; color: #6c6350 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-price{ display: grid; justify-items: end; gap: 2px; padding-left: 14px; border-left: 1px solid rgba(184, 137, 44, .45); }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-price small{ font: 600 12px Kanit, sans-serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-price .gold, html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-price .cur{ font: 700 15px Kanit, sans-serif !important; color: #1d2a4a !important; filter: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-item.sel :is(.shop-name b, .shop-name small, .shop-price small, .shop-price .gold, .shop-price .cur){ color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-detail:not(.fg):not(.muted){ display: flex !important; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 20px !important; text-align: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-big{ align-items: center; gap: 4px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-big canvas{ width: 96px !important; height: 96px !important; padding: 12px; box-sizing: border-box; border-radius: 0 !important; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-big small{ font: 600 13px Kanit, sans-serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-info{ text-align: center; color: #2c3650; font-size: 13px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-info > b:first-child{ font: 700 21px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; margin-bottom: 2px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .qty{ width: 240px; margin: 2px auto 0; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-total{ align-items: center; border-top: 0 !important; padding-top: 18px !important; position: relative; font: 700 16px 'Noto Serif Thai', serif !important; color: #1d2a4a; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-total::before{ content: ''; position: absolute; left: 0; right: 0; top: 0; height: 16px; background: url(assets/ui/c2-divider.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-total b, html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-total .cur{ font: 700 22px Kanit, sans-serif !important; color: #1d2a4a !important; filter: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-acts .btn{ min-height: 46px; font: 700 18px 'Noto Serif Thai', serif !important; }

/* ---- Theme C v2 · second parts sheet (art/source/ui-c2-kit2.png → scripts/ui-c2-kit2-crop.json + ui-dehalo):
   angled tabs, angled big buttons (primary / secondary / disabled), the rounded primary, the square −/+ button, the
   speech bubble, the portrait ring, the gold tag, the ribbon with its right divider, the number field, list rows. */
/* Section ribbons: the star end and (when there is a count) the divider end stay their size. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-rib{ border-image: url(assets/ui/c-ribbon.png) 0 40 0 95 fill / 0 16px 0 38px stretch !important; height: 30px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-rib:has(small){ border-image: url(assets/ui/c2-ribbon.png) 0 205 0 130 fill / 0 64px 0 40px stretch !important; padding-right: 12px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-rib:has(small) small{ min-width: 44px; text-align: center; }
/* Tabs: angled ends. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button, .sk-tabs button){
  border: 0 solid transparent !important; border-image: url(assets/ui/c2-tab.png) 0 52 0 52 fill / 0 20px 0 20px stretch !important; background: none !important; box-shadow: none !important;
  border-radius: 0 !important; min-height: 34px; padding: 0 24px !important; color: #1d2a4a !important; font-weight: 600 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab.on, .qb-tabs button.on, .mk-seg button.on, .shop-tabs button.on, .tabs button.on, .sk-tabs button.on){
  border-image-source: url(assets/ui/c2-tab-on.png) !important; color: #f6ecd2 !important; text-shadow: 0 1px 2px #000 !important; }
/* Buttons: secondary ivory pill, primary navy rounded, disabled greyed; the big action buttons angled. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 11px 15px stretch !important; background: none !important;
  box-shadow: none !important; border-radius: 0 !important; color: #1d2a4a !important; text-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.btn.primary, .btn.go){ border-image: url(assets/ui/c2-btn-round.png) 34 44 fill / 11px 15px stretch !important; color: #f6ecd2 !important; text-shadow: 0 1px 2px #000 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.ok{ border-image: url(assets/ui/c2-pill.png) 30 40 fill / 11px 15px stretch !important; color: #23602c !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.danger{ border-image: url(assets/ui/c-btn-danger.png) 26 fill / 10px stretch !important; color: #fff1e8 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn.on:not(.primary){ border-image: url(assets/ui/c2-pill-on.png) 30 40 fill / 11px 15px stretch !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .btn:disabled{ filter: grayscale(.85) opacity(.6) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-acts .btn, .sm-acts .btn, .fg-go, .bag-detail .acts .btn.primary){
  border-image: url(assets/ui/c2-btn2.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-acts .btn.primary, .sm-acts .btn.primary, .fg-go.primary, .bag-detail .acts .btn.primary){
  border-image: url(assets/ui/c2-btn.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-acts, .sm-acts, .bag-detail .acts) .btn:disabled{ border-image: url(assets/ui/c2-btn-off.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; filter: none !important; color: #f0f0f0 !important; }
/* The amount box: square navy −/+ and the recessed field. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .qty .btn{ border-image: url(assets/ui/c2-square.png) 36 fill / 10px stretch !important; color: #f6ecd2 !important; font-weight: 700 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .qty input{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-field.png) 36 44 fill / 11px 14px stretch !important; background: none !important; box-shadow: none !important; }
/* List rows. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-item, .mk-line, .gd-row, .gd-task, .rk-row, .mail-item, .bd-row, .qi-row, .shop-row, .set-row){
  border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.shop-item.sel, .mk-line.sel, .gd-row.on, .bd-row.on, .mail-item.on, .mail-item.sel){
  border-image: url(assets/ui/c2-row-on.png) 40 50 fill / 12px 15px stretch !important; }
/* The gold tag (Passive, SHIFT, small labels). */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .sk-tag{ border-image: url(assets/ui/c2-tag.png) 0 40 0 40 fill / 0 12px 0 12px stretch !important; height: 22px; padding: 0 14px !important; }
/* NPC portrait in the gold ring; the greeting in a speech bubble. */
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-who{ border: 9px solid transparent !important; border-image: url(assets/ui/c2-ring.png) 60 fill / 22px stretch !important; box-shadow: none !important;
  width: 92px !important; height: 92px !important; border-radius: 50% !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-top .dlg-text{ border-image: url(assets/ui/c2-bubble.png) 40 50 40 70 fill / 14px 16px 14px 24px stretch !important; padding: 12px 18px 12px 30px !important; margin-left: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-top .dlg-text::before{ content: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop > .body > .bag-tabs .bag-tab, html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-tabs button{ border-image: url(assets/ui/c2-tab.png) 0 52 0 52 fill / 0 20px 0 20px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop > .body > .bag-tabs .bag-tab.on, html:not([data-ui="a"],[data-ui="b"]) #win-skills .sk-tabs button.on{ border-image-source: url(assets/ui/c2-tab-on.png) !important; }
/* The frame image's parchment is cut out (no 9-slice seams); the window paints one even parchment under it. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){
  background: radial-gradient(120% 90% at 50% 0%, #fbf3df 0%, #f6ebd1 55%, #efe0bf 100%) !important; background-clip: padding-box !important;
  border-radius: 18px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){ background-clip: border-box !important; background-origin: border-box !important; }

/* ---- Theme C v2 · quest book (mockup art/source/ui-c2-mock-quests.png): angled tabs with gold count badges; the
   doing / all toggle as one two-part pill; cards: round portrait in a gold ring, a gold chapter tag over the bold title,
   the step pill at the right; a vertical gold timeline (done = gold check, now = glowing navy dot with its bar in a
   well, upcoming = hollow); the map pin; a gold divider; reward chips as ivory pills; the go button angled navy. */
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-tabs{ gap: 8px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-tabs button{ flex: 1 !important; height: 38px; font: 700 15px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-tabs em{ display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px !important; border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #fff3c0, #f0b733 60%, #a8700e) !important; color: #3a2602 !important; font: 700 12px Kanit, sans-serif !important;
  box-shadow: 0 0 0 1px #7a5410, 0 1px 2px rgba(0, 0, 0, .35); text-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-view{ gap: 0 !important; margin: 8px 0 2px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-view button{ height: 28px; padding: 0 14px !important; border: 0 solid transparent !important; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 10px 14px stretch !important;
  color: #1d2a4a !important; font: 600 12.5px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-view button.on{ border-image-source: url(assets/ui/c2-pill-on.png) !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-card{ padding: 14px 18px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-top{ grid-template-columns: 64px 1fr auto !important; gap: 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-who{ width: 64px !important; height: 64px !important; border-radius: 50% !important; border: 7px solid transparent !important;
  border-image: url(assets/ui/c2-ring.png) 60 fill / 16px stretch !important; background: radial-gradient(circle at 50% 35%, #5b6fa8, #1f3566) !important; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-card.compact .qb-who{ width: 52px !important; height: 52px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-card.compact .qb-top{ grid-template-columns: 52px 1fr auto !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-title small{ align-self: flex-start; height: 20px; display: inline-flex; align-items: center; padding: 0 12px; margin-bottom: 3px; border: 0 solid transparent;
  border-image: url(assets/ui/c2-tag.png) 0 40 0 40 fill / 0 11px 0 11px stretch; color: #4a3204 !important; font: 700 11.5px Kanit, sans-serif !important; opacity: 1 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-title b{ font: 700 19px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-state{ height: 26px; display: inline-flex; align-items: center; padding: 0 14px !important; border: 0 solid transparent !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-btn-round.png) 34 44 fill / 10px 14px stretch !important; background: none !important; color: #f6ecd2 !important; font: 600 12.5px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-desc{ color: #4a4636 !important; font-size: 13px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps{ margin: 10px 0 0 22px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li{ grid-template-columns: 22px 1fr !important; gap: 10px !important; padding-bottom: 9px !important; font: 600 14px 'Noto Serif Thai', serif !important; color: #8d8573 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li::before{ left: 10.5px !important; top: 18px !important; width: 2px !important; background: linear-gradient(180deg, #d9a92e, #b8892c) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li > i{ width: 18px !important; height: 18px !important; margin: 1px 0 0 2px !important; border-radius: 50% !important; border: 2px solid #c99a33 !important; background: #fbf3dd !important; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li.ok{ color: #6f6551 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li.ok > i{ background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c) !important; border-color: #7a5410 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li.ok > i::after{ content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font: 900 11px/1 sans-serif; color: #3a2602; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li.now{ color: #1d2a4a !important; font-weight: 700 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li.now > i{ background: radial-gradient(circle at 40% 35%, #4f6db0, #1f3566 70%) !important; border-color: #f0c75a !important;
  box-shadow: 0 0 0 3px rgba(255, 210, 90, .35), 0 0 10px rgba(255, 190, 60, .9) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li small{ color: #9b4a1a !important; font-weight: 500; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li .qbar{ height: 10px !important; max-width: 320px !important; margin-top: 6px !important; border-radius: 6px !important; background: #efe2c2 !important;
  box-shadow: inset 0 1px 2px rgba(70, 50, 20, .3), 0 0 0 1px #c99a33 !important; overflow: hidden; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-steps li .qbar i{ background: linear-gradient(180deg, #4f6db0, #1f3566) !important; border-radius: 6px; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-where{ font: 600 13px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-where svg{ stroke: #c0392b !important; width: 15px !important; height: 15px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-foot{ position: relative; border-top: 0 !important; padding-top: 16px !important; align-items: center !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-foot::before{ content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: url(assets/ui/c2-divider.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-reward .pc-chip, html:not([data-ui="a"],[data-ui="b"]) #win-quests .qc-rewards .pc-chip{ height: 28px; display: inline-flex; align-items: center; gap: 5px; padding: 0 12px 0 8px !important;
  border: 0 solid transparent !important; border-radius: 0 !important; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 10px 14px stretch !important; background: none !important;
  color: #1d2a4a !important; font: 600 12.5px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-reward .ci-icon{ width: 22px !important; height: 22px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-go .btn{ border-image: url(assets/ui/c2-btn.png) 0 50 0 50 fill / 0 18px 0 18px stretch !important; color: #f6ecd2 !important; min-height: 34px; padding: 0 22px !important; font: 700 14px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-go .btn:not(.primary):not(.go){ border-image-source: url(assets/ui/c2-btn2.png) !important; color: #1d2a4a !important; text-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-sum{ padding: 6px 8px 0 !important; font: 700 14px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-sum .qbar.story{ height: 12px !important; max-width: 320px !important; border-radius: 7px; background: #efe2c2 !important; box-shadow: inset 0 1px 2px rgba(70, 50, 20, .3), 0 0 0 1.5px #c99a33 !important; overflow: hidden; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-sum .qbar.story i{ background: linear-gradient(180deg, #4f6db0, #1f3566) !important; }
/* ---- Theme C v2 · stats window (mockup art/source/ui-c2-mock-stats.png): points on a gold plaque with gold rules
   either side; attribute cards = big icon in a navy well · code + bold name · big number · gain line · +1 navy / +5
   ivory; the power plaque with rules; slim icon rows below. */
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts{ position: relative; display: flex !important; align-items: center; justify-content: center; gap: 10px; width: 58%; height: 38px; margin: 4px auto 10px !important;
  border: 0 !important; border-image: none !important; background: url(assets/ui/c2-plaque.png) center / 100% 100% no-repeat !important; padding: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts::before, html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts::after, html:not([data-ui="a"],[data-ui="b"]) #win-stats .power::before, html:not([data-ui="a"],[data-ui="b"]) #win-stats .power::after{
  content: ''; position: absolute; top: 50%; width: 120px; height: 16px; transform: translateY(-50%); background: url(assets/ui/c2-divider.png) center / 200% 100% no-repeat; pointer-events: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts::before, html:not([data-ui="a"],[data-ui="b"]) #win-stats .power::before{ right: calc(100% + 4px); background-position: left center; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts::after, html:not([data-ui="a"],[data-ui="b"]) #win-stats .power::after{ left: calc(100% + 4px); background-position: right center; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts small{ font: 700 14.5px 'Noto Serif Thai', serif !important; color: #4a3204 !important; letter-spacing: 0; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts b{ font: 700 20px/1 'Noto Serif Thai', serif !important; color: #3a2602 !important; text-shadow: 0 1px 0 rgba(255, 245, 210, .8) !important; animation: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .pts span{ display: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .power{ position: relative; width: 52% !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .attr-grid{ gap: 10px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .attr-card{ grid-template-columns: 68px 1fr auto !important; grid-template-areas: 'ic name val' 'ic gain gain' 'ic btns btns' !important; gap: 2px 12px !important; padding: 10px 14px 10px 10px !important; align-items: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .attr-card::before{ content: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-ic{ grid-area: ic; width: 68px; height: 68px; display: grid; place-items: center; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-ic .sti{ width: 48px !important; height: 48px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-name small{ font: 700 12px 'Noto Serif Thai', serif !important; letter-spacing: .06em; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-name b{ font: 700 19px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-val{ font: 700 30px/1 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-gain{ font-size: 12px !important; color: #6c6350 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-btns{ gap: 8px !important; margin-top: 4px; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .ac-btns .btn{ min-height: 30px; font: 700 15px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .bag-stats .st{ min-height: 30px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .bag-stats .st span{ font: 600 13px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .bag-stats .st b{ font: 700 14px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .bag-stats .sti{ width: 22px !important; height: 22px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats{ width: min(1060px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .st-cols{ grid-template-columns: 1.2fr 1fr !important; gap: 22px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-stats .rd-wrap, html:not([data-ui="a"],[data-ui="b"]) #win-stats .st-right svg{ max-height: 240px; }
/* ---- Theme C v2 · events + mail (mockup art/source/ui-c2-mock-events-mail.png). */
html:not([data-ui="a"],[data-ui="b"]) #win-events{ width: min(760px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-grid{ gap: 6px !important; margin: 4px 0 10px; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day{ min-height: 118px !important; padding: 26px 4px 8px !important; gap: 4px !important; justify-content: flex-start; align-items: center;
  border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 14px 16px stretch !important; filter: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day small{ position: absolute; top: 5px; left: 50%; transform: translateX(-50%); height: 18px; display: inline-flex; align-items: center; padding: 0 10px; white-space: nowrap;
  border: 0 solid transparent; border-image: url(assets/ui/c2-tag.png) 0 40 0 40 fill / 0 9px 0 9px stretch; color: #4a3204 !important; font: 700 11px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day canvas{ width: 46px !important; height: 46px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day span{ font: 700 12px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; text-align: center; line-height: 1.2; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day.done{ opacity: 1 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day.done > :not(i){ opacity: .55; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day i{ position: static !important; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; margin-top: 2px;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c); color: #3a2602 !important; font: 900 13px/1 sans-serif !important; box-shadow: 0 0 0 1px #7a5410; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day.today{ border-image: url(assets/ui/c2-card.png) 50 60 fill / 14px 16px stretch !important; filter: drop-shadow(0 0 6px rgba(255, 196, 60, .9)) drop-shadow(0 0 2px #f0c75a) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day.today em{ position: static; height: 20px; display: inline-flex; align-items: center; padding: 0 10px; border: 0 solid transparent; border-image: url(assets/ui/c2-btn-round.png) 34 44 fill / 8px 12px stretch;
  color: #f6ecd2 !important; font: 700 11px Kanit, sans-serif; font-style: normal; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .login-day:last-child{ background: radial-gradient(circle at 50% 55%, rgba(255, 214, 110, .55), transparent 70%) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qlist{ gap: 6px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qcard{ display: grid !important; grid-template-columns: 1fr auto auto; grid-template-areas: 'head rew btn' 'prog rew btn'; column-gap: 12px; align-items: center; padding: 8px 14px !important;
  border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-head{ grid-area: head; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-head b{ font: 700 15px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-state{ display: none; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-prog{ grid-area: prog; display: flex; align-items: center; gap: 10px; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-prog .qbar{ flex: 1; height: 10px !important; border-radius: 6px; background: #efe2c2 !important; box-shadow: inset 0 1px 2px rgba(70, 50, 20, .3), 0 0 0 1px #c99a33 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-prog .qbar i{ background: linear-gradient(180deg, #4f6db0, #1f3566) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-foot{ display: contents; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-rewards{ grid-area: rew; display: flex; gap: 5px; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-rewards .pc-chip{ height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 0 12px 0 8px !important; border: 0 solid transparent !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-pill.png) 30 40 fill / 10px 14px stretch !important; background: none !important; color: #1d2a4a !important; font: 600 12.5px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qc-foot > .btn{ grid-area: btn; min-width: 104px; min-height: 32px; }
html:not([data-ui="a"],[data-ui="b"]) #win-events .qcard .btn.ok{ border-image: url(assets/ui/c2-btn-round.png) 34 44 fill / 11px 15px stretch !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail{ width: min(820px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-wrap{ grid-template-columns: 300px 1fr !important; gap: 16px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-list{ gap: 6px !important; max-height: 420px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item{ display: grid; grid-template-columns: 50px 1fr; gap: 10px; align-items: center; padding: 6px 12px 6px 6px !important; position: relative; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item canvas{ width: 46px; height: 46px; padding: 7px; box-sizing: border-box; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item b{ font: 700 14px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item b::before{ content: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item.unread::after{ content: ''; position: absolute; top: 9px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: #d8343c; box-shadow: 0 0 0 1.5px #fff3d6, 0 0 4px #d8343c; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item small{ font-size: 12px !important; color: #6c6350 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item.active{ border-image: url(assets/ui/c2-row-on.png) 40 50 fill / 12px 15px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item.active :is(b, small){ color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-item.claimed{ opacity: .6; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read{ display: flex; flex-direction: column; gap: 8px; padding: 18px 22px !important; min-height: 380px; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read .quest-name{ font: 700 24px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read > .muted{ color: #6c6350 !important; font-size: 13px !important; padding-bottom: 12px; position: relative; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read > .muted::after{ content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 14px; background: url(assets/ui/c2-divider.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-body{ flex: 1; font: 500 15px/1.7 'Noto Serif Thai', serif !important; color: #1d2a4a !important; margin: 8px 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-att small{ display: inline-flex; align-items: center; height: 24px; padding: 0 16px; margin-bottom: 6px; border: 0 solid transparent;
  border-image: url(assets/ui/c2-tag.png) 0 40 0 40 fill / 0 12px 0 12px stretch; color: #4a3204 !important; font: 700 13px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-att .pc-chip{ height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 0 12px 0 8px !important; border: 0 solid transparent !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-pill.png) 30 40 fill / 10px 14px stretch !important; background: none !important; color: #1d2a4a !important; font: 600 13px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read > .btn{ float: none !important; align-self: center; min-width: 70%; min-height: 44px; font: 700 18px 'Noto Serif Thai', serif !important;
  border-image: url(assets/ui/c2-btn.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; color: #f6ecd2 !important; text-shadow: 0 1px 2px #000 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read > .btn:disabled{ border-image-source: url(assets/ui/c2-btn-off.png) !important; filter: none !important; color: #f0f0f0 !important; }

/* (Kept out of the shared :is() lists above: an id inside :is() lifts the whole rule's specificity.) */
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item{ border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item.on{ border-image: url(assets/ui/c2-row-on.png) 40 50 fill / 12px 15px stretch !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read > .btn.btn{ border-image: url(assets/ui/c2-btn.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read > .btn.btn:disabled{ border-image: url(assets/ui/c2-btn-off.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; color: #f0f0f0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.btn.ok, .btn.go, .btn.danger, .btn.primary, .btn.on, .btn){ box-shadow: none !important; border-radius: 0 !important; }
/* ---- Theme C v2 · guild + market (mockup art/source/ui-c2-mock-guild-market.png). */
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-banner{ display: grid !important; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 12px 18px !important;
  border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 18px 22px stretch !important; background: none !important; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-banner > :first-child{ padding: 8px; border: 0 solid transparent; border-image: url(assets/ui/c2-ring.png) 60 fill / 18px stretch; border-radius: 50%; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-title b{ font: 700 26px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-title span{ font: 500 14px 'Noto Serif Thai', serif !important; color: #6c6350 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-exp{ height: 14px !important; border-radius: 8px !important; background: #efe2c2 !important; box-shadow: inset 0 1px 2px rgba(70, 50, 20, .3), 0 0 0 1.5px #c99a33 !important; overflow: hidden; margin-top: 6px; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-exp i{ background: linear-gradient(90deg, #1f3566, #3e5fa8 70%, #e2b648) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-title small{ font: 600 12px Kanit, sans-serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-perk{ padding: 8px 14px; text-align: center; border: 0 solid transparent; border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-perk small{ color: #6c6350 !important; } html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-perk b{ font: 700 14px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .mk-seg{ display: flex !important; gap: 4px !important; flex-wrap: nowrap; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .mk-seg button{ flex: 1 1 auto; padding: 0 14px !important; min-height: 34px; font: 600 13px 'Noto Serif Thai', serif !important; white-space: nowrap; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mtable{ border: 0 solid transparent; border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch; padding: 0 0 4px; overflow: hidden; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mhead{ height: 34px; align-items: center; border: 0 solid transparent !important; border-image: url(assets/ui/c2-row-on.png) 40 50 fill / 12px 15px stretch !important; background: none !important;
  color: #f6ecd2 !important; font: 700 13.5px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mhead span{ color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow{ min-height: 38px; border: 0 !important; border-image: none !important; border-bottom: 1px solid rgba(184, 137, 44, .35) !important; background: none !important; border-radius: 0 !important;
  font: 600 14px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow b, html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow span{ color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow.sel{ background: rgba(31, 53, 102, .12) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow .gd-dot{ background: #9a937f; box-shadow: none; } html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow.on .gd-dot{ background: #3fae4a; box-shadow: 0 0 5px #3fae4a; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow .rk-leader{ display: inline-flex; justify-content: center; height: 24px; align-items: center; padding: 0 12px; border: 0 solid transparent; border-image: url(assets/ui/c2-tag.png) 0 40 0 40 fill / 0 11px 0 11px stretch; color: #4a3204 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-mrow :is(.rk-officer, .rk-member){ display: inline-flex; justify-content: center; height: 24px; align-items: center; padding: 0 12px; border: 0 solid transparent; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 9px 12px stretch; }
html:not([data-ui="a"],[data-ui="b"]) #win-guild .gd-bar{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 16px 20px stretch !important; background: none !important; padding: 8px 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-top .mk-seg{ gap: 6px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-seg button{ min-width: 120px; min-height: 36px; font: 700 15px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-collect, html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-gold{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-btn-round.png) 34 44 fill / 11px 15px stretch !important; background: none !important;
  filter: hue-rotate(-95deg) saturate(1.2) brightness(1.05); color: #eaffe8 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-find button{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-pill.png) 30 40 fill / 10px 14px stretch !important; background: none !important; height: 28px; padding: 0 10px !important; border-radius: 0 !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-find button.on{ border-image-source: url(assets/ui/c2-pill-on.png) !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-line{ min-height: 60px; padding: 6px 14px 6px 8px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-line canvas{ padding: 6px; box-sizing: border-box; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-line b{ font: 700 15px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-line.sel b{ color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-card canvas{ background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; padding: 10px; box-sizing: border-box; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-pr{ border: 0 solid transparent; border-image: url(assets/ui/c2-row2.png) 40 50 fill / 10px 14px stretch; padding: 4px 12px; }
html:not([data-ui="a"],[data-ui="b"]) #win-market .mk-link{ color: #1f3566 !important; font: 700 13px 'Noto Serif Thai', serif; text-decoration: underline; text-underline-offset: 3px; }
/* ---- Theme C v2 · auto + vault (mockup art/source/ui-c2-mock-auto-vault.png). */
html:not([data-ui="a"],[data-ui="b"]) #win-auto{ width: min(560px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-row{ padding: 10px 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-row b{ font: 700 15px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-row small{ color: #6c6350 !important; font-size: 12px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-row.col > div:first-child{ margin: -10px -14px 8px; padding: 0 14px 0 44px; height: 30px; display: flex; align-items: center; gap: 10px;
  border: 0 solid transparent; border-image: url(assets/ui/c-ribbon.png) 0 40 0 95 fill / 0 16px 0 38px stretch; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-row.col > div:first-child b{ color: #f6ecd2 !important; text-shadow: 0 1px 2px #000; font-size: 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-row.col > div:first-child small{ color: #e3cf96 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-card{ padding: 8px 6px 8px !important; border: 0 solid transparent !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-card.png) 50 60 / 12px 14px stretch !important; background: radial-gradient(circle at 50% 38%, #4b3f8a, #1d2550 75%) !important; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-card b{ color: #f6ecd2 !important; font: 700 12.5px 'Noto Serif Thai', serif !important; text-shadow: 0 1px 2px #000; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-card small{ color: #e3cf96 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-card .tick{ width: 20px !important; height: 20px !important; top: 6px !important; right: 6px !important; border: 1.5px solid #c99a33 !important; background: rgba(20, 24, 50, .6) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-card.on .tick{ background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c) !important; border-color: #7a5410 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-card.on .tick::after{ left: 6.5px !important; top: 3px !important; border-color: #3a2602 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .auto-card.on{ filter: drop-shadow(0 0 5px rgba(255, 200, 70, .6)); }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .seg{ gap: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .seg button{ height: 34px; border: 0 solid transparent !important; border-radius: 0 !important; border-image: url(assets/ui/c2-tab.png) 0 52 0 52 fill / 0 18px 0 18px stretch !important;
  background: none !important; color: #1d2a4a !important; font: 700 14px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto .seg button.on{ border-image-source: url(assets/ui/c2-tab-on.png) !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto input[type="checkbox"]{ appearance: none; width: 52px; height: 26px; border-radius: 14px !important; min-height: 0; padding: 0 !important; position: relative; cursor: pointer;
  background: linear-gradient(180deg, #1b2a52, #2b3f78) !important; border: 2px solid #c99a33 !important; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto input[type="checkbox"]::after{ content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; transition: left .15s;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
html:not([data-ui="a"],[data-ui="b"]) #win-auto input[type="checkbox"]:checked{ background: linear-gradient(180deg, #2f7a35, #4caf50) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-auto input[type="checkbox"]:checked::after{ left: 28px; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-arrow{ width: 54px; height: 64px; border: 0 solid transparent !important; border-image: url(assets/ui/c2-square.png) 36 fill / 12px stretch !important; background: none !important;
  border-radius: 0 !important; color: #f6ecd2 !important; display: grid; place-items: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-arrow i{ color: #ffd36a !important; font-style: normal; font-size: 20px; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-arrow span{ color: #f6ecd2 !important; font: 700 13px 'Noto Serif Thai', serif; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-arrow:disabled{ filter: grayscale(.8) opacity(.5); }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-bar{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 18px 22px stretch !important; background: none !important; padding: 10px 16px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-info b{ font: 700 18px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-step .btn{ border-image: url(assets/ui/c2-square.png) 36 fill / 10px stretch !important; color: #f6ecd2 !important; min-width: 36px; min-height: 34px; }
html:not([data-ui="a"],[data-ui="b"]) #win-vault .vt-qty{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-field.png) 36 44 fill / 11px 14px stretch !important; background: none !important; box-shadow: none !important; }
/* ---- Theme C v2 · craft + forge (mockup art/source/ui-c2-mock-craft-forge.png). */
html:not([data-ui="a"],[data-ui="b"]) #win-craft{ width: min(980px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item{ min-height: 62px; padding: 6px 14px 6px 8px !important; gap: 12px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item canvas{ width: 50px !important; height: 50px !important; padding: 6px; box-sizing: border-box; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item b{ font: 700 15px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item small{ font: 600 12.5px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-item.on b{ color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-head canvas{ width: 84px !important; height: 84px !important; padding: 10px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-head h3{ font: 700 22px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-tags span, html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-tags b{ display: inline-flex; align-items: center; height: 26px; padding: 0 16px; border: 0 solid transparent; border-image: url(assets/ui/c2-tag.png) 0 40 0 40 fill / 0 13px 0 13px stretch;
  color: #4a3204 !important; font: 700 14px 'Noto Serif Thai', serif !important; background: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-need > :first-child, html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-card > small{ display: flex; justify-content: center; align-items: center; height: 30px; margin: 4px auto 6px; width: 46%;
  border: 0 solid transparent; border-image: url(assets/ui/c2-tab-on.png) 0 52 0 52 fill / 0 18px 0 18px stretch; color: #f6ecd2 !important; font: 700 14px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-row{ min-height: 52px; padding: 4px 12px 4px 6px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-row canvas{ padding: 5px; box-sizing: border-box; background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-nm{ font: 700 14px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-n{ font: 700 16px Kanit, sans-serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-foot{ display: flex; flex-direction: column; align-items: center; gap: 8px; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go{ display: flex !important; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; width: 100%; border: 0 !important; border-image: none !important; background: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go [data-cq]{ width: 40px; min-height: 36px; border-image: url(assets/ui/c2-square.png) 36 fill / 10px stretch !important; color: #f6ecd2 !important; font-size: 18px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go .cf2-n{ width: 90px; height: 36px; text-align: center; border: 0 solid transparent !important; border-image: url(assets/ui/c2-field.png) 36 44 fill / 11px 14px stretch !important; background: none !important; box-shadow: none !important; font: 700 16px Kanit, sans-serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go [data-cmax]{ min-height: 32px; padding: 0 16px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go [data-craft]{ flex: 0 0 82%; min-height: 46px; font: 700 18px 'Noto Serif Thai', serif !important; border-image: url(assets/ui/c2-btn.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go [data-craft]:disabled{ border-image-source: url(assets/ui/c2-btn-off.png) !important; filter: none !important; color: #f0f0f0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-list .shop-item{ min-height: 60px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-ring{ width: 150px !important; height: 150px !important; border: 0 !important; background: radial-gradient(circle, #ffdd7a 0%, #e09a1c 45%, #9a5a0a 72%, transparent 73%) !important;
  box-shadow: 0 0 0 4px #f0c75a, 0 0 0 7px #7a5410, 0 0 24px rgba(255, 190, 60, .7) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-halo{ border-color: rgba(255, 245, 210, .55) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-name{ font: 700 22px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-name b{ color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-cmp > div{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch !important; border-radius: 0 !important; padding: 8px 10px !important; background: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-cmp > div.nx{ border-image-source: url(assets/ui/c2-row-on.png) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-cmp > div :is(small, b){ color: #1d2a4a !important; opacity: 1 !important; font-family: 'Noto Serif Thai', serif; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-cmp > div.nx :is(small, b){ color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-cmp > i{ color: #e2a52b !important; opacity: 1 !important; font-size: 22px; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-cost > span{ padding: 6px 14px 6px 8px; border: 0 solid transparent; border-image: url(assets/ui/c2-row2.png) 40 50 fill / 10px 14px stretch; color: #1d2a4a !important; font-weight: 600; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-rate{ font: 700 18px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-rate b{ color: #1d2a4a !important; font-size: 20px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-pity{ padding: 4px 14px; border: 0 solid transparent; border-image: url(assets/ui/c2-row2.png) 40 50 fill / 10px 14px stretch; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-opt input[type="checkbox"]{ appearance: none; width: 20px; height: 20px; min-height: 0; padding: 0 !important; border-radius: 4px !important; border: 2px solid #c99a33 !important;
  background: #fbf3dd !important; box-shadow: inset 0 1px 2px rgba(70, 50, 20, .3) !important; position: relative; vertical-align: middle; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-opt input[type="checkbox"]:checked{ background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-opt input[type="checkbox"]:checked::after{ content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font: 900 13px/1 sans-serif; color: #3a2602; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .fg-go{ min-width: 70% !important; min-height: 46px; font: 700 18px 'Noto Serif Thai', serif !important; border-image: url(assets/ui/c2-btn.png) 0 50 0 50 fill / 0 22px 0 22px stretch !important; color: #f6ecd2 !important; }
/* ---- Theme C v2 · friends + ranking (mockup art/source/ui-c2-mock-social-rank.png). */
html:not([data-ui="a"],[data-ui="b"]) #win-ranking{ width: min(700px, calc(100vw - 40px)) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pod{ display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 8px; align-items: end; margin: 6px 0 10px; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc{ position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 30px 8px 10px; border: 0 solid transparent;
  border-image: url(assets/ui/c2-card.png) 50 60 fill / 14px 16px stretch; text-align: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc.p1{ padding-top: 40px; background: radial-gradient(circle at 50% 30%, rgba(255, 214, 110, .6), transparent 70%); filter: drop-shadow(0 0 6px rgba(255, 196, 60, .6)); }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc.p2{ background: linear-gradient(180deg, rgba(200, 210, 225, .55), transparent); }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc.p3{ background: linear-gradient(180deg, rgba(214, 150, 100, .45), transparent); }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc i{ position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  font: 700 18px 'Noto Serif Thai', serif; font-style: normal; color: #3a2602; box-shadow: 0 0 0 2px #7a5410, 0 2px 4px rgba(0, 0, 0, .4);
  background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c); }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc.p2 i{ background: radial-gradient(circle at 35% 30%, #ffffff, #b9c2cf 60%, #6b7684); color: #2a3240; box-shadow: 0 0 0 2px #59616e, 0 2px 4px rgba(0, 0, 0, .4); }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc.p3 i{ background: radial-gradient(circle at 35% 30%, #ffe2c8, #c98652 60%, #7a4520); color: #3a1c08; box-shadow: 0 0 0 2px #6a3a18, 0 2px 4px rgba(0, 0, 0, .4); }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc.p1 i{ width: 44px; height: 44px; top: -16px; font-size: 22px; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc.p1 i::before{ content: '♛'; position: absolute; top: -18px; font-size: 18px; color: #e2a52b; text-shadow: 0 1px 0 #7a5410; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc b{ font: 700 16px 'Noto Serif Thai', serif; color: #1d2a4a; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc small{ font-size: 12px; color: #6c6350; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-pc em{ font: 700 18px 'Noto Serif Thai', serif; font-style: normal; color: #1d2a4a; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-head{ height: 32px; align-items: center !important; padding: 0 14px !important; border: 0 solid transparent !important; border-image: url(assets/ui/c2-row-on.png) 40 50 fill / 12px 15px stretch !important;
  color: #f6ecd2 !important; font: 700 13px 'Noto Serif Thai', serif !important; letter-spacing: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-head span{ color: #f6ecd2 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-row{ padding: 4px 14px !important; min-height: 40px; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-n{ width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; margin: 0 auto; background: radial-gradient(circle at 40% 35%, #4f6db0, #1f3566 70%);
  color: #f6ecd2 !important; font: 700 15px 'Noto Serif Thai', serif !important; box-shadow: 0 0 0 1.5px #c99a33; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-who b{ font: 700 15px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-who small{ color: #6c6350 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-guild small{ color: #1d2a4a !important; font-weight: 600; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-power{ font: 700 17px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-row.me{ border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch !important; background: radial-gradient(120% 100% at 50% 50%, rgba(255, 214, 110, .55), transparent) !important;
  filter: drop-shadow(0 0 4px rgba(255, 196, 60, .7)); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .mk-pages{ display: flex; justify-content: center; align-items: center; gap: 14px; font: 700 15px 'Noto Serif Thai', serif; color: #1d2a4a; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .mk-pages button{ width: 40px; height: 34px; border: 0 solid transparent !important; border-image: url(assets/ui/c2-square.png) 36 fill / 10px stretch !important;
  background: none !important; color: #f6ecd2 !important; font: 700 18px sans-serif; border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .mk-pages button:disabled{ filter: grayscale(.8) opacity(.5); }
html:not([data-ui="a"],[data-ui="b"]) #win-social .soc-row{ padding: 8px 12px !important; min-height: 56px; border: 0 solid transparent !important; border-radius: 0 !important; border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch !important; background: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-social .soc-row b{ font: 700 16px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-social .soc-row small{ color: #6c6350 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-social .soc-card-row b{ color: #1d2a4a !important; font: 700 15px 'Noto Serif Thai', serif !important; }
/* Ranks 1–3 in the table: gold / silver / bronze medals instead of the navy disc. */
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-row:is(.top1, .top2, .top3) .rk-n.rk-n{ color: #3a2602 !important; background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c) !important; box-shadow: 0 0 0 1.5px #7a5410 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-row.top2 .rk-n.rk-n{ color: #2a3240 !important; background: radial-gradient(circle at 35% 30%, #ffffff, #b9c2cf 60%, #6b7684) !important; box-shadow: 0 0 0 1.5px #59616e !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-ranking .rk-row.top3 .rk-n.rk-n{ color: #3a1c08 !important; background: radial-gradient(circle at 35% 30%, #ffe2c8, #c98652 60%, #7a4520) !important; box-shadow: 0 0 0 1.5px #6a3a18 !important; }
/* ---- Theme C v2 · board, settings, Astra shop, help (mockup art/source/ui-c2-mock-board-settings-gems.png). */
html:not([data-ui="a"],[data-ui="b"]) #win-settings .set-row{ min-height: 46px; padding: 6px 16px !important; margin-bottom: 4px; border: 0 solid transparent !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-row2.png) 40 50 fill / 12px 15px stretch !important; background: none !important; display: grid !important; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; }
html:not([data-ui="a"],[data-ui="b"]) #win-settings .set-row span{ font: 700 14.5px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-settings .set-row b{ font: 700 14px Kanit, sans-serif !important; color: #1d2a4a !important; min-width: 42px; text-align: right; }
html:not([data-ui="a"],[data-ui="b"]) #win-settings input[type="range"]{ appearance: none; -webkit-appearance: none; width: 180px; height: 12px; padding: 0 !important; min-height: 0; border-radius: 7px !important;
  border: 1.5px solid #c99a33 !important; background: linear-gradient(180deg, #1b2a52, #2b3f78) !important; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-settings input[type="range"]::-webkit-slider-thumb{ -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c); box-shadow: 0 0 0 1.5px #7a5410, 0 1px 3px rgba(0, 0, 0, .5); }
html:not([data-ui="a"],[data-ui="b"]) #win-settings input[type="checkbox"]{ appearance: none; width: 56px; height: 28px; border-radius: 15px !important; min-height: 0; padding: 0 !important; position: relative; cursor: pointer;
  background: linear-gradient(180deg, #8a8578, #b3ad9d) !important; border: 2px solid #c99a33 !important; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-settings input[type="checkbox"]::after{ content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; transition: left .15s;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d8d3c6 60%, #8a8578); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
html:not([data-ui="a"],[data-ui="b"]) #win-settings input[type="checkbox"]:checked{ background: linear-gradient(180deg, #1b2a52, #2b3f78) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-settings input[type="checkbox"]:checked::after{ left: 30px; background: radial-gradient(circle at 35% 30%, #fff1b0, #e2a52b 60%, #8a5a0c); }
html:not([data-ui="a"],[data-ui="b"]) #win-gems .gs-card{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 16px 20px stretch !important; background: none !important; padding: 12px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-gems .gs-card canvas{ background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat; padding: 8px; box-sizing: border-box; }
html:not([data-ui="a"],[data-ui="b"]) #win-gems .gs-card b{ font: 700 15px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-gems .gs-top{ flex-direction: column !important; min-height: 130px !important; border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 16px 20px stretch !important;
  background: radial-gradient(circle at 50% 40%, rgba(140, 190, 255, .35), transparent 70%) !important; color: #1d2a4a !important; font: 700 16px 'Noto Serif Thai', serif !important; text-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-gems .gs-top canvas{ width: 72px; height: 72px; }
html:not([data-ui="a"],[data-ui="b"]) #win-gems .gs-top:nth-child(2)::before{ content: 'ยอดนิยม'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); height: 22px; display: inline-flex; align-items: center; padding: 0 14px;
  border: 0 solid transparent; border-image: url(assets/ui/c2-tag.png) 0 40 0 40 fill / 0 11px 0 11px stretch; color: #4a3204; font: 700 12px Kanit, sans-serif; white-space: nowrap; }
html:not([data-ui="a"],[data-ui="b"]) #win-gems .gs-top{ position: relative; }
html:not([data-ui="a"],[data-ui="b"]) #win-board .bd-row{ border-left: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-board .bd-row::before{ content: ''; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--kind, #c0392b); }
html:not([data-ui="a"],[data-ui="b"]) #win-board .bd-row{ position: relative; }
html:not([data-ui="a"],[data-ui="b"]) #win-board .bd-pic{ border-radius: 50%; border: 6px solid transparent; border-image: url(assets/ui/c2-ring.png) 60 fill / 14px stretch; background: radial-gradient(circle at 50% 35%, #5b6fa8, #1f3566); }
html:not([data-ui="a"],[data-ui="b"]) #win-board .bd-name{ font: 700 14.5px 'Noto Serif Thai', serif !important; color: #1d2a4a !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-help .hk-group{ border: 0 solid transparent !important; border-image: url(assets/ui/c2-card.png) 50 60 fill / 14px 18px stretch !important; background: none !important; padding: 12px 14px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-help .hk-group > b{ display: flex; align-items: center; height: 26px; margin: -2px -4px 8px; padding: 0 12px 0 36px; border: 0 solid transparent;
  border-image: url(assets/ui/c-ribbon.png) 0 40 0 95 fill / 0 14px 0 34px stretch; color: #f6ecd2 !important; font: 700 13.5px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-help kbd{ display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; margin-right: 3px; border: 0 solid transparent !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-square.png) 36 fill / 8px stretch !important; background: none !important; color: #f6ecd2 !important; font: 700 12px Kanit, sans-serif; box-shadow: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-help .hk small{ color: #1d2a4a !important; font-size: 12.5px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-help .hk-grid{ grid-template-columns: 1fr 1.35fr 1fr !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-help kbd{ min-width: 22px !important; height: 22px !important; padding: 0 4px !important; margin-right: 2px !important; font-size: 11px !important; }
/* ---- Fewer lines (user 2026-11-15 "lines everywhere"): rarity is a soft glow behind the icon, not a second ring;
   stat rows and chips are soft plates without rims; ornamental dividers inside cards removed. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.cell, .doll-slot)[class*="r-"]::after{
  inset: 10% !important; border-radius: 50% !important; box-shadow: none !important;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 55%, transparent) 0%, transparent 70%) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .bag-stats .st, html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .trio span{
  border: 0 !important; border-image: none !important; border-radius: 8px !important; background: rgba(255, 250, 238, .75) !important; box-shadow: inset 0 0 0 1px rgba(184, 137, 44, .18) !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-foot::before, html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-total::before, html:not([data-ui="a"],[data-ui="b"]) #win-mail .mail-read > .muted::after{ content: none !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-foot{ padding-top: 8px !important; }
/* Compact quest cards list their step as plain text (no timeline marker column). */
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-card.compact .qb-steps{ margin-left: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-card.compact .qb-steps li{ grid-template-columns: 1fr !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-card.compact .qb-steps li::before, html:not([data-ui="a"],[data-ui="b"]) #win-quests .qb-card.compact .qb-steps li > i{ display: none !important; }
/* Bag detail card: contents centred, the name on its own line. */
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-detail:not(.muted){ align-content: center !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-bag .bag-detail .bd-info > b:first-child{ display: block; margin-bottom: 2px; }
/* Craft: why it can't be made, said clearly. */
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-why{ display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 14px; background: rgba(192, 57, 43, .1); color: #9b2c1f !important; font: 700 13.5px 'Noto Serif Thai', serif !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-why::before{ content: '!'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #c0392b; color: #fff; font: 900 12px sans-serif; }
/* No leftover boxes behind painted pieces (user 2026-11-15: the open tab, "กำลังทำ" and "ขั้น 1/5" each sat in an old
   square navy box with a hairline): every tab / pill / button / tag state paints only its own picture. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button, .sk-tabs button, .qb-view button, .seg button, .mk-find button, .bag-filters button, .btn, .qb-state, .sk-tag):is(.on, .sel, :hover, :focus, :active, *):not(#_){
  background-color: transparent !important; background-image: none !important; box-shadow: none !important; outline: none !important; border-radius: 0 !important; filter: none; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.qb-tabs, .qb-view, .mk-seg, .seg, .bag-tabs){ background: none !important; box-shadow: none !important; border: 0 !important; }
/* Money pills: the text stays clear of the rim. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .bag-money > span{ padding: 0 20px 0 10px !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) > .panel-title .bag-money{ gap: 8px; display: inline-flex; }
/* The figure's canvas fades out at its top instead of ending on a hard edge (wings' glow used to stop on a line). */
html:not([data-ui="a"],[data-ui="b"]) #win-bag .doll-niche .doll-look{ -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%); mask-image: linear-gradient(180deg, transparent 0, #000 16%); }
/* Ribbons never carry the inner divider (it cut through counts like "17 / 50"). */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) .c-rib:has(small){ border-image: url(assets/ui/c-ribbon.png) 0 40 0 95 fill / 0 16px 0 38px stretch !important; padding-right: 18px !important; }
/* Windows sit on whole pixels (user 2026-11-15: hairlines everywhere): no transform at all — a translate(-50%) put the
   painted pieces on half pixels and the slices of every 9-sliced picture showed their joins as light lines. Centred with
   inset + auto margins; a window taller than the screen shrinks with zoom (--fit from ui fitWindows). */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){ max-height: none !important; transform: none !important; right: auto !important; bottom: auto !important; margin: 0 !important;
  left: var(--wx, 0) !important; top: var(--wy, 0) !important; height: fit-content !important; zoom: var(--fit, 1); }

/* ---- Seam underlay (user 2026-11-15 "still lines everywhere"): a 9-sliced picture is drawn as nine separate pieces;
   where two meet on a fractional pixel the edge is antialiased twice and whatever lies under shows through as a hairline.
   So under every sliced piece we lay its own inside colour (inset a little so it never shows past a rounded rim),
   and under the window frame's navy band a navy band: a join now shows the same colour = invisible. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){
  --nv: rgb(4, 40, 96); --iv: rgb(252, 234, 202);
  background:
    linear-gradient(var(--nv), var(--nv)) 8px 8px / calc(100% - 16px) 52px no-repeat border-box,
    radial-gradient(120% 90% at 50% 0%, #fbf3df 0%, #f6ebd1 55%, #efe0bf 100%) border-box !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button, .sk-tabs button, .seg button,
  .qb-view button, .bag-filters button, .mk-find button, .btn, .shop-item, .mk-line, .gd-row, .gd-task, .rk-row, .mail-item, .bd-row, .qi-row, .shop-row, .set-row, .cf2-item, .cf2-row,
  .qb-card, .bag-detail, .shop-detail, .mk-card, .gd-card, .cf-card, .vt-box, .gs-card, .attr-card, .sk-card, .soc-card, .auto-row, .qcard, .mail-read, .st-title, .login-day,
  .gd-banner, .gd-perk, .gd-mtable, .gd-bar, .vt-bar, .fg-cmp > div, .fg-cost > span, .fg-pity, .cf2-head, .hk-group, .soc-row, .pc-chip, .qb-state, .sk-tag, .gd-mhead, .rk-head, .c-rib,
  .shop-top .dlg-text, .mk-pr):not(.gs-top, .rk-row.me, .login-day:last-child, .login-day.today):not(#_):not(#__){
  background: linear-gradient(var(--under, var(--iv)), var(--under, var(--iv))) center / calc(100% - 7px) calc(100% - 7px) no-repeat !important; border-radius: 9px !important; }
/* Pointed ends (angled tabs, ribbons, the big angled buttons): the underlay stays clear of the points. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button, .sk-tabs button, .seg button, .c-rib,
  .shop-acts .btn, .sm-acts .btn, .fg-go, .bag-detail .acts .btn.primary, .qb-go .btn):not(#_):not(#__):not(#___){
  background-size: calc(100% - 46px) calc(100% - 8px) !important; border-radius: 0 !important; }
/* Navy pieces lay navy. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab.on, .qb-tabs button.on, .mk-seg button.on, .shop-tabs button.on, .tabs button.on, .sk-tabs button.on, .seg button.on,
  .qb-view button.on, .bag-filters button.on, .mk-find button.on, .btn.primary, .btn.go, .btn.on, .qty .btn, .vt-step .btn, .mk-pages button, .shop-item.sel, .mk-line.sel,
  .mail-item.active, .cf2-item.on, .qb-state, .gd-mhead, .rk-head, .c-rib, .fg-cmp > div.nx, .shop-acts .btn.primary):not(#_):not(#__){ --under: var(--nv); }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.btn:disabled, .btn.danger, .sk-tag, .qb-title small):not(#_):not(#__){ --under: transparent; }
html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go [data-cq]:not(#_), html:not([data-ui="a"],[data-ui="b"]) #win-craft .cf2-go [data-craft]:not(#_){ --under: var(--nv); }
/* The seam underlay never shows past a rim (user 2026-11-15: a navy box poked out around "+1"): small pieces keep it
   12px in from each end and 4px from top and bottom (the slice joins it hides lie inside that), big cards 7px all round,
   pointed pieces clear of their points. No rounded clipping needed. */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button, .sk-tabs button, .seg button,
  .qb-view button, .bag-filters button, .mk-find button, .btn, .shop-item, .mk-line, .gd-row, .gd-task, .rk-row, .mail-item, .bd-row, .qi-row, .shop-row, .set-row, .cf2-item, .cf2-row,
  .qb-card, .bag-detail, .shop-detail, .mk-card, .gd-card, .cf-card, .vt-box, .gs-card, .attr-card, .sk-card, .soc-card, .auto-row, .qcard, .mail-read, .st-title, .login-day,
  .gd-banner, .gd-perk, .gd-mtable, .gd-bar, .vt-bar, .fg-cmp > div, .fg-cost > span, .fg-pity, .cf2-head, .hk-group, .soc-row, .pc-chip, .qb-state, .sk-tag, .gd-mhead, .rk-head, .c-rib,
  .shop-top .dlg-text, .mk-pr):not(#_):not(#__):not(#___):not(#____):not(#t5):not(#t6):not(#t7):not(#t8){
  background-size: calc(100% - 24px) calc(100% - 18px) !important; border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.qb-card, .bag-detail, .shop-detail, .mk-card, .gd-card, .cf-card, .vt-box, .gs-card, .attr-card, .sk-card, .soc-card,
  .auto-row, .qcard, .mail-read, .login-day, .gd-banner, .gd-mtable, .gd-bar, .vt-bar, .cf2-head, .hk-group):not(#_):not(#__):not(#___):not(#____):not(#t5):not(#t6):not(#t7):not(#t8){
  background-size: calc(100% - 16px) calc(100% - 16px) !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today) :is(.bag-tab, .qb-tabs button, .mk-seg button, .shop-tabs button, .tabs button, .sk-tabs button, .seg button, .c-rib,
  .shop-acts .btn, .sm-acts .btn, .fg-go, .bag-detail .acts .btn.primary, .qb-go .btn, #win-craft .cf2-go [data-craft], #win-mail .mail-read > .btn):not(#_):not(#__):not(#___):not(#____):not(#t5):not(#t6):not(#t7):not(#t8){
  background-size: calc(100% - 50px) calc(100% - 18px) !important; }
/* The window's own parchment stays inside the painted frame (it showed as a pale sliver past the frame's rounded corner). */
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){
  background:
    linear-gradient(var(--nv), var(--nv)) 10px 10px / calc(100% - 20px) 43px no-repeat border-box,
    radial-gradient(120% 90% at 50% 0%, #fbf3df 0%, #f6ebd1 55%, #efe0bf 100%) center / calc(100% - 20px) calc(100% - 20px) no-repeat border-box !important;
  border-radius: 0 !important; }
html:not([data-ui="a"],[data-ui="b"]) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today){ border-radius: 16px !important; }
html:not([data-ui="a"],[data-ui="b"]) #win-shop .shop-big canvas:not(#_){ background: url(assets/ui/c2-slot.png) center / 100% 100% no-repeat !important; }
/* ---- Settings: the window theme picker (all themes). Three small cards with a colour swatch each. */
.set-head { margin: 2px 0 6px; font: 700 13px 'Noto Serif Thai', serif; opacity: .85; }
.set-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.set-theme { display: grid; justify-items: center; gap: 3px; padding: 8px 6px; cursor: pointer; border: 1px solid rgba(160, 130, 70, .45); border-radius: 8px; background: rgba(127, 127, 127, .08); color: inherit; text-align: center; }
.set-theme i { width: 100%; height: 34px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .25); }
.set-theme.t-c i { background: linear-gradient(180deg, #0a2b62 0 38%, #d9a92e 38% 44%, #f6ebd1 44%); }
.set-theme.t-a i { background: linear-gradient(180deg, #121014 0 38%, #c9a96e 38% 41%, #1b1820 41%); }
.set-theme.t-b i { background: linear-gradient(180deg, #1f2b45 0 38%, #b8924a 38% 41%, #f3ead6 41%); }
.set-theme b { font: 700 12.5px 'Noto Serif Thai', serif; }
.set-theme small { font-size: 10.5px; opacity: .75; line-height: 1.3; }
.set-theme.on { border: 2px solid #d9a92e; box-shadow: 0 0 8px rgba(255, 196, 60, .55); }
/* =====================================================================================================================
   Theme B (ivory & navy) · legibility pass 2 (user 2026-11-16: "text the same colour as its background, check carefully").
   Found with tools/contrast-scan.js (__scan('b')) plus the user's shots: NPC dialog, the bag figure and slots, the shop.
   ===================================================================================================================== */
/* NPC dialog: the name on a navy plate, the quest box on paper, option buttons navy with light text. */
html[data-ui="b"] #dialog:not(#_) .dlg-name { background: #1f2b45 !important; border: 1px solid #b8924a !important; border-image: none !important; border-radius: 6px !important;
  padding: 4px 14px !important; top: -16px !important; filter: none !important; color: #f6efe0 !important; text-shadow: none !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-name :is(b, span) { color: #f6efe0 !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-name small { color: #e3cf96 !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-text { color: #1f2b45 !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-quest { background: rgba(255, 252, 244, .85) !important; border: 1px solid rgba(169, 133, 60, .45) !important; border-left: 3px solid #b8924a !important; color: #1f2b45 !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-quest :is(.quest-name, b, li, .quest-desc, small, span) { color: #1f2b45 !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-quest :is(.quest-desc, small) { color: #6f6857 !important; }
html[data-ui="b"] #dialog:not(#_) .btn { background: #1f2b45 !important; color: #f6efe0 !important; border: 1px solid #b8924a !important; border-image: none !important; box-shadow: none !important; }
html[data-ui="b"] #dialog:not(#_) .btn * { color: inherit !important; }
html[data-ui="b"] #dialog:not(#_) .btn:hover { background: #2b3d63 !important; }
/* Shop: the chosen row reads light on navy; the list has a plain header; the amount box fits its card. */
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) :is(.shop-item.sel, .mk-line.sel, .cf2-item.on, .mail-item.active) :is(b, small, span, em, div) { color: #f6efe0 !important; filter: none !important; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .c-rib { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 8px; padding: 0 0 4px; border-bottom: 1px solid rgba(169, 133, 60, .5);
  font: 700 14px 'Noto Serif Thai', serif; color: #1f2b45; background: none; border-image: none; height: auto; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .c-rib small { margin-left: auto; font: 500 12px Kanit, sans-serif; color: #6f6857; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .qty { display: grid !important; grid-template-columns: 38px minmax(0, 1fr) 38px !important; gap: 6px; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .qty input { min-width: 0; width: 100%; }
/* Skills: the next-level line in a readable green. */
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .sk-next, html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .sk-next span { color: #2f7a35 !important; }
/* Check-in days: navy text on the light cards. */
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .login-day :is(small, span, em) { color: #1f2b45 !important; text-shadow: none !important; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .login-day.today { background: rgba(255, 236, 190, .9) !important; }
/* Bag figure (markup shared with theme C): a calm navy panel, the level inside it at the top; slot names are hover
   titles (the + level is a small navy badge in the corner, not text under the icon). */
html[data-ui="b"] #win-bag:not(#_) .doll-niche { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #33456f, #1f2b45 75%); border: 1px solid #b8924a; }
html[data-ui="b"] #win-bag:not(#_) .doll-niche .doll-look { border: 0 !important; background: none !important; width: 100%; }
html[data-ui="b"] #win-bag:not(#_) .doll-who { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font: 600 12px Kanit, sans-serif; color: #f6efe0; }
html[data-ui="b"] #win-bag:not(#_) .doll-who em { font-style: normal; color: #ffd36a; margin-right: 3px; }
html[data-ui="b"] #win-bag:not(#_) .doll-slot small { display: none !important; }
html[data-ui="b"] .doll-slot .ds-plus { position: absolute; top: -5px; right: -5px; min-width: 20px; padding: 0 4px; border-radius: 9px; background: #1f2b45; border: 1px solid #b8924a;
  color: #ffe9a8; font: 700 10.5px/16px Kanit, sans-serif; font-style: normal; text-align: center; z-index: 2; }
html[data-ui="b"] #win-bag:not(#_) .doll-slot.empty[data-kind] canvas { background: var(--sil) center / 64% no-repeat; opacity: .4; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .trio span { display: flex; align-items: center; justify-content: center; gap: 4px; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .trio .tri-ic, html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .sti, html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .fi { display: inline-block; width: 18px; height: 18px; flex: none; background: var(--ic) center / contain no-repeat; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) .trio b { display: inline; }
html[data-ui="b"] #win-bag:not(#_) .bd-well { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 8px; background: #1f2b45; }
html[data-ui="b"] #win-bag:not(#_) .bd-well canvas { width: 80%; height: 80%; }
html[data-ui="b"] #win-bag:not(#_) .bag-detail:not(.muted) { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
html[data-ui="b"] #win-events:not(#_) .login-day { background: rgba(255, 252, 244, .85) !important; border: 1px solid rgba(169, 133, 60, .45) !important; }
html[data-ui="b"] #win-events:not(#_) .login-day.today { background: #fff0c8 !important; border: 2px solid #b8924a !important; }
html[data-ui="b"] #win-events:not(#_) .login-day.today em { background: #1f2b45; color: #f6efe0 !important; border-radius: 8px; padding: 0 8px; }
html[data-ui="b"] .window:not(#win-dungeon, #win-admin, #win-waygate, #win-book, #win-today):not(#_) :is(.mail-item.active, .cf2-item.on) { background: #1f2b45 !important; border-color: #b8924a !important; }
/* Dialog choices in theme B: clear buttons — the main one navy with light text, the others ivory with navy text. */
html[data-ui="b"] #dialog:not(#_) .dlg-choice { border: 1px solid rgba(169, 133, 60, .55) !important; border-image: none !important; border-radius: 8px !important; padding: 6px 12px 6px 8px !important;
  background: #fffaf0 !important; color: #1f2b45 !important; text-shadow: none !important; filter: none !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-choice:is(.primary, .main, .go, .ok) { background: #1f2b45 !important; color: #f6efe0 !important; border-color: #b8924a !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-choice i { color: #8a6418 !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-choice:is(.primary, .main, .go, .ok) i { color: #e3c27e !important; }
html[data-ui="b"] #dialog:not(#_) .dlg-choice:hover:not(:disabled) { filter: brightness(1.06) !important; }
/* Bag in theme B: a taller figure panel, the level under the figure, the three stats fitting their column,
   gear filters as icons only (one row). */
html[data-ui="b"] #win-bag:not(#_) .doll { grid-template-columns: 52px 1fr 52px; align-items: stretch; }
html[data-ui="b"] #win-bag:not(#_) .doll-niche { flex-direction: column; justify-content: flex-end; min-height: 236px; padding-bottom: 6px; }
html[data-ui="b"] #win-bag:not(#_) .doll-niche .doll-look { position: static; flex: 1; width: 100%; height: auto; min-height: 0; aspect-ratio: auto; }
html[data-ui="b"] #win-bag:not(#_) .doll-who { position: static; margin-top: 2px; }
html[data-ui="b"] #win-bag:not(#_) .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
html[data-ui="b"] #win-bag:not(#_) .trio span { font-size: 11px; white-space: nowrap; min-width: 0; }
html[data-ui="b"] #win-bag:not(#_) .trio b { font-size: 13.5px; }
html[data-ui="b"] #win-bag:not(#_) .bag-filters { flex-wrap: nowrap; gap: 4px; align-items: center; }
html[data-ui="b"] #win-bag:not(#_) .bag-filters button { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
html[data-ui="b"] #win-bag:not(#_) .bag-filters button.icon-only { padding: 3px 5px; }
html[data-ui="b"] #win-bag:not(#_) .bag-filters button.icon-only span { display: none; }
html[data-ui="b"] #win-bag:not(#_) .bag-filters .sort { margin-left: auto; }
/* Theme A (noir gilt) · legibility (2026-11-16 scan, tools/contrast-scan.js __scan('a')): the light-theme rules for skills,
   check-in, vault and dialog choices made some text dark on dark. */
html[data-ui="a"] #win-events:not(#_) .login-day small { color: #e3c27e !important; }
html[data-ui="a"] #dialog:not(#_) .dlg-choice { color: #f3ecdc !important; }
html[data-ui="a"] #dialog:not(#_) .dlg-choice:is(.primary, .main) { background: rgba(201, 169, 110, .18) !important; color: #ffe7a6 !important; }
html[data-ui="a"] #win-vault:not(#_) .vt-arrow { color: #ece4d4 !important; }
html[data-ui="a"] #win-vault:not(#_) .vt-arrow :is(span, i) { color: inherit !important; }
html[data-ui="a"] #win-vault:not(#_) .vt-panel .btn { color: #ece4d4 !important; background: rgba(255, 255, 255, .08) !important; }
/* Theme B bag figure: the canvas keeps its square shape (it was stretched tall to fill the panel). */
html[data-ui="b"] #win-bag:not(#_) .doll-niche { justify-content: center; }
html[data-ui="b"] #win-bag:not(#_) .doll-niche .doll-look { flex: none !important; width: 100% !important; height: auto !important; aspect-ratio: 1 / 1 !important; object-fit: contain; }
/* Theme B bag figure, round 3 (user 2026-11-16: "trim the empty top and bottom, the figure standing in the middle"):
   the panel is just the square figure, centred between the slot columns; the level sits over its foot. */
html[data-ui="b"] #win-bag:not(#_) .doll { align-items: center !important; }
html[data-ui="b"] #win-bag:not(#_) .doll-niche { min-height: 0 !important; padding: 0 !important; justify-content: center; align-self: center; }
html[data-ui="b"] #win-bag:not(#_) .doll-niche .doll-look { flex: none !important; width: 100% !important; height: auto !important; aspect-ratio: 1 / 1 !important; }
html[data-ui="b"] #win-bag:not(#_) .doll-who { position: absolute !important; top: auto !important; bottom: 5px; left: 0; right: 0; margin: 0; text-shadow: 0 1px 3px #000; }
/* Theme B: the level and class sit under the figure panel, not over its feet (user 2026-11-16). */
html[data-ui="b"] #win-bag:not(#_) .doll-niche { overflow: visible !important; margin-bottom: 20px; }
html[data-ui="b"] #win-bag:not(#_) .doll-niche .doll-look { border-radius: 10px; }
html[data-ui="b"] #win-bag:not(#_) .doll-who { top: calc(100% + 4px) !important; bottom: auto !important; color: #1f2b45 !important; text-shadow: none !important; font-weight: 700; }
html[data-ui="b"] #win-bag:not(#_) .doll-who em { color: #8a6418 !important; }
/* Boss / dungeon gear (user 2026-11-16): no glowing frame or glowing icon — the boss medallion on the icon is enough. */
canvas.dg-gear, canvas.dg-gear:not(#_) { filter: none !important; animation: none !important; }
.cell.boss-loot, .cell.mvp-loot, .cell:has(canvas.dg-gear) { animation: none !important; box-shadow: none !important; }
html[data-ui="a"] .cell:is(.boss-loot, .mvp-loot), html[data-ui="b"] .cell:is(.boss-loot, .mvp-loot) { border-color: var(--edge, rgba(31, 43, 69, .25)) !important; }
html[data-ui="b"] .window .cell:has(canvas.dg-gear)::after, html[data-ui="b"] .window .cell:has(canvas.dg-gear)::before { content: none !important; }
/* Theme B item card: the picture sits at the top beside the name, not in the middle of the card. */
html[data-ui="b"] #win-bag:not(#_) .bag-detail:not(.muted) { align-items: start !important; }
html[data-ui="b"] #win-bag:not(#_) .bag-detail .bd-well { align-self: start; margin-top: 2px; }
html[data-ui="b"] #win-bag:not(#_) .bag-detail .acts { align-self: start; }
/* The set-progress chips under the bag's stats are gone (user 2026-11-16 "เอาออก"); the set still shows in the item's tooltip. */
#win-bag .bag-sets { display: none !important; }
/* Theme B bag: the stats stay inside the left column (they ran into the bag grid). */
html[data-ui="b"] #win-bag:not(#_) .bag-wrap { grid-template-columns: 300px minmax(0, 1fr) !important; }
html[data-ui="b"] #win-bag:not(#_) .bag-left { min-width: 0; overflow: hidden; }
html[data-ui="b"] #win-bag:not(#_) .bag-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; column-gap: 12px !important; }
html[data-ui="b"] #win-bag:not(#_) .bag-stats .st { min-width: 0; gap: 4px; }
html[data-ui="b"] #win-bag:not(#_) .bag-stats .st span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
html[data-ui="b"] #win-bag:not(#_) .bag-stats .st span small { display: none; }
html[data-ui="b"] #win-bag:not(#_) .bag-stats .st b { flex: none; font-size: 12.5px; }
html[data-ui="b"] #win-bag:not(#_) .trio { gap: 8px !important; }
/* Guild pages used at a station in the guild room: a line saying where, the page's buttons asleep until you are there. */
.gd-away { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 8px; padding: 8px 14px; border-radius: 8px;
  background: rgba(31, 53, 102, .1); border: 1px dashed rgba(184, 137, 44, .7); }
.gd-away b { font: 700 13.5px 'Noto Serif Thai', serif; }
.gd-locked :is(button, input):not(.mk-pages button):not([data-bpage]):not([data-spage]) { pointer-events: none !important; opacity: .45 !important; filter: grayscale(.6) !important; }
.gd-locked-give :is([data-gdonate], #gd-give, [data-gjunk], [data-gjall]) { pointer-events: none !important; opacity: .45 !important; filter: grayscale(.6) !important; }
.gd-locked-give + * , .gd-away + .gd-page.gd-locked-give { }
/* (Theme B bag: the left column does not clip — the chosen slot's outline was cut off at its edge.) */
html[data-ui="b"] #win-bag:not(#_) .bag-left { overflow: visible !important; padding-left: 3px; }
html[data-ui="b"] #win-bag:not(#_) .bag-stats { overflow: hidden; }
/* Guild buildings (user 2026-11-16): each grade costs ten named boss junk; the chosen building's list on the right. */
#win-guild .gd-bld[data-gbld] { cursor: pointer; }
#win-guild .gd-bld.on { outline: 2px solid #c9a24e; outline-offset: -2px; }
#win-guild .gd-need .gd-needs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px; margin: 6px 0; }
#win-guild .gd-nd { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 6px; background: rgba(31, 43, 69, 0.06); }
#win-guild .gd-nd img, #win-guild .gd-nd canvas { width: 30px; height: 30px; }
#win-guild .gd-nd b { display: block; font-size: 11.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-nd small { display: block; font-size: 10px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-guild .gd-nd em { font-style: normal; font-weight: 700; font-size: 12px; color: #b23a2a; }
#win-guild .gd-nd.ok em { color: #2e7d3a; }
#win-guild .gd-nd.ok { background: rgba(46, 125, 58, 0.1); }
#win-guild .gd-want { color: #b8741a; font-weight: 700; }
html[data-ui="a"] #win-guild .gd-nd { background: rgba(255, 255, 255, 0.05); }
html[data-ui="a"] #win-guild .gd-nd em { color: #ff8a7a; }
html[data-ui="a"] #win-guild .gd-nd.ok em { color: #8fe09a; }
#win-guild .gd-need .gd-needs { grid-template-columns: 1fr; gap: 2px; }
#win-guild .gd-nd { grid-template-columns: 24px minmax(0, 1fr) auto; padding: 1px 6px; }
#win-guild .gd-nd img, #win-guild .gd-nd canvas { width: 24px; height: 24px; }
#win-guild .gd-nd > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
#win-guild .gd-nd b { flex: none; max-width: 60%; }
#win-guild .gd-nd small { flex: 1; }
/* The coffer's daily request (user 2026-11-16). */
#win-guild .gd-req { margin: 6px 0; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(201, 162, 78, 0.6); background: rgba(201, 162, 78, 0.12); }
#win-guild .gd-req.done { border-color: rgba(46, 125, 58, 0.5); background: rgba(46, 125, 58, 0.1); }
#win-guild .gd-req-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 4px; }
#win-guild .gd-req-head span { font-size: 11px; font-weight: 700; color: #a2671a; }
#win-guild .gd-req.done .gd-req-head span { color: #2e7d3a; }
#win-guild .gd-req-items { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#win-guild .gd-ask { color: #a2671a; font-weight: 700; }
/* Ribbon titles in the guild cards: one line, centred on the ribbon. */
#win-guild .gd-card-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex !important; align-items: center; gap: 6px; line-height: 1.2 !important; }
#win-guild .gd-card-title small { flex: none; }
#win-guild .gd-need .gd-card-title:not(#_), #win-guild .gd-card-title:not(#_) { margin: 2px 6px 6px !important; justify-content: center; padding-left: 40px !important; padding-right: 22px !important; }
#win-guild .gd-split.gd-donate { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) !important; }
#win-guild .gd-req-items { grid-template-columns: 1fr; }
#win-guild .gd-req:not(#_) { display: block !important; }
#win-guild .gd-req .gd-req-items:not(#_) { display: grid !important; grid-template-columns: 1fr 1fr !important; }
#win-guild .gd-req .gd-nd b { max-width: none; }
/* Dungeon sweep (user 2026-11-16). */
#win-dungeon .dg-sweep { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; justify-content: center; gap: 2px 8px; width: 100%; margin-top: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid #c9a24e; background: linear-gradient(#2a3a5c, #18233b); color: #f5e6c0; cursor: pointer; font: inherit; }
#win-dungeon .dg-sweep b { font-size: 14px; }
#win-dungeon .dg-sweep small { grid-column: 1 / -1; font-size: 11px; opacity: .8; }
#win-dungeon .dg-sweep:disabled { opacity: .5; cursor: default; }
#win-dungeon .dg-sweep:not(:disabled):hover { filter: brightness(1.15); }
#win-dungeon .dg-sweep-hint { display: block; margin-top: 6px; font-size: 11px; opacity: .75; line-height: 1.35; }
#win-dungeon .dg-sweep .dg-gr { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; font-weight: 800; font-size: 14px; color: #1a1206; }
#win-dungeon .dg-sweep .dg-gr.g-s { background: linear-gradient(#ffe48a, #c99a2e); }
#win-dungeon .dg-sweep .dg-gr.g-a { background: linear-gradient(#f2f4f8, #9aa3b4); }
#win-dungeon .dg-sweep .dg-gr.g-b { background: linear-gradient(#f0b98a, #a5653a); }
/* Sweep button v2 (user 2026-11-16 "make it pretty"): a dark plate with a double gold rim, a grade medal, a gold title, a moving shine. */
@keyframes dgSwShine { 0%, 55% { transform: translateX(-120%) skewX(-20deg) } 100% { transform: translateX(320%) skewX(-20deg) } }
@keyframes dgSwGlow { 0%, 100% { box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 10px rgba(232,190,96,.35) } 50% { box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 18px rgba(255,214,120,.7) } }
#win-dungeon button.dg-sweep:not(#_) {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; width: min(100%, 420px); margin: 10px auto 0; padding: 8px 16px 8px 10px; height: 64px;
  border: 1px solid #e8c46a; border-radius: 12px; cursor: pointer; font: inherit; color: #f6e7c0; text-align: left;
  background: radial-gradient(120% 140% at 0% 50%, rgba(232,196,106,.18), transparent 55%), linear-gradient(180deg, #2c1f46 0%, #191230 55%, #110c22 100%);
  box-shadow: inset 0 0 0 3px #191230, inset 0 0 0 4px rgba(232,196,106,.45), 0 4px 14px rgba(0,0,0,.55); animation: dgSwGlow 2.6s ease-in-out infinite; }
#win-dungeon button.dg-sweep:not(#_)::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 34%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,236,180,.22), transparent); animation: dgSwShine 3.4s ease-in-out infinite; }
#win-dungeon button.dg-sweep:not(#_):hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
#win-dungeon button.dg-sweep:not(#_):disabled { animation: none; filter: grayscale(.7) brightness(.75); cursor: default; }
#win-dungeon button.dg-sweep:not(#_):disabled::after { display: none; }
#win-dungeon .dg-sw-medal { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; padding: 3px; box-sizing: border-box;
  background: conic-gradient(from 200deg, #fff3c4, #c8963c, #7a4e14, #f6dc8e, #fff3c4); box-shadow: 0 0 12px rgba(255,210,120,.55); }
#win-dungeon .dg-sw-medal i { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; font: 800 22px/1 'Noto Serif Thai', serif; font-style: normal;
  background: radial-gradient(circle at 35% 30%, #4a3470, #1a1030 70%); color: #ffe7a0; text-shadow: 0 0 8px rgba(255,214,120,.9), 0 1px 0 #000; }
#win-dungeon .dg-sw-medal.g-a { background: conic-gradient(from 200deg, #ffffff, #9aa3b4, #4d5566, #dfe4ee, #ffffff); box-shadow: 0 0 12px rgba(220,230,255,.45); }
#win-dungeon .dg-sw-medal.g-a i { color: #eef2fa; text-shadow: 0 0 8px rgba(220,230,255,.9), 0 1px 0 #000; }
#win-dungeon .dg-sw-medal.g-b { background: conic-gradient(from 200deg, #ffd9b0, #b0703c, #5e3414, #e8a878, #ffd9b0); box-shadow: 0 0 12px rgba(230,150,90,.45); }
#win-dungeon .dg-sw-medal.g-b i { color: #ffd2a8; text-shadow: 0 0 8px rgba(240,160,100,.9), 0 1px 0 #000; }
#win-dungeon .dg-sw-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#win-dungeon .dg-sw-text b { font: 700 19px/1.1 'Noto Serif Thai', serif; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff6d6, #f0c96a 55%, #b8822e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(0,0,0,.8)); }
#win-dungeon .dg-sw-text small { font-size: 11.5px; color: #d9c9a6; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-dungeon .dg-sw-go { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(232,196,106,.6); background: rgba(232,196,106,.1); }
#win-dungeon .dg-sw-go svg { width: 16px; height: 16px; fill: none; stroke: #f0c96a; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* Sweep button v3 (user: "use the same frame"): the enter button's own gold frame, with the grade medal in it. */
#win-dungeon .dg-swrow { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; }
#win-dungeon .dg-gobtn.dg-swbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
#win-dungeon .dg-swbtn .dg-sw-medal { width: 32px; height: 32px; padding: 2px; }
#win-dungeon .dg-swbtn .dg-sw-medal i { font-size: 16px; }
/* Enter and sweep side by side, each button with its caption centred under it. */
#win-dungeon .dg-go.two:not(#_) { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; justify-items: center; }
#win-dungeon .dg-gocol, #win-dungeon .dg-swrow { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; min-width: 0; text-align: center; }
#win-dungeon .dg-gocol small, #win-dungeon .dg-swrow small { display: block; max-width: 260px; font-size: 11px; line-height: 1.35; text-align: center; }
#win-dungeon .dg-go.two .dg-gobtn { min-width: 0; width: 230px; }
/* The party's dungeon ready check (user 2026-11-16). */
#dg-ready { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 10000; }
#dg-ready.out { opacity: 0; transition: opacity .25s; }
@keyframes rdIn { from { opacity: 0; transform: translate(-50%, -10px) } }
#dg-ready .rd-card { width: 380px; padding: 14px 16px 12px; border-radius: 12px; color: #f3e6c2;
  background: radial-gradient(120% 80% at 50% 0%, rgba(232,196,106,.16), transparent 60%), linear-gradient(180deg, #241a3c, #120d22);
  border: 1px solid #e8c46a; box-shadow: inset 0 0 0 3px #120d22, inset 0 0 0 4px rgba(232,196,106,.4), 0 10px 30px rgba(0,0,0,.6); }
#dg-ready .rd-head { text-align: center; display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
#dg-ready .rd-head small { font-size: 11px; letter-spacing: .08em; color: #d8c08a; }
#dg-ready .rd-head b { font: 700 20px/1.2 'Noto Serif Thai', serif; background: linear-gradient(180deg, #fff6d6, #f0c96a 55%, #b8822e); -webkit-background-clip: text; background-clip: text; color: transparent; }
#dg-ready .rd-head span { font-size: 11.5px; opacity: .8; }
#dg-ready .rd-list { display: flex; flex-direction: column; gap: 4px; }
#dg-ready .rd-m { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(232,196,106,.18); }
#dg-ready .rd-m canvas { width: 40px; height: 40px; border-radius: 6px; background: rgba(0,0,0,.3); }
#dg-ready .rd-m b { font-size: 13px; }
#dg-ready .rd-m small { font-size: 11px; opacity: .7; }
#dg-ready .rd-m em { font-style: normal; font-size: 12px; font-weight: 700; color: #cfc2a0; }
#dg-ready .rd-m.yes { border-color: rgba(110,210,120,.55); background: rgba(80,170,90,.12); }
#dg-ready .rd-m.yes em { color: #8fe09a; }
#dg-ready .rd-m.no { border-color: rgba(230,110,100,.5); background: rgba(200,70,60,.12); }
#dg-ready .rd-m.no em { color: #ff9a8a; }
#dg-ready .rd-time { position: relative; height: 16px; margin: 10px 0 8px; border-radius: 8px; background: rgba(0,0,0,.45); overflow: hidden; border: 1px solid rgba(232,196,106,.3); }
#dg-ready .rd-time i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b8822e, #f0c96a); transition: width .1s linear; }
#dg-ready .rd-time span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
#dg-ready .rd-acts { display: flex; justify-content: center; gap: 10px; min-height: 32px; align-items: center; }
#dg-ready .rd-acts .btn { min-width: 120px; }
/* Ready card v2 (user: "pretty buttons"): rows like party plates, a status pill, gold-framed Ready / dark-red Not ready. */
#dg-ready .rd-card { width: 400px; }
#dg-ready .rd-m { grid-template-columns: 44px 1fr auto; padding: 5px 8px 5px 5px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(232,196,106,.22); }
#dg-ready .rd-m canvas { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3d3a5e, #120d22); box-shadow: 0 0 0 2px rgba(232,196,106,.55); }
#dg-ready .rd-who { display: flex; flex-direction: column; min-width: 0; }
#dg-ready .rd-who b { font-size: 14px; color: #fbf0d4; }
#dg-ready .rd-who small { font-size: 11px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dg-ready .rd-m em { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); color: #cfc2a0; }
#dg-ready .rd-m.wait em { animation: rdWait 1.2s ease-in-out infinite; }
@keyframes rdWait { 50% { opacity: .45 } }
#dg-ready .rd-m.yes em { color: #0f2a14; background: linear-gradient(180deg, #a6f0ae, #4fbf62); border-color: #c8ffd0; }
#dg-ready .rd-m.yes canvas { box-shadow: 0 0 0 2px #8fe09a, 0 0 10px rgba(143,224,154,.6); }
#dg-ready .rd-m.no em { color: #fff; background: linear-gradient(180deg, #e6776a, #a8352c); border-color: #ffb3a8; }
#dg-ready .rd-m.no canvas { filter: grayscale(.8) brightness(.7); }
#dg-ready .rd-acts { gap: 14px; }
#dg-ready .rd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 150px; height: 46px; padding: 0 22px; border: 0; cursor: pointer;
  font: 700 16px 'Noto Serif Thai', serif; letter-spacing: .03em; }
#dg-ready .rd-btn span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 800 13px/1 sans-serif; }
#dg-ready .rd-btn.yes { color: #2a1606; text-shadow: 0 1px 0 rgba(255,240,200,.6);
  background: url(assets/ui/dg-button.png) center/100% 100% no-repeat, linear-gradient(180deg, #f6dc8e, #c8963c 55%, #8a5a1c) center/90% 62% no-repeat; }
#dg-ready .rd-btn.yes span { background: #2a1606; color: #f6dc8e; }
#dg-ready .rd-btn.no { color: #f3d6cf; text-shadow: 0 1px 2px #000;
  background: url(assets/ui/dg-button.png) center/100% 100% no-repeat, linear-gradient(180deg, #7a2a26, #3e1210) center/90% 62% no-repeat; filter: saturate(.6) hue-rotate(-25deg) brightness(.85); }
#dg-ready .rd-btn.no span { background: rgba(0,0,0,.5); color: #ff9a8a; }
#dg-ready .rd-btn:hover { filter: brightness(1.12) drop-shadow(0 0 8px rgba(255,210,120,.6)); transform: translateY(-1px); }
#dg-ready .rd-btn.no:hover { filter: saturate(.6) hue-rotate(-25deg) brightness(1) drop-shadow(0 0 8px rgba(255,120,100,.5)); }

/* Party panel v2 (user: "make the party UI nicer"): dark plates with a fine gold rim, framed portraits, a class
   line, a slim HP bar, a status chip, round gold-rim action buttons. */
#party-frames { width: 248px; gap: 6px; }
#party-frames .pt-head { padding: 5px 6px 5px 10px; border-radius: 10px; background: linear-gradient(180deg, rgba(36,28,58,.92), rgba(18,13,34,.9));
  border: 1px solid rgba(232,196,106,.55); box-shadow: inset 0 0 0 2px rgba(18,13,34,.9), inset 0 0 0 3px rgba(232,196,106,.18), 0 3px 10px rgba(0,0,0,.45); }
#party-frames .pt-head b { font-family: 'Noto Serif Thai', serif; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff6d6, #f0c96a 60%, #c28a34); -webkit-background-clip: text; background-clip: text; color: transparent; }
#party-frames .pt-bonus { padding: 2px 8px; border-radius: 999px; }
#party-frames .pt-leave { border-radius: 999px; padding: 0 10px; }
#party-frames .pt-fold { border-radius: 50%; }
#party-frames .pt-card { grid-template-columns: 48px 1fr auto; gap: 8px; padding: 6px 7px 6px 6px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(36,28,58,.9), rgba(18,13,34,.82)); border: 1px solid rgba(232,196,106,.35);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), 0 3px 10px rgba(0,0,0,.4); }
#party-frames .pt-card:hover { border-color: #f0c96a; transform: translateX(2px); }
#party-frames .pt-card canvas { width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #463e6c, #120d22);
  box-shadow: 0 0 0 2px #c8963c, 0 0 0 3px rgba(0,0,0,.6); }
#party-frames .pt-card .crown-ico { left: 34px; top: -4px; }
#party-frames .pt-name b { font-size: 13px; color: #fbf0d4; }
#party-frames .pt-name small { color: #b9ab8a; }
#party-frames .pt-hp { height: 10px; border-radius: 999px; border: 1px solid rgba(0,0,0,.6); }
#party-frames .pt-hp i { background: linear-gradient(180deg, #ff8f7a, #d23c34 60%, #9c2420); border-radius: 999px; }
#party-frames .pt-hp i.low { background: linear-gradient(180deg, #ffb070, #e0602a); }
#party-frames .pt-hp span { font-size: 8.5px; line-height: 10px; }
#party-frames .pt-where { display: inline-block; justify-self: start; max-width: 100%; padding: 1px 8px; border-radius: 999px; font-size: 10px; background: rgba(255,255,255,.07); }
#party-frames .pt-card[data-state="near"] .pt-where { color: #0f2a14; background: linear-gradient(180deg, #a6f0ae, #5fc870); }
#party-frames .pt-card[data-state="near"] canvas { box-shadow: 0 0 0 2px #8fe09a, 0 0 10px rgba(143,224,154,.55); }
#party-frames .pt-card[data-state="far"] .pt-where, #party-frames .pt-card[data-state="away"] .pt-where { color: #cfe8ff; background: rgba(90,150,220,.25); }
#party-frames .pt-card[data-state="dead"] .pt-where { color: #fff; background: rgba(200,70,60,.6); }
#party-frames .pt-acts { flex-direction: column; gap: 4px; }
#party-frames .pt-acts button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(232,196,106,.55);
  background: radial-gradient(circle at 50% 35%, #3a3058, #160f2a); box-shadow: 0 2px 4px rgba(0,0,0,.5); }
#party-frames .pt-acts button:hover { border-color: #f0c96a; box-shadow: 0 0 8px rgba(240,201,106,.6); }
#party-frames .pt-acts .ui-ico { width: 17px; height: 17px; }
/* Party finder (dungeon window, user 2026-11-16). */
#win-dungeon .dg-findbtn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; cursor: pointer; border-radius: 10px; font: inherit; color: #f3e6c2;
  border: 1px solid #e8c46a; background: linear-gradient(180deg, #2c1f46, #140e26); box-shadow: inset 0 0 0 2px #140e26, inset 0 0 0 3px rgba(232,196,106,.35), 0 3px 10px rgba(0,0,0,.5); }
#win-dungeon .dg-findbtn svg { width: 28px; height: 28px; fill: none; stroke: #f0c96a; stroke-width: 1.8; stroke-linecap: round; }
#win-dungeon .dg-findbtn span { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
#win-dungeon .dg-findbtn b { font: 700 14px 'Noto Serif Thai', serif; color: #f6dc8e; }
#win-dungeon .dg-findbtn small { font-size: 11px; opacity: .8; }
#win-dungeon .dg-findbtn:hover { filter: brightness(1.15); transform: translateY(-1px); }
#win-dungeon .dg-findbtn + .dg-shopbtn { margin-left: 10px; }
#win-dungeon .dg-findbtn { margin-left: auto; }
#win-dungeon .dg-back { padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(232,196,106,.6); background: rgba(0,0,0,.35); color: #f0c96a; cursor: pointer; font: inherit; }
#win-dungeon .dgf { display: flex; flex-direction: column; gap: 10px; min-width: 820px; }
#win-dungeon .dgf-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
#win-dungeon .dgf-tabs button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px; border-radius: 10px; cursor: pointer; font: 700 13px 'Noto Serif Thai', serif; color: #e9dcb8;
  border: 1px solid rgba(232,196,106,.35); background: linear-gradient(180deg, rgba(44,31,70,.9), rgba(20,14,38,.9)); }
#win-dungeon .dgf-tabs button small { font: 500 10.5px var(--sans, sans-serif); opacity: .75; }
#win-dungeon .dgf-tabs button.on { border-color: #f0c96a; color: #fff3cc; box-shadow: 0 0 12px rgba(240,201,106,.45), inset 0 0 0 1px rgba(240,201,106,.5); background: linear-gradient(180deg, #4a3470, #22173c); }
#win-dungeon .dgf-list { display: flex; flex-direction: column; gap: 6px; min-height: 300px; }
#win-dungeon .dgf-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid rgba(232,196,106,.35); background: linear-gradient(90deg, rgba(44,31,70,.92), rgba(20,14,38,.85)); }
#win-dungeon .dgf-row.mine { border-color: #8fe09a; }
#win-dungeon .dgf-cls { display: flex; gap: 4px; }
#win-dungeon .dgf-cls canvas, #win-dungeon .dgf-cls i { width: 40px; height: 40px; border-radius: 50%; box-sizing: border-box; }
#win-dungeon .dgf-cls canvas { background: radial-gradient(circle at 50% 35%, #463e6c, #120d22); box-shadow: 0 0 0 2px #c8963c; }
#win-dungeon .dgf-cls i { border: 2px dashed rgba(232,196,106,.35); }
#win-dungeon .dgf-info { display: flex; flex-direction: column; min-width: 0; }
#win-dungeon .dgf-info b { font: 700 15px 'Noto Serif Thai', serif; color: #fbf0d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-dungeon .dgf-info small { font-size: 12px; opacity: .75; }
#win-dungeon .dgf-join { min-width: 150px !important; height: 44px !important; font-size: 1em !important; }
#win-dungeon .dgf-tag { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #0f2a14; background: linear-gradient(180deg, #a6f0ae, #5fc870); }
#win-dungeon .dgf-empty { display: grid; place-items: center; align-content: center; gap: 4px; flex: 1; min-height: 240px; border-radius: 12px; border: 1px dashed rgba(232,196,106,.35);
  color: #e9dcb8; font: 700 15px 'Noto Serif Thai', serif; }
#win-dungeon .dgf-empty small { font: 500 12px var(--sans, sans-serif); opacity: .7; }
#win-dungeon .dgf-mine { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#dg-ready .rd-help { font-style: normal; padding: 0 6px; border-radius: 999px; background: rgba(120,170,255,.25); color: #cfe0ff; }
/* Party panel: seat count + empty seats (user 2026-11-16). */
#party-frames .pt-count { padding: 1px 8px; border-radius: 999px; font: 700 11px var(--sans, sans-serif); color: #f6dc8e; background: rgba(0,0,0,.4); border: 1px solid rgba(232,196,106,.5); white-space: nowrap; }
#party-frames .pt-count.full { color: #0f2a14; background: linear-gradient(180deg, #a6f0ae, #5fc870); border-color: #c8ffd0; }
#party-frames .pt-empty { width: 100%; font: inherit; text-align: left; color: #d9c9a6; background: rgba(18,13,34,.55) !important; border: 1px dashed rgba(232,196,106,.45) !important; box-shadow: none !important; }
#party-frames .pt-empty > i { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px dashed rgba(232,196,106,.5); font: 700 22px/1 sans-serif; font-style: normal; color: #f0c96a; }
#party-frames .pt-empty b { color: #f0c96a; font-size: 13px; }
#party-frames .pt-empty small { display: block; font-size: 10.5px; opacity: .75; }
#party-frames .pt-empty:hover { border-color: #f0c96a !important; background: rgba(44,31,70,.75) !important; }
#win-dungeon .dg-buy canvas[data-icon^="dgticket_"] { width: 34px; height: 34px; margin-left: -6px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
/* Dungeon chests: a breathing halo in the chest's own colour, a little bob — exciting to open (user 2026-11-16). */
@keyframes chestAura { 0%, 100% { filter: drop-shadow(0 0 3px var(--chest)) drop-shadow(0 0 7px var(--chest)) brightness(1); }
  50% { filter: drop-shadow(0 0 6px var(--chest)) drop-shadow(0 0 16px var(--chest)) brightness(1.1); } }
@keyframes chestBob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-2px) } }
canvas.dg-chest, canvas.dg-chest:not(#_) { animation: chestAura 1.8s ease-in-out infinite, chestBob 1.8s ease-in-out infinite !important; }
/* A dungeon chest opening: its own colour aura from the first knock (user 2026-11-16). */
@keyframes coDgAura { 0%, 100% { filter: drop-shadow(0 0 8px var(--cc)) drop-shadow(0 0 22px var(--cc)) drop-shadow(0 14px 18px rgba(0,0,0,.6)); }
  50% { filter: drop-shadow(0 0 14px var(--cc)) drop-shadow(0 0 40px var(--cc)) drop-shadow(0 14px 18px rgba(0,0,0,.6)) brightness(1.12); } }
@keyframes coDgHalo { 0%, 100% { opacity: .55; transform: scale(.92) } 50% { opacity: .95; transform: scale(1.08) } }
#chest-open.co-dg .co-chest { animation: coDgAura 1.1s ease-in-out infinite; }
#chest-open.co-dg.co-shake .co-glow { animation: coDgHalo 1.1s ease-in-out infinite; }
#chest-open.co-dg.co-shake .co-rays { opacity: .5; animation: dgSpin 9s linear infinite; }
#dg-ready .rd-why { font-style: normal; color: #ff9a8a; font-weight: 700; }
#dg-ready .rd-m.blocked canvas { filter: grayscale(1) brightness(.6); }
/* Dungeon weekly ranking page (user 2026-11-16). */
#win-dungeon .dg-rankbtn { margin-left: auto; }
#win-dungeon .dg-rankbtn + .dg-findbtn { margin-left: 10px; }
#win-dungeon .dgr { min-width: 920px; display: flex; flex-direction: column; gap: 10px; }
#win-dungeon .dgr-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#win-dungeon .dgr-col { border-radius: 12px; overflow: hidden; border: 1px solid rgba(232,196,106,.4);
  background: linear-gradient(180deg, rgba(18,13,34,.55), rgba(18,13,34,.95) 45%), var(--bn) center top/cover; }
#win-dungeon .dgr-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 8px; text-align: center; }
#win-dungeon .dgr-head canvas { width: 72px; height: 44px; object-fit: contain; }
#win-dungeon .dgr-head b { font: 700 14px 'Noto Serif Thai', serif; color: #f6dc8e; }
#win-dungeon .dgr-head small { font-size: 10.5px; color: #d9c9a6; }
#win-dungeon .dgr-head em { font-style: normal; color: #fff3cc; font-weight: 700; }
#win-dungeon .dgr-col ol { list-style: none; margin: 0; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 4px; }
#win-dungeon .dgr-col li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 8px; background: rgba(255,255,255,.05); font-size: 11.5px; color: #eadfc2; }
#win-dungeon .dgr-col li i { font-style: normal; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-weight: 800; font-size: 11px; background: rgba(0,0,0,.4); }
#win-dungeon .dgr-col li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-dungeon .dgr-col li b { font-variant-numeric: tabular-nums; color: #fff; }
#win-dungeon .dgr-col li.p1 i { background: linear-gradient(180deg, #fff3c4, #c8963c); color: #2a1606; }
#win-dungeon .dgr-col li.p2 i { background: linear-gradient(180deg, #fff, #9aa3b4); color: #1a1d24; }
#win-dungeon .dgr-col li.p3 i { background: linear-gradient(180deg, #ffd9b0, #a5653a); color: #2a1606; }
#win-dungeon .dgr-col li.p1 { box-shadow: inset 0 0 0 1px rgba(240,201,106,.6); }
#win-dungeon .dgr-col li.mine { background: rgba(143,224,154,.18); box-shadow: inset 0 0 0 1px #8fe09a; }
#win-dungeon .dgr-col li.empty { opacity: .45; }

/* Dungeon blessings card (user 2026-11-16). */
#dg-bless { position: fixed; left: 50%; top: 16%; transform: translateX(-50%); z-index: 9500; }
#dg-bless .bl-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 18px 12px; border-radius: 14px; color: #f3e6c2;
  background: radial-gradient(120% 80% at 50% 0%, rgba(232,196,106,.18), transparent 60%), linear-gradient(180deg, #241a3c, #120d22);
  border: 1px solid #e8c46a; box-shadow: inset 0 0 0 3px #120d22, inset 0 0 0 4px rgba(232,196,106,.4), 0 10px 30px rgba(0,0,0,.6); }
#dg-bless .bl-card > small { font-size: 11.5px; color: #d8c08a; }
#dg-bless .bl-card > b { font: 700 20px 'Noto Serif Thai', serif; background: linear-gradient(180deg, #fff6d6, #f0c96a 55%, #b8822e); -webkit-background-clip: text; background-clip: text; color: transparent; }
#dg-bless .bl-list { display: flex; gap: 10px; margin-top: 4px; }
#dg-bless .bl-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 130px; padding: 12px 8px; border-radius: 12px; cursor: pointer; font: inherit; color: #f3e6c2;
  border: 1px solid rgba(232,196,106,.5); background: linear-gradient(180deg, rgba(74,52,112,.9), rgba(30,20,52,.95)); transition: transform .12s, box-shadow .12s; }
#dg-bless .bl-opt i { font-style: normal; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; color: #fff3cc;
  background: radial-gradient(circle at 50% 35%, #6a4fa0, #2a1d48); box-shadow: 0 0 0 2px #c8963c, 0 0 14px rgba(240,201,106,.45); }
#dg-bless .bl-opt b { font-size: 13px; }
#dg-bless .bl-opt em { font-style: normal; font-weight: 800; font-size: 16px; color: #8fe09a; }
#dg-bless .bl-opt:hover { transform: translateY(-3px); box-shadow: 0 0 18px rgba(240,201,106,.55); border-color: #f0c96a; }
#dg-bless .bl-time { font-size: 11px; opacity: .65; }
/* Role badges on the VICTORY screen. */
.dgv-badges { display: flex; justify-content: center; gap: 10px; margin: 6px 0 2px; }
.dgv-badge { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto auto; align-items: center; column-gap: 8px; padding: 6px 12px; border-radius: 12px;
  background: rgba(20,14,38,.75); border: 1px solid rgba(232,196,106,.45); color: #f3e6c2; animation: dgvBadge .4s 1.6s both; }
.dgv-badge i { grid-row: span 3; font-style: normal; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 18px;
  background: radial-gradient(circle at 50% 35%, #fff3c4, #c8963c); color: #2a1606; }
.dgv-badge.b-taken i { background: radial-gradient(circle at 50% 35%, #dfe8ff, #6f86b8); }
.dgv-badge.b-heal i { background: radial-gradient(circle at 50% 35%, #d9ffe0, #4fbf62); }
.dgv-badge small { font-size: 10.5px; color: #d8c08a; }
.dgv-badge b { font-size: 13px; }
.dgv-badge em { font-style: normal; font-size: 11px; opacity: .75; }
.dgv-badge.mine { border-color: #8fe09a; box-shadow: 0 0 12px rgba(143,224,154,.45); }
@keyframes dgvBadge { from { opacity: 0; transform: translateY(8px) scale(.9) } }
/* The donation coffer's own window (no guild banner or tabs). */
#win-guild .gd-solo-donate { min-height: 320px; }
#win-guild .gd-solo-donate { min-width: 820px; }
#win-guild .gd-solo .gd-split.gd-donate { min-height: 360px; }

#win-guild .gd-donate .gd-fund { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; margin: 6px 0; border-radius: 10px; background: rgba(4,40,96,.08); border: 1px solid rgba(201,162,78,.45); }
#win-guild .gd-donate .gd-fund span { font-size: 12px; opacity: .8; }
#win-guild .gd-donate .gd-fund b { font-size: 16px; }
#win-guild .gd-donate .gd-dayline { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; }
#win-guild .gd-donate .gd-daybar { height: 10px; margin: 4px 0 8px; border-radius: 999px; background: rgba(0,0,0,.18); overflow: hidden; }
#win-guild .gd-donate .gd-daybar i { display: block; height: 100%; background: linear-gradient(90deg, #c8963c, #f0c96a); }
#win-guild .gd-donate .gd-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
#win-guild .gd-donate .gd-give { display: flex; gap: 8px; align-items: center; }
#win-guild .gd-donate .gd-give input { flex: 1; }
/* Theme B (ivory) · guild window legibility (user 2026-11-16 "hard to read"): titles, labels, the level table, pagers. */
html[data-ui="b"] #win-guild .gd-card-title:not(#_) { color: #1f2b45 !important; font-weight: 700; border-bottom: 1px solid rgba(169,133,60,.45); padding-bottom: 4px; margin-bottom: 6px; }
html[data-ui="b"] #win-guild .gd-card-title small:not(#_) { color: #6a5a3c !important; }
html[data-ui="b"] #win-guild label:not(#_), html[data-ui="b"] #win-guild .gd-levels span:not(#_) { color: #3a3226 !important; }
html[data-ui="b"] #win-guild .gd-levels .past span:not(#_) { color: #8a7f6a !important; }
html[data-ui="b"] #win-guild .mk-pages button:not(#_), html[data-ui="b"] #win-guild .mk-pages span:not(#_) { color: #1f2b45 !important; }
html[data-ui="b"] #win-guild .gd-step.now .bd-btn:not(#_) { color: #f6dc8e !important; border-color: #f0c96a !important; }
html[data-ui="b"] #win-guild .btn.go .cur:not(#_) { color: inherit !important; }
html[data-ui="b"] #win-guild .gd-log div:not(#_), html[data-ui="b"] #win-guild .gd-log small:not(#_) { color: #3a3226 !important; }

/* The base and job lines side by side at the foot of the skill bar (RULES.job, user 2026-11-16 "both bars here, each its
   own colour"): the level's EXP in gold on the left, the class's job in blue on the right. */
#hud #skillbar #xp-row { order: 4; grid-column: 1 / -1; display: flex; gap: 12px; margin: 8px -12px 15px; }
#hud #skillbar #xp-row #exp-line { flex: 1; margin: 0; order: 0; }
#hud #skillbar #xp-row #job-line { order: 1; }
#hud #skillbar #job-line { position: relative; flex: 1; height: 3px; background: rgba(242, 237, 227, 0.07); }
#hud #skillbar #job-line i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #2f6fb8, #5aa8ff 70%, #bfe2ff); transition: width 0.3s; }
#hud #skillbar #job-line.top i { background: linear-gradient(90deg, #3f9a52, #8fe09a 70%, #d4ffdc); }
#hud #skillbar #job-line span { position: absolute; left: 50%; top: 5px; transform: translateX(-50%); font: 500 9.5px var(--sans, Kanit), sans-serif; letter-spacing: 0.06em; color: rgba(170, 210, 255, 0.85); white-space: nowrap; }
#hud #skillbar #job-line.top span { color: rgba(170, 240, 185, 0.9); }
.job-chip { display: inline-grid; place-items: center; padding: 0 5px; margin-right: 4px; height: 16px; border-radius: 4px; font: 800 9px/1 sans-serif; letter-spacing: .04em; color: #fff; background: linear-gradient(180deg, #5aa8ff, #2f6fb8); vertical-align: middle; }
/* Theme B / C (ivory) · the party note in the friends window was pale green on pale green (user 2026-11-16). */
html:not([data-ui="a"]) #win-social .soc-note:not(#_) { color: #1f4f2a !important; background: rgba(80, 170, 90, 0.14) !important; border: 1px solid rgba(60, 140, 75, 0.35) !important; }
html:not([data-ui="a"]) #win-social .soc-note kbd:not(#_) { color: #1f2b45 !important; background: rgba(255, 255, 255, 0.7) !important; border: 1px solid rgba(31, 43, 69, 0.3); border-radius: 4px; padding: 0 4px; }

/* Ranking podium (user 2026-11-16, every UI theme): the top three as they look, 1st diamond, 2nd gold, 3rd silver. */
#win-ranking .rk-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; margin: 6px 0 10px; }
#win-ranking .rkp-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 10px; border-radius: 14px; text-align: center;
  background: linear-gradient(180deg, #1d1630, #0f0b1c); color: #f3e6c2; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
#win-ranking .rkp-frame { position: relative; width: 100%; aspect-ratio: 9 / 10; border-radius: 12px; padding: 4px; box-sizing: border-box; overflow: hidden; }
#win-ranking .rkp-frame canvas { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 9px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.18), rgba(0,0,0,.35) 75%); }
#win-ranking .rkp-shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 48%, transparent 60%) no-repeat; background-size: 250% 100%; animation: rkpShine 3.6s ease-in-out infinite; }
@keyframes rkpShine { 0%, 60% { background-position: 120% 0 } 100% { background-position: -120% 0 } }
#win-ranking .rkp-medal { position: absolute; z-index: 3; left: 50%; bottom: -2px; transform: translateX(-50%); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font: 800 17px/1 'Noto Serif Thai', serif; color: #1a1206; box-shadow: 0 2px 6px rgba(0,0,0,.55); }
#win-ranking .rkp-name { margin-top: 6px; font: 700 15px 'Noto Serif Thai', serif; color: #fff6dc; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-ranking .rkp-cls, #win-ranking .rkp-guild { font-size: 11px; color: #d8c9a6; display: inline-flex; align-items: center; gap: 4px; }
#win-ranking .rkp-power { font-style: normal; font: 800 16px 'Noto Serif Thai', serif; letter-spacing: .02em; }
#win-ranking .rkp-card.me { outline: 2px solid #8fe09a; outline-offset: 2px; }
/* 1st · diamond */
#win-ranking .rkp-diamond { padding-top: 14px; border: 2px solid #bdf3ff; box-shadow: 0 0 0 1px #4ab6d8, 0 0 22px rgba(130, 225, 255, .55), 0 8px 18px rgba(0,0,0,.5); }
#win-ranking .rkp-diamond .rkp-frame { background: conic-gradient(from 200deg, #e9fdff, #7fd9f2, #ffffff, #9fb6ff, #e3faff, #6fd0ee, #e9fdff); animation: rkpGlow 2.4s ease-in-out infinite; }
#win-ranking .rkp-diamond .rkp-medal { background: radial-gradient(circle at 35% 30%, #ffffff, #9ee6f7 55%, #3f9fc3); }
#win-ranking .rkp-diamond .rkp-power { color: #bdf3ff; text-shadow: 0 0 10px rgba(130,225,255,.7); }
@keyframes rkpGlow { 50% { filter: brightness(1.25) saturate(1.2) } }
/* 2nd · gold */
#win-ranking .rkp-gold { border: 2px solid #f0c96a; box-shadow: 0 0 0 1px #8a5a1c, 0 0 14px rgba(240,201,106,.35), 0 6px 16px rgba(0,0,0,.45); }
#win-ranking .rkp-gold .rkp-frame { background: conic-gradient(from 200deg, #fff3c4, #c8963c, #7a4e14, #f6dc8e, #fff3c4); }
#win-ranking .rkp-gold .rkp-medal { background: radial-gradient(circle at 35% 30%, #fff3c4, #f0c96a 55%, #a5731f); }
#win-ranking .rkp-gold .rkp-power { color: #f6dc8e; }
/* 3rd · silver */
#win-ranking .rkp-silver { border: 2px solid #e2e7ef; box-shadow: 0 0 0 1px #6b7486, 0 0 12px rgba(220,228,240,.3), 0 6px 16px rgba(0,0,0,.45); }
#win-ranking .rkp-silver .rkp-frame { background: conic-gradient(from 200deg, #ffffff, #9aa3b4, #4d5566, #dfe4ee, #ffffff); }
#win-ranking .rkp-silver .rkp-medal { background: radial-gradient(circle at 35% 30%, #ffffff, #c9d0dc 55%, #7a8396); }
#win-ranking .rkp-silver .rkp-power { color: #e8edf5; }
/* Rows 4–10: a bronze rank number. */
#win-ranking .rk-row:not(.top1):not(.top2):not(.top3) .rk-n:not(#_) { color: #b0703c; }
/* (Theme C/B colour the window's text navy; the podium cards are dark in every theme, so their text stays light.) */
#win-ranking .rkp-card .rkp-name:not(#_) { color: #fff6dc !important; text-shadow: 0 1px 2px #000; }
#win-ranking .rkp-card .rkp-cls:not(#_), #win-ranking .rkp-card .rkp-guild:not(#_) { color: #d8c9a6 !important; }
#win-ranking .rkp-diamond .rkp-power:not(#_) { color: #bdf3ff !important; }
#win-ranking .rkp-gold .rkp-power:not(#_) { color: #f6dc8e !important; }
#win-ranking .rkp-silver .rkp-power:not(#_) { color: #e8edf5 !important; }
#win-ranking .rkp-card { background: linear-gradient(180deg, #1d1630, #0f0b1c) !important; }
/* The lobby on/off switch in the party tab: the ivory themes' input style had made it a blank white box (user 2026-11-16). */
#win-social .soc-switch input:not(#_) { appearance: none; -webkit-appearance: none; width: 44px !important; height: 24px !important; min-width: 0 !important; padding: 0 !important; border-radius: 12px !important;
  border: 1px solid rgba(31, 43, 69, 0.45) !important; background: #8a8f9c !important; box-shadow: inset 0 1px 3px rgba(0,0,0,.45) !important; position: relative; cursor: pointer; }
#win-social .soc-switch input:not(#_)::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.4); transition: left .2s; }
#win-social .soc-switch input:checked:not(#_) { background: linear-gradient(90deg, #2f8a44, #5fc870) !important; border-color: #2f8a44 !important; }
#win-social .soc-switch input:checked:not(#_)::after { left: 23px; }
html:not([data-ui="a"]) #win-social .soc-switch:not(#_) { color: #1f2b45 !important; font-weight: 600; }
/* Party requests (user 2026-11-16): who asks, their role and readiness, accept / turn down. */
#win-social .soc-switches { gap: 14px; flex-wrap: wrap; }
#win-social .soc-apps { margin: 8px 0; padding: 8px; border-radius: 10px; border: 1px solid rgba(201,162,78,.55); background: rgba(201,162,78,.12); }
#win-social .soc-apps-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-weight: 700; }
#win-social .soc-apps-head b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: #c0443a; color: #fff; font-size: 12px; }
#win-social .soc-apps-head small { font-weight: 400; opacity: .75; }
#win-social .soc-app { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; background: rgba(255,255,255,.08); margin-top: 4px; }
#win-social .soc-app canvas { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #463e6c, #120d22); box-shadow: 0 0 0 2px #c8963c; }
#win-social .soc-app-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#win-social .soc-app-who small { font-size: 11px; }
#win-social .soc-app-acts { display: flex; flex-direction: column; gap: 4px; }
#win-social .soc-role { font-style: normal; padding: 0 6px; border-radius: 999px; font-size: 10px; color: #fff; background: #8a6a3a; }
#win-social .soc-role.r-แท็งก์ { background: #4a6fb0; }
#win-social .soc-role.r-ฮีล { background: #3f9a52; }
#win-social .soc-dup { font-style: normal; color: #c0443a; font-weight: 700; }

/* The adventurer's book (user 2026-11-16): an open book, every UI theme alike — a navy leather cover with a gold edge,
   two ivory pages and a gutter, bookmarks down the right edge. Art (assets/ui/book-*.png) replaces the drawn cover. */
html #win-book.window:not(#_) { width: min(1120px, 97vw); background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-image: none !important; color: #2b2f45; overflow: visible; }
html #win-book.window:not(#_)::before, html #win-book.window:not(#_)::after { display: none !important; }
html #win-book:not(#_) > .panel-title { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); z-index: 3; margin: 0; padding: 6px 34px 7px; border-radius: 6px; height: auto;
  background: linear-gradient(#2a3a66, #18223e) !important; color: #f6e3b0 !important; border: 1.5px solid #c9a24e; font: 700 17px 'Noto Serif Thai', serif; letter-spacing: .04em; box-shadow: 0 4px 10px rgba(0,0,0,.4); white-space: nowrap; }
html #win-book:not(#_) > .panel-title .close { position: fixed; right: auto; left: auto; display: none; }
html #win-book:not(#_) .bk-x { position: absolute; right: 4px; top: 4px; z-index: 4; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #c9a24e; background: radial-gradient(circle at 35% 30%, #e0553c, #8e1e12); color: #fff3d8; font: 700 18px sans-serif; cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,.45); }
html #win-book:not(#_) .bk-x:hover { filter: brightness(1.15); }
html #win-book:not(#_) .body.bk { position: relative; display: block; padding: 22px 58px 14px 8px; overflow: visible; background: transparent; }
#win-book .bk-book { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; padding: 22px 24px 24px; border-radius: 16px;
  background: linear-gradient(160deg, #23315a, #141c36); border: 2px solid #c9a24e; box-shadow: 0 12px 30px rgba(0,0,0,.55), inset 0 0 0 4px #1a2546, inset 0 0 0 5px rgba(201,162,78,.5); }
#win-book .bk-book.art { background: var(--bk-art) center / 100% 100% no-repeat; border: 0; box-shadow: none; filter: drop-shadow(0 12px 22px rgba(0,0,0,.5)); padding: var(--bk-pad, 34px 40px 40px); }
#win-book .bk-page { position: relative; min-width: 0; padding: 22px 24px 18px; background: #fbf6ea; display: flex; flex-direction: column; gap: 12px; }
#win-book .bk-page.left { border-radius: 10px 2px 2px 10px; box-shadow: inset -18px 0 22px -14px rgba(90,70,40,.45); }
#win-book .bk-page.right { border-radius: 2px 10px 10px 2px; box-shadow: inset 18px 0 22px -14px rgba(90,70,40,.45); }
#win-book .bk-book.art .bk-page { background: transparent; box-shadow: none; }
:is(#win-book, #win-events) .bk-h { margin: 0; font: 700 16px 'Noto Serif Thai', serif; color: #1f2c4d; display: flex; align-items: baseline; gap: 8px; }
:is(#win-book, #win-events) .bk-h small { font: 500 12px 'IBM Plex Sans Thai', sans-serif; color: #7a6a48; }
:is(#win-book, #win-events) .bk-text { margin: 0; font-size: 13px; line-height: 1.6; color: #4a4e63; }
:is(#win-book, #win-events) .bk-bar { display: block; height: 6px; border-radius: 3px; background: #e6dcc4; overflow: hidden; }
:is(#win-book, #win-events) .bk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c9a24e, #f0d68a); border-radius: 3px; }
/* bookmarks */
#win-book .bk-tabs { position: absolute; right: 4px; top: 58px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
#win-book .bk-tab { position: relative; display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border: 0; cursor: pointer; border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, #22305a, #2f4378); box-shadow: 2px 3px 6px rgba(0,0,0,.35); transition: transform .12s, filter .12s; }
#win-book .bk-tab::before { content: ""; position: absolute; inset: 3px 3px 3px 0; border: 1px solid rgba(201,162,78,.55); border-left: 0; border-radius: 0 8px 8px 0; }
#win-book .bk-tab.art { background: var(--bk-mark) center / 100% 100% no-repeat; box-shadow: none; filter: drop-shadow(2px 3px 4px rgba(0,0,0,.4)); }
#win-book .bk-tab.art::before { display: none; }
#win-book .bk-tab.art.on { background-image: var(--bk-mark-on); }
#win-book .bk-tab span { display: none; }
#win-book .bk-tab .bk-ti { width: 34px; height: 34px; background: var(--ti) center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
#win-book .bk-tab:hover { transform: translateX(3px); }
#win-book .bk-tab.on { transform: translateX(7px); }
#win-book .bk-tab.on:not(.art) { background: linear-gradient(90deg, #a8781f, #e7c46c); }
#win-book .bk-tab.on::before { border-color: rgba(255,248,220,.8); }
#win-book .bk-tab:hover span, #win-book .bk-tab:focus-visible span { display: block; position: absolute; left: 66px; white-space: nowrap; padding: 3px 9px; border-radius: 5px; background: #18223e; color: #f6e3b0; font-size: 12px; }
#win-book .bk-dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #d9432c; color: #fff; font: 700 11px/18px sans-serif; box-shadow: 0 0 0 2px #fbf6ea; }
/* the adventurer */
#win-book .bk-me { display: grid; justify-items: center; gap: 8px; }
#win-book .bk-me canvas { width: 160px; height: 178px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #fff, #efe4c8 70%); border: 2px solid #d8c08a; }
#win-book .bk-me-id { display: grid; justify-items: center; gap: 1px; }
#win-book .bk-me-id b { font: 700 20px 'Noto Serif Thai', serif; color: #1f2c4d; }
#win-book .bk-me-id small { font-size: 12px; color: #6a6f86; }
#win-book .bk-title { color: #a8781f !important; font-weight: 600; }
#win-book .bk-rank { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; background: #f3ead5; }
#win-book .bk-rank em { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font: 800 26px 'Noto Serif Thai', serif; font-style: normal; color: #fff6dc;
  background: radial-gradient(circle at 35% 30%, #f6dc8e, #c9963c 55%, #7a4e14); box-shadow: 0 2px 6px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.4); }
#win-book .bk-rank b { display: block; font-size: 14px; color: #1f2c4d; }
#win-book .bk-rank small { display: block; font-size: 12px; color: #7a6a48; margin-bottom: 4px; }
#win-book .bk-sum { padding: 10px 12px; border-radius: 10px; border: 1px dashed #d8c08a; display: grid; gap: 4px; }
#win-book .bk-sum h4 { margin: 0; font: 700 13px 'IBM Plex Sans Thai', sans-serif; color: #a8781f; }
#win-book .bk-sum p { margin: 0; font: 700 15px 'IBM Plex Sans Thai', sans-serif; color: #1f2c4d; }
#win-book .bk-sum small { font-size: 12px; color: #6a6f86; }
#win-book .bk-prog { display: grid; gap: 6px; }
#win-book .bk-pr { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 8px 12px; border-radius: 8px; border: 1px solid #e6dcc4; background: #fffdf6; cursor: pointer; text-align: left; font: 500 14px 'IBM Plex Sans Thai', sans-serif; color: #2b2f45; }
#win-book .bk-pr:hover { border-color: #c9a24e; }
#win-book .bk-pr b { color: #1f2c4d; font-variant-numeric: tabular-nums; }
#win-book .bk-pr .bk-bar { grid-column: 1 / -1; }
:is(#win-book, #win-events) .bk-facts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
:is(#win-book, #win-events) .bk-facts.big { grid-template-columns: 1fr 1fr; }
:is(#win-book, #win-events) .bk-facts span { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #f3ead5; }
:is(#win-book, #win-events) .bk-facts small { font-size: 11px; color: #7a6a48; }
:is(#win-book, #win-events) .bk-facts b { font: 700 18px 'Noto Serif Thai', serif; color: #1f2c4d; font-variant-numeric: tabular-nums; }
/* the road */
:is(#win-book, #win-events) .bk-roadnow { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border-radius: 10px; background: #f3ead5; }
:is(#win-book, #win-events) .bk-roadnow b { font: 800 30px 'Noto Serif Thai', serif; color: #1f2c4d; }
:is(#win-book, #win-events) .bk-roadnow small { font-size: 12px; color: #7a6a48; }
:is(#win-book, #win-events) .bk-next { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; border: 1px dashed #d8c08a; }
:is(#win-book, #win-events) .bk-next small { font-size: 12px; color: #a8781f; font-weight: 600; }
:is(#win-book, #win-events) .bk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
:is(#win-book, #win-events) .bk-chips .pc-chip { background: #fffdf6 !important; color: #2b2f45 !important; border: 1px solid #e6dcc4 !important; }
:is(#win-book, #win-events) .bk-claim { margin-top: auto; align-self: center; min-width: 240px; }
:is(#win-book, #win-events) .bk-road { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
:is(#win-book, #win-events) .bk-rc { position: relative; display: grid; justify-items: center; gap: 1px; padding: 4px 2px 3px; border-radius: 8px; background: #f3ead5; border: 1px solid #e6dcc4; }
:is(#win-book, #win-events) .bk-rc small { font: 700 10px sans-serif; color: #7a6a48; }
:is(#win-book, #win-events) .bk-rc canvas { width: 38px; height: 38px; }
:is(#win-book, #win-events) .bk-rc.big { background: #f6e3b0; border-color: #c9a24e; }
:is(#win-book, #win-events) .bk-rc.lock canvas { filter: grayscale(1) opacity(.45); }
:is(#win-book, #win-events) .bk-rc.ready { border-color: #2f9a5a; box-shadow: 0 0 0 2px rgba(47,154,90,.35); animation: bkReady 1.6s ease-in-out infinite; }
:is(#win-book, #win-events) .bk-rc.done { opacity: .55; }
:is(#win-book, #win-events) .bk-rc i { position: absolute; right: 3px; top: 1px; color: #2f9a5a; font-style: normal; font-weight: 800; font-size: 12px; }
@keyframes bkReady { 50% { box-shadow: 0 0 0 4px rgba(47,154,90,.2); } }
/* a collection page */
#win-book .bk-pick { display: grid; justify-items: center; gap: 6px; text-align: center; }
#win-book .bk-pick canvas { width: 200px; height: 200px; border-radius: 14px; background: radial-gradient(circle at 50% 45%, #fff, #efe4c8 70%); border: 2px solid #d8c08a; }
#win-book .bk-pick.locked canvas { filter: brightness(0) opacity(.35); }
#win-book .bk-pick b { font: 700 19px 'Noto Serif Thai', serif; color: #1f2c4d; }
#win-book .bk-pick small { font-size: 12px; color: #6a6f86; }
#win-book .bk-reward { width: 100%; box-sizing: border-box; display: grid; gap: 2px; padding: 10px 12px; margin-top: 6px; border-radius: 10px; background: #f3ead5; text-align: left; }
#win-book .bk-reward small { font-size: 11px; color: #a8781f; font-weight: 600; }
#win-book .bk-reward span { font-size: 14px; color: #1f2c4d; margin-bottom: 4px; }
#win-book .bk-gridhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
#win-book .bk-rars { display: flex; gap: 4px; flex-wrap: wrap; }
#win-book .bk-rar { padding: 2px 9px; border-radius: 999px; border: 1px solid #e6dcc4; background: #fffdf6; color: #4a4e63; font: 500 12px sans-serif; cursor: pointer; }
#win-book .bk-rar.on { background: #1f2c4d; color: #f6e3b0; border-color: #1f2c4d; }
#win-book .bk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#win-book .bk-cell { aspect-ratio: 1; padding: 4px; border-radius: 10px; border: 1.5px solid #e2d6b8; background: #fffdf6; cursor: pointer; display: grid; place-items: center; min-width: 0; }
#win-book .bk-cell canvas { width: 100%; height: 100%; }
#win-book .bk-cell.off canvas { filter: grayscale(1) brightness(.2) opacity(.35); }
#win-book .bk-cell.on { background: radial-gradient(circle at 50% 40%, #fff, #f6ecd2); }
#win-book .bk-cell.sel { border-color: #c9a24e; box-shadow: 0 0 0 2px rgba(201,162,78,.55); }
#win-book .bk-cell:hover { border-color: #c9a24e; }
#win-book .bk-pages { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: auto; font-size: 13px; color: #6a6f86; }
/* wanted */
:is(#win-book, #win-events) .bk-poster { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 18px 16px; border-radius: 6px; background: linear-gradient(#f4e2bc, #e9cf9a); border: 2px solid #9a6a2a; box-shadow: 0 4px 10px rgba(80,50,10,.3); }
:is(#win-book, #win-events) .bk-poster > small { font: 800 24px 'Noto Serif Thai', serif; letter-spacing: .2em; color: #7a2a14; }
:is(#win-book, #win-events) .bk-poster canvas { width: 120px; height: 120px; border-radius: 8px; background: #f8ecd0; border: 1.5px solid #9a6a2a; }
:is(#win-book, #win-events) .bk-poster b { font: 700 18px 'Noto Serif Thai', serif; color: #5a1e0e; }
:is(#win-book, #win-events) .bk-poster span { font-size: 13px; color: #5a3a1a; }
:is(#win-book, #win-events) .bk-poster.empty b { margin-top: 10px; }
@media (max-width: 760px) {
  html #win-book:not(#_) .body.bk { padding-right: 8px; padding-bottom: 70px; }
  #win-book .bk-book { grid-template-columns: 1fr; }
  #win-book .bk-tabs { flex-direction: row; top: auto; bottom: 6px; right: 8px; left: 8px; justify-content: center; }
  #win-book .bk-tab { width: 44px; height: 44px; border-radius: 8px; }
}

/* The book's own buttons (it sits outside the theme frames): gold for the main action, navy to go somewhere. */
html #win-book:not(#_) .btn { border-radius: 8px; border: 1.5px solid #c9a24e; padding: 7px 16px; font: 600 14px 'IBM Plex Sans Thai', sans-serif; cursor: pointer;
  background: linear-gradient(#2a3a66, #18223e); color: #f6e3b0; box-shadow: 0 2px 4px rgba(0,0,0,.25); text-shadow: none; filter: none; opacity: 1; }
html #win-book:not(#_) .btn.primary { background: linear-gradient(#f3d98a, #c9963c); color: #2a1a06; border-color: #9a6a1f; }
html #win-book:not(#_) .btn.small { padding: 3px 12px; font-size: 13px; }
html #win-book:not(#_) .btn:hover:not(:disabled) { filter: brightness(1.1); }
html #win-book:not(#_) .btn:disabled { background: #e6dcc4; color: #9a8f74; border-color: #d8cba8; box-shadow: none; cursor: default; }

/* The book's painted frame (art/source/book-frame.png → assets/ui/book-frame.webp, 1467×912): the pages are laid
   over its two ivory leaves, the bookmarks stand out of its right edge. */
html #win-book:not(#_) .bk-book { aspect-ratio: 1467 / 912; min-height: 0; padding: 3.6% 6.2% 6.6% 6%; border: 0; border-radius: 0; box-shadow: none;
  background: url(../assets/ui/book-frame.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 14px 22px rgba(0,0,0,.5)); }
html #win-book:not(#_) .bk-page { background: transparent; box-shadow: none; border-radius: 0; padding: 14px 20px 10px; overflow: hidden; }
html #win-book:not(#_) .bk-page.left { padding-right: 30px; }
html #win-book:not(#_) .bk-page.right { padding-left: 30px; }
html #win-book:not(#_) .bk-grid { grid-template-columns: repeat(5, minmax(0, 74px)); justify-content: center; gap: 8px; }
html #win-book:not(#_) .bk-tabs { top: 70px; right: 6px; }
html #win-book:not(#_) .bk-x { right: 8px; top: 8px; }
html #win-book:not(#_) .body.bk { padding: 26px 62px 10px 4px; }
html #win-book:not(#_) > .panel-title { top: -2px; }

:is(#win-book, #win-events) .bk-facts.big.one { grid-template-columns: 1fr; }

/* The road and the wanted poster in the events window (moved out of the book): two ivory pages side by side. */
#win-events .ev-split { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; margin-top: 10px; color: #2b2f45; }
#win-events .ev-split .bk-page { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 10px; background: #fbf6ea; border: 1px solid #e6dcc4; min-height: 360px; }
#win-events .ev-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-left: 4px; border-radius: 9px; background: #d9432c; color: #fff; font: 700 11px/18px sans-serif; }
html #win-events:not(#_) .ev-split .btn.primary { background: linear-gradient(#f3d98a, #c9963c); color: #2a1a06; border: 1.5px solid #9a6a1f; }
html #win-events:not(#_) .ev-split .btn.go { background: linear-gradient(#2a3a66, #18223e); color: #f6e3b0; border: 1.5px solid #c9a24e; }
html #win-events:not(#_) .ev-split .btn:disabled { background: #e6dcc4; color: #9a8f74; border-color: #d8cba8; }
@media (max-width: 760px) { #win-events .ev-split { grid-template-columns: 1fr; } }

/* Map cells: the world-map thumbnail fills the cell, rounded; a map not walked into yet is a dark blur. */
#win-book .bk-cell[data-bkpick] canvas { border-radius: 7px; }
#win-book .bk-grid.maps .bk-cell.off canvas { filter: grayscale(1) brightness(.35) blur(1.5px); }
#win-book .bk-pick.maps canvas { object-fit: cover; }
#win-book .bk-pick.maps.locked canvas { filter: grayscale(1) brightness(.4) blur(3px); }

/* Feats not done yet stay readable (an achievement shows what to do): faded, not a dark shape. */
#win-book .bk-grid.feats .bk-cell.off canvas { filter: grayscale(1) opacity(.45); }
#win-book .bk-pick.feats.locked canvas { filter: grayscale(1) opacity(.5); }

/* The book draws its own cover: no frosted-glass blur behind its (transparent) window box. */
html #win-book.window:not(#_), html #win-book.window:not(#_) .body { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* No title plate floating over the book (user 2026-11-16 "ไม่สวย"): the name is a small heading on its first page. */
html #win-book:not(#_) > .panel-title { display: none !important; }
html #win-book:not(#_) .body.bk { padding-top: 8px; }
#win-book .bk-eyebrow { display: flex; align-items: center; gap: 10px; width: 100%; justify-content: center; font: 700 15px 'Noto Serif Thai', serif; letter-spacing: .12em; color: #8a6420; }
#win-book .bk-eyebrow::before, #win-book .bk-eyebrow::after { content: ""; flex: 1; max-width: 70px; height: 1px; background: linear-gradient(90deg, transparent, #c9a24e); }
#win-book .bk-eyebrow::after { background: linear-gradient(90deg, #c9a24e, transparent); }

/* Quest book tabs: the count says what it is — "ทำอยู่ n" (running, navy) or "ส่งได้ n" (ready to hand in, green, pulsing). */
html .qb-tabs button:not(#_) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
html .qb-tabs button:not(#_) .qt-run, html .qb-tabs button:not(#_) .qt-ready { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 700 11px/1.5 'IBM Plex Sans Thai', sans-serif; white-space: nowrap; letter-spacing: 0; }
html .qb-tabs button:not(#_) .qt-run { background: #1f2c4d; color: #f6e3b0; }
html .qb-tabs button.on:not(#_) .qt-run { background: #f6e3b0; color: #1f2c4d; }
html .qb-tabs button:not(#_) .qt-ready { background: #2f9a5a; color: #fff; box-shadow: 0 0 0 0 rgba(47,154,90,.6); animation: qtReady 1.6s ease-out infinite; }
@keyframes qtReady { 70% { box-shadow: 0 0 0 6px rgba(47,154,90,0); } 100% { box-shadow: 0 0 0 0 rgba(47,154,90,0); } }
html .qb-tabs button:not(#_) { white-space: nowrap; padding-left: 10px !important; padding-right: 10px !important; }
html .qb-tabs button:not(#_) .qt-name { white-space: nowrap; }

/* Book class emblems (user 2026-11-16): the badge art with the letter on its centre; the next class on the card's right. */
#win-book .bk-rank { grid-template-columns: auto 1fr auto; }
#win-book .bk-emb { position: relative; display: grid; place-items: center; width: 60px; height: 60px; flex: none; }
#win-book .bk-emb:not(.art) { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6dc8e, #c9963c 55%, #7a4e14); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
#win-book .bk-emb.art { background: var(--emb) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
#win-book .bk-emb b { position: relative; font: 800 22px/1 'Noto Serif Thai', Georgia, serif; color: #fff7dc; text-shadow: 0 1px 0 #6a4510, 0 0 6px rgba(0,0,0,.45); }
#win-book .bk-emb.art b { margin-top: var(--emb-dy, 0px); }
#win-book .bk-emb.r-S.art, #win-book .bk-emb.r-A.art { width: 68px; height: 68px; }
#win-book .bk-emb.r-S b { color: #ffffff; text-shadow: 0 0 6px #7fd0ff, 0 0 2px #2a5a9a; }
#win-book .bk-nextemb { display: grid; justify-items: center; gap: 1px; padding-left: 6px; border-left: 1px dashed #d8c08a; }
#win-book .bk-nextemb small { font-size: 10px; color: #8a7a58; line-height: 1.2; }
#win-book .bk-nextemb .bk-emb { width: 44px; height: 44px; filter: grayscale(.55) opacity(.75); }
#win-book .bk-nextemb .bk-emb.r-S, #win-book .bk-nextemb .bk-emb.r-A { width: 48px; height: 48px; }
#win-book .bk-nextemb .bk-emb b { font-size: 16px; }

/* Theme A (noir gold), user 2026-11-16 "อ่านยาก": the class-3 path cards were light cards with the theme's light text. */
html[data-ui="a"] .c3p-col { background: rgba(24, 21, 30, .9); border-color: rgba(201, 162, 78, .45); color: #efe6cf; }
html[data-ui="a"] .c3p-col.on { border-color: #e2bb62; }
html[data-ui="a"] .c3p-col header b, html[data-ui="a"] .c3p-col p, html[data-ui="a"] .c3p-pas b { color: #f3ead2; }
html[data-ui="a"] .c3p-col header small { color: #e2bb62; }
html[data-ui="a"] .c3p-bars b, html[data-ui="a"] .c3p-pas small, html[data-ui="a"] .c3p-intro { color: #bdb4a0; }
html[data-ui="a"] .c3p-bars span { background: rgba(255, 255, 255, .12); }
html[data-ui="a"] .c3p-bars i { background: rgba(255, 255, 255, .38); }
html[data-ui="a"] .c3p-here { color: #8fe09a; }
html[data-ui="a"] .c3p-fork b { color: #e2bb62; }
html[data-ui="a"] .c3p-look { background: radial-gradient(closest-side, rgba(226, 187, 98, .18), transparent); }
/* Theme A: the + of a worn piece sits as a badge on the slot's top-right corner, clear of the slot's name. */
html[data-ui="a"] .doll-slot .ds-plus { position: absolute; top: -5px; right: -5px; min-width: 20px; padding: 0 5px; border-radius: 9px; background: #14121a; border: 1px solid #c9a24e;
  color: #ffe08a; font: 700 10.5px/17px 'IBM Plex Sans Thai', sans-serif; font-style: normal; text-align: center; z-index: 2; }
html[data-ui="a"] .c3p-bars i.up { background: linear-gradient(90deg, #a9853c, #f0d68a); }
/* Where the letter sits on each badge (its plain face), and its colour: dark on the silver faces. */
#win-book .bk-emb.r-F { --emb-dy: 0px; } #win-book .bk-emb.r-E { --emb-dy: -3px; } #win-book .bk-emb.r-D { --emb-dy: -7px; } #win-book .bk-emb.r-C { --emb-dy: -7px; }
#win-book .bk-emb.r-B { --emb-dy: -4px; } #win-book .bk-emb.r-A { --emb-dy: -6px; } #win-book .bk-emb.r-S { --emb-dy: -2px; }
#win-book .bk-emb.art.r-D b, #win-book .bk-emb.art.r-S b { color: #1f2c4d; text-shadow: 0 1px 0 rgba(255,255,255,.8), 0 0 6px rgba(140,200,255,.6); }
#win-book .bk-emb.art.r-F b { color: #e8e2d4; text-shadow: 0 1px 2px #000; }

/* ==== Gameplay bar, layout B (user 2026-11-16, picked from tools/skillbar-mock.html: "B, the JOB bar below, LV above,
   the % inside the bars") ====
   Items small on top, the numbered skills big below, and on the right an action cluster: a big round attack (SPACE),
   dash (SHIFT) and auto (H) round it. The level and job bars run the full width of the screen's foot, LV over JOB, each
   with its level and % printed inside. Every UI theme alike. */
html #hud #skillbar:not(#_):not(#__) { display: grid; grid-template-columns: auto auto; grid-template-areas: "items act" "skills act" "xp act"; align-items: end; justify-content: center;
  column-gap: 14px; row-gap: 6px; bottom: 10px; padding: 0; width: max-content; max-width: calc(100vw - 16px); background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
html #hud #skillbar:not(#_):not(#__) .sb-top { display: contents; }
html #hud #skillbar:not(#_):not(#__) :is(.sb-emblem, .sb-rail) { display: none; }
html #hud #skillbar:not(#_):not(#__) #dock-right { grid-area: items; justify-self: center; display: flex; gap: 5px; padding: 5px 8px; margin: 0; border: 0; border-radius: 12px;
  background: rgba(16, 13, 22, 0.62); box-shadow: inset 0 0 0 1px rgba(242, 214, 138, 0.2); }
html #hud #skillbar:not(#_):not(#__) #dock-main { grid-area: skills; display: flex; gap: 7px; padding: 8px 10px; margin: 0; border: 0; border-radius: 14px;
  background: rgba(16, 13, 22, 0.74); box-shadow: inset 0 0 0 1px rgba(242, 214, 138, 0.3), 0 6px 18px rgba(0, 0, 0, 0.4); }
html #hud #skillbar:not(#_):not(#__) #dock-left { grid-area: act; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: end; gap: 6px; margin: 0; padding: 0; border: 0; }
/* the slots */
html #hud #skillbar:not(#_):not(#__) .slot { width: 38px; height: 38px; border-radius: 9px; border: 0; background: rgba(20, 16, 26, 0.78);
  box-shadow: inset 0 0 0 1px rgba(242, 214, 138, 0.3), 0 2px 6px rgba(0, 0, 0, 0.45); overflow: visible; }
html #hud #skillbar:not(#_):not(#__) .slot canvas { width: 86%; height: 86%; margin: 7%; border-radius: 7px; }
html #hud #skillbar:not(#_):not(#__) :is(.slot .cd, .slot .lock) { inset: 0; border-radius: 9px; }
html #hud #skillbar:not(#_):not(#__) #dock-main .slot { width: 56px; height: 56px; border-radius: 10px; }
html #hud #skillbar:not(#_):not(#__) #dock-main :is(.slot .cd, .slot .lock) { border-radius: 10px; }
html #hud #skillbar:not(#_):not(#__) .slot .key { left: -4px; top: -7px; bottom: auto; z-index: 3; min-width: 15px; padding: 0 4px; border-radius: 5px; text-align: center;
  font: 600 10px/15px Kanit, sans-serif; letter-spacing: 0; color: #f3e3b8; background: #13101a; border: 1px solid rgba(242, 214, 138, 0.6); text-shadow: none; }
html #hud #skillbar:not(#_):not(#__) #dock-main .slot .key { font-size: 11px; line-height: 16px; }
html #hud #skillbar:not(#_):not(#__) .slot .count { right: 3px; bottom: 1px; font: 700 11.5px Kanit, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
html #hud #skillbar:not(#_):not(#__) .slot:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px rgba(242, 214, 138, 0.85), 0 4px 10px rgba(0, 0, 0, 0.5); }
html #hud #skillbar:not(#_):not(#__) .slot.empty { background: rgba(20, 16, 26, 0.4); box-shadow: inset 0 0 0 1px rgba(242, 214, 138, 0.18); border: 0; }
/* the action cluster: attack big and round on the right, auto over dash on its left */
html #hud #skillbar:not(#_):not(#__) #dock-left .slot { border-radius: 50%; }
html #hud #skillbar:not(#_):not(#__) #dock-left .slot canvas, html #hud #skillbar:not(#_):not(#__) #dock-left :is(.slot .cd, .slot .lock) { border-radius: 50%; }
html #hud #skillbar:not(#_):not(#__) #dock-left .slot:nth-child(1) { grid-column: 2; grid-row: 1 / 3; width: 78px; height: 78px; box-shadow: inset 0 0 0 2px #e3b04a, 0 4px 14px rgba(0, 0, 0, 0.5); }
html #hud #skillbar:not(#_):not(#__) #dock-left .slot:nth-child(2) { grid-column: 1; grid-row: 2; width: 50px; height: 50px; }
html #hud #skillbar:not(#_):not(#__) #dock-left .slot:nth-child(3) { grid-column: 1; grid-row: 1; width: 42px; height: 42px; justify-self: end; }
html #hud #skillbar:not(#_):not(#__) #dock-left .slot.on { box-shadow: inset 0 0 0 2px #7fe08f, 0 0 12px rgba(127, 224, 143, 0.65); }
html #hud #skillbar:not(#_):not(#__) #dock-left .slot .key { left: 50%; top: -8px; transform: translateX(-50%); }

/* the level and job bars across the screen's foot: LV (gold) over JOB (blue), each with its text inside */
/* (Only as wide as the skills, under them, user 2026-11-16 "หลอดเวลไว้แค่นี้พอ".) */
html #hud #skillbar #xp-row:not(#_) { grid-area: xp; position: static; display: grid; gap: 2px; margin: 0; padding: 0; order: 0; }
html #hud #skillbar #xp-row:not(#_) :is(#exp-line, #job-line) { position: relative; height: 13px; margin: 0; border-radius: 6px; background: rgba(8, 7, 12, 0.72); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); overflow: hidden; pointer-events: auto; }
html #hud #skillbar #xp-row:not(#_) #job-line { height: 11px; }
html #hud #skillbar #xp-row:not(#_) :is(#exp-line, #job-line) i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; transition: width 0.3s; }
html #hud #skillbar #xp-row:not(#_) #exp-line i { background: linear-gradient(90deg, #a8772a, #e8b84a 60%, #ffe28a); }
html #hud #skillbar #xp-row:not(#_) #exp-line i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 248, 225, 0.6), transparent) no-repeat; background-size: 30% 100%; animation: xpRun 3.2s linear infinite; }
@keyframes xpRun { from { background-position: -40% 0; } to { background-position: 140% 0; } }
html #hud #skillbar #xp-row:not(#_) #job-line i { background: linear-gradient(90deg, #2f6fb8, #5aa8ff 70%, #bfe2ff); }
html #hud #skillbar #xp-row:not(#_) #job-line.top i { background: linear-gradient(90deg, #3f9a52, #8fe09a 70%, #d4ffdc); }
html #hud #skillbar #xp-row:not(#_) :is(#exp-line, #job-line) span { position: absolute; inset: 0; left: 0; top: 0; transform: none; display: grid; place-items: center; z-index: 1;
  font: 600 10px/1 Kanit, sans-serif; letter-spacing: 0.04em; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; white-space: nowrap; }
html #hud #skillbar #xp-row:not(#_) #job-line span { font-size: 9px; color: #e6f3ff; }
html #hud #skillbar #xp-row:not(#_) #exp-line.near i { background: linear-gradient(90deg, #a8662a, #f0a040 70%, #ffd27a); }
html #hud #skillbar #xp-row:not(#_) #exp-line.almost i { background: linear-gradient(90deg, #c8743a, #ffb050 60%, #fff0b0); animation: exp-pulse 0.9s ease-in-out infinite; }
html #hud #skillbar #xp-row:not(#_) #exp-line.almost span::after { content: ' · ใกล้เลเวลอัป!'; }
html #hud #skillbar #xp-row:not(#_) #exp-line.gain i { animation: exp-gain 0.5s ease-out; }
@media (prefers-reduced-motion: reduce) { html #hud #skillbar #xp-row:not(#_) #exp-line i::after, html #hud #skillbar #xp-row:not(#_) #exp-line.almost i { animation: none; } }

/* Toasts smaller (user 2026-11-16 "ย่อลงหน่อย ยาวไปนิด"): a smaller icon and type, tighter padding, a narrower cap. */
#toasts:not(#_) { gap: 4px; bottom: 250px; } /* above the menu grid (user: drops covered the menu) */
#toasts .toast:not(#_) { max-width: 210px; gap: 6px; padding: 3px 9px 3px 5px; font-size: 12px; line-height: 1.25; }
#toasts .toast:not(#_) canvas { width: 22px; height: 22px; }

/* New in the bag (user 2026-11-16): a NEW tag on a kind of item the bag did not hold before, a soft glow that pulses a
   few times, a dot on its filter; gone once pointed at (ui bagNewTick / bagSeen). Every theme alike. */
html .bag-grid .cell.is-new:not(#_) { position: relative; animation: bag-new 1.1s ease-in-out 3; box-shadow: inset 0 0 0 1.5px #ffd65a, 0 0 8px rgba(255, 214, 90, 0.55); }
@keyframes bag-new { 50% { box-shadow: inset 0 0 0 2px #fff0a8, 0 0 16px rgba(255, 214, 90, 0.95); } }
html .bag-grid .cell .new-tag:not(#_) { position: absolute; left: -3px; top: -5px; z-index: 3; padding: 0 4px; border-radius: 4px; pointer-events: none;
  font: 800 9px/13px Kanit, sans-serif; font-style: normal; letter-spacing: 0.04em; color: #2a1800; background: linear-gradient(#fff3b0, #ffc93a); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
html .bag-filters button.has-new:not(#_) { position: relative; }
html .bag-filters button.has-new:not(#_)::after { content: ''; position: absolute; top: 1px; right: 1px; width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 5px #ff5a5a; }
@media (prefers-reduced-motion: reduce) { html .bag-grid .cell.is-new:not(#_) { animation: none; } }

/* Dragging a usable item out of the bag (user 2026-11-16: the bag window covered the item bar): while it is held the
   gameplay bar comes up over every window and its item slots light up as drop targets (ui ondragstart/ondragend). */
html.quick-drag #hud #skillbar:not(#_):not(#__) { z-index: 60; }
html.quick-drag #hud #skillbar:not(#_):not(#__) #dock-right .slot { box-shadow: inset 0 0 0 2px #ffd65a, 0 0 12px rgba(255, 214, 90, 0.8); animation: quick-drop 0.9s ease-in-out infinite; }
@keyframes quick-drop { 50% { transform: translateY(-3px); } }

/* The bag's item card, every theme (user 2026-11-16: the name ran into the text, the button sat under the icon):
   icon top-left, the text beside it (the name on its own line), the button on the right. Theme C has its own. */
html #win-bag:not(#_) .bag-detail:not(.muted) { display: grid !important; grid-template-columns: auto 1fr auto; align-items: start !important; align-content: stretch !important; grid-template-rows: 1fr; gap: 14px; }
html #win-bag:not(#_) .bag-detail .bd-well { align-self: start; margin: 0; }
html #win-bag:not(#_) .bag-detail .bd-info { align-self: start; line-height: 1.5; }
html:is([data-ui="a"], [data-ui="b"]) #win-bag:not(#_) .bag-detail .bd-info > b:first-child { display: block; margin-bottom: 2px; font-size: 15px; }
html #win-bag:not(#_) .bag-detail .acts { grid-column: 3; grid-row: 1; align-self: end; display: flex; flex-direction: column; gap: 8px; margin: 0; }
html:is([data-ui="a"], [data-ui="b"]) #win-bag:not(#_) .bag-detail .acts .btn { min-width: 96px; min-height: 32px; font-size: 13.5px; }

/* The guild window in theme A (user 2026-11-16 "อ่านยาก"): the quest, building and boss-step rows were ivory cards
   from theme B with theme A's light text on them. Dark rows here, text in theme A's colours. */
html[data-ui="a"] #win-guild:not(#_) :is(.gd-quest, .gd-bld, .gd-step) { background: rgba(255, 255, 255, 0.045); border-color: rgba(201, 169, 110, 0.32); }
html[data-ui="a"] #win-guild:not(#_) :is(.gd-quest, .gd-bld, .gd-step) :is(b, .gd-main > b) { color: #f2ede3; }
html[data-ui="a"] #win-guild:not(#_) :is(.gd-quest, .gd-bld, .gd-step) :is(small, .gd-qrw small) { color: #b8ab92; }
html[data-ui="a"] #win-guild:not(#_) .gd-quest .gd-qrw { color: #e2c98c; }
html[data-ui="a"] #win-guild:not(#_) .gd-qbar { background: rgba(255, 255, 255, 0.1); }
html[data-ui="a"] #win-guild:not(#_) .gd-qbar span { color: #fff; text-shadow: 0 0 3px #000; }
html[data-ui="a"] #win-guild:not(#_) .gd-quest.done { opacity: 0.85; border-color: rgba(108, 191, 116, 0.5); }
html[data-ui="a"] #win-guild:not(#_) :is(.bd-done, .gd-bld .gd-main small.ok) { color: #8fe09a; }
html[data-ui="a"] #win-guild:not(#_) .gd-step .gd-sn { color: #e2c98c; }
html[data-ui="a"] #win-guild:not(#_) .gd-step.done { background: rgba(63, 138, 74, 0.16); }

/* "เข้าห้องกิลด์" stands out in every theme (user 2026-11-16): a green-gold button with a door glyph and a soft pulse. */
html #win-guild [data-ghall]:not(#_):not(#__):not(#___) { position: relative; padding: 7px 16px 7px 34px !important; min-height: 34px; border: 1px solid #f0d48e !important; border-image: none !important; border-radius: 8px !important;
  background: linear-gradient(180deg, #4fae6a, #2f7a48) !important; color: #fff !important; font: 600 13.5px Kanit, sans-serif !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 3px 10px rgba(47, 122, 72, 0.5); animation: ghall-pulse 2.4s ease-in-out infinite; }
html #win-guild [data-ghall]:not(#_):not(#__):not(#___)::before { content: ''; position: absolute; left: 12px; top: 50%; width: 14px; height: 16px; translate: 0 -50%;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath d='M1 15V3.5A3.5 3.5 0 0 1 4.5 0h5A3.5 3.5 0 0 1 13 3.5V15z' fill='%23fff3c8'/%3E%3Ccircle cx='9.6' cy='9' r='1.1' fill='%232f7a48'/%3E%3C/svg%3E"); }
html #win-guild [data-ghall]:not(#_):not(#__):not(#___):hover:not(:disabled) { filter: brightness(1.12); }
html #win-guild [data-ghall]:not(#_):not(#__):not(#___):disabled { animation: none; opacity: 1; background: linear-gradient(180deg, #5b6570, #3e464f) !important; border-color: #8a96a2 !important; box-shadow: none; }
@keyframes ghall-pulse { 50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 16px rgba(120, 220, 140, 0.75); } }
@media (prefers-reduced-motion: reduce) { html #win-guild [data-ghall]:not(#_):not(#__):not(#___) { animation: none; } }

/* The wanted poster (user 2026-11-16 "UI แบบประกาศจับจริงๆ WANTED"): torn, aged parchment pinned up with two nails,
   WANTED in big serif type, a sepia portrait in an inked frame with the time left as a red stamp across its corner,
   "dead or alive", the name, the charge, the reward in big type. Every theme alike. */
html :is(#win-book, #win-events) .bk-poster.wp:not(#_) { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; box-sizing: border-box;
  padding: 18px 18px 14px; border: 0; border-radius: 0; text-align: center; color: #3b2410;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 248, 225, 0.75), transparent 55%), radial-gradient(ellipse at 80% 85%, rgba(150, 95, 35, 0.28), transparent 60%),
    radial-gradient(circle at 12% 70%, rgba(120, 70, 20, 0.16) 0 6%, transparent 7%), radial-gradient(circle at 88% 30%, rgba(120, 70, 20, 0.12) 0 4%, transparent 5%), linear-gradient(#ecd3a0, #d9b678);
  box-shadow: inset 0 0 26px rgba(105, 60, 15, 0.55), inset 0 0 4px rgba(80, 40, 10, 0.6); filter: drop-shadow(0 6px 10px rgba(40, 20, 5, 0.45));
  clip-path: polygon(0 1.5%, 6% 0, 14% 1.2%, 23% 0.2%, 33% 1.4%, 44% 0, 55% 1.1%, 66% 0.1%, 77% 1.3%, 88% 0.2%, 100% 1%, 99.2% 12%, 100% 26%, 99% 40%, 100% 55%, 99.1% 70%, 100% 84%, 99.3% 100%,
    90% 98.8%, 79% 100%, 67% 98.9%, 55% 100%, 43% 98.7%, 31% 100%, 20% 98.9%, 9% 100%, 0 98.6%, 0.9% 86%, 0 72%, 0.8% 57%, 0 42%, 0.9% 28%, 0 14%); }
html :is(#win-book, #win-events) .bk-poster.wp .wp-pin { position: absolute; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f2e0b0, #8a6a2a 55%, #3a2a10); box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5); }
html :is(#win-book, #win-events) .bk-poster.wp .wp-pin.l { left: 12px; } html :is(#win-book, #win-events) .bk-poster.wp .wp-pin.r { right: 12px; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-wanted:not(#_) { font: 900 44px/1 'Noto Serif Thai', Georgia, serif; letter-spacing: 0.1em; color: #4a2410; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6), 0 0 1px #2a1408; margin-top: 2px; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-sub { display: flex; align-items: center; gap: 8px; font: 700 13px 'Noto Serif Thai', serif; letter-spacing: 0.4em; color: #7a2a14; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-sub::before, html :is(#win-book, #win-events) .bk-poster.wp .wp-sub::after { content: ''; width: 34px; height: 2px; background: linear-gradient(90deg, transparent, #7a2a14); }
html :is(#win-book, #win-events) .bk-poster.wp .wp-sub::after { transform: scaleX(-1); }
html :is(#win-book, #win-events) .bk-poster.wp .wp-photo { position: relative; margin: 6px 0 2px; padding: 5px; background: #f3e2bb; border: 3px double #5a3418; box-shadow: 0 2px 4px rgba(60, 30, 5, 0.35); }
html :is(#win-book, #win-events) .bk-poster.wp .wp-photo canvas:not(#_) { display: block; width: 116px; height: 104px; border: 0; border-radius: 0; background: radial-gradient(circle, #f6ead0, #dcc08a); filter: sepia(0.45) contrast(1.05) saturate(0.85); }
html :is(#win-book, #win-events) .bk-poster.wp .wp-photo.none { display: grid; place-items: center; width: 116px; height: 104px; box-sizing: content-box; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-photo.none span { font: 900 54px 'Noto Serif Thai', serif; color: rgba(90, 52, 24, 0.35); }
html :is(#win-book, #win-events) .bk-poster.wp .wp-stamp { position: absolute; right: -30px; bottom: 8px; padding: 3px 7px; border: 2px solid #b0201a; border-radius: 4px; rotate: -14deg;
  font: 800 11px/1.15 Kanit, sans-serif; color: #b0201a; background: rgba(243, 226, 187, 0.55); mix-blend-mode: multiply; text-transform: uppercase; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-dead { font: 700 12px 'Noto Serif Thai', serif; letter-spacing: 0.15em; color: #7a2a14; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-name:not(#_) { margin: 0; font: 800 19px/1.2 'Noto Serif Thai', serif; color: #3b1a08; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-meta { font-size: 12px; line-height: 1.35; color: #5a3a1a; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-reward { display: grid; margin: 4px 0 2px; padding: 3px 18px; border-top: 2px solid #5a3418; border-bottom: 2px solid #5a3418; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-reward small { font: 700 11px 'Noto Serif Thai', serif; letter-spacing: 0.3em; color: #7a2a14; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-reward b:not(#_) { font: 900 22px/1.15 'Noto Serif Thai', serif; color: #3b1a08; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-reward b img, html :is(#win-book, #win-events) .bk-poster.wp .wp-reward b canvas { width: 20px; height: 20px; vertical-align: -3px; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-go { margin-top: auto; }
html :is(#win-book, #win-events) .bk-poster.wp.empty .wp-meta { max-width: 240px; }
html :is(#win-book, #win-events) .bk-poster.wp :is(.wp-meta, .wp-crime, .wp-name, .wp-dead) { text-wrap: balance; max-width: 92%; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-meta em { font-style: normal; font-weight: 700; color: #3b1a08; }
html :is(#win-book, #win-events) .bk-poster.wp .wp-crime { font: 600 13px/1.35 'Noto Serif Thai', serif; color: #4a2410; }

/* The book, part two (user 2026-11-16): eleven bookmarks now (smaller), a monster's three stars under its picture and
   a gold frame once its champion is beaten, a friend's mark, a story or an animal's line, the titles as name cards. */
/* (Eleven bookmarks fit the book's own height whatever its cover: the column runs from near the top to near the
   bottom of the book and each bookmark shrinks to share it, user 2026-11-16 "เลยมา".) */
@media (min-width: 761px) {
  html #win-book:not(#_):not(#__) .bk-tabs { top: 60px; bottom: 12px; gap: 3px; justify-content: flex-start; }
  html #win-book:not(#_):not(#__) .bk-tab { flex: 0 1 48px; min-height: 30px; height: auto; }
}
#win-book .bk-tab:not(#_) { width: 50px; height: 48px; }
#win-book .bk-tab:not(#_) .bk-ti { width: 30px; height: 30px; }
#win-book .bk-cell { position: relative; }
#win-book .bk-cell .bk-stars { position: absolute; left: 0; right: 0; bottom: 1px; display: flex; justify-content: center; gap: 0; font-style: normal; pointer-events: none; }
#win-book .bk-stars b, #win-book .bk-starline .bk-star { font: 900 11px/1 sans-serif; color: rgba(70, 50, 30, 0.28); text-shadow: 0 0 2px rgba(255, 250, 235, 0.9); }
#win-book .bk-stars b.on.s1, #win-book .bk-star.on.s1 { color: #c07a3c; }
#win-book .bk-stars b.on.s2, #win-book .bk-star.on.s2 { color: #a9b6c4; text-shadow: 0 0 2px #3a4a5a; }
#win-book .bk-stars b.on.s3, #win-book .bk-star.on.s3 { color: #ffcf3a; text-shadow: 0 0 4px rgba(255, 190, 40, 0.9), 0 0 1px #6a4400; }
#win-book .bk-cell.champ { box-shadow: inset 0 0 0 2px #e2b23a, 0 0 8px rgba(226, 178, 58, 0.55); }
#win-book .bk-cell.champ::after { content: '♛'; position: absolute; right: 2px; top: 0; font-size: 11px; color: #c8901c; text-shadow: 0 0 2px #fff6d8; }
#win-book .bk-cell.friend::after { content: '♥'; position: absolute; right: 3px; top: 1px; font-size: 11px; color: #e0567a; text-shadow: 0 0 2px #fff; }
#win-book .bk-starline { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: center; }
#win-book .bk-starline .bk-star { font-size: 17px; font-style: normal; }
#win-book .bk-starline small { margin-left: 6px; }
#win-book .bk-champ { color: #8a7a60; } #win-book .bk-champ.on { color: #a26a10; font-weight: 700; }
#win-book .bk-tale { margin: 4px 6px 0; font: italic 500 12.5px/1.5 'Noto Serif Thai', serif; color: #5a4128; text-align: center; text-wrap: balance; }
#win-book .bk-grid.titles { grid-template-columns: repeat(2, 1fr) !important; grid-auto-rows: 40px; }
#win-book .bk-grid.titles .bk-cell { display: grid; place-items: center; padding: 0 6px; width: auto; height: 40px; aspect-ratio: auto; }
#win-book .bk-tt { font: 700 12.5px/1.2 'Noto Serif Thai', serif; color: #6a5a40; text-align: center; text-wrap: balance; }
#win-book .bk-grid.titles .bk-cell.on .bk-tt { color: #8a5a08; }
#win-book .bk-grid.titles .bk-cell.on { background: linear-gradient(#fff3c8, #f2d784); box-shadow: inset 0 0 0 1.5px #c9a24e; }
#win-book .bk-grid.titles .bk-cell.off .bk-tt { color: #9a8a70; }
#win-book .bk-ribbon { display: grid; place-items: center; gap: 4px; width: 200px; min-height: 120px; margin: 30px auto 6px; padding: 18px 14px; box-sizing: border-box; border-radius: 10px;
  background: linear-gradient(#fff2c4, #ecd08a); box-shadow: inset 0 0 0 2px #c9a24e, 0 4px 10px rgba(90, 60, 20, 0.25); text-align: center; }
#win-book .bk-ribbon small { font: 700 11px 'Noto Serif Thai', serif; letter-spacing: 0.3em; color: #8a6a30; }
#win-book .bk-ribbon b { font: 800 18px/1.3 'Noto Serif Thai', serif; color: #6a3c06; text-wrap: balance; }
#win-book .bk-pick.titles.locked .bk-ribbon { filter: grayscale(0.9) opacity(0.6); }
#win-book .bk-pick.titles > b { display: none; }
/* Locked gear and looks in the book (user 2026-11-16 "ลอย ขาวดำ มันหายไป": a solid black shape of a square piece — a
   tome, armour, boots — read as an empty box): faded grey with its own lines still showing, not a flat silhouette. */
#win-book .bk-grid:is(.gear, .fashion, .people, .animals) .bk-cell.off canvas:not(#_), #win-book .bk-pick:is(.gear, .fashion, .people, .animals).locked canvas:not(#_) { filter: grayscale(1) brightness(0.8) contrast(0.9) opacity(0.42); }
/* (A locked monster or boss keeps its dark shape, but the big picture's frame stays the page's colour: the filter goes
   on the picture alone, its box behind it drawn by a wrapper.) */
#win-book .bk-pick:is(.monsters, .bosses).locked canvas:not(#_) { filter: brightness(0) opacity(0.3); background: none !important; box-shadow: none !important; }

/* The book's first page dressed (user 2026-11-16 "ตกแต่งหน้านี้ให้ดูดีกว่านี้"): an engraved compass-rose watermark and
   faint ruled lines on both paper pages, ornamented headings, the progress as two columns of cards with each page's own
   bookmark icon, the stats as small chips, four counters in a row. */
#win-book .bk-page { position: relative; isolation: isolate; }
#win-book .bk-page::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.11;
  background: no-repeat center 58% / 78% auto url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%237a5418' stroke-width='1.2'%3E%3Ccircle cx='100' cy='100' r='92'/%3E%3Ccircle cx='100' cy='100' r='84' stroke-dasharray='2 4'/%3E%3Ccircle cx='100' cy='100' r='40'/%3E%3Cpath d='M100 6 L110 90 L194 100 L110 110 L100 194 L90 110 L6 100 L90 90 Z' fill='%237a5418' fill-opacity='.25'/%3E%3Cpath d='M100 34 L106 94 L166 100 L106 106 L100 166 L94 106 L34 100 L94 94 Z' transform='rotate(45 100 100)' fill='%237a5418' fill-opacity='.15'/%3E%3C/svg%3E"),
  repeating-linear-gradient(transparent 0 27px, rgba(122, 84, 24, 0.18) 27px 28px); }
#win-book .bk-orn { display: flex; align-items: center; gap: 8px; }
#win-book .bk-orn::before, #win-book .bk-orn::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #c9a24e); }
#win-book .bk-orn::after { transform: scaleX(-1); }
#win-book h3.bk-orn { justify-content: center; margin: 0 0 8px; }
#win-book h3.bk-orn small { font: 500 11.5px 'IBM Plex Sans Thai', sans-serif; color: #8a7448; margin-left: 4px; }
#win-book .bk-prog2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
#win-book .bk-pc { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; padding: 5px 9px 5px 6px; border: 1px solid #e3d4ac; border-radius: 9px; cursor: pointer; text-align: left;
  background: linear-gradient(#fffdf6, #f7eed8); box-shadow: 0 1px 2px rgba(110, 80, 20, 0.12); }
#win-book .bk-pc:hover { border-color: #c9a24e; transform: translateY(-1px); }
#win-book .bk-pc .bk-pi { width: 30px; height: 30px; background: var(--ti) center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
#win-book .bk-pc span { display: grid; grid-template-columns: 1fr auto; gap: 1px 6px; min-width: 0; }
#win-book .bk-pc b { font: 600 13px 'IBM Plex Sans Thai', sans-serif; color: #2b2f45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-book .bk-pc em { font: 700 12px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #1f2c4d; font-variant-numeric: tabular-nums; }
#win-book .bk-pc .bk-bar { grid-column: 1 / -1; }
#win-book .bk-pc.full { border-color: #d8b04a; background: linear-gradient(#fff6d8, #f6e2a6); }
#win-book .bk-pc.full em::after { content: ' ✓'; color: #3f8a4a; }
#win-book .bk-facts4 { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; margin-top: 10px; }
#win-book .bk-facts4 span { display: grid; justify-items: center; gap: 1px; padding: 6px 4px; border-radius: 8px; background: rgba(201, 162, 78, 0.14); border: 1px solid rgba(201, 162, 78, 0.35); }
#win-book .bk-facts4 small { font-size: 10.5px; color: #7a6a48; }
#win-book .bk-facts4 b { font: 700 16px 'Noto Serif Thai', serif; color: #1f2c4d; font-variant-numeric: tabular-nums; }
#win-book .bk-sum:not(#_) { border: 0; padding: 4px 0 0; gap: 6px; }
#win-book .bk-sum h4.bk-orn { justify-content: center; }
#win-book .bk-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
#win-book .bk-chips span { display: grid; justify-items: center; padding: 3px 2px; border-radius: 7px; background: #fffaf0; border: 1px solid #eadcb8; }
#win-book .bk-chips small { font-size: 10px; color: #8a7448; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#win-book .bk-chips b { font: 700 13px 'IBM Plex Sans Thai', sans-serif; color: #2f6a3a; }
/* (The left page fits everything: the portrait beside the name, the class card under both, the stats in 4 columns.) */
#win-book .bk-me:not(#_) { grid-template-columns: 104px 1fr; align-items: center; justify-items: stretch; column-gap: 12px; row-gap: 6px; }
#win-book .bk-me:not(#_) > .bk-eyebrow, #win-book .bk-me:not(#_) > .bk-rank { grid-column: 1 / -1; }
#win-book .bk-me:not(#_) > canvas { width: 104px; height: 116px; }
#win-book .bk-me:not(#_) .bk-me-id { justify-items: start; text-align: left; }
#win-book .bk-me:not(#_) .bk-me-id b { font-size: 22px; }
#win-book .bk-chips:not(#_) { grid-template-columns: repeat(4, 1fr); gap: 3px; }
#win-book .bk-chips:not(#_) span { padding: 2px 2px 3px; }
#win-book .bk-chips:not(#_) b { font-size: 12.5px; line-height: 1.2; }
/* (The name block beside the portrait: the name, the class under it, then Lv and Job as two small labelled tags.) */
#win-book .bk-me:not(#_) .bk-me-id { align-self: center; gap: 4px; }
#win-book .bk-me:not(#_) .bk-me-id b { line-height: 1.1; }
#win-book .bk-me-id .bk-cls { font: 600 13px 'IBM Plex Sans Thai', sans-serif; color: #8a6420; }
#win-book .bk-me-id .bk-lvs { display: flex; gap: 6px; }
#win-book .bk-me-id .bk-lvs em { display: inline-flex; align-items: baseline; gap: 3px; padding: 1px 9px; border-radius: 999px; font: 700 13px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #1f2c4d;
  background: #fffaf0; border: 1px solid #e3d4ac; }
#win-book .bk-me-id .bk-lvs em small { font-size: 10.5px; font-weight: 600; color: #8a7448; }
#win-book .bk-rank b .bk-blv { display: block; white-space: nowrap; font: 600 12px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #8a6420; }

/* The monthly check-in calendar (user 2026-11-16): 28 small day cells, 7 to a row, every 7th a gold big day; the
   daily missions as slim rows so the whole page fits without scrolling. Every theme alike. */
html #win-events .login-grid.month:not(#_) { grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 8px; }
html #win-events .login-grid.month .login-day:not(#_):not(#__):not(#___) { aspect-ratio: auto; height: 60px; min-height: 0; padding: 3px 2px 2px; border-radius: 8px; transform: none; animation: none;
  display: grid; grid-template-rows: 12px 1fr 13px; justify-items: center; align-items: center; gap: 0; border: 1px solid rgba(201, 162, 78, 0.35); border-image: none;
  background: linear-gradient(#253150, #141b2e); filter: none; box-shadow: none; }
html #win-events .login-grid.month .login-day small:not(#_) { position: static; font: 700 10px/12px Kanit, sans-serif; color: #c9b27a; }
html #win-events .login-grid.month .login-day canvas:not(#_) { width: 30px; height: 30px; aspect-ratio: auto; }
html #win-events .login-grid.month .login-day span:not(#_) { font: 700 10.5px/13px Kanit, sans-serif; color: #f2ead6; text-shadow: 0 1px 2px #000; white-space: nowrap; }
html #win-events .login-grid.month .login-day.big:not(#_):not(#__):not(#___) { background: linear-gradient(#6a4a12, #3a2708); border-color: #e2b23a; box-shadow: inset 0 0 0 1px rgba(255, 220, 120, 0.4), 0 0 8px rgba(226, 178, 58, 0.45); }
html #win-events .login-grid.month .login-day.big small:not(#_) { color: #ffe08a; }
html #win-events .login-grid.month .login-day.today:not(#_):not(#__):not(#___) { border-color: #7fe08f; box-shadow: 0 0 0 1px #7fe08f, 0 0 12px rgba(127, 224, 143, 0.6); animation: today 1.8s ease-in-out infinite; }
html #win-events .login-grid.month .login-day.done:not(#_):not(#__):not(#___) { filter: grayscale(0.6) brightness(0.55); }
html #win-events .login-grid.month .login-day i:not(#_) { font-size: 22px; }
html #win-events .login-grid.month .login-day em { display: none; }

/* ==== The events page, redesigned (user 2026-11-16 "ไม่น่ากดเข้ามา ช่องก็ไม่สวย") ====
   Its own navy-and-gold look in every theme: a showcase of today's gift turning in rays with one big button, the
   month's track with its four big days as chests, the calendar of small cards (a red ink stamp on taken days, the
   big days gold), the four daily missions as cards. Fits without scrolling. */
html #win-events:not(#_):not(#__) { width: min(820px, calc(100vw - 32px)) !important; }
html #win-events .ev2 { --ev-navy: #18213a; --ev-navy2: #0f1628; --ev-gold: #e2b84e; --ev-gold2: #fff0b8; --ev-ink: #f3ead6; --ev-dim: #a9a08a; }
html #win-events .ev2-hero { display: grid; grid-template-columns: 210px 1fr; gap: 14px; margin: 6px 0 10px; padding: 12px; border-radius: 14px;
  background: radial-gradient(ellipse at 18% 50%, rgba(255, 210, 110, 0.25), transparent 55%), linear-gradient(135deg, #22305a, #121a33 60%, #1c1530);
  box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35); color: var(--ev-ink); }
html #win-events .ev2-gift { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 176px; text-align: center; overflow: hidden; border-radius: 10px;
  background: radial-gradient(circle at 50% 42%, rgba(255, 220, 130, 0.35), rgba(20, 26, 48, 0) 62%); }
html #win-events .ev2-rays { position: absolute; left: 50%; top: 42%; width: 260px; height: 260px; translate: -50% -50%; pointer-events: none; opacity: 0.5;
  background: repeating-conic-gradient(from 0deg, rgba(255, 226, 140, 0.45) 0 7deg, transparent 7deg 22deg); mask: radial-gradient(circle, #000 18%, transparent 62%); animation: ev2-spin 18s linear infinite; }
@keyframes ev2-spin { to { rotate: 360deg; } }
html #win-events .ev2-gift canvas { position: relative; width: 104px; height: 104px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); animation: ev2-bob 2.4s ease-in-out infinite; }
@keyframes ev2-bob { 50% { translate: 0 -5px; } }
html #win-events .ev2-gift small { position: relative; font: 600 11.5px Kanit, sans-serif; letter-spacing: 0.04em; color: var(--ev-gold); }
html #win-events .ev2-gname { position: relative; max-width: 190px; font: 700 13px/1.3 Kanit, sans-serif; color: #fff; text-wrap: balance; }
html #win-events .ev2-gift.taken canvas { animation: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)) saturate(0.7); }
html #win-events .ev2-gift.taken .ev2-rays { opacity: 0.18; }
html #win-events .ev2-done { position: relative; font-size: 64px; color: #8fe09a; }
html #win-events .ev2-side { display: grid; align-content: center; gap: 8px; min-width: 0; }
html #win-events .ev2-title { display: flex; align-items: baseline; gap: 10px; }
html #win-events .ev2-title small { font: 600 12px Kanit, sans-serif; color: var(--ev-dim); }
html #win-events .ev2-title b { font: 800 22px 'Noto Serif Thai', serif; color: var(--ev-gold2); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
html #win-events .ev2-count { position: absolute; }
html #win-events .ev2-side { position: relative; }
html #win-events .ev2-count { top: 0; right: 4px; display: flex; align-items: baseline; gap: 4px; }
html #win-events .ev2-count b { font: 800 30px/1 'Noto Serif Thai', serif; color: #fff; }
html #win-events .ev2-count span { font: 600 13px Kanit, sans-serif; color: var(--ev-dim); }
html #win-events .ev2-track { position: relative; height: 10px; margin: 22px 22px 26px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.35); }
html #win-events .ev2-track > i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, #b07a20, #f0c860 70%, #fff0b0); box-shadow: 0 0 8px rgba(240, 200, 96, 0.6); }
html #win-events .ev2-mile { position: absolute; top: 50%; translate: -50% -50%; display: grid; justify-items: center; }
html #win-events .ev2-mile canvas { width: 38px; height: 38px; padding: 2px; border-radius: 50%; background: radial-gradient(circle, #2b3760, #141b33); box-shadow: 0 0 0 2px #6a5a34; filter: grayscale(0.6) brightness(0.75); }
html #win-events .ev2-mile b { position: absolute; bottom: -19px; font: 700 10.5px Kanit, sans-serif; color: var(--ev-dim); }
html #win-events .ev2-mile.got canvas { box-shadow: 0 0 0 2px var(--ev-gold), 0 0 12px rgba(240, 200, 96, 0.8); filter: none; }
html #win-events .ev2-mile.got b { color: var(--ev-gold); }
html #win-events .ev2-go:not(#_):not(#__):not(#___) { justify-self: start; min-width: 240px; min-height: 40px; padding: 8px 22px !important; border-radius: 10px !important; border: 1px solid #fff0b8 !important; border-image: none !important;
  font: 700 15px Kanit, sans-serif !important; color: #2a1800 !important; text-shadow: none !important; background: linear-gradient(#ffe48a, #e0a02a) !important; box-shadow: 0 4px 0 #8a5a10, 0 6px 14px rgba(0, 0, 0, 0.4); animation: ev2-pulse 1.6s ease-in-out infinite; }
html #win-events .ev2-go:not(#_):not(#__):not(#___):hover:not(:disabled) { filter: brightness(1.08); translate: 0 -1px; }
html #win-events .ev2-go:not(#_):not(#__):not(#___):disabled { animation: none; background: linear-gradient(#3a4566, #26304c) !important; color: #c9c2ae !important; border-color: #56607e !important; box-shadow: none; opacity: 1; }
@keyframes ev2-pulse { 50% { box-shadow: 0 4px 0 #8a5a10, 0 0 22px rgba(255, 210, 90, 0.85); } }
html #win-events .ev2-note { font: 500 11px Kanit, sans-serif; color: var(--ev-dim); }
/* the calendar */
html #win-events .ev2-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 10px; border-radius: 12px; background: linear-gradient(#1a2440, #10172b); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.35); }
html #win-events .ev2-day { position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; height: 58px; padding: 3px 2px 2px; border-radius: 9px; overflow: hidden;
  background: linear-gradient(#2c3a63, #1b2443); box-shadow: inset 0 0 0 1px rgba(160, 175, 220, 0.25), 0 2px 4px rgba(0, 0, 0, 0.35); color: var(--ev-ink); cursor: default; transition: transform 0.15s; }
html #win-events .ev2-day:hover { transform: translateY(-2px); }
html #win-events .ev2-day > small { position: absolute; left: 4px; top: 2px; font: 700 10px/1 Kanit, sans-serif; color: rgba(243, 234, 214, 0.65); }
html #win-events .ev2-day canvas { width: 32px; height: 32px; margin-top: 4px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
html #win-events .ev2-day > span { font: 700 11px/13px Kanit, sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
html #win-events .ev2-day.big { background: linear-gradient(#7a5414, #3c2808); box-shadow: inset 0 0 0 1.5px #f0c860, 0 0 10px rgba(240, 200, 96, 0.45); }
html #win-events .ev2-day.big::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 230, 150, 0.35), transparent 60%); pointer-events: none; }
html #win-events .ev2-day.big > small { color: #ffe08a; }
html #win-events .ev2-day.big canvas { width: 36px; height: 36px; }
html #win-events .ev2-day.done canvas, html #win-events .ev2-day.done > span { opacity: 0.45; filter: grayscale(0.7); }
html #win-events .ev2-stamp { position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: -16deg; padding: 1px 5px; border: 2px solid #e04a3a; border-radius: 4px;
  font: 800 10px/1.1 Kanit, sans-serif; font-style: normal; color: #ff6a5a; background: rgba(40, 10, 10, 0.35); letter-spacing: 0.05em; pointer-events: none; }
html #win-events .ev2-day.today { box-shadow: inset 0 0 0 2px #8fe09a, 0 0 14px rgba(143, 224, 154, 0.75); animation: ev2-today 1.4s ease-in-out infinite; }
@keyframes ev2-today { 50% { box-shadow: inset 0 0 0 2px #c8ffd0, 0 0 22px rgba(143, 224, 154, 1); } }
html #win-events .ev2-day.next { box-shadow: inset 0 0 0 1.5px rgba(143, 200, 255, 0.8); }
html #win-events .ev2-tag { position: absolute; right: 2px; top: 2px; padding: 0 4px; border-radius: 4px; font: 700 9px/13px Kanit, sans-serif; font-style: normal; color: #0e2a14; background: #8fe09a; }
html #win-events .ev2-tag.soon { color: #0e1a2a; background: #9fd0ff; }
/* daily missions */
html #win-events .ev2-h { display: flex; align-items: baseline; gap: 10px; margin: 10px 2px 6px; }
html #win-events .ev2-h b { font: 800 16px 'Noto Serif Thai', serif; }
html #win-events .ev2-h small { font: 500 11.5px Kanit, sans-serif; opacity: 0.75; }
html #win-events .ev2-quests { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html #win-events .ev2-q { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; color: var(--ev-ink);
  background: linear-gradient(#202b4a, #141b31); box-shadow: inset 0 0 0 1px rgba(160, 175, 220, 0.28); }
html #win-events .ev2-q canvas { width: 40px; height: 40px; border-radius: 50%; padding: 2px; background: radial-gradient(circle, #33416e, #18203a); box-shadow: 0 0 0 1.5px rgba(226, 184, 78, 0.6); }
html #win-events .ev2-qm { display: grid; gap: 3px; min-width: 0; }
html #win-events .ev2-qm b { font: 700 13px Kanit, sans-serif; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html #win-events .ev2-qm small { font: 500 11px Kanit, sans-serif; color: var(--ev-gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html #win-events .ev2-qbar { position: relative; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
html #win-events .ev2-qbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3f7ad0, #7fc0ff); border-radius: 7px; }
html #win-events .ev2-qbar em { position: relative; display: block; text-align: center; font: 700 10px/14px Kanit, sans-serif; font-style: normal; color: #fff; text-shadow: 0 0 3px #000; }
html #win-events .ev2-q.ready { box-shadow: inset 0 0 0 1.5px #8fe09a, 0 0 12px rgba(143, 224, 154, 0.45); }
html #win-events .ev2-q.ready .ev2-qbar i { background: linear-gradient(90deg, #3f9a52, #8fe09a); }
html #win-events .ev2-q.claimed { opacity: 0.55; }
html #win-events .ev2-q.claimed .ev2-qbar i { background: linear-gradient(90deg, #7a6a3a, #b8a060); }
html #win-events .ev2-q .btn:not(#_):not(#__) { min-width: 54px; }
@media (prefers-reduced-motion: reduce) { html #win-events :is(.ev2-rays, .ev2-gift canvas, .ev2-go, .ev2-day.today) { animation: none !important; } }
@media (max-width: 760px) { html #win-events .ev2-hero { grid-template-columns: 1fr; } html #win-events .ev2-quests { grid-template-columns: 1fr; } }
html #win-events .ev2-day.big > span { font-size: 9.5px; color: #ffe08a; }
/* (Theme C and B paint text navy/brown; the events panels keep their own colours.) */
html #win-events .ev2 :is(.ev2-hero, .ev2-cal, .ev2-quests) :is(b, small, span, em, i):not(#_) { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
html #win-events .ev2 .ev2-gift small:not(#_), html #win-events .ev2 .ev2-mile.got b:not(#_), html #win-events .ev2 .ev2-qm small:not(#_), html #win-events .ev2 .ev2-day.big > small:not(#_), html #win-events .ev2 .ev2-day.big > span:not(#_) { color: #ffd870 !important; }
html #win-events .ev2 .ev2-gname:not(#_), html #win-events .ev2 .ev2-count b:not(#_), html #win-events .ev2 .ev2-qm b:not(#_), html #win-events .ev2 .ev2-day > span:not(#_), html #win-events .ev2 .ev2-qbar em:not(#_) { color: #fff !important; }
html #win-events .ev2 .ev2-title b:not(#_) { color: #fff0b8 !important; }
html #win-events .ev2 :is(.ev2-title small, .ev2-count span, .ev2-note, .ev2-mile b):not(#_) { color: #b9b09a !important; }
html #win-events .ev2 .ev2-day > small:not(#_) { color: rgba(243, 234, 214, 0.7) !important; }
html #win-events .ev2 .ev2-stamp:not(#_) { color: #ff6a5a !important; text-shadow: none; }
html #win-events .ev2 .ev2-tag:not(#_) { color: #0e2a14 !important; text-shadow: none; }
html #win-events .ev2 .ev2-tag.soon:not(#_) { color: #0e1a2a !important; }
html #win-events .ev2 .ev2-done:not(#_) { color: #8fe09a !important; }
html #win-events .ev2 .ev2-q .btn:not(#_):not(#__):not(#___):disabled { color: #c9c2ae !important; }
/* (The missions' claim buttons look the same in every theme: navy and readable while waiting, green when ready.) */
html #win-events .ev2 .ev2-q .btn:not(#_):not(#__):not(#___):not(#____):not(#t5):not(#t6):not(#t7):not(#t8) { min-height: 30px; padding: 4px 12px !important; border-radius: 8px !important; border: 1px solid #56607e !important; border-image: none !important;
  background: linear-gradient(#323d5e, #222a44) !important; color: #c9c2ae !important; font: 700 12.5px Kanit, sans-serif !important; text-shadow: none !important; box-shadow: none !important; opacity: 1 !important; filter: none !important; }
html #win-events .ev2 .ev2-q .btn.ok:not(#_):not(#__):not(#___):not(#____):not(#t5):not(#t6):not(#t7):not(#t8):not(:disabled) { border-color: #c8ffd0 !important; background: linear-gradient(#5fc070, #2f7a48) !important; color: #fff !important; box-shadow: 0 0 10px rgba(143, 224, 154, 0.6) !important; }

/* ==== The Star Tower's page in the dungeon window (user 2026-11-16): its own black-stone-and-gold look, every theme ==== */
html #win-dungeon .tw-body:not(#_) { display: grid; gap: 10px; color: #ece6d6; }
html #win-dungeon .tw-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html #win-dungeon .tw-stat { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 4px; padding: 6px 12px; border-radius: 10px; background: linear-gradient(#232a44, #151b30); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.4); }
html #win-dungeon .tw-stat em { grid-column: 1 / -1; font: 600 11px Kanit, sans-serif; font-style: normal; color: #b9b09a; }
html #win-dungeon .tw-stat b { font: 800 22px/1 'Noto Serif Thai', serif; color: #fff0b8; }
html #win-dungeon .tw-stat i { font-style: normal; color: #b9b09a; font-size: 12px; }
html #win-dungeon .tw-main { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 12px; }
html #win-dungeon .tw-spire { display: grid; gap: 3px; padding: 12px 16px; border-radius: 12px; clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 22px), linear-gradient(#0b0e1a, #1e2238); }
html #win-dungeon .tw-seg { position: relative; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 4px 10px; border-radius: 6px;
  background: linear-gradient(90deg, #2a2f48, #1a1f34); box-shadow: inset 0 0 0 1px rgba(160, 150, 200, 0.18); }
html #win-dungeon .tw-seg b { grid-row: 1 / 3; font: 800 13px Kanit, sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
html #win-dungeon .tw-seg span { font: 600 12.5px Kanit, sans-serif; color: #e8e0cc; }
html #win-dungeon .tw-seg small { font-size: 10.5px; color: #a8a090; }
html #win-dungeon .tw-seg.done { box-shadow: inset 4px 0 0 #8fe09a, inset 0 0 0 1px rgba(143, 224, 154, 0.3); }
html #win-dungeon .tw-seg.done i { position: absolute; right: 10px; top: 50%; translate: 0 -50%; font-style: normal; color: #8fe09a; }
html #win-dungeon .tw-seg.now { background: linear-gradient(90deg, #5a4614, #2a2210); box-shadow: inset 0 0 0 1.5px #e2b84e, 0 0 12px rgba(226, 184, 78, 0.5); }
html #win-dungeon .tw-seg.now em { position: absolute; right: 8px; top: 50%; translate: 0 -50%; padding: 1px 7px; border-radius: 999px; font: 700 10px Kanit, sans-serif; font-style: normal; color: #241700; background: #e2b84e; }
html #win-dungeon .tw-side { display: grid; gap: 10px; align-content: start; min-width: 0; }
html #win-dungeon .tw-card { padding: 10px 12px; border-radius: 12px; background: linear-gradient(#1c2238, #12172a); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.3); display: grid; gap: 6px; }
html #win-dungeon .tw-card h4 { margin: 0; font: 800 15px 'Noto Serif Thai', serif; color: #e2b84e; }
html #win-dungeon .tw-card .muted { color: #a8a090 !important; font-size: 11.5px; }
html #win-dungeon .tw-bosses { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
html #win-dungeon .tw-b { display: grid; justify-items: center; gap: 1px; padding: 2px 0; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
html #win-dungeon .tw-b small { font: 700 9.5px Kanit, sans-serif; color: #c9c0aa; }
html #win-dungeon .tw-b span { display: flex; justify-content: center; flex-wrap: wrap; }
html #win-dungeon .tw-b canvas { width: 26px; height: 26px; }
html #win-dungeon .tw-b.k-mvp { box-shadow: inset 0 0 0 1px rgba(255, 210, 110, 0.55); }
html #win-dungeon .tw-b.k-tower { box-shadow: inset 0 0 0 1.5px #b07aff, 0 0 8px rgba(176, 122, 255, 0.5); background: rgba(80, 40, 140, 0.25); }
html #win-dungeon .tw-b.done { opacity: 0.45; }
html #win-dungeon .tw-rules { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 12.5px; line-height: 1.45; color: #e8e0cc; }
html #win-dungeon .tw-rules b { color: #fff0b8; }
html #win-dungeon .tw-gears > div { display: flex; gap: 10px; flex-wrap: wrap; }
html #win-dungeon .tw-gear { display: grid; grid-template-columns: 44px auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 10px; background: rgba(255, 60, 60, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.45); }
html #win-dungeon .tw-gear canvas { grid-row: 1 / 3; width: 44px; height: 44px; }
html #win-dungeon .tw-gear b { font: 700 12.5px Kanit, sans-serif; color: #ffd0c8; }
html #win-dungeon .tw-gear small { font-size: 10.5px; color: #ff8a7a; }
html #win-dungeon .tw-go-row { display: grid; justify-items: start; gap: 4px; }
html #dg-room.tw-room .tw-tag { display: block; margin-top: 6px; font: 700 14px Kanit, sans-serif; font-style: normal; color: #ffd870; letter-spacing: 0.06em; }
html #dg-room.tw-room.out { opacity: 0; transition: opacity 0.7s; }
@media (max-width: 760px) { html #win-dungeon .tw-main { grid-template-columns: 1fr; } html #win-dungeon .tw-bosses { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
html #win-dungeon .tw-body .tw-seg b:not(#_) { color: #fff !important; }
html #win-dungeon .tw-body .tw-seg span:not(#_) { color: #f0e8d4 !important; }
html #win-dungeon .tw-body .tw-seg small:not(#_) { color: #b0a890 !important; }
html #win-dungeon .tw-body .tw-seg.now span:not(#_), html #win-dungeon .tw-body .tw-seg.now b:not(#_) { color: #fff6d8 !important; }
html #win-dungeon .tw-body .tw-card h4:not(#_) { color: #e2b84e !important; }
html #win-dungeon .tw-body .tw-rules:not(#_), html #win-dungeon .tw-body .tw-rules li:not(#_) { color: #e8e0cc !important; }

/* ===== Dungeon window: tabs + Star Tower page (2026-11-17, user "split into sections, say what matters") ===== */
html #win-dungeon .dg-nav:not(#_) { display: flex; gap: 6px; padding: 2px 2px 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(226, 184, 78, 0.35); }
html #win-dungeon .dg-tab:not(#_) { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 10px; cursor: pointer; font: inherit; color: #d9cfb6; text-align: left;
  background: linear-gradient(#1d2236, #13172a); border: 1px solid rgba(226, 184, 78, 0.22); transition: border-color .15s, filter .15s; }
html #win-dungeon .dg-tab:not(#_):hover { border-color: rgba(226, 184, 78, 0.6); filter: brightness(1.12); }
html #win-dungeon .dg-tab svg:not(#_) { flex: none; width: 26px; height: 26px; fill: none; stroke: #c9a85a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html #win-dungeon .dg-tab .ds-ico:not(#_) { width: 30px; height: 30px; animation: none; }
html #win-dungeon .dg-tab span:not(#_) { display: grid; min-width: 0; line-height: 1.2; }
html #win-dungeon .dg-tab b:not(#_) { font: 700 14px 'Noto Serif Thai', serif; color: #efe2bf; white-space: nowrap; }
html #win-dungeon .dg-tab small:not(#_) { display: flex; align-items: center; gap: 3px; font: 500 11.5px 'IBM Plex Sans Thai', sans-serif; color: #a9a08a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html #win-dungeon .dg-tab small canvas:not(#_) { width: 14px; height: 14px; padding: 0; background: none; }
html #win-dungeon .dg-tab.on:not(#_) { background: linear-gradient(#5a4516, #2d2210); border-color: #e2b84e; box-shadow: 0 0 14px rgba(226, 184, 78, 0.35), inset 0 1px 0 rgba(255, 230, 160, 0.3); }
html #win-dungeon .dg-tab.on b:not(#_) { color: #fff1c2; }
html #win-dungeon .dg-tab.on small:not(#_) { color: #f1d58c; }
html #win-dungeon .dg-tab.on svg:not(#_) { stroke: #ffe39a; }
html #win-dungeon .dg-tab.shop:not(#_) { flex: 1.15 1 0; }

html #win-dungeon .tw2:not(#_) { display: grid; gap: 0; color: #ece6d6; }
html #win-dungeon .tw2-main:not(#_) { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; }
html #win-dungeon .tw2-left:not(#_) { display: grid; gap: 10px; align-content: start; }
html #win-dungeon .tw2-prog:not(#_) { padding: 10px 14px 12px; border-radius: 12px; background: linear-gradient(#232a44, #141a2e); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.4); }
html #win-dungeon .tw2-prog > small:not(#_) { font: 600 11.5px Kanit, sans-serif; color: #b9b09a; }
html #win-dungeon .tw2-big:not(#_) { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 6px; }
html #win-dungeon .tw2-big b:not(#_) { font: 800 34px/1 'Noto Serif Thai', serif; color: #fff0b8; }
html #win-dungeon .tw2-big i:not(#_) { font-style: normal; color: #b9b09a; font-size: 13px; }
html #win-dungeon .tw2-bar:not(#_) { position: relative; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.25); overflow: hidden; }
html #win-dungeon .tw2-bar i:not(#_) { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b8862a, #ffe08a); border-radius: 99px; }
html #win-dungeon .tw2-bar s:not(#_) { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.22); }
html #win-dungeon .tw2-prog dl:not(#_) { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; margin: 10px 0 0; font-size: 12.5px; }
html #win-dungeon .tw2-prog dt:not(#_) { color: #b9b09a; }
html #win-dungeon .tw2-prog dd:not(#_) { margin: 0; font-weight: 700; color: #fff0b8; text-align: right; }
html #win-dungeon .tw2-spire:not(#_) { display: grid; gap: 3px; }
html #win-dungeon .tw2-seg:not(#_) { position: relative; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left;
  background: linear-gradient(90deg, #1e2337, #151a2a); border: 1px solid rgba(255, 255, 255, 0.06); }
html #win-dungeon .tw2-seg:not(#_):hover { border-color: rgba(226, 184, 78, 0.5); }
html #win-dungeon .tw2-seg b:not(#_) { font: 800 13px Kanit, sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
html #win-dungeon .tw2-seg span:not(#_) { display: grid; min-width: 0; font: 600 12.5px Kanit, sans-serif; color: #e8e0cc; line-height: 1.2; }
html #win-dungeon .tw2-seg span span:not(#_) { display: block; }
html #win-dungeon .tw2-seg .tw2-top:not(#_) { display: inline-block; }
html #win-dungeon .tw2-seg span small:not(#_) { font: 400 10.5px 'IBM Plex Sans Thai', sans-serif; color: #9d9581; }
html #win-dungeon .tw2-seg em:not(#_) { font: 700 10px Kanit, sans-serif; font-style: normal; padding: 1px 7px; border-radius: 99px; color: #8fe09a; box-shadow: inset 0 0 0 1px rgba(143, 224, 154, 0.5); }
html #win-dungeon .tw2-seg em.now:not(#_) { color: #241700; background: #e2b84e; box-shadow: none; }
html #win-dungeon .tw2-seg.done:not(#_) { opacity: 0.72; }
html #win-dungeon .tw2-seg.now:not(#_) { background: linear-gradient(90deg, #4a3a12, #231c0d); }
html #win-dungeon .tw2-seg.sel:not(#_) { border-color: #e2b84e; box-shadow: 0 0 0 1px #e2b84e, 0 0 12px rgba(226, 184, 78, 0.4); opacity: 1; }
html #win-dungeon .tw2-top:not(#_) { margin-left: 6px; padding: 0 6px; border-radius: 99px; font: 700 9.5px Kanit, sans-serif; font-style: normal; color: #e6d2ff; background: rgba(120, 70, 210, 0.45); box-shadow: inset 0 0 0 1px #b07aff; vertical-align: 1px; }
html #win-dungeon .tw2-right:not(#_) { display: grid; gap: 10px; align-content: start; min-width: 0; }
html #win-dungeon .tw2-tier:not(#_) { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(#1c2238, #12172a); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.35); }
html #win-dungeon .tw2-th:not(#_) { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
html #win-dungeon .tw2-range:not(#_) { font: 700 12px Kanit, sans-serif; color: #241700; background: #e2b84e; padding: 2px 9px; border-radius: 99px; }
html #win-dungeon .tw2-th b:not(#_) { font: 800 19px 'Noto Serif Thai', serif; color: #fff0b8; }
html #win-dungeon .tw2-lv:not(#_) { font-size: 12.5px; color: #c9c0aa; }
html #win-dungeon .tw2-st:not(#_) { margin-left: auto; font: 700 11px Kanit, sans-serif; font-style: normal; padding: 2px 9px; border-radius: 99px; color: #c9c0aa; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
html #win-dungeon .tw2-st.now:not(#_) { color: #ffe39a; box-shadow: inset 0 0 0 1px #e2b84e; }
html #win-dungeon .tw2-st.done:not(#_) { color: #8fe09a; box-shadow: inset 0 0 0 1px rgba(143, 224, 154, 0.5); }
html #win-dungeon .tw2-mobs > small:not(#_), html #win-dungeon .tw2-bosses > small:not(#_) { display: block; margin-bottom: 4px; font: 600 11.5px Kanit, sans-serif; color: #b9b09a; }
html #win-dungeon .tw2-mobs > div:not(#_) { display: flex; flex-wrap: wrap; gap: 4px; }
html #win-dungeon .tw2-mob:not(#_) { width: 40px; height: 40px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
html #win-dungeon .tw2-mob canvas:not(#_) { width: 40px; height: 40px; }
html #win-dungeon .tw2-bosses:not(#_) { display: grid; gap: 6px; }
html #win-dungeon .tw2-boss:not(#_) { position: relative; display: grid; grid-template-columns: 50px auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
html #win-dungeon .tw2-boss.k-mvp:not(#_) { box-shadow: inset 0 0 0 1px rgba(255, 210, 110, 0.5); background: rgba(255, 200, 90, 0.05); }
html #win-dungeon .tw2-boss.k-tower:not(#_) { box-shadow: inset 0 0 0 1.5px #b07aff, 0 0 10px rgba(176, 122, 255, 0.35); background: rgba(80, 40, 140, 0.22); }
html #win-dungeon .tw2-boss.done:not(#_) { opacity: 0.55; }
html #win-dungeon .tw2-fl:not(#_) { display: grid; justify-items: center; font: 800 20px/1 Kanit, sans-serif; color: #fff0b8; }
html #win-dungeon .tw2-fl small:not(#_) { font: 600 10px Kanit, sans-serif; color: #b9b09a; }
html #win-dungeon .tw2-pics:not(#_) { display: flex; gap: 2px; }
html #win-dungeon .tw2-pics canvas:not(#_) { width: 56px; height: 56px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
html #win-dungeon .tw2-who:not(#_) { display: grid; min-width: 0; line-height: 1.3; }
html #win-dungeon .tw2-who em:not(#_) { font: 700 11px Kanit, sans-serif; font-style: normal; color: #e2b84e; }
html #win-dungeon .tw2-boss.k-tower .tw2-who em:not(#_) { color: #c9a2ff; }
html #win-dungeon .tw2-who b:not(#_) { font: 700 14px Kanit, sans-serif; color: #fff; }
html #win-dungeon .tw2-who small:not(#_) { font-size: 11px; color: #a8a090; }
html #win-dungeon .tw2-acc:not(#_) { display: grid; justify-items: center; gap: 1px; }
html #win-dungeon .tw2-acc canvas:not(#_) { width: 36px; height: 36px; filter: drop-shadow(0 0 6px rgba(255, 80, 80, 0.6)); }
html #win-dungeon .tw2-acc small:not(#_) { font: 700 9.5px Kanit, sans-serif; color: #ff9c8c; }
html #win-dungeon .tw2-coin:not(#_) { display: inline-flex; align-items: center; gap: 3px; font: 800 15px Kanit, sans-serif; color: #ffe39a; }
html #win-dungeon .tw2-coin canvas:not(#_) { width: 20px; height: 20px; padding: 0; background: none; }
html #win-dungeon .tw2-ok:not(#_) { position: absolute; right: 6px; top: 4px; font-style: normal; font-size: 11px; color: #8fe09a; }
html #win-dungeon .tw2-rules:not(#_) { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
html #win-dungeon .tw2-rules li:not(#_) { display: flex; align-items: center; gap: 8px; padding: 8px 10px; text-wrap: balance; border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 12px; line-height: 1.35; color: #e0d8c4; }
html #win-dungeon .tw2-rules svg:not(#_) { flex: none; width: 20px; height: 20px; fill: none; stroke: #e2b84e; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html #win-dungeon .tw2-rules b:not(#_) { color: #ffd88a; }
html #win-dungeon .tw2-go:not(#_) { display: grid; justify-items: center; gap: 4px; }
html #win-dungeon .tw2-go .dg-gobtn:not(#_) { min-width: 320px; }

/* NPC junk cap line in the shop sell tab (2026-11-17) */
.shop-bulk:has(.shop-cap) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.shop-cap { font-size: 12px; opacity: .85; }
.shop-cap.full { color: #d65a4a; opacity: 1; font-weight: 600; }

/* ===== Theme A · blacksmith window (2026-11-17, user "hard to read; make the buy/sell/enhance/smelt tabs nice") ===== */
html[data-ui="a"] #win-shop .bag-tabs:not(#_) { display: flex; gap: 4px; padding: 4px; margin: 2px 0 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(212, 175, 90, 0.35); border: 0; }
html[data-ui="a"] #win-shop .bag-tab:not(#_) { flex: 1 1 0; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #b9ae94; font: 600 14px 'Noto Serif Thai', serif; letter-spacing: .02em; cursor: pointer; box-shadow: none; transition: background .15s, color .15s; }
html[data-ui="a"] #win-shop .bag-tab:not(#_)::after, html[data-ui="a"] #win-shop .bag-tab:not(#_)::before { content: none; }
html[data-ui="a"] #win-shop .bag-tab:not(#_):hover { color: #f3e3b8; background: rgba(212, 175, 90, 0.1); }
html[data-ui="a"] #win-shop .bag-tab.on:not(#_) { color: #1d1508; background: linear-gradient(#f6dc8e, #c9a24a); box-shadow: 0 0 12px rgba(232, 196, 106, 0.35), inset 0 1px 0 rgba(255, 245, 210, 0.7); }

/* the forge panel: now / next, the odds */
html[data-ui="a"] #win-shop .fg-cmp .now:not(#_) { background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(212, 175, 90, 0.3); }
html[data-ui="a"] #win-shop .fg-cmp .now small:not(#_) { color: #b9ae94; }
html[data-ui="a"] #win-shop .fg-cmp .now b:not(#_) { color: #f3e3b8; }
html[data-ui="a"] #win-shop .fg-cmp .now:not(#_), html[data-ui="a"] #win-shop .fg-cmp .now *:not(small):not(b) { color: #e6dcc2; }
html[data-ui="a"] #win-shop .fg-rate:not(#_) { color: #d9cfb6; font-size: 14px; }
html[data-ui="a"] #win-shop .fg-rate b:not(#_) { color: #ffd36a; }
html[data-ui="a"] #win-shop .fg-note:not(#_), html[data-ui="a"] #win-shop .fg-pity:not(#_) { color: #a9a08a; }

/* the smelter's amount: −, the number, +, MAX */
html[data-ui="a"] #win-shop .sm-qty button:not(#_) { min-width: 34px; height: 32px; border-radius: 6px; border: 1px solid #c9a24a; background: #2a2418; color: #f6dc8e; font: 700 15px 'IBM Plex Sans Thai', sans-serif; opacity: 1; cursor: pointer; }
html[data-ui="a"] #win-shop .sm-qty button:not(#_):hover:not(:disabled) { background: #3a301a; color: #fff1c2; }
html[data-ui="a"] #win-shop .sm-qty button:not(#_):disabled { border-color: #8c7a55; color: #8c7a55; background: #1d1912; cursor: default; }
html[data-ui="a"] #win-shop .sm-qty input:not(#_) { height: 32px; border-radius: 6px; border: 1px solid #c9a24a; background: #14110b; color: #fff1c2; font: 700 16px 'IBM Plex Sans Thai', sans-serif; text-align: center; }

/* Theme A forge panel: dark cards, light text (the shared rules above paint them cream with navy ink) */
html[data-ui="a"] #win-shop .fg-cmp > .now:not(#_) { background: rgba(255, 255, 255, 0.06) !important; box-shadow: inset 0 0 0 1px rgba(212, 175, 90, 0.35) !important; }
html[data-ui="a"] #win-shop .fg-cmp > .now small:not(#_) { color: #b9ae94 !important; }
html[data-ui="a"] #win-shop .fg-cmp > .now b:not(#_) { color: #f3e3b8 !important; }
html[data-ui="a"] #win-shop .fg-cmp > .now span:not(#_) { color: #e6dcc2 !important; }
html[data-ui="a"] #win-shop .fg-cmp > .nx:not(#_) { background: linear-gradient(#3a2d12, #241b0b) !important; box-shadow: inset 0 0 0 1px #e2b84e, 0 0 12px rgba(226, 184, 78, 0.25) !important; }
html[data-ui="a"] #win-shop .fg-cost > div:not(#_) { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(212, 175, 90, 0.35); }
html[data-ui="a"] #win-shop .fg-cost small:not(#_), html[data-ui="a"] #win-shop .fg-cost em:not(#_) { color: #b9ae94; }
html[data-ui="a"] #win-shop .fg-cost b:not(#_) { color: #f3e3b8; }
html[data-ui="a"] #win-shop .fg-cost > div.no:not(#_) { background: rgba(160, 40, 30, 0.22); box-shadow: inset 0 0 0 1px #c0564a; }
html[data-ui="a"] #win-shop .fg-cost > div.no b:not(#_), html[data-ui="a"] #win-shop .fg-cost > div.no em:not(#_) { color: #ff9c8c; }
html[data-ui="a"] #win-shop .fg-opt:not(#_) { background: rgba(255, 255, 255, 0.05) !important; box-shadow: inset 0 0 0 1px rgba(212, 175, 90, 0.3); }
html[data-ui="a"] #win-shop .fg-opt.on:not(#_) { background: rgba(226, 184, 78, 0.16) !important; box-shadow: inset 0 0 0 1.5px #e2b84e; }
html[data-ui="a"] #win-shop .fg-opt .fg-box:not(#_) { background: #14110b; box-shadow: inset 0 0 0 2px #c9a24a; color: #ffd36a; }
html[data-ui="a"] #win-shop .fg-opt.on .fg-box:not(#_) { background: #c9a24a; color: #1d1508; }
html[data-ui="a"] #win-shop .fg-opt span b:not(#_) { color: #f3e3b8; }
html[data-ui="a"] #win-shop .fg-opt span small:not(#_) { color: #b9ae94; }
html[data-ui="a"] #win-shop .fg-rate:not(#_) { color: #d9cfb6 !important; }
html[data-ui="a"] #win-shop .fg-rate b:not(#_) { color: #ffd36a !important; }
html[data-ui="a"] #win-shop .fg-note:not(#_) { color: #a9a08a !important; }

/* Theme A forge: the list runs the full height of the panel beside it, and the panel is compact enough for the button
   to sit inside the window (2026-11-17, user: empty space under the list, the button cut off at the bottom). */
html[data-ui="a"] #win-shop .shop-wrap.forge:not(#_) { align-items: stretch; }
html[data-ui="a"] #win-shop .shop-wrap.forge .shop-left:not(#_) { position: relative; min-height: 300px; }
html[data-ui="a"] #win-shop .shop-wrap.forge .fg-list:not(#_) { position: absolute; inset: 0; max-height: none; overflow-y: auto; }
html[data-ui="a"] #win-shop .shop-detail.fg:not(#_) { gap: 8px; padding: 10px 12px 12px; }
html[data-ui="a"] #win-shop .fg-ring:not(#_) { width: 112px; height: 112px; }
html[data-ui="a"] #win-shop .fg-ring canvas:not(#_) { width: 70px; height: 70px; }
html[data-ui="a"] #win-shop .fg-cmp > div:not(#_) { padding: 6px 6px !important; }
html[data-ui="a"] #win-shop .fg-cmp b:not(#_) { font-size: 22px !important; }
html[data-ui="a"] #win-shop .fg-cost > div:not(#_) { padding: 5px 10px; }
html[data-ui="a"] #win-shop .fg-opt:not(#_) { padding: 5px 10px !important; }
html[data-ui="a"] #win-shop .fg-pity:not(#_) { padding: 3px 10px; font-size: 12px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(212, 175, 90, 0.3); }
html[data-ui="a"] #win-shop .fg-note:not(#_) { font-size: 12px; line-height: 1.35; }
html[data-ui="a"] #win-shop .fg-go:not(#_) { min-height: 46px !important; margin-top: 2px; }

/* Theme A forge panel as a grid: the piece's ring on the left beside its name and now/next, everything else full
   width under them, so the whole panel (both scrolls, the pity row, the button) fits a 768 px screen. */
html[data-ui="a"] #win-shop .shop-detail.fg:not(#_):has(.fg-cmp) { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 8px; text-align: center; }
html[data-ui="a"] #win-shop .shop-detail.fg:has(.fg-cmp) > *:not(#_) { grid-column: 1 / -1; }
html[data-ui="a"] #win-shop .shop-detail.fg:has(.fg-cmp) > .fg-ring:not(#_) { grid-column: 1; grid-row: 1 / span 2; width: 104px; height: 104px; justify-self: center; }
html[data-ui="a"] #win-shop .shop-detail.fg:has(.fg-cmp) > .fg-ring canvas:not(#_) { width: 64px; height: 64px; }
html[data-ui="a"] #win-shop .shop-detail.fg:has(.fg-cmp) > .fg-name:not(#_) { grid-column: 2; grid-row: 1; text-align: left; }
html[data-ui="a"] #win-shop .shop-detail.fg:has(.fg-cmp) > .fg-cmp:not(#_) { grid-column: 2; grid-row: 2; }
html[data-ui="a"] #win-shop .shop-detail.fg:has(.fg-cmp) > .fg-pity:not(#_), html[data-ui="a"] #win-shop .shop-detail.fg:has(.fg-cmp) > .fg-rate:not(#_) { justify-self: center; }

/* ===== Theme A forge panel (forgePanelA, 2026-11-17 "beautiful, easy, looks advanced") ===== */
html[data-ui="a"] #win-shop .shop-detail.fga:not(#_) { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px 14px; text-align: left; position: relative; overflow: hidden;
  background: radial-gradient(120% 60% at 30% 0%, rgba(226, 184, 78, 0.10), transparent 60%), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px), #12110d;
  border: 1px solid rgba(212, 175, 90, 0.35); border-radius: 12px; }
html[data-ui="a"] #win-shop .fga-head:not(#_) { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 14px; align-items: center; }
html[data-ui="a"] #win-shop .fga-core:not(#_) { position: relative; width: 136px; height: 136px; display: grid; place-items: center; }
html[data-ui="a"] #win-shop .fga-gauge:not(#_) { position: absolute; inset: 0; width: 136px; height: 136px; transform: rotate(-90deg); overflow: visible; }
html[data-ui="a"] #win-shop .fga-gauge circle:not(#_) { fill: none; }
html[data-ui="a"] #win-shop .fga-gauge .trk:not(#_) { stroke: rgba(255, 255, 255, 0.08); stroke-width: 6; }
html[data-ui="a"] #win-shop .fga-gauge .val:not(#_) { stroke: url(#none) #e8c46a; stroke: #e8c46a; stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(232, 196, 106, 0.8)); transition: stroke-dasharray .4s ease; }
html[data-ui="a"] #win-shop .fga-gauge .tick:not(#_) { stroke: rgba(232, 196, 106, 0.45); stroke-width: 1.5; stroke-dasharray: 2 6.5; transform-origin: 68px 68px; animation: fga-spin 24s linear infinite; }
@keyframes fga-spin { to { transform: rotate(360deg); } }
html[data-ui="a"] #win-shop .fga .fg-ring:not(#_) { width: 104px !important; height: 104px !important; margin: 0; }
html[data-ui="a"] #win-shop .fga .fg-ring canvas:not(#_) { width: 66px !important; height: 66px !important; }
html[data-ui="a"] #win-shop .fga-id:not(#_) { display: grid; gap: 6px; min-width: 0; }
html[data-ui="a"] #win-shop .fga-name:not(#_) { font: 700 16px 'Noto Serif Thai', serif; line-height: 1.25; }
html[data-ui="a"] #win-shop .fga-lv:not(#_) { display: flex; align-items: center; gap: 10px; }
html[data-ui="a"] #win-shop .fga-lv span:not(#_) { font: 800 30px/1 'Noto Serif Thai', serif; color: #cfc4a8; }
html[data-ui="a"] #win-shop .fga-lv span.nx:not(#_) { color: #ffe08a; text-shadow: 0 0 14px rgba(255, 200, 90, 0.55); }
html[data-ui="a"] #win-shop .fga-lv i:not(#_) { width: 34px; height: 2px; background: linear-gradient(90deg, rgba(232, 196, 106, 0.2), #e8c46a); position: relative; }
html[data-ui="a"] #win-shop .fga-lv i:not(#_)::after { content: ''; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: #e8c46a; border-right: 0; }
html[data-ui="a"] #win-shop .fga-lv small:not(#_) { color: #8fe09a; font-weight: 700; }
html[data-ui="a"] #win-shop .fga-stats:not(#_) { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
html[data-ui="a"] #win-shop .fga-stats li:not(#_) { display: grid; grid-template-columns: 38px auto auto auto 1fr; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; font-size: 13px; color: #cfc4a8; }
html[data-ui="a"] #win-shop .fga-stats em:not(#_) { font: 700 11px 'IBM Plex Sans Thai', sans-serif; font-style: normal; letter-spacing: .06em; color: #8c826b; }
html[data-ui="a"] #win-shop .fga-stats i:not(#_) { font-style: normal; color: #8c826b; }
html[data-ui="a"] #win-shop .fga-stats b:not(#_) { color: #fff1c2; }
html[data-ui="a"] #win-shop .fga-stats u:not(#_) { text-decoration: none; font-weight: 700; font-size: 12px; color: #8fe09a; }

html[data-ui="a"] #win-shop .fga-odds:not(#_) { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; }
html[data-ui="a"] #win-shop .fga-odds > div:not(#_) { display: grid; gap: 1px; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
html[data-ui="a"] #win-shop .fga-odds em:not(#_) { font: 600 11px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #8c826b; letter-spacing: .03em; }
html[data-ui="a"] #win-shop .fga-odds b:not(#_) { font: 700 15px 'IBM Plex Sans Thai', sans-serif; color: #e6dcc2; }
html[data-ui="a"] #win-shop .fga-odds .win:not(#_) { background: linear-gradient(135deg, rgba(232, 196, 106, 0.18), rgba(232, 196, 106, 0.04)); box-shadow: inset 0 0 0 1px rgba(232, 196, 106, 0.55); }
html[data-ui="a"] #win-shop .fga-odds .win b:not(#_) { font: 800 26px/1 'Noto Serif Thai', serif; color: #ffe08a; }
html[data-ui="a"] #win-shop .fga-odds .win b small:not(#_) { font-size: 14px; margin-left: 1px; }
html[data-ui="a"] #win-shop .fga-odds .bad b:not(#_) { color: #ff8c7a; }
html[data-ui="a"] #win-shop .fga-odds .bad:not(#_) { box-shadow: inset 0 0 0 1px rgba(255, 110, 90, 0.35); }
html[data-ui="a"] #win-shop .fga-odds .ok b:not(#_) { color: #8fe09a; }
html[data-ui="a"] #win-shop .fga-odds .ok:not(#_) { box-shadow: inset 0 0 0 1px rgba(143, 224, 154, 0.4); }

html[data-ui="a"] #win-shop .fga-pity:not(#_) { display: grid; gap: 4px; }
html[data-ui="a"] #win-shop .fga-pity > div:not(#_) { display: flex; justify-content: space-between; align-items: baseline; }
html[data-ui="a"] #win-shop .fga-pity em:not(#_) { font: 600 11.5px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #8c826b; }
html[data-ui="a"] #win-shop .fga-pity b:not(#_) { font: 700 13px 'IBM Plex Sans Thai', sans-serif; color: #e6dcc2; }
html[data-ui="a"] #win-shop .fga-pity b small:not(#_) { color: #8c826b; }
html[data-ui="a"] #win-shop .fga-pity > span:not(#_) { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; }
html[data-ui="a"] #win-shop .fga-pity > span i:not(#_) { height: 6px; border-radius: 1px; background: rgba(255, 255, 255, 0.08); }
html[data-ui="a"] #win-shop .fga-pity > span i.on:not(#_) { background: linear-gradient(#ffe08a, #c9a24a); box-shadow: 0 0 4px rgba(232, 196, 106, 0.6); }
html[data-ui="a"] #win-shop .fga-pity.sure em:not(#_) { color: #ffe08a; }

html[data-ui="a"] #win-shop .fga-cost:not(#_) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
html[data-ui="a"] #win-shop .fga-cost > span:not(#_) { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
html[data-ui="a"] #win-shop .fga-cost img:not(#_), html[data-ui="a"] #win-shop .fga-cost canvas:not(#_) { grid-row: 1 / 3; width: 30px !important; height: 30px !important; }
html[data-ui="a"] #win-shop .fga-cost em:not(#_) { font: 600 11px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #8c826b; }
html[data-ui="a"] #win-shop .fga-cost b:not(#_) { font: 700 15px 'IBM Plex Sans Thai', sans-serif; color: #fff1c2; }
html[data-ui="a"] #win-shop .fga-cost small:not(#_) { grid-column: 2; font-size: 11px; color: #8c826b; }
html[data-ui="a"] #win-shop .fga-cost > span.no:not(#_) { box-shadow: inset 0 0 0 1px rgba(255, 110, 90, 0.55); background: rgba(160, 40, 30, 0.15); }
html[data-ui="a"] #win-shop .fga-cost > span.no b:not(#_) { color: #ff8c7a; }
html[data-ui="a"] #win-shop .fga-cost b:not(#_) { grid-column: 2; }
html[data-ui="a"] #win-shop .fga-cost em:not(#_) { grid-column: 2; grid-row: 1; }
html[data-ui="a"] #win-shop .fga-cost > span:not(#_) { grid-template-rows: auto auto auto; }

html[data-ui="a"] #win-shop .fga-sws:not(#_) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
html[data-ui="a"] #win-shop .fga-sws:has(> :only-child):not(#_) { grid-template-columns: 1fr; }
html[data-ui="a"] #win-shop .fga-sw:not(#_) { display: grid; grid-template-columns: 26px minmax(0, 1fr) 34px; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); transition: border-color .15s, background .15s; }
html[data-ui="a"] #win-shop .fga-sw img:not(#_) { width: 26px; height: 26px; }
html[data-ui="a"] #win-shop .fga-sw span:not(#_) { display: grid; min-width: 0; line-height: 1.25; }
html[data-ui="a"] #win-shop .fga-sw b:not(#_) { font: 700 12.5px 'IBM Plex Sans Thai', sans-serif; color: #e6dcc2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-ui="a"] #win-shop .fga-sw small:not(#_) { font-size: 10.5px; color: #8c826b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-ui="a"] #win-shop .fga-tg:not(#_) { position: relative; width: 34px; height: 18px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); transition: background .15s; }
html[data-ui="a"] #win-shop .fga-tg s:not(#_) { position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #8c826b; transition: left .15s, background .15s; }
html[data-ui="a"] #win-shop .fga-sw.on:not(#_) { border-color: #e8c46a; background: rgba(232, 196, 106, 0.12); }
html[data-ui="a"] #win-shop .fga-sw.on .fga-tg:not(#_) { background: #c9a24a; }
html[data-ui="a"] #win-shop .fga-sw.on .fga-tg s:not(#_) { left: 18px; background: #1d1508; }
html[data-ui="a"] #win-shop .fga-sw:disabled:not(#_) { opacity: 0.45; cursor: default; }
html[data-ui="a"] #win-shop .fga-sw:hover:not(:disabled):not(#_) { border-color: rgba(232, 196, 106, 0.6); }

html[data-ui="a"] #win-shop .fga .fg-go:not(#_) { width: 100%; min-height: 50px !important; margin-top: 2px; font: 800 18px 'Noto Serif Thai', serif !important; letter-spacing: .04em; }
html[data-ui="a"] #win-shop .fga-to:not(#_) { margin-left: 8px; font: 700 13px 'IBM Plex Sans Thai', sans-serif; opacity: .75; }
html[data-ui="a"] #win-shop .fga-max:not(#_) { padding: 16px; text-align: center; border-radius: 8px; color: #8fe09a; font-weight: 700; background: rgba(143, 224, 154, 0.08); box-shadow: inset 0 0 0 1px rgba(143, 224, 154, 0.35); }

/* Admin window: player care tab; the report card; the player menu's line (2026-11-17) */
#win-admin .adm-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
#win-admin .adm-h { margin: 10px 0 4px; font-size: 13px; color: #e8c46a; }
#win-admin .adm-reports, #win-admin .adm-log { max-height: 220px; overflow-y: auto; display: grid; gap: 6px; font-size: 12px; }
#win-admin .adm-rep { padding: 6px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
#win-admin .adm-rep.done { opacity: .5; }
#win-admin .adm-rep > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#win-admin .adm-rep ul { margin: 4px 0 0; padding-left: 16px; }
#win-admin #adm-why { flex: 1; min-width: 120px; }
.report-card { position: fixed; left: 50%; top: 50%; translate: -50% -50%; width: min(380px, 92vw); z-index: 60; }
.report-card .rp-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 8px 0; font-size: 13px; }
.report-card textarea { width: 100%; min-height: 60px; box-sizing: border-box; resize: vertical; font: inherit; }
.report-card .rp-go { display: flex; justify-content: flex-end; gap: 8px; }
.peer-menu .pm-sep { height: 1px; margin: 4px 6px; background: rgba(255, 255, 255, 0.12); }

/* Premium (2026-11-17): the gem shop card, the profile badge, a gold name in chat */
.gs-prem { margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, rgba(255, 210, 110, 0.18), rgba(120, 70, 20, 0.12)); box-shadow: inset 0 0 0 1.5px #e2b84e, 0 0 16px rgba(226, 184, 78, 0.25); }
.gs-prem-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.gs-prem-head b { font-size: 17px; }
.gs-prem-head small { opacity: .8; }
.gs-prem-badge, #pf-name.prem::after { padding: 1px 8px; border-radius: 99px; font: 800 10.5px 'IBM Plex Sans Thai', sans-serif; letter-spacing: .08em; color: #2a1a00; background: linear-gradient(#ffe08a, #c9a24a); }
.gs-prem ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 14px; font-size: 13px; }
.gs-prem li::before { content: '✦ '; color: #e2b84e; }
.gs-prem li small { margin-left: 6px; opacity: .6; }
.gs-prem .btn { width: 100%; }
#pf-name.prem::after { content: 'PREMIUM'; margin-left: 6px; font-size: 8.5px; vertical-align: 2px; }
.chat-prem { background: linear-gradient(90deg, #ffe08a, #ffb347, #ffe08a); -webkit-background-clip: text; background-clip: text; color: transparent !important; text-shadow: none; }

.fga-mk, #win-shop .fg .fga-mk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.fga-mk em { font-style: normal; color: #e2b84e; font-weight: 700; margin-right: 2px; }

/* ===== Premium check-in calendar + glowing chat name (2026-11-17) ===== */
.ev2.prem .ev2-hero:not(#_) { background: radial-gradient(120% 90% at 20% 0%, rgba(200, 150, 255, 0.35), transparent 60%), linear-gradient(135deg, #2a1550, #120a24 60%, #2b1a05) !important;
  box-shadow: inset 0 0 0 1.5px #e2b84e, 0 0 22px rgba(170, 110, 255, 0.35) !important; }
.ev2.prem .ev2-title small:not(#_) { color: #ffe08a !important; }
.ev2-prem { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; letter-spacing: .02em; }
.ev2-prem canvas { width: 20px; height: 20px; }
.ev2.prem .ev2-day:not(#_) { position: relative; overflow: hidden; background: linear-gradient(160deg, #3a2160, #1d1036) !important; box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.55) !important; color: #f3e6ff !important; }
.ev2.prem .ev2-day:not(#_) small, .ev2.prem .ev2-day:not(#_) span { color: #f6e7ff !important; }
.ev2.prem .ev2-day:not(#_)::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 180, 0.28) 50%, transparent 65%); background-size: 260% 100%; animation: ev2-sheen 3.6s linear infinite; }
.ev2.prem .ev2-day.big:not(#_) { background: linear-gradient(160deg, #6a3b0e, #2d1606) !important; box-shadow: inset 0 0 0 1.5px #ffd36a, 0 0 12px rgba(255, 200, 90, 0.45) !important; }
.ev2.prem .ev2-day.today:not(#_) { box-shadow: inset 0 0 0 2px #ffe08a, 0 0 18px rgba(200, 150, 255, 0.8) !important; animation: ev2-prem-pulse 1.6s ease-in-out infinite; }
.ev2.prem .ev2-day.done:not(#_) { filter: saturate(.6) brightness(.85); }
.ev2-x2 { position: absolute; top: 3px; right: 4px; padding: 0 5px; border-radius: 99px; font: 800 9.5px 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #2a1a00; background: linear-gradient(#ffe08a, #c9a24a); z-index: 1; }
.ev2.prem .ev2-track > i:not(#_) { background: linear-gradient(90deg, #c9a2ff, #ffe08a) !important; }
.ev2-up { color: #e2b84e; font-weight: 700; cursor: pointer; text-decoration: underline; }
@keyframes ev2-sheen { from { background-position: 130% 0; } to { background-position: -130% 0; } }
@keyframes ev2-prem-pulse { 50% { box-shadow: inset 0 0 0 2px #ffe08a, 0 0 28px rgba(220, 170, 255, 1); } }
.chat-prem { background: linear-gradient(90deg, #ffe08a, #ffb6d9, #c9a2ff, #ffb6d9, #ffe08a) !important; background-size: 200% 100% !important; -webkit-background-clip: text !important; background-clip: text !important;
  color: transparent !important; filter: drop-shadow(0 0 3px rgba(255, 200, 90, 0.75)); animation: chat-prem 3s linear infinite; }
@keyframes chat-prem { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ev2.prem .ev2-day::after, .ev2.prem .ev2-day.today, .chat-prem { animation: none !important; } }

.gs-prem-head { flex-wrap: nowrap !important; align-items: center !important; }
.gs-prem-head canvas { flex: none; width: 56px; height: 56px; filter: drop-shadow(0 0 8px rgba(200, 150, 255, 0.7)); }
.gs-prem-head small { min-width: 0; }

/* Premium chat name, toned down (user 2026-11-17: gold, a soft glow, not overblown) */
html .chat-prem:not(#_) { background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important; color: #ffd76a !important; animation: none !important; filter: none !important;
  text-shadow: 0 0 4px rgba(255, 200, 90, 0.55), 0 1px 1px rgba(0, 0, 0, 0.6) !important; }

/* Premium chat name, more gold (user 2026-11-17): a metal gold gradient on the letters, a thin warm glow */
html body .chat-prem:not(#_) { background: linear-gradient(180deg, #fff4b8 0%, #ffd23f 45%, #e8a317 70%, #ffcf4a 100%) !important; -webkit-background-clip: text !important; background-clip: text !important;
  color: transparent !important; text-shadow: none !important; filter: drop-shadow(0 0 2px rgba(255, 190, 40, 0.75)) drop-shadow(0 1px 0 rgba(60, 30, 0, 0.8)) !important; }

/* ===== Astra shop front (2026-11-17 "products worth buying"): one royal look in every theme ===== */
#win-gems { width: min(980px, calc(100vw - 32px)); }
#win-gems .gs2-hero:not(#_) { position: relative; display: grid; grid-template-columns: 230px 1fr; gap: 6px 18px; margin: 4px 0 14px; padding: 16px 18px 16px 10px; border-radius: 16px; overflow: hidden; color: #f4e9ff;
  background: radial-gradient(90% 120% at 12% 30%, rgba(170, 110, 255, 0.42), transparent 60%), radial-gradient(60% 80% at 100% 0%, rgba(255, 200, 90, 0.22), transparent 70%), linear-gradient(135deg, #2c1656 0%, #160b2e 55%, #2a1a06 100%);
  box-shadow: inset 0 0 0 1.5px #e2b84e, inset 0 0 0 4px rgba(20, 8, 40, 0.6), inset 0 0 0 5px rgba(226, 184, 78, 0.35), 0 8px 26px rgba(40, 10, 80, 0.45); }
#win-gems .gs2-hero:not(#_)::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255, 240, 200, 0.16) 50%, transparent 60%); background-size: 300% 100%; animation: gs2-sheen 5s linear infinite; }
#win-gems .gs2-art { position: relative; display: grid; place-items: center; }
#win-gems .gs2-art canvas { position: relative; width: 210px; height: 210px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 18px rgba(255, 200, 90, 0.35)); animation: gs2-bob 3.4s ease-in-out infinite; }
#win-gems .gs2-rays { position: absolute; width: 230px; height: 230px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 220, 140, 0.22) 0 8deg, transparent 8deg 22deg);
  mask: radial-gradient(circle, #000 18%, transparent 68%); -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); animation: gs2-spin 18s linear infinite; }
#win-gems .gs2-live { position: absolute; bottom: 4px; padding: 3px 12px; border-radius: 99px; font: 700 12px 'IBM Plex Sans Thai', sans-serif; color: #10351c; background: linear-gradient(#b9f5c8, #5fcf82); box-shadow: 0 0 12px rgba(110, 230, 150, 0.6); }
#win-gems .gs2-main { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#win-gems .gs2-kicker { display: flex; align-items: center; gap: 8px; }
#win-gems .gs2-kicker small { color: #cdb9ef !important; font-size: 12px; }
#win-gems .gs2-chip { padding: 1px 10px; border-radius: 99px; font: 800 11px 'IBM Plex Sans Thai', sans-serif; letter-spacing: .12em; color: #2a1a00 !important; background: linear-gradient(#fff0b8, #e2b84e 60%, #b8862a); box-shadow: 0 0 10px rgba(255, 210, 110, 0.55); }
#win-gems .gs2-main h3:not(#_) { margin: 0; font: 700 26px/1.15 'Noto Serif Thai', serif !important; background: linear-gradient(180deg, #fff6d0, #ffd36a 55%, #e0a030); -webkit-background-clip: text; background-clip: text; color: transparent !important; filter: drop-shadow(0 2px 0 rgba(40, 10, 0, 0.6)); }
#win-gems .gs2-heads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#win-gems .gs2-heads > div { display: flex; flex-direction: column; align-items: center; padding: 8px 6px 7px; border-radius: 10px; text-align: center; background: linear-gradient(180deg, rgba(255, 215, 120, 0.14), rgba(255, 215, 120, 0.04)); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.5); }
#win-gems .gs2-heads b:not(#_) { font: 800 28px/1.05 'Noto Serif Thai', serif !important; color: #ffe08a !important; text-shadow: 0 0 12px rgba(255, 200, 90, 0.55); }
#win-gems .gs2-heads b small { font-size: 14px; margin-left: 2px; color: #ffe08a !important; }
#win-gems .gs2-heads span { font-size: 12.5px; font-weight: 700; color: #fff !important; }
#win-gems .gs2-heads em { font-style: normal; font-size: 11px; color: #bba6dd !important; }
#win-gems .gs2-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px 10px; }
#win-gems .gs2-perks > div { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; padding: 4px 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); }
#win-gems .gs2-perks canvas { grid-row: span 2; width: 26px; height: 26px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
#win-gems .gs2-perks span { font-size: 12.5px; line-height: 1.25 !important; color: #f4e9ff !important; }
#win-gems .gs2-perks s { font-size: 10.5px; line-height: 1.2 !important; color: #a893cc !important; }
#win-gems .gs2-buyrow { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
#win-gems .gs2-price { display: flex; flex-direction: column; }
#win-gems .gs2-price .cur:not(#_) { font: 800 24px 'Noto Serif Thai', serif !important; color: #bfe8ff !important; text-shadow: 0 0 10px rgba(130, 200, 255, 0.6); }
#win-gems .gs2-price .cur img { width: 22px; height: 22px; }
#win-gems .gs2-price small { font-size: 11px; color: #bba6dd !important; }
#win-gems .gs2-buy:not(#_) { flex: 1; height: 46px; border: 0; border-radius: 12px; cursor: pointer; font: 800 17px 'Noto Serif Thai', serif !important; color: #2a1600 !important; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff3c4, #ffd36a 45%, #d99a2b) !important; box-shadow: inset 0 0 0 1.5px #fff2c0, 0 0 0 1.5px #8a5a12, 0 4px 0 #6e430c, 0 0 22px rgba(255, 200, 90, 0.55); animation: gs2-pulse 1.8s ease-in-out infinite; }
#win-gems .gs2-buy:not(#_):hover { filter: brightness(1.08); }
#win-gems .gs2-buy:not(#_):active { transform: translateY(2px); }
#win-gems .gs2-buy.short:not(#_), #win-gems .gs2-pill.short:not(#_) { animation: none; filter: saturate(.55); color: #3a2a10 !important; }
#win-gems .gs2-sec { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; font: 700 15px 'Noto Serif Thai', serif; }
#win-gems .gs2-sec::before, #win-gems .gs2-sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #c9a24a, transparent); }
#win-gems .gs2-goods, #win-gems .gs2-tops { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
#win-gems .gs2-tops { grid-template-columns: repeat(3, 1fr); }
#win-gems :is(.gs2-card, .gs2-top):not(#_) { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 12px 12px; border: 0; border-radius: 14px; text-align: center; overflow: hidden; color: #eaf1ff;
  background: radial-gradient(70% 60% at 50% 30%, rgba(120, 190, 255, 0.28), transparent 70%), linear-gradient(170deg, #1d2c55, #101830); box-shadow: inset 0 0 0 1.5px #c9a24a, 0 4px 14px rgba(10, 20, 50, 0.35); transition: transform .15s, box-shadow .15s; }
#win-gems :is(.gs2-card, .gs2-top):not(#_):hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px #ffe08a, 0 8px 20px rgba(10, 20, 50, 0.45), 0 0 18px rgba(255, 210, 110, 0.35); }
#win-gems .gs2-ico { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 230, 160, 0.35), transparent 65%); }
#win-gems .gs2-ico canvas { width: 82px; height: 82px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); animation: gs2-bob 3s ease-in-out infinite; }
#win-gems :is(.gs2-card, .gs2-top) b:not(#_) { font: 700 16px 'Noto Serif Thai', serif !important; color: #fff3cf !important; }
#win-gems .gs2-top b:not(#_) { font-size: 24px !important; color: #bfe8ff !important; text-shadow: 0 0 10px rgba(130, 200, 255, 0.55); line-height: 1.1 !important; }
#win-gems :is(.gs2-card, .gs2-top) small { font-size: 12px; color: #a9b8d8 !important; }
#win-gems .gs2-tag { position: absolute; top: 8px; left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; color: #10351c !important; background: #8ee6a8; }
#win-gems .gs2-pill:not(#_) { margin-top: 8px; min-width: 120px; height: 34px; border: 0; border-radius: 99px; cursor: pointer; background: linear-gradient(180deg, #fff3c4, #ffd36a 45%, #d99a2b) !important; box-shadow: inset 0 0 0 1px #fff2c0, 0 0 0 1px #8a5a12, 0 3px 0 #6e430c; }
#win-gems .gs2-pill .cur:not(#_) { font: 800 15px 'IBM Plex Sans Thai', sans-serif !important; color: #2a1600 !important; }
#win-gems .gs2-flag { position: absolute; top: 12px; right: -32px; width: 120px; padding: 2px 0; transform: rotate(35deg); font-size: 11px; font-weight: 800; color: #2a1600 !important; background: linear-gradient(#ffe08a, #e2a53a); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
#win-gems .gs2-flag.best { color: #fff !important; background: linear-gradient(#ff8a7a, #d23a3a); }
#win-gems .gs2-soon { margin-top: 6px; padding: 2px 12px; border-radius: 99px; font-size: 11px; color: #c9d6f2 !important; box-shadow: inset 0 0 0 1px rgba(201, 214, 242, 0.45); }
#win-gems .gs2-note { text-align: center; }
@keyframes gs2-sheen { from { background-position: 150% 0; } to { background-position: -150% 0; } }
@keyframes gs2-bob { 50% { transform: translateY(-5px); } }
@keyframes gs2-spin { to { transform: rotate(360deg); } }
@keyframes gs2-pulse { 50% { box-shadow: inset 0 0 0 1.5px #fff2c0, 0 0 0 1.5px #8a5a12, 0 4px 0 #6e430c, 0 0 34px rgba(255, 210, 110, 0.85); } }
@media (max-width: 720px) { #win-gems .gs2-hero:not(#_) { grid-template-columns: 1fr; } #win-gems .gs2-perks { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { #win-gems .gs2-hero::after, #win-gems .gs2-rays, #win-gems .gs2-art canvas, #win-gems .gs2-ico canvas, #win-gems .gs2-buy { animation: none !important; } }
#win-gems .gs2-perks s { text-decoration: none; }
#win-gems .gs2-perks span:not(#_) { font-size: 13.5px; font-weight: 600; }
#win-gems .gs2-perks canvas { width: 30px; height: 30px; }
#win-gems .gs2-perks > div { grid-template-columns: 30px 1fr; }
#win-gems .gs2-goods { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
#win-gems .gs2-card:not(#_) { display: grid; grid-template-columns: 92px 1fr auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; text-align: left; padding: 12px 18px 12px 12px; }
#win-gems .gs2-card .gs2-ico { grid-row: span 2; }
#win-gems .gs2-card b { align-self: end; font-size: 18px !important; }
#win-gems .gs2-card small { align-self: start; }
#win-gems .gs2-card .gs2-pill { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
#win-gems .gs2-card .gs2-tag { left: auto; right: 10px; top: 8px; }
#win-gems .gs2-hero:not(#_) { grid-template-columns: 190px 1fr; padding: 12px 16px 12px 6px; margin-bottom: 8px; }
#win-gems .gs2-art canvas { width: 180px; height: 180px; }
#win-gems .gs2-rays { width: 200px; height: 200px; }
#win-gems .gs2-main { gap: 6px; }
#win-gems .gs2-heads > div { padding: 5px 6px; }
#win-gems .gs2-perks > div { padding: 3px 6px; }
#win-gems .gs2-sec { margin: 2px 0 6px; }
#win-gems .gs2-goods { margin-bottom: 8px; }
#win-gems .gs2-card:not(#_) { padding: 6px 18px 6px 8px; }
#win-gems .gs2-card .gs2-ico { width: 70px; height: 70px; }
#win-gems .gs2-card .gs2-ico canvas { width: 62px; height: 62px; }
#win-gems .gs2-card:not(#_) { grid-template-columns: 70px 1fr auto; }
#win-gems .gs2-top:not(#_) { display: grid; grid-template-columns: 70px 1fr; grid-template-rows: auto auto auto; column-gap: 10px; justify-items: start; align-items: center; text-align: left; padding: 8px 12px; }
#win-gems .gs2-top .gs2-ico { grid-row: 1 / span 3; width: 70px; height: 70px; }
#win-gems .gs2-top .gs2-ico canvas { width: 62px; height: 62px; }
#win-gems .gs2-top .gs2-soon { margin-top: 2px; }
#win-gems .gs2-tops { margin-bottom: 6px; }
#win-gems .gs2-flag:not(#_) { top: 8px; right: 10px; width: auto; padding: 1px 10px; border-radius: 99px; transform: none; }

/* Astra shop hero, round 2 (user 2026-11-17 "not pretty; drop the details, a big headline and 1–2 real benefits") */
#win-gems .gs2-hero:not(#_) { grid-template-columns: 250px 1fr; padding: 22px 28px 22px 10px; gap: 0 22px; align-items: center; }
#win-gems .gs2-art canvas { width: 230px; height: 230px; }
#win-gems .gs2-rays { width: 260px; height: 260px; }
#win-gems .gs2-main { gap: 12px; }
#win-gems .gs2-main h3:not(#_) { font-size: 36px !important; line-height: 1.1 !important; }
#win-gems .gs2-bens { display: flex; flex-direction: column; gap: 0; margin: 2px 0 4px; }
#win-gems .gs2-bens > div { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
#win-gems .gs2-bens > div + div { border-top: 1px solid; border-image: linear-gradient(90deg, rgba(226, 184, 78, 0.6), transparent 80%) 1; }
#win-gems .gs2-bens canvas { flex: none; width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 8px rgba(255, 210, 110, 0.35)); }
#win-gems .gs2-bens p:not(#_) { margin: 0; display: flex; flex-direction: column; font: 600 21px/1.2 'IBM Plex Sans Thai', sans-serif !important; color: #fff !important; }
#win-gems .gs2-bens p b:not(#_) { font: 800 30px/1 'Noto Serif Thai', serif !important; color: #ffe08a !important; text-shadow: 0 0 14px rgba(255, 200, 90, 0.6); margin: 0 4px; }
#win-gems .gs2-bens p small { font-size: 12.5px; font-weight: 400; color: #c8b6e6 !important; margin-top: 2px; }
#win-gems .gs2-buyrow { margin-top: 4px; }
#win-gems .gs2-bens:not(#_) { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#win-gems .gs2-bens > div:not(#_) { padding: 12px 14px; border: 0; border-radius: 12px; background: linear-gradient(180deg, rgba(255, 215, 120, 0.13), rgba(255, 215, 120, 0.03)); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.45); }
#win-gems .gs2-bens p span { white-space: nowrap; }
#win-gems .gs2-info:not(#_) { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 10px; padding: 0; vertical-align: 6px; border: 0; border-radius: 50%; cursor: help;
  font: italic 800 15px/1 'Noto Serif Thai', serif; color: #2a1600; -webkit-text-fill-color: #2a1600; background: linear-gradient(#fff0b8, #e2b84e 60%, #b8862a); box-shadow: 0 0 0 1px #8a5a12, 0 0 10px rgba(255, 210, 110, 0.6); }
#win-gems .gs2-info:not(#_):hover { filter: brightness(1.12); box-shadow: 0 0 0 1px #8a5a12, 0 0 16px rgba(255, 210, 110, 0.9); }
.gs2-tip { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; min-width: 260px; }
.gs2-tip li { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.gs2-tip li::before { content: '✦'; color: #e2b84e; margin-right: -8px; }
.gs2-tip li small { opacity: .65; white-space: nowrap; }
.gs2-tip:not(#_) { text-align: left; min-width: 300px; }
.gs2-tip li:not(#_) { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: baseline; text-align: left; }
.gs2-tip li:not(#_)::before { margin: 0; }
.gs2-tip li small:not(#_) { text-align: right; }
.tooltip.wide:not(#_) { max-width: 400px; }
.gs2-tip:not(#_) { min-width: 0; width: 360px; }
.gs2-tip li:not(#_) { grid-template-columns: 14px 1fr auto; }
.gs2-tip li span, .gs2-tip li small:not(#_) { min-width: 0; }

/* Astra shop: top-up packs (2026-11-17, six packs 50–9,999 baht), the same in every theme */
#win-gems .gs3-banner:not(#_) { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 2px 0 12px; padding: 10px 16px; border-radius: 12px; text-align: center;
  background: linear-gradient(90deg, #5a1d0e, #b4441a 30%, #e07a1e 50%, #b4441a 70%, #5a1d0e); box-shadow: inset 0 0 0 1.5px #ffd36a, 0 4px 14px rgba(120, 40, 10, 0.35); position: relative; overflow: hidden; }
#win-gems .gs3-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 245, 210, 0.35) 50%, transparent 60%); background-size: 300% 100%; animation: gs2-sheen 3.5s linear infinite; pointer-events: none; }
#win-gems .gs3-banner b:not(#_) { font: 800 22px 'Noto Serif Thai', serif !important; color: #fff6d8 !important; text-shadow: 0 2px 0 rgba(80, 20, 0, 0.7); }
#win-gems .gs3-banner b em { font-style: normal; font-size: 30px; color: #ffe08a; margin-left: 4px; text-shadow: 0 0 14px rgba(255, 220, 120, 0.9), 0 2px 0 rgba(80, 20, 0, 0.7); }
#win-gems .gs3-banner span { font-size: 12.5px; color: #ffe6c4 !important; }
#win-gems .gs3-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
#win-gems .gs3-pack:not(#_) { --c1: #1d2c55; --c2: #101830; --rim: #c9a24a; --glow: rgba(120, 190, 255, 0.3);
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 12px 12px 12px; border-radius: 14px; overflow: hidden; text-align: center;
  background: radial-gradient(70% 55% at 50% 30%, var(--glow), transparent 70%), linear-gradient(170deg, var(--c1), var(--c2)); box-shadow: inset 0 0 0 1.5px var(--rim), 0 4px 14px rgba(10, 20, 50, 0.35); transition: transform .15s, box-shadow .15s; }
#win-gems .gs3-pack:not(#_):hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px #ffe08a, 0 8px 20px rgba(10, 20, 50, 0.45), 0 0 20px rgba(255, 210, 110, 0.4); }
#win-gems .gs3-pack.t2:not(#_), #win-gems .gs3-pack.t3:not(#_) { --c1: #3a1c66; --c2: #180c33; --glow: rgba(200, 140, 255, 0.35); --rim: #d9b25c; }
#win-gems .gs3-pack.t4:not(#_), #win-gems .gs3-pack.t5:not(#_) { --c1: #5a3a0c; --c2: #24150a; --glow: rgba(255, 210, 110, 0.4); --rim: #ffd36a; }
#win-gems .gs3-pack.t5:not(#_) { box-shadow: inset 0 0 0 2px #ffe08a, 0 0 22px rgba(255, 200, 90, 0.45); animation: gs3-best 2.4s ease-in-out infinite; }
#win-gems .gs3-art { position: relative; display: grid; place-items: center; width: 110px; height: 96px; }
#win-gems .gs3-art i { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 230, 160, 0.2) 0 8deg, transparent 8deg 24deg);
  mask: radial-gradient(circle, #000 15%, transparent 66%); -webkit-mask: radial-gradient(circle, #000 15%, transparent 66%); animation: gs2-spin 16s linear infinite; }
#win-gems .gs3-art canvas { position: relative; width: 84px; height: 84px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); animation: gs2-bob 3s ease-in-out infinite; }
#win-gems .gs3-pack.t1 .gs3-art canvas, #win-gems .gs3-pack.t3 .gs3-art canvas { width: 94px; height: 94px; }
#win-gems .gs3-pack.t5 .gs3-art canvas { width: 104px; height: 104px; }
#win-gems .gs3-total:not(#_) { display: inline-flex; align-items: center; gap: 5px; font: 800 26px/1.1 'Noto Serif Thai', serif !important; color: #c6ecff !important; text-shadow: 0 0 12px rgba(130, 200, 255, 0.6); }
#win-gems .gs3-pack:is(.t4, .t5) .gs3-total:not(#_) { color: #ffe08a !important; text-shadow: 0 0 14px rgba(255, 200, 90, 0.7); }
#win-gems .gs3-total img { width: 22px; height: 22px; }
#win-gems .gs3-split { font-size: 12px; color: #c3cde6 !important; }
#win-gems .gs3-first { min-height: 20px; margin-top: 4px; padding: 1px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #3a1400 !important; background: linear-gradient(#ffd9a0, #ff9a4a); }
#win-gems .gs3-first.none { background: none; }
#win-gems .gs3-price:not(#_) { margin-top: 8px; width: 100%; height: 38px; border: 0; border-radius: 10px; cursor: pointer; font: 800 18px 'IBM Plex Sans Thai', sans-serif !important; color: #2a1600 !important;
  background: linear-gradient(180deg, #fff3c4, #ffd36a 45%, #d99a2b) !important; box-shadow: inset 0 0 0 1px #fff2c0, 0 0 0 1px #8a5a12, 0 3px 0 #6e430c; }
#win-gems .gs3-price:not(#_):hover { filter: brightness(1.08); }
#win-gems .gs3-tag { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 1px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; color: #2a1600 !important; background: linear-gradient(#ffe08a, #e2a53a); }
#win-gems .gs3-tag.best { color: #fff !important; background: linear-gradient(#ff8a7a, #d23a3a); box-shadow: 0 0 10px rgba(255, 90, 70, 0.6); }
#win-gems .gs3-pct { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 1px 8px; border-radius: 6px; font: 800 13px 'IBM Plex Sans Thai', sans-serif; color: #fff !important; background: linear-gradient(#4fd17a, #229a4c); box-shadow: 0 0 10px rgba(80, 220, 120, 0.5); }
@keyframes gs3-best { 50% { box-shadow: inset 0 0 0 2px #fff2c0, 0 0 34px rgba(255, 210, 110, 0.8); } }
#win-gems .gs2-hero:not(#_) { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { #win-gems .gs3-banner::after, #win-gems .gs3-art i, #win-gems .gs3-art canvas, #win-gems .gs3-pack.t5 { animation: none !important; } }
#win-gems .gs-scroll:not(#_) { min-height: 568px; }
#win-gems .av-card b:not(#_) { color: #f3e9d2 !important; }
#win-gems .av-card .rarity-tag:not(#_) { color: #f3e9d2 !important; }

/* Premium plans (2026-11-17): 15 days ฿199 · 30 days ฿299 (the better buy, lit up) */
#win-gems .gs2-plans { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; align-items: stretch; margin-top: 4px; }
#win-gems .gs2-plan:not(#_) { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 12px 12px; border-radius: 12px; text-align: center;
  background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.35); }
#win-gems .gs2-plan.best:not(#_) { background: linear-gradient(180deg, rgba(255, 215, 120, 0.22), rgba(255, 215, 120, 0.06)); box-shadow: inset 0 0 0 2px #ffd36a, 0 0 22px rgba(255, 200, 90, 0.4); animation: gs3-best 2.4s ease-in-out infinite; }
#win-gems .gs2-plan > b:not(#_) { font: 800 34px/1 'Noto Serif Thai', serif !important; color: #fff !important; }
#win-gems .gs2-plan > b small { font-size: 16px; color: #d9c8f5 !important; }
#win-gems .gs2-plan.best > b:not(#_) { color: #ffe08a !important; text-shadow: 0 0 14px rgba(255, 200, 90, 0.6); }
#win-gems .gs2-plan-price { display: flex; align-items: baseline; gap: 8px; }
#win-gems .gs2-plan-price s { font-size: 15px; color: #a893cc !important; text-decoration-color: #ff7a6a; text-decoration-thickness: 2px; }
#win-gems .gs2-plan-price strong:not(#_) { font: 800 28px 'IBM Plex Sans Thai', sans-serif !important; color: #c6ecff !important; text-shadow: 0 0 10px rgba(130, 200, 255, 0.5); }
#win-gems .gs2-plan.best .gs2-plan-price strong:not(#_) { font-size: 32px !important; color: #fff !important; }
#win-gems .gs2-plan > small { font-size: 12px; color: #c8b6e6 !important; }
#win-gems .gs2-plan.best > small { color: #ffe6b0 !important; font-weight: 700; }
#win-gems .gs2-plan .gs2-buy:not(#_) { flex: none; width: 100%; height: 42px; margin-top: 8px; font-size: 16px !important; }
#win-gems .gs2-plan .gs2-buy.plain:not(#_) { animation: none; background: linear-gradient(180deg, #e9e3f5, #b9aed6) !important; box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px #5b4a85, 0 3px 0 #3d2f60; color: #251a40 !important; }
#win-gems .gs2-plan-tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 12px; border-radius: 99px; font-size: 12px; font-weight: 800; color: #fff !important;
  background: linear-gradient(#ff8a7a, #d23a3a); box-shadow: 0 0 12px rgba(255, 90, 70, 0.6); }
#win-gems .gs2-hero .gs2-main { gap: 10px; }

/* ===== Astra shop from generated art (2026-11-17): assets/ui/shop-*.png (art/source/ui-shop-kit.png, scripts/ui-shop-kit-crop.json) ===== */
#win-gems .gs4-banner:not(#_) { position: relative; display: flex; align-items: center; gap: 12px; height: 92px; margin: 10px 0 14px; padding: 0 22px 0 190px;
  background: url(assets/ui/shop-banner.png) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(60, 10, 0, 0.35)); }
#win-gems .gs4-x2 { position: absolute; left: 4px; top: 50%; width: 190px; transform: translateY(-52%) rotate(-4deg); filter: drop-shadow(0 4px 6px rgba(60, 10, 0, 0.5)); animation: gs4-pop 2.2s ease-in-out infinite; }
#win-gems .gs4-banner div { display: flex; flex-direction: column; gap: 2px; }
#win-gems .gs4-banner b:not(#_) { font: 800 27px/1.15 'Noto Serif Thai', serif !important; background: linear-gradient(180deg, #fffbe8, #ffe08a 55%, #ffb63a); -webkit-background-clip: text; background-clip: text; color: transparent !important;
  filter: drop-shadow(0 2px 0 rgba(90, 15, 0, 0.8)); }
#win-gems .gs4-banner span { font-size: 12.5px; font-weight: 600; color: #ffe7c8 !important; text-shadow: 0 1px 2px rgba(60, 0, 0, 0.8); }
#win-gems .gs4-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; margin-bottom: 6px; }
#win-gems .gs4-pack:not(#_) { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 14px 16px 16px; min-height: 236px; text-align: center;
  border: 26px solid transparent; border-image: url(assets/ui/shop-card-blue.png) 56 fill / 26px stretch; padding: 0; transition: transform .15s, filter .15s; }
#win-gems .gs4-pack.purple:not(#_) { border-image-source: url(assets/ui/shop-card-purple.png); }
#win-gems .gs4-pack.gold:not(#_) { border-image-source: url(assets/ui/shop-card-gold.png); }
#win-gems .gs4-pack:not(#_):hover { transform: translateY(-3px); filter: brightness(1.08) drop-shadow(0 0 12px rgba(255, 210, 110, 0.55)); }
#win-gems .gs4-pack.gold:last-child:not(#_) { filter: drop-shadow(0 0 12px rgba(255, 200, 90, 0.55)); animation: gs4-glow 2.4s ease-in-out infinite; }
#win-gems .gs4-art { display: grid; place-items: center; height: 104px; margin-top: -8px; }
#win-gems .gs4-art img { max-width: 150px; max-height: 104px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); animation: gs2-bob 3s ease-in-out infinite; }
#win-gems .gs4-total:not(#_) { display: inline-flex; align-items: center; gap: 6px; font: 800 28px/1.1 'Noto Serif Thai', serif !important; color: #fff !important; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 12px rgba(140, 200, 255, 0.55); }
#win-gems .gs4-pack.gold .gs4-total:not(#_) { color: #fff3c8 !important; text-shadow: 0 2px 0 rgba(60, 25, 0, 0.7), 0 0 14px rgba(255, 210, 110, 0.7); }
#win-gems .gs4-total img { width: 24px; height: 24px; }
#win-gems .gs4-split { font-size: 12px; font-weight: 600; color: #dfe7ff !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
#win-gems .gs4-first { margin-top: 3px; padding: 1px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; color: #4a1600 !important; background: linear-gradient(#ffe4b0, #ffa24a); box-shadow: 0 0 8px rgba(255, 150, 60, 0.6); }
#win-gems .gs4-buy:not(#_) { margin-top: auto; width: 86%; height: 44px; border: 0; cursor: pointer; font: 800 21px 'IBM Plex Sans Thai', sans-serif !important; color: #3a2000 !important; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.7);
  background: url(assets/ui/shop-btn-gold.png) center / 100% 100% no-repeat !important; box-shadow: none !important; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4)); }
#win-gems .gs4-buy:not(#_):hover { filter: brightness(1.1) drop-shadow(0 0 10px rgba(255, 210, 110, 0.8)); }
#win-gems .gs4-buy:not(#_):active { transform: translateY(2px); }
#win-gems .gs4-tag { position: absolute; top: -20px; left: -18px; z-index: 1; min-width: 96px; padding: 7px 18px 9px 10px; font-size: 12px; font-weight: 800; color: #3a2000 !important; text-align: left;
  background: url(assets/ui/shop-tag-gold.png) center / 100% 100% no-repeat; }
#win-gems .gs4-tag.red { color: #fff !important; text-shadow: 0 1px 0 rgba(80, 0, 0, 0.7); background-image: url(assets/ui/shop-tag-red.png); }
#win-gems .gs4-pct { position: absolute; top: -16px; right: -14px; z-index: 1; display: grid; place-items: center; width: 66px; height: 34px; font: 800 14px 'IBM Plex Sans Thai', sans-serif; color: #fff !important; text-shadow: 0 1px 0 rgba(0, 50, 0, 0.8);
  background: url(assets/ui/shop-badge.png) center / 100% 100% no-repeat; }
/* premium plans and the item card on the same parts */
#win-gems .gs2-plan:not(#_) { border: 22px solid transparent; border-image: url(assets/ui/shop-card-purple.png) 56 fill / 22px stretch; background: none; box-shadow: none; padding: 0; }
#win-gems .gs2-plan.best:not(#_) { border-image-source: url(assets/ui/shop-card-gold.png); background: none; box-shadow: none; filter: drop-shadow(0 0 12px rgba(255, 200, 90, 0.5)); animation: gs4-glow 2.4s ease-in-out infinite; }
#win-gems .gs2-plan .gs2-buy:not(#_) { height: 44px; border-radius: 0; background: url(assets/ui/shop-btn-gold.png) center / 100% 100% no-repeat !important; box-shadow: none !important; animation: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4)); }
#win-gems .gs2-plan .gs2-buy.plain:not(#_) { background: url(assets/ui/shop-btn-silver.png) center / 100% 100% no-repeat !important; box-shadow: none !important; color: #262040 !important; }
#win-gems .gs2-plan .gs2-buy.short:not(#_) { filter: saturate(.5) brightness(.9); }
#win-gems .gs2-plan-tag:not(#_) { top: -34px; padding: 6px 22px 9px 14px; border-radius: 0; background: url(assets/ui/shop-tag-red.png) center / 100% 100% no-repeat; box-shadow: none; text-shadow: 0 1px 0 rgba(80, 0, 0, 0.7); }
#win-gems .gs2-card:not(#_) { border: 22px solid transparent; border-image: url(assets/ui/shop-card-blue.png) 56 fill / 22px stretch; background: none; box-shadow: none; padding: 0; }
#win-gems .gs2-pill:not(#_) { height: 40px; min-width: 130px; border-radius: 0; background: url(assets/ui/shop-btn-gold.png) center / 100% 100% no-repeat !important; box-shadow: none !important; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); }
@keyframes gs4-pop { 50% { transform: translateY(-54%) rotate(-2deg) scale(1.05); } }
@keyframes gs4-glow { 50% { filter: drop-shadow(0 0 22px rgba(255, 210, 110, 0.95)); } }
@media (prefers-reduced-motion: reduce) { #win-gems .gs4-x2, #win-gems .gs4-art img, #win-gems .gs4-pack, #win-gems .gs2-plan { animation: none !important; } }
#win-gems .gs4-banner:not(#_) { padding-left: 206px; }
#win-gems .gs4-x2 { width: 186px; left: 6px; }
#win-gems .gs4-tab:not(#_) { min-width: 128px !important; height: 40px !important; padding: 0 22px !important; line-height: 40px !important; border: 0 !important; border-radius: 0 !important; font: 700 14px 'IBM Plex Sans Thai', sans-serif !important; color: #d9e2ff !important; background: url(assets/ui/shop-tab.png) center / 100% 100% no-repeat !important; box-shadow: none !important; border-image: none !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
#win-gems .gs4-tab.on:not(#_) { color: #fff3c8 !important; background-image: url(assets/ui/shop-tab-on.png) !important; text-shadow: 0 0 8px rgba(255, 210, 110, 0.8), 0 1px 2px rgba(0, 0, 0, 0.7); }
#win-gems .gs4-tab:not(#_)::before, #win-gems .gs4-tab:not(#_)::after { display: none !important; }
#win-gems .gs-scroll > .gs2-hero:not(#_) { min-height: 548px; margin: 6px 0 0; padding: 0 8px 0 0; border: 30px solid transparent; border-image: url(assets/ui/shop-card-purple.png) 56 fill / 30px stretch; background: none; box-shadow: none; filter: drop-shadow(0 8px 16px rgba(40, 10, 80, 0.4)); grid-template-columns: 290px 1fr; }
#win-gems .gs-scroll > .gs2-hero:not(#_)::after { inset: -30px; border-radius: 14px; }
#win-gems .gs-scroll > .gs2-hero .gs2-art canvas { width: 270px; height: 270px; }
#win-gems .gs-scroll > .gs2-hero .gs2-rays { width: 300px; height: 300px; }
#win-gems .gs-scroll > .gs2-hero .gs2-main { gap: 16px; }
#win-gems .gs-scroll > .gs2-hero .gs2-main h3:not(#_) { font-size: 42px !important; }
#win-gems .gs2-plan:not(#_) { padding-bottom: 6px; }
#win-gems .gs2-plan .gs2-buy:not(#_) { flex: none; height: 46px; margin-top: 10px; }
#win-gems .gs2-plans:not(#_) { margin-top: 18px; gap: 16px; }
#win-gems .gs2-bens > div:not(#_) { background: rgba(10, 6, 30, 0.35); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.55); }
#win-gems .gs-scroll > .gs2-hero:not(#_) { grid-template-columns: 230px 1fr; padding: 0; }
#win-gems .gs-scroll > .gs2-hero:not(#_)::after { display: none; }
#win-gems .gs-scroll > .gs2-hero .gs2-art canvas { width: 230px; height: 230px; }
#win-gems .gs-scroll > .gs2-hero .gs2-rays { width: 250px; height: 250px; }
#win-gems .gs-scroll > .gs2-hero .gs2-main:not(#_) { padding-right: 6px; }
#win-gems .gs2-bens p span:not(#_) { white-space: normal; }
#win-gems .gs2-bens p span:not(#_) { white-space: nowrap; font-size: 19px; }
#win-gems .gs4-tab:not(#_) { background-size: 100% 100% !important; background-position: center !important; }
#win-gems .gs4-tab:not(#_) { display: inline-grid; place-items: center; cursor: pointer; margin-right: 6px; }
#win-gems .gs4-tab:not(#_):hover { filter: brightness(1.15); }
#win-gems .gs4-banner:not(#_) { padding-left: 226px; }
#win-gems .gs4-good .gs4-art canvas { width: 100px; height: 100px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); animation: gs2-bob 3s ease-in-out infinite; }
#win-gems .gs4-name:not(#_) { font: 700 19px 'Noto Serif Thai', serif !important; color: #fff3cf !important; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55); }
#win-gems .gs4-buy:not(#_) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#win-gems .gs4-buy img { width: 22px; height: 22px; }
#win-gems .gs4-buy.short:not(#_) { filter: saturate(.5) brightness(.85); }
#win-gems .gs4-good:not(#_) { min-height: 236px; }
#win-gems .av-card:not(#_):not(#__) { border: 20px solid transparent !important; border-image: url(assets/ui/shop-card-purple.png) 56 fill / 20px stretch !important; background: none !important; box-shadow: none !important; padding: 0 !important; }
#win-gems .av-card.r-omega:not(#_):not(#__) { border-image-source: url(assets/ui/shop-card-gold.png) !important; }
#win-gems .av-card canvas:not(#_) { background: radial-gradient(circle, rgba(255, 230, 170, 0.25), transparent 70%) !important; border: 0 !important; }
#win-gems .av-card .btn:not(#_):not(#__):not(#___) { height: 38px; border: 0 !important; border-image: none !important; border-radius: 0 !important; font: 800 15px 'IBM Plex Sans Thai', sans-serif !important; color: #3a2000 !important; background: url(assets/ui/shop-btn-gold.png) center / 100% 100% no-repeat !important; box-shadow: none !important; }
#win-gems .av-card .btn[disabled]:not(#_):not(#__):not(#___) { background-image: url(assets/ui/shop-btn-silver.png) !important; color: #2a2440 !important; }
#win-gems .gs-scroll:not(#_) { height: 568px; max-height: 568px; overflow-y: auto; flex: none; }
#win-gems .gs-scroll:not(#_) { height: 640px; max-height: 640px; }
#win-gems .gs-scroll > .gs2-hero:not(#_) { min-height: 600px; }
#win-gems .gs-scroll:not(#_) { height: 664px; max-height: 664px; }

/* Avatar shop cards (user 2026-11-17 "the grade badge prettier, lined up"): one header row inside the frame —
   a metal grade plate top-left, the zoom button top-right, the art below it, never under the badge. */
#win-gems .av-card:not(#_):not(#__) { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#win-gems .av-card canvas:not(#_) { margin-top: 26px; width: 100%; height: auto; aspect-ratio: 1; }
#win-gems .av-card .rarity-tag:not(#_):not(#__) { position: absolute; top: 0; left: 0; z-index: 2; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px 0 7px;
  border: 0; border-radius: 4px 11px 11px 4px; font: 800 11px/1 'IBM Plex Sans Thai', sans-serif !important; letter-spacing: .14em; filter: none !important;
  color: #3a1d00 !important; background: linear-gradient(180deg, #fff1c4 0%, #ffcf6a 38%, #e8901e 70%, #ffbf55 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 225, 0.75), 0 0 0 1.5px #6e3d06, 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 178, 62, 0.45); text-shadow: 0 1px 0 rgba(255, 245, 210, 0.7); }
#win-gems .av-card .rarity-tag:not(#_):not(#__)::before { content: ''; width: 8px; height: 8px; transform: rotate(45deg); border-radius: 1px;
  background: linear-gradient(135deg, #fff, #ffe08a 45%, #c25a00); box-shadow: 0 0 0 1px #6e3d06, 0 0 5px rgba(255, 230, 150, 0.9); }
#win-gems .av-card .rarity-tag.r-omega:not(#_):not(#__) { color: #fff !important; text-shadow: 0 1px 0 rgba(90, 0, 20, 0.85);
  background: linear-gradient(180deg, #ffb3bf 0%, #ff4f6d 38%, #b3122f 72%, #ff6a82 100%); box-shadow: inset 0 0 0 1px rgba(255, 220, 228, 0.7), 0 0 0 1.5px #5c0716, 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 79, 109, 0.55); }
#win-gems .av-card .rarity-tag.r-omega:not(#_):not(#__)::before { background: linear-gradient(135deg, #fff, #ffd0d8 45%, #a10c28); box-shadow: 0 0 0 1px #5c0716, 0 0 6px rgba(255, 180, 195, 0.95); }
#win-gems .av-card .rarity-tag.r-nova:not(#_):not(#__) { color: #fff !important; text-shadow: 0 1px 0 rgba(40, 0, 80, 0.85); background: linear-gradient(180deg, #e7d2ff, #b77bff 40%, #6a2fc4 75%, #c79bff); box-shadow: inset 0 0 0 1px rgba(240, 225, 255, 0.7), 0 0 0 1.5px #34106a, 0 2px 4px rgba(0, 0, 0, 0.5); }
#win-gems .av-card .rarity-tag.r-prime:not(#_):not(#__) { color: #06283c !important; text-shadow: 0 1px 0 rgba(220, 245, 255, 0.7); background: linear-gradient(180deg, #d8f3ff, #4fc3ff 40%, #1a7fb8 75%, #7fd6ff); box-shadow: inset 0 0 0 1px rgba(225, 248, 255, 0.7), 0 0 0 1.5px #0b3b57, 0 2px 4px rgba(0, 0, 0, 0.5); }
#win-gems .av-card .av-zoom:not(#_):not(#__) { top: 0; right: 0; width: 24px; height: 24px; padding: 4px; border: 0; background: radial-gradient(circle at 40% 35%, #2a3a6a, #0c1430); box-shadow: inset 0 0 0 1px rgba(255, 224, 138, 0.35), 0 0 0 1.5px #c9a24a, 0 2px 4px rgba(0, 0, 0, 0.5); }
#win-gems .av-card .av-zoom svg { stroke: #ffe08a; }
#win-gems .av-card .av-zoom:not(#_):not(#__):hover { background: radial-gradient(circle at 40% 35%, #fff3c4, #e2b84e); }
#win-gems .av-card .av-zoom:hover svg { stroke: #3a2000; }

/* Card frames without the seam (user 2026-11-17 "remove that line"): the frame draws only its ring (no `fill`, whose
   stretched middle met the squeezed edge slices in a faint line); the inside is a CSS glow from the frame's own
   colours — edge = the frame's inside at its slice line, centre = the frame's centre. */
#win-gems :is(.gs4-pack, .gs2-plan, .av-card, .gs-scroll > .gs2-hero):not(#_):not(#__):not(#___) { --cc: #1d4fa8; --ce: #14347b;
  border-image-slice: 56 !important; background: radial-gradient(closest-side at 50% 50%, var(--cc), var(--ce)) border-box !important; border-radius: 16px !important; }
#win-gems :is(.gs4-pack.purple, .gs2-plan, .av-card, .gs-scroll > .gs2-hero):not(#_):not(#__):not(#___) { --cc: #752fa5; --ce: #4d1e79; }
#win-gems :is(.gs4-pack.gold, .gs2-plan.best, .av-card.r-omega):not(#_):not(#__):not(#___) { --cc: #bb7f2d; --ce: #814f19; }

/* VFX behind the ฿3,000 and ฿9,999 packs (user 2026-11-17 "for the grandeur"): a breathing glow, turning god rays,
   rising star sparks; the ฿9,999 one adds counter-turning rays, a spinning ring of light and a sweep across the card. */
#win-gems .gs4-art { position: relative; }
#win-gems .gs4-art img { position: relative; z-index: 2; }
#win-gems .gs4-pack.vfx .gs4-glow { position: absolute; z-index: 0; left: 50%; top: 52%; width: 190px; height: 150px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 240, 190, 0.85), rgba(255, 190, 70, 0.45) 45%, transparent); animation: gs4-breathe 2.6s ease-in-out infinite; }
#win-gems .gs4-pack.vfx .gs4-rays { position: absolute; z-index: 1; left: 50%; top: 52%; width: 250px; height: 250px; margin: -125px 0 0 -125px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 236, 170, 0.55) 0 5deg, transparent 5deg 18deg);
  mask: radial-gradient(closest-side, #000 22%, rgba(0, 0, 0, 0.5) 50%, transparent 100%); -webkit-mask: radial-gradient(closest-side, #000 22%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  mix-blend-mode: screen; animation: gs2-spin 16s linear infinite; }
#win-gems .gs4-pack.max .gs4-rays { width: 290px; height: 290px; margin: -145px 0 0 -145px; background: repeating-conic-gradient(from 0deg, rgba(255, 240, 180, 0.7) 0 4deg, transparent 4deg 15deg); animation-duration: 11s; }
#win-gems .gs4-pack.max .gs4-rays.r2 { background: repeating-conic-gradient(from 7deg, rgba(150, 210, 255, 0.45) 0 3deg, transparent 3deg 24deg); animation: gs4-unspin 19s linear infinite; }
#win-gems .gs4-pack.max .gs4-glow { width: 230px; height: 175px; background: radial-gradient(closest-side, rgba(255, 250, 220, 0.95), rgba(255, 200, 80, 0.55) 45%, rgba(130, 190, 255, 0.18) 70%, transparent); }
#win-gems .gs4-ring { position: absolute; z-index: 1; left: 50%; top: 52%; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 245, 200, 0.95) 75%, transparent 76% 100%);
  mask: radial-gradient(closest-side, transparent 88%, #000 90%, #000 97%, transparent 100%); -webkit-mask: radial-gradient(closest-side, transparent 88%, #000 90%, #000 97%, transparent 100%);
  transform: scaleY(0.42); animation: gs4-orbit 2.4s linear infinite; }
#win-gems .gs4-spark { position: absolute; z-index: 3; left: var(--x); bottom: 6px; width: 10px; height: 10px; margin-left: -5px; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 236, 160, 0.9) 30%, transparent 62%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); transform: scale(var(--s));
  opacity: 0; animation: gs4-rise 2.6s ease-out var(--d) infinite; }
#win-gems .gs4-pack.max .gs4-spark { animation-duration: 2.1s; }
#win-gems .gs4-shine { position: absolute; z-index: 0; inset: -26px; border-radius: 16px; overflow: hidden; pointer-events: none; }
#win-gems .gs4-shine::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255, 250, 225, 0.38) 48%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 250, 225, 0.38) 52%, transparent 62%);
  background-size: 250% 100%; animation: gs4-sweep 3.2s ease-in-out infinite; }
#win-gems .gs4-pack.vfx > :not(.gs4-shine, .gs4-tag, .gs4-pct) { position: relative; z-index: 1; }
@keyframes gs4-breathe { 50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.12); } }
@keyframes gs4-unspin { to { transform: rotate(-360deg); } }
@keyframes gs4-orbit { from { transform: scaleY(0.42) rotate(0deg); } to { transform: scaleY(0.42) rotate(360deg); } }
@keyframes gs4-rise { 0% { opacity: 0; transform: translateY(0) scale(var(--s)); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-120px) scale(calc(var(--s) * 0.4)) rotate(90deg); } }
@keyframes gs4-sweep { 0%, 35% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { #win-gems .gs4-glow, #win-gems .gs4-rays, #win-gems .gs4-ring, #win-gems .gs4-spark, #win-gems .gs4-shine::before { animation: none !important; } }
/* (The light lives in the card-sized clipped layer .gs4-shine, centred on the pack art: never past the frame.) */
#win-gems .gs4-shine :is(.gs4-glow, .gs4-rays, .gs4-ring) { top: 72px !important; }
#win-gems .gs4-shine::before { z-index: 2; }
#win-gems .gs4-pack.max .gs4-shine::before { display: block; }
#win-gems .gs4-pack.vfx:not(.max) .gs4-shine::before { display: none; }
@keyframes gs4-rise { 0% { opacity: 0; transform: translateY(0) scale(var(--s)); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-88px) scale(calc(var(--s) * 0.4)) rotate(90deg); } }
#win-gems .gs4-shine:not(#_) { inset: -4px; border-radius: 10px; }
#win-gems .gs4-shine :is(.gs4-glow, .gs4-rays, .gs4-ring):not(#_) { top: 50px !important; }
/* Aura only (user 2026-11-17 "the VFX isn't pretty, just an aura"): the pack art glows along its own outline, breathing. */
#win-gems .gs4-pack.vfx .gs4-art img { animation: gs2-bob 3s ease-in-out infinite, gs4-aura 2.4s ease-in-out infinite; }
#win-gems .gs4-pack.max .gs4-art img { animation: gs2-bob 3s ease-in-out infinite, gs4-aura-max 2.4s ease-in-out infinite; }
@keyframes gs4-aura { 0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 225, 140, 0.9)) drop-shadow(0 0 12px rgba(255, 190, 70, 0.55)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); }
  50% { filter: drop-shadow(0 0 6px rgba(255, 240, 180, 1)) drop-shadow(0 0 20px rgba(255, 190, 70, 0.8)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); } }
@keyframes gs4-aura-max { 0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 240, 190, 1)) drop-shadow(0 0 16px rgba(255, 200, 80, 0.75)) drop-shadow(0 0 30px rgba(140, 200, 255, 0.35)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 250, 220, 1)) drop-shadow(0 0 26px rgba(255, 205, 90, 0.95)) drop-shadow(0 0 44px rgba(140, 200, 255, 0.55)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); } }
/* Ribbon tags (user 2026-11-17 "คุ้มสุด / ยอดนิยม not lined up"): fixed ribbon size, text centred on the flat band (the tail and the curl kept clear). */
#win-gems .gs4-tag:not(#_) { top: -18px; left: -16px; width: 108px; height: 54px; min-width: 0; padding: 0 18px 7px 4px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; font-size: 13px; line-height: 1; white-space: nowrap; text-align: center; background-size: 100% 100%; }
/* Aura colours (user 2026-11-17): ฿3,000 icy blue, the big ฿9,999 pure gold. */
@keyframes gs4-aura { 0%, 100% { filter: drop-shadow(0 0 4px rgba(200, 235, 255, 0.95)) drop-shadow(0 0 13px rgba(90, 180, 255, 0.65)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); }
  50% { filter: drop-shadow(0 0 6px rgba(225, 245, 255, 1)) drop-shadow(0 0 22px rgba(90, 180, 255, 0.9)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); } }
@keyframes gs4-aura-max { 0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 245, 200, 1)) drop-shadow(0 0 16px rgba(255, 205, 80, 0.85)) drop-shadow(0 0 30px rgba(255, 170, 40, 0.45)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 250, 220, 1)) drop-shadow(0 0 26px rgba(255, 210, 90, 1)) drop-shadow(0 0 44px rgba(255, 175, 40, 0.7)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); } }

/* ===================== Touch layout (user 2026-11-17 "playable on phones, every browser") =====================
   html.touch (ui TOUCH: a coarse pointer or no hover; ?touch=1 to test on a desktop). Thumbs: the joystick bottom-left,
   the item bar above it, a big attack button bottom-right with dash, auto and the skills on two arcs round it (ui
   touchLayout gives each its --tx/--ty from the attack button's centre), the menu as a grid behind one round button,
   windows across the whole width and scrolling inside. Every tap target at least 44 px. */
#menu-toggle { display: none; }
html.touch, html.touch body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.touch input, html.touch textarea { -webkit-user-select: text; user-select: text; }
html.touch button, html.touch .slot, html.touch canvas#world, html.touch #joystick { touch-action: manipulation; }
html.touch canvas#world, html.touch #joystick { touch-action: none; }

/* the action cluster */
html.touch #hud #skillbar:not(#_):not(#__):not(#___) { position: fixed !important; inset: 0 !important; left: 0 !important; top: 0 !important; width: auto !important; height: auto !important; display: block !important;
  transform: none !important; filter: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; pointer-events: none; z-index: 6; }
html.touch #hud #skillbar:not(#_):not(#__):not(#___) :is(.sb-top, #dock-left, #dock-right, #dock-main) { display: contents !important; }
html.touch #hud #skillbar:not(#_):not(#__):not(#___) :is(.sb-emblem, .sb-rail, .sb-wing) { display: none !important; }
html.touch #hud #skillbar .slot:not(#_):not(#__):not(#___) { --sz: 58px; --cx: calc(100% - 22px - 48px); --cy: calc(100% - 22px - 48px);
  position: absolute !important; left: calc(var(--cx) + var(--tx, 0px) - var(--sz) / 2) !important; top: calc(var(--cy) + var(--ty, 0px) - var(--sz) / 2) !important;
  width: var(--sz) !important; height: var(--sz) !important; margin: 0 !important; border-radius: 50% !important; pointer-events: auto; overflow: hidden;
  background: radial-gradient(circle at 45% 35%, #22325e, #0b1228) !important; box-shadow: inset 0 0 0 2px #c9a24a, inset 0 0 0 4px rgba(10, 16, 40, 0.8), 0 3px 8px rgba(0, 0, 0, 0.55) !important; border: 0 !important; }
html.touch #hud #skillbar .slot canvas { width: 78% !important; height: 78% !important; margin: 11% !important; border-radius: 50%; }
html.touch #hud #skillbar .slot[data-id="attack"]:not(#_):not(#__):not(#___) { --sz: 96px; --tx: 0px; --ty: 0px; box-shadow: inset 0 0 0 3px #ffd36a, inset 0 0 0 6px rgba(10, 16, 40, 0.8), 0 0 16px rgba(255, 210, 110, 0.45), 0 4px 10px rgba(0, 0, 0, 0.6) !important; }
html.touch #hud #skillbar .slot[data-id="dash"]:not(#_):not(#__):not(#___) { --sz: 56px; }
html.touch #hud #skillbar .slot[data-id="auto"]:not(#_):not(#__):not(#___) { --sz: 50px; }
html.touch #hud #skillbar .slot.on[data-id="auto"]:not(#_):not(#__):not(#___) { box-shadow: inset 0 0 0 2px #7dffa6, 0 0 14px rgba(110, 255, 160, 0.7) !important; }
html.touch #hud #skillbar .slot:active { filter: brightness(1.3); transform: scale(0.94); }
/* the item bar: a row above the joystick */
html.touch #hud #skillbar .slot[data-dock="right"]:not(#_):not(#__):not(#___) { --sz: 46px; border-radius: 12px !important; left: calc(18px + var(--qi) * 52px) !important; top: auto !important; bottom: 172px; }
html.touch #hud #skillbar .slot[data-dock="right"]:nth-child(1) { --qi: 0; } html.touch #hud #skillbar .slot[data-dock="right"]:nth-child(2) { --qi: 1; }
html.touch #hud #skillbar .slot[data-dock="right"]:nth-child(3) { --qi: 2; } html.touch #hud #skillbar .slot[data-dock="right"]:nth-child(4) { --qi: 3; }
html.touch #hud #skillbar .slot[data-dock="right"]:nth-child(5) { --qi: 4; }
html.touch #hud #skillbar .slot[data-dock="right"] canvas { border-radius: 8px; }
/* keyboard keys mean nothing to a thumb; lock labels stay */
html.touch #hud #skillbar .slot .key { display: none !important; }
html.touch #hud #skillbar .slot .lock { font-size: 10px; border-radius: 50%; }
html.touch #hud #skillbar .slot .cd { border-radius: 50%; }
/* LV / JOB: a hairline across the bottom edge */
html.touch #hud #skillbar #xp-row:not(#_):not(#__):not(#___) { position: absolute !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; width: auto !important; display: grid !important; gap: 1px; margin: 0 !important; pointer-events: none; }
html.touch #hud #skillbar #xp-row > div:not(#_):not(#__) { height: 4px !important; min-height: 0 !important; border-radius: 0 !important; border: 0 !important; }
html.touch #hud #skillbar #xp-row span { display: none !important; }
html.touch #joystick { display: block; left: 22px !important; bottom: 22px !important; width: 136px !important; height: 136px !important; z-index: 6; }
html.touch #talk-btn:not([hidden]) { display: grid; place-items: center; position: fixed; left: 50%; bottom: 22px; right: auto; width: 76px; height: 76px; margin-left: -38px; border-radius: 50%; z-index: 7;
  font: 700 16px 'IBM Plex Sans Thai', Kanit, sans-serif; color: #fff3cf; background: radial-gradient(circle at 45% 35%, #2a3a6a, #0c1430); border: 0; box-shadow: inset 0 0 0 3px #ffd36a, 0 0 16px rgba(255, 210, 110, 0.55); }

/* the menu: one round button, a grid when open */
html.touch #menu-toggle { display: grid; place-items: center; position: fixed; right: 14px; top: 40%; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; z-index: 9; cursor: pointer;
  background: radial-gradient(circle at 45% 35%, #2a3a6a, #0c1430); box-shadow: inset 0 0 0 2.5px #e2b84e, 0 3px 8px rgba(0, 0, 0, 0.55); }
html.touch #menu-toggle i { width: 22px; height: 22px; background: radial-gradient(circle, #ffe08a 2.6px, transparent 3px) 0 0 / 33.3% 33.3%; }
html.touch #hud #menu:not(#_):not(#__) { display: none !important; }
html.touch #hud #menu.open:not(#_):not(#__) { display: grid !important; position: fixed !important; inset: auto !important; left: 50% !important; top: 50% !important; right: auto !important; bottom: auto !important;
  transform: translate(-50%, -50%) !important; grid-template-columns: repeat(4, 78px) !important; gap: 10px !important; padding: 18px !important; z-index: 30; border-radius: 18px;
  background: linear-gradient(170deg, rgba(28, 38, 74, 0.97), rgba(10, 14, 32, 0.98)) !important; box-shadow: inset 0 0 0 1.5px #c9a24a, 0 10px 40px rgba(0, 0, 0, 0.7) !important; }
html.touch #hud #menu.open .menu-btn:not(#_):not(#__) { width: 78px !important; height: 72px !important; font-size: 12.5px !important; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
html.touch #hud #menu .menu-btn .key { display: none !important; }

/* top right: a smaller map, icon-only top buttons, no chat (set 2 brings a chat button), a folded quest box */
html.touch #hud #map-panel:not(#_) { width: 150px !important; top: 6px !important; right: 6px !important; }
html.touch #hud #minimap:not(#_) { width: 150px !important; height: auto !important; }
html.touch #hud #top-buttons:not(#_) { top: 6px !important; right: 164px !important; flex-direction: row !important; gap: 4px !important; }
html.touch #hud .top-btn:not(#_) { min-width: 46px; min-height: 46px; font-size: 0 !important; padding: 4px !important; }
html.touch #hud .top-btn svg { width: 26px; height: 26px; }
html.touch #hud #chat:not(#_) { display: none !important; }

/* windows: across the screen, scrolling inside (ui fitWindows fits the width only) */
html.touch .window:not(#_):not(#__) { left: var(--wx, 0px) !important; top: 0 !important; right: auto !important; bottom: auto !important; margin: 0 !important; transform: none !important;
  zoom: var(--fit, 1); max-height: calc(100dvh / var(--fit, 1)) !important; height: auto !important; overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
html.touch .window .close:not(#_) { min-width: 44px; min-height: 44px; font-size: 22px !important; }
html.touch #win-gems .gs-scroll:not(#_) { height: auto; max-height: none; }

/* every tap target at least 44 px */
html.touch .btn:not(#_), html.touch .window button:not(#_) { min-height: 40px; }
html.touch .btn.small:not(#_) { min-height: 38px; padding-left: 14px; padding-right: 14px; }

/* phones held upright: please turn */
#rotate-hint { display: none; }
@media (orientation: portrait) and (max-width: 820px) {
  html.touch #rotate-hint { display: grid; place-items: center; position: fixed; inset: 0; z-index: 999; padding: 24px; text-align: center;
    font: 700 20px 'IBM Plex Sans Thai', Kanit, sans-serif; color: #fff3cf; background: radial-gradient(circle at 50% 40%, #1d2a55, #070b1a); }
}
html.touch #menu-toggle:not(#_) { top: 6px; right: 164px; width: 46px; height: 46px; }
html.touch #hud #top-buttons:not(#_) { right: 216px !important; }
html.touch #hud #quest-panel:not(#_):not(#__) { left: 312px !important; right: auto !important; top: 6px !important; bottom: auto !important; width: min(250px, calc(100vw - 680px)) !important; min-width: 170px; max-height: 104px !important; overflow-y: auto !important; font-size: 12px; }
@media (max-width: 760px) { html.touch #hud #quest-panel:not(#_):not(#__) { display: none !important; } }

/* Touch controls in generated art (2026-11-17, art/source/ui-touch-kit.png → scripts/ui-touch-kit-crop.json → assets/ui/touch-*.png) */
html.touch #hud #skillbar .slot:not(#_):not(#__):not(#___) { background: url(assets/ui/touch-skill.png) center / 100% 100% no-repeat !important; box-shadow: none !important; overflow: visible; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55)); }
html.touch #hud #skillbar .slot:not(#_):not(#__):not(#___):active { background-image: url(assets/ui/touch-skill-on.png) !important; filter: brightness(1.15); transform: scale(0.94); }
html.touch #hud #skillbar .slot canvas:not(#_) { width: 68% !important; height: 68% !important; margin: 16% !important; border-radius: 50%; }
html.touch #hud #skillbar .slot .cd:not(#_), html.touch #hud #skillbar .slot .lock:not(#_) { inset: 12% !important; border-radius: 50% !important; }
html.touch #hud #skillbar .slot[data-id="attack"]:not(#_):not(#__):not(#___) { background-image: url(assets/ui/touch-attack.png) !important; filter: drop-shadow(0 0 10px rgba(255, 210, 110, 0.45)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6)); }
html.touch #hud #skillbar .slot[data-id="attack"] canvas:not(#_) { width: 58% !important; height: 58% !important; margin: 21% !important; }
html.touch #hud #skillbar .slot[data-id="attack"] .cd:not(#_) { inset: 18% !important; }
/* dash and auto carry their own painted icon; the dash charges still show as a number */
html.touch #hud #skillbar .slot:is([data-id="dash"], [data-id="auto"]):not(#_):not(#__):not(#___) { background-image: url(assets/ui/touch-dash.png) !important; }
html.touch #hud #skillbar .slot[data-id="auto"]:not(#_):not(#__):not(#___) { background-image: url(assets/ui/touch-auto.png) !important; }
html.touch #hud #skillbar .slot:is([data-id="dash"], [data-id="auto"]) canvas:not(#_) { opacity: 0; }
html.touch #hud #skillbar .slot.on[data-id="auto"]:not(#_):not(#__):not(#___) { box-shadow: none !important; filter: drop-shadow(0 0 6px #7dffa6) drop-shadow(0 0 14px rgba(110, 255, 160, 0.8)); animation: tc-auto 1.6s ease-in-out infinite; }
@keyframes tc-auto { 50% { filter: drop-shadow(0 0 10px #a6ffc4) drop-shadow(0 0 22px rgba(110, 255, 160, 1)); } }
/* the item bar: round like the rest */
html.touch #hud #skillbar .slot[data-dock="right"]:not(#_):not(#__):not(#___) { --sz: 48px; border-radius: 50% !important; }
html.touch #hud #skillbar .slot[data-dock="right"] canvas:not(#_) { border-radius: 50%; }
html.touch #hud #skillbar .slot .count:not(#_) { right: -2px; bottom: -2px; }
/* joystick, menu, talk */
html.touch #joystick:not(#_) { background: url(assets/ui/touch-stick.png) center / 100% 100% no-repeat !important; border: 0 !important; box-shadow: none !important; opacity: 0.9; }
html.touch #joystick i:not(#_) { width: 62px; height: 62px; margin: -31px 0 0 -31px; background: url(assets/ui/touch-knob.png) center / 100% 100% no-repeat !important; box-shadow: none !important; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.6)); }
html.touch #menu-toggle:not(#_) { background: url(assets/ui/touch-menu.png) center / 100% 100% no-repeat !important; box-shadow: none !important; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
html.touch #menu-toggle i { display: none; }
html.touch #talk-btn:not([hidden]):not(#_) { width: 72px; height: 72px; margin-left: -36px; padding-top: 88px; box-sizing: content-box; height: 0; padding-bottom: 0; box-shadow: none;
  background: url(assets/ui/touch-talk.png) center top / 72px 72px no-repeat !important; font-size: 13px; text-shadow: 0 1px 3px #000, 0 0 6px #000; line-height: 1; overflow: visible; }
html.touch #talk-btn:not([hidden]):not(#_) { height: 18px; padding-top: 74px; bottom: 10px; }
html.touch #hud #quest-panel:not(#_):not(#__) { left: 10px !important; top: 100px !important; width: 270px !important; max-height: max(60px, calc(100dvh - 330px)) !important; }
@media (max-width: 760px) { html.touch #hud #quest-panel:not(#_):not(#__) { display: block !important; } }
@media (min-width: 640px) { html.touch #hud #menu.open:not(#_):not(#__) { grid-template-columns: repeat(5, 78px) !important; } }
/* (The scroll lives on the window's body, not the window: a scrolling frame clipped the title plate and close button
   that theme C hangs on the frame's top edge.) */
html.touch .window:not([hidden]):not(#_):not(#__):not(#___) { overflow: visible !important; display: flex !important; flex-direction: column !important; top: 22px !important; max-height: calc((100dvh - 26px) / var(--fit, 1)) !important; }
html.touch .window > .body:not(#_):not(#__) { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
html.touch .window > .panel-title:not(#_) { flex: none; }
html.touch .window > .body:not(#_):not(#__) { overflow-x: hidden !important; }

/* ===================== Touch, set 2 (2026-11-17): iPhone Safari, chat, fullscreen ===================== */
/* The real visible height (mobile.js --vh): iPhone's 100vh runs under its bottom bar. */
html.touch, html.touch body { height: var(--vh, 100dvh); }
html.touch canvas#world { height: var(--vh, 100dvh) !important; }
html.touch body { touch-action: manipulation; }
/* Safe areas: the notch / rounded corners / home bar of a phone held sideways. */
html.touch #hud #profile:not(#_) { left: calc(10px + env(safe-area-inset-left)) !important; }
html.touch #hud #quest-panel:not(#_):not(#__) { left: calc(10px + env(safe-area-inset-left)) !important; }
html.touch #joystick:not(#_) { left: calc(22px + env(safe-area-inset-left)) !important; bottom: calc(22px + env(safe-area-inset-bottom)) !important; }
html.touch #hud #skillbar .slot[data-dock="right"]:not(#_):not(#__):not(#___) { left: calc(18px + env(safe-area-inset-left) + var(--qi) * 52px) !important; bottom: calc(172px + env(safe-area-inset-bottom)); }
html.touch #hud #skillbar .slot:not([data-dock="right"]):not(#_):not(#__):not(#___) { --cx: calc(100% - 22px - 48px - env(safe-area-inset-right)); --cy: calc(100% - 22px - 48px - env(safe-area-inset-bottom)); }
html.touch #hud #map-panel:not(#_) { right: calc(6px + env(safe-area-inset-right)) !important; }
html.touch #menu-toggle:not(#_) { right: calc(164px + env(safe-area-inset-right)); }
html.touch #hud #top-buttons:not(#_) { right: calc(216px + env(safe-area-inset-right)) !important; }
html.touch .window:not([hidden]):not(#_):not(#__):not(#___) { top: calc(22px + env(safe-area-inset-top)) !important; max-height: calc((var(--vh, 100dvh) - 26px - env(safe-area-inset-top)) / var(--fit, 1)) !important; }

/* chat: a round button left of the menu button; the box opens over the left side, above the keyboard while typing */
#chat-btn, #fs-btn { display: none; }
html.touch #chat-btn:not(#_), html.touch #fs-btn:not([hidden]):not(#_) { display: grid; place-items: center; position: fixed; top: calc(6px + env(safe-area-inset-top)); width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; z-index: 9; cursor: pointer;
  background: radial-gradient(circle at 45% 35%, #2a3a6a, #0c1430); box-shadow: inset 0 0 0 2.5px #e2b84e, 0 3px 8px rgba(0, 0, 0, 0.55); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
html.touch #chat-btn:not(#_) { right: calc(266px + env(safe-area-inset-right)); }
html.touch #hud #top-buttons:not(#_) { right: calc(318px + env(safe-area-inset-right)) !important; }
html.touch #fs-btn:not([hidden]):not(#_) { top: auto; bottom: calc(176px + env(safe-area-inset-bottom)); right: calc(14px + env(safe-area-inset-right)); width: 40px; height: 40px; }
html.touch #chat-btn.on:not(#_) { filter: drop-shadow(0 0 8px rgba(255, 210, 110, 0.9)); }
html.touch #chat-btn .dot { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff3b0, #ffb020); box-shadow: 0 0 6px rgba(255, 190, 60, 0.95); }
html.touch #chat-btn .dot[hidden] { display: none; }
html.touch #hud #chat.open:not(#_):not(#__) { display: flex !important; flex-direction: column; position: fixed !important; z-index: 25; left: calc(8px + env(safe-area-inset-left)) !important; right: auto !important; top: auto !important;
  bottom: calc(var(--kb, 0px) + 8px + env(safe-area-inset-bottom)) !important; width: min(440px, calc(100vw - 16px)) !important; height: min(58%, calc(var(--vh, 100dvh) - var(--kb, 0px) - 70px)) !important; }
html.touch #hud #chat.open #chat-log:not(#_) { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; font-size: 13.5px; }
html.touch #hud #chat.open .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
html.touch #hud #chat.open .tabs .tab { flex: none; min-height: 34px; padding: 0 10px; }
html.touch #hud #chat.open #chat-grip { display: none; }
html.touch #hud #chat.open #chat-toggle { display: none; }
html.touch #hud #chat.open #chat-input:not(#_) { font-size: 16px; min-height: 40px; } /* (16 px: iPhone zooms the page into any smaller text field) */
html.touch #hud #chat.open #chat-form .btn:not(#_) { min-height: 40px; min-width: 56px; }
html.touch.kb-open #joystick, html.touch.kb-open #hud #skillbar { visibility: hidden; }
/* set 2 buttons in generated art (art/source/ui-mobile-kit2.png → scripts/ui-mobile-kit2-crop.json) */
html.touch #chat-btn:not(#_) { background: url(assets/ui/touch-chat.png) center / 100% 100% no-repeat !important; box-shadow: none !important; }
html.touch #fs-btn:not([hidden]):not(#_) { background: url(assets/ui/touch-fs.png) center / 100% 100% no-repeat !important; box-shadow: none !important; top: calc(56px + env(safe-area-inset-top)); bottom: auto; right: calc(164px + env(safe-area-inset-right)); width: 46px; height: 46px; }
html.touch.fullscreen #fs-btn:not([hidden]):not(#_) { background-image: url(assets/ui/touch-fs-exit.png) !important; }
/* Touch windows: the painted red close button, finger-sized */
html.touch .window .close:not(#_):not(#__):not(#___) { width: 46px !important; height: 46px !important; font-size: 0 !important; color: transparent !important; border: 0 !important; box-shadow: none !important;
  background: url(assets/ui/touch-close.png) center / 100% 100% no-repeat !important; }
html.touch .window .close:not(#_):not(#__):not(#___)::before, html.touch .window .close:not(#_):not(#__):not(#___)::after { display: none !important; }
.set-ios .ios-share { display: inline-block; width: 14px; height: 16px; vertical-align: -2px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 2px; }
.set-ios .ios-share::before { content: ''; position: absolute; left: 50%; top: -8px; width: 2px; height: 12px; margin-left: -1px; background: currentColor; }
html.touch input:not([type=range]):not([type=checkbox]):not(#_), html.touch textarea:not(#_), html.touch select:not(#_) { font-size: max(16px, 1em) !important; } /* (iPhone zooms the page into any text field under 16 px) */

/* The art loading bar (main.js, 2026-11-17): bottom of the screen while the sprite sheets arrive. */
#art-load { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60; width: min(420px, 70vw); height: 22px; transform: translateX(-50%); border-radius: 99px; overflow: hidden;
  background: rgba(8, 12, 30, 0.85); box-shadow: inset 0 0 0 1.5px #c9a24a, 0 4px 14px rgba(0, 0, 0, 0.5); pointer-events: none; }
#art-load i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #8a5a12, #ffd36a, #fff3c4); transition: width .2s; }
#art-load span { position: relative; display: grid; place-items: center; height: 100%; font: 700 12px 'IBM Plex Sans Thai', Kanit, sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
/* auto: a bigger, labelled button on phones (it is how most phone players hunt) */
html.touch #hud #skillbar .slot[data-id="auto"]:not(#_):not(#__):not(#___) { --sz: 60px; overflow: visible; }
html.touch #hud #skillbar .slot[data-id="auto"]::after { content: 'AUTO'; position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); padding: 0 6px; border-radius: 99px;
  font: 800 9.5px/14px 'IBM Plex Sans Thai', sans-serif; letter-spacing: .08em; color: #2a1a00; background: linear-gradient(#fff0b8, #e2b84e); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
html.touch #hud #skillbar .slot.on[data-id="auto"]::after { content: 'AUTO ON'; color: #0b3a1c; background: linear-gradient(#c9ffd9, #4fd17a); }
html.touch #hud #skillbar .slot[data-id="auto"]::after { bottom: auto; top: -13px; }
/* the title / character card on a short landscape phone: scrolls inside instead of running off */
html.touch #title-screen .title-card:not(#_) { max-height: calc(var(--vh, 100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
html.touch #title-screen:not(#_) { place-items: center; padding: 8px; }

/* ===================== Touch layout, round 2 (user 2026-11-17 "lay it out neatly") =====================
   ui touchLayout sets --tx/--ty/--sz per cluster slot and --ar (attack radius) / --qs (item size) on #skillbar. */
html.touch #hud #skillbar:not(#_):not(#__):not(#___) { --ar: 48px; --qs: 46px; }
html.touch #hud #skillbar .slot:not([data-dock="right"]):not(#_):not(#__):not(#___):not(#____) {
  --cx: calc(100% - 22px - var(--ar) - env(safe-area-inset-right)); --cy: calc(100% - 22px - var(--ar) - env(safe-area-inset-bottom)); }
/* the item bar: one row right of the joystick, centred on it */
html.touch #hud #skillbar .slot[data-dock="right"]:not(#_):not(#__):not(#___):not(#____) { --sz: var(--qs);
  left: calc(22px + env(safe-area-inset-left) + 136px + 14px + var(--qi) * (var(--qs) + 6px)) !important; top: auto !important;
  bottom: calc(22px + env(safe-area-inset-bottom) + (136px - var(--qs)) / 2) !important; }
/* the talk / use button: over the middle of the item row */
html.touch #talk-btn:not([hidden]):not(#_):not(#__) { left: calc(22px + env(safe-area-inset-left) + 136px + 14px + 2.5 * (var(--qs, 46px) + 6px) - 36px); margin-left: 0;
  bottom: calc(22px + env(safe-area-inset-bottom) + (136px + var(--qs, 46px)) / 2 + 10px); }

/* the top row, right to left: minimap · menu · fullscreen · chat · events · mail · shop — one size, even gaps */
html.touch :is(#menu-toggle, #chat-btn, #fs-btn:not([hidden])):not(#_):not(#__) { top: calc(8px + env(safe-area-inset-top)); bottom: auto; width: 46px; height: 46px; }
html.touch #menu-toggle:not(#_):not(#__) { right: calc(164px + env(safe-area-inset-right)); }
html.touch #fs-btn:not([hidden]):not(#_):not(#__) { right: calc(216px + env(safe-area-inset-right)); }
html.touch #chat-btn:not(#_):not(#__) { right: calc(268px + env(safe-area-inset-right)); }
html.touch #hud #top-buttons:not(#_):not(#__) { top: calc(8px + env(safe-area-inset-top)) !important; right: calc(320px + env(safe-area-inset-right)) !important; gap: 6px !important; }
html.touch:has(#fs-btn[hidden]) #chat-btn:not(#_):not(#__) { right: calc(216px + env(safe-area-inset-right)); }
html.touch:has(#fs-btn[hidden]) #hud #top-buttons:not(#_):not(#__) { right: calc(268px + env(safe-area-inset-right)) !important; }
html.touch #hud .top-btn:not(#_):not(#__) { width: 46px !important; height: 46px !important; min-width: 0; min-height: 0; padding: 0 !important; justify-content: center !important; border: 0 !important; border-radius: 50%;
  background: url(assets/ui/touch-skill.png) center / 100% 100% no-repeat !important; box-shadow: none !important; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
html.touch #hud .top-btn :is(canvas, svg, img):not(#_) { width: 28px !important; height: 28px !important; margin: 0 !important; }
html.touch #hud .top-btn .badge:not(#_) { top: -3px; right: -3px; }

/* the menu: a bar of icons under the top row (the round button shows or hides it); two rows on a narrow phone */
html.touch #hud #menu.bar:not(#_):not(#__):not(#___) { display: flex !important; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: 4px !important;
  position: fixed !important; inset: auto !important; top: calc(60px + env(safe-area-inset-top)) !important; right: calc(164px + env(safe-area-inset-right)) !important; left: auto !important; bottom: auto !important;
  width: auto !important; max-width: calc(100vw - 330px - 164px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important; transform: none !important; padding: 5px 6px !important; z-index: 8;
  border-radius: 14px; background: linear-gradient(170deg, rgba(22, 32, 66, 0.82), rgba(10, 14, 32, 0.86)) !important; box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.6), 0 4px 14px rgba(0, 0, 0, 0.45) !important; }
html.touch #hud #menu.bar .menu-btn:not(#_):not(#__) { width: 50px !important; height: 52px !important; padding: 2px 0 1px !important; gap: 0; display: flex !important; flex-direction: column; align-items: center; justify-content: center;
  font-size: 9.5px !important; line-height: 1.1 !important; white-space: nowrap; background: none !important; border: 0 !important; box-shadow: none !important; }
html.touch #hud #menu.bar .menu-btn :is(canvas, svg):not(#_) { width: 30px !important; height: 30px !important; }
html.touch #hud #menu.bar .menu-btn:active { transform: scale(0.92); filter: brightness(1.2); }
html.touch #menu-toggle.on:not(#_) { filter: drop-shadow(0 0 7px rgba(255, 210, 110, 0.9)); }

/* chat: a low box (user: "the message box is far too tall") */
html.touch #hud #chat.open:not(#_):not(#__):not(#___) { width: min(400px, calc(100vw - 16px)) !important; height: min(220px, calc(var(--vh, 100dvh) - var(--kb, 0px) - 80px)) !important; }
html.touch #hud #menu.bar:not(#_):not(#__):not(#___) { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; }
@media (max-height: 520px) {
  html.touch #hud #menu.bar:not(#_):not(#__):not(#___) { gap: 2px !important; padding: 3px 4px !important; top: calc(58px + env(safe-area-inset-top)) !important; max-width: calc(100vw - 316px - 160px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important; }
  html.touch #hud #menu.bar .menu-btn:not(#_):not(#__) { width: 44px !important; height: 44px !important; font-size: 8.5px !important; }
  html.touch #hud #menu.bar .menu-btn :is(canvas, svg):not(#_) { width: 24px !important; height: 24px !important; }
}
/* ===== Touch round 3 (user 2026-11-17): everyday windows at the bottom centre; items above them; chat above the joystick ===== */
html.touch #hud #menu.bar:not(#_):not(#__):not(#___) { display: none !important; }
#quickmenu { display: none; }
html.touch #quickmenu { --qb: 48px; display: flex; align-items: center; gap: 3px; position: fixed; z-index: 7; left: calc(22px + env(safe-area-inset-left) + 136px + 12px); bottom: calc(6px + env(safe-area-inset-bottom));
  padding: 3px 4px; border-radius: 12px; background: linear-gradient(170deg, rgba(22, 32, 66, 0.82), rgba(10, 14, 32, 0.86)); box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.6), 0 3px 10px rgba(0, 0, 0, 0.45); }
html.touch #quickmenu .menu-btn:not(#_) { width: var(--qb) !important; height: var(--qb) !important; padding: 2px 0 0 !important; gap: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 9px !important; line-height: 1.1; white-space: nowrap; background: none !important; border: 0 !important; box-shadow: none !important; }
html.touch #quickmenu .menu-btn :is(canvas, svg) { width: 28px !important; height: 28px !important; }
html.touch #quickmenu .menu-btn:active { transform: scale(0.9); filter: brightness(1.25); }
html.touch #quickmenu .qm-fold { width: 22px; height: var(--qb); padding: 0; border: 0; background: none; cursor: pointer; color: #e2b84e; font-size: 14px; }
html.touch #quickmenu .qm-fold::before { content: '◀'; }
html.touch #quickmenu.folded .qm-fold::before { content: '▶'; }
html.touch #quickmenu.folded .menu-btn { display: none !important; }
@media (max-height: 520px) { html.touch #quickmenu { --qb: 37px; } html.touch #quickmenu .menu-btn { font-size: 0 !important; } html.touch #quickmenu .menu-btn :is(canvas, svg) { width: 27px !important; height: 27px !important; } }
/* items one row above the bar */
html.touch #hud #skillbar .slot[data-dock="right"]:not(#_):not(#__):not(#___):not(#____) { left: calc(22px + env(safe-area-inset-left) + 136px + 12px + var(--qi) * (var(--qs) + 6px)) !important;
  bottom: calc(6px + env(safe-area-inset-bottom) + 44px + 18px) !important; }
@media (min-height: 521px) { html.touch #hud #skillbar .slot[data-dock="right"]:not(#_):not(#__):not(#___):not(#____) { bottom: calc(6px + env(safe-area-inset-bottom) + 56px + 14px) !important; } }
html.touch #talk-btn:not([hidden]):not(#_):not(#__) { left: calc(22px + env(safe-area-inset-left) + 136px + 12px + 2.5 * (var(--qs, 46px) + 6px) - 36px); bottom: calc(6px + env(safe-area-inset-bottom) + 70px + var(--qs, 46px) + 8px); }
/* chat above the joystick, never over the items */
html.touch #hud #chat.open:not(#_):not(#__):not(#___) { bottom: calc(var(--kb, 0px) + 22px + 136px + 10px + env(safe-area-inset-bottom)) !important; height: clamp(110px, calc(var(--vh, 100dvh) - 330px), 200px) !important; width: min(380px, calc(100vw - 16px)) !important; }
html.touch.kb-open #hud #chat.open:not(#_):not(#__):not(#___) { bottom: calc(var(--kb, 0px) + 8px) !important; }
/* dash: its own skill icon, not the generated ring art (user) */
html.touch #hud #skillbar .slot[data-id="dash"]:not(#_):not(#__):not(#___) { background-image: url(assets/ui/touch-skill.png) !important; }
html.touch #hud #skillbar .slot[data-id="dash"] canvas:not(#_) { opacity: 1 !important; }
@media (max-height: 520px) {
  html.touch #hud #chat.open:not(#_):not(#__):not(#___) { left: calc(22px + env(safe-area-inset-left) + 136px + 12px) !important; bottom: calc(6px + env(safe-area-inset-bottom) + 44px + 18px + var(--qs, 46px) + 8px) !important;
    width: min(340px, calc(100vw - 340px - 158px)) !important; height: min(200px, calc(var(--vh, 100dvh) - 190px)) !important; }
  html.touch.kb-open #hud #chat.open:not(#_):not(#__):not(#___) { left: calc(8px + env(safe-area-inset-left)) !important; width: min(440px, calc(100vw - 16px)) !important; bottom: calc(var(--kb, 0px) + 6px) !important; }
}
/* Touch round 4 (user 2026-11-17 "centre it on the screen, every feature in it, drop the top-corner menu"): */
html.touch #menu-toggle:not(#_):not(#__):not(#___) { display: none !important; }
html.touch #fs-btn:not([hidden]):not(#_):not(#__):not(#___) { right: calc(164px + env(safe-area-inset-right)); }
html.touch #chat-btn:not(#_):not(#__):not(#___) { right: calc(216px + env(safe-area-inset-right)); }
html.touch #hud #top-buttons:not(#_):not(#__):not(#___) { right: calc(268px + env(safe-area-inset-right)) !important; }
html.touch:has(#fs-btn[hidden]) #chat-btn:not(#_):not(#__):not(#___) { right: calc(164px + env(safe-area-inset-right)); }
html.touch:has(#fs-btn[hidden]) #hud #top-buttons:not(#_):not(#__):not(#___) { right: calc(216px + env(safe-area-inset-right)) !important; }
html.touch #quickmenu:not(#_) { left: 50%; transform: translateX(-50%); }
html.touch #quickmenu.folded:not(#_) { left: 50%; }
@media (max-height: 520px) {
  html.touch #quickmenu:not(#_) { --qb: 33px; gap: 2px; padding: 2px 3px; bottom: calc(2px + env(safe-area-inset-bottom)); }
  html.touch #quickmenu .menu-btn :is(canvas, svg):not(#_) { width: 25px !important; height: 25px !important; }
  html.touch #quickmenu .qm-fold:not(#_) { width: 18px; }
}
html.touch #quickmenu .qm-fold:not(#_)::before { content: '▼'; }
html.touch #quickmenu.folded .qm-fold:not(#_)::before { content: '▲'; }
html.touch #quickmenu.folded:not(#_) { padding: 0 !important; border-radius: 10px 10px 0 0; bottom: 0 !important; }
html.touch #quickmenu.folded .qm-fold:not(#_) { width: 52px !important; height: 18px !important; font-size: 11px; line-height: 18px; }
/* items on an arc round the joystick (user 2026-11-17) */
html.touch #hud #skillbar .slot[data-dock="right"]:not(#_):not(#__):not(#___):not(#____):not(#q5) {
  left: calc(22px + env(safe-area-inset-left) + 68px + var(--jx, 0px) - var(--qs) / 2) !important; top: auto !important;
  bottom: calc(22px + env(safe-area-inset-bottom) + 68px - var(--jy, 0px) - var(--qs) / 2) !important; }
html.touch #talk-btn:not([hidden]):not(#_):not(#__):not(#___) { left: 50%; margin-left: -36px; bottom: calc(60px + env(safe-area-inset-bottom)); }
html.touch #hud #skillbar .slot[data-id="auto"]::after { top: auto !important; bottom: -9px !important; }
html.touch #hud #skillbar .slot[data-id="auto"]::after { bottom: -3px !important; font-size: 8.5px !important; line-height: 12px !important; }
/* chat box at the top right, under the top row and left of the minimap (user 2026-11-17: it covered the items) */
html.touch:not(.kb-open) #hud #chat.open:not(#_):not(#__):not(#___):not(#c4) { top: calc(60px + env(safe-area-inset-top)) !important; bottom: auto !important; left: auto !important;
  right: calc(220px + env(safe-area-inset-right)) !important; width: min(400px, calc(100vw - 330px - 220px)) !important; height: min(220px, calc(var(--vh, 100dvh) - 260px)) !important; min-height: 110px; }
/* the chat box dragged by its handle (user 2026-11-17) */
#chat-move { display: none; }
html.touch #chat.open #chat-move { display: grid; place-items: center; flex: none; width: 34px; min-height: 34px; margin-right: 4px; padding: 0; border: 0; border-radius: 8px; cursor: grab; touch-action: none;
  background: rgba(226, 184, 78, 0.18); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.6); }
html.touch #chat.open #chat-move::before { content: '✥'; font-size: 18px; color: #ffe08a; }
html.touch:not(.kb-open) #hud #chat.open.moved:not(#_):not(#__):not(#___):not(#c4):not(#c5) { left: var(--chx) !important; top: var(--chy) !important; right: auto !important; bottom: auto !important; }
/* the chat box resized by its corner grip (user 2026-11-17) */
#chat-size { display: none; }
html.touch #chat.open #chat-size { display: block; position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; z-index: 2; touch-action: none; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 52%, rgba(255, 224, 138, 0.9) 52% 60%, transparent 60% 68%, rgba(255, 224, 138, 0.9) 68% 76%, transparent 76%); }
html.touch:not(.kb-open) #hud #chat.open.sized:not(#_):not(#__):not(#___):not(#c4):not(#c5) { width: var(--chw) !important; height: var(--chh) !important; }

/* next-target button (touch, Tab on a keyboard): up-right of the attack button */
#target-btn { display: none; }
html.touch #target-btn { display: grid; place-items: center; position: fixed; z-index: 6; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  right: calc(22px + var(--ar, 48px) - 0.71 * (var(--ar, 48px) + 30px) - 21px + env(safe-area-inset-right)); bottom: calc(22px + var(--ar, 48px) + 0.71 * (var(--ar, 48px) + 30px) - 21px + env(safe-area-inset-bottom));
  background: url(assets/ui/touch-skill.png) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
html.touch #target-btn svg { width: 22px; height: 22px; fill: none; stroke: #ffe08a; stroke-width: 2; stroke-linecap: round; }
html.touch #target-btn:active { transform: scale(0.9); filter: brightness(1.25); }
html.touch.kb-open #target-btn { visibility: hidden; }

/* ===================== Character select (user 2026-11-17: 3 characters per account) ===================== */
#title-screen.cs-mode .title-card { display: none; }
#title-screen.cs-mode { place-items: stretch; padding: 0; }
#char-select { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto auto; gap: 6px; padding: calc(14px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
  background: radial-gradient(70% 60% at 50% 45%, rgba(10, 14, 36, 0.35), rgba(6, 8, 22, 0.82)); color: #f3e9d2; font-family: 'IBM Plex Sans Thai', Kanit, sans-serif; }
#char-select .cs-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
#char-select .cs-top h1 { margin: 0; font: 800 30px 'Noto Serif Thai', serif; letter-spacing: .04em; background: linear-gradient(180deg, #fff6d0, #ffd36a 55%, #e0a030); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(40, 10, 0, 0.7)); }
#char-select .cs-acc { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #d9c8a0; }
#char-select .cs-acc .ui-ico { width: 22px; height: 22px; }
#char-select .cs-top .cs-sub { justify-self: end; }
#char-select .cs-stage { display: grid; grid-template-columns: 1fr minmax(300px, 420px); align-items: center; gap: 24px; min-height: 0; max-width: 1100px; width: 100%; margin: 0 auto; }
#char-select .cs-hero { position: relative; display: grid; place-items: end center; height: 100%; min-height: 260px; }
#char-select .cs-circle { position: absolute; bottom: 4%; width: min(380px, 70%); height: auto; aspect-ratio: 420 / 220; opacity: .9; filter: drop-shadow(0 0 18px rgba(255, 200, 90, 0.55)); animation: cs-turn 20s linear infinite; }
#char-select .cs-fig { position: relative; width: auto; height: min(100%, 440px); aspect-ratio: 1; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)); }
#char-select .cs-side { display: flex; flex-direction: column; gap: 12px; }
#char-select .cs-card { position: relative; padding: 18px 22px; border: 22px solid transparent; border-image: url(assets/ui/shop-card-purple.png) 56 / 22px stretch; border-radius: 16px;
  background: radial-gradient(closest-side, #5a2a8a, #2c1250) padding-box; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#char-select .cs-card h2 { margin: 0; font: 800 30px 'Noto Serif Thai', serif; color: #fff3cf; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 200, 90, 0.4); }
#char-select .cs-card p { margin: 0; font-size: 13.5px; color: #e4d6f5; }
#char-select .cs-cls-name { font: 700 16px 'IBM Plex Sans Thai', sans-serif; color: #ffe08a; }
#char-select .cs-where { color: #cdb9ef; }
#char-select .cs-dying { color: #ff9a8a !important; font-weight: 700; }
#char-select .cs-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#char-select .cs-stats span { padding: 2px 10px; border-radius: 99px; font-size: 12.5px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.45); }
#char-select .cs-stats b { color: #ffe08a; }
#char-select .cs-name { display: flex; flex-direction: column; gap: 4px; width: 100%; font-size: 12.5px; color: #e4d6f5; }
#char-select .cs-name input { width: 100%; box-sizing: border-box; height: 42px; padding: 0 12px; border-radius: 10px; border: 0; font: 600 16px 'IBM Plex Sans Thai', sans-serif; color: #fff; text-align: center;
  background: rgba(8, 6, 24, 0.7); box-shadow: inset 0 0 0 1.5px #c9a24a; outline: none; }
#char-select .cs-name input:focus { box-shadow: inset 0 0 0 2px #ffe08a, 0 0 10px rgba(255, 210, 110, 0.5); }
#char-select .cs-go { width: 100%; height: 52px; border: 0; cursor: pointer; font: 800 20px 'Noto Serif Thai', serif; color: #3a2000; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.7);
  background: url(assets/ui/shop-btn-gold.png) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); animation: cs-pulse 2s ease-in-out infinite; }
#char-select .cs-go:hover { filter: brightness(1.1) drop-shadow(0 0 12px rgba(255, 210, 110, 0.8)); }
#char-select .cs-go.danger { filter: hue-rotate(-40deg) saturate(1.6) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); animation: none; }
#char-select .cs-sub { padding: 6px 14px; border: 0; border-radius: 99px; cursor: pointer; font: 600 13px 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.5); }
#char-select .cs-sub:hover { color: #fff; box-shadow: inset 0 0 0 1px #ffe08a; }
#char-select .cs-row { display: flex; gap: 10px; width: 100%; align-items: center; }
#char-select .cs-classes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
#char-select .cs-cls { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 2px 6px; border: 0; border-radius: 12px; cursor: pointer; color: #e8dcc0; font: 600 12px 'IBM Plex Sans Thai', sans-serif;
  background: rgba(10, 14, 36, 0.65); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.35); }
#char-select .cs-cls canvas { width: 56px; height: 56px; }
#char-select .cs-cls.on { color: #fff3cf; background: radial-gradient(circle at 50% 40%, rgba(255, 210, 110, 0.35), rgba(30, 20, 60, 0.85)); box-shadow: inset 0 0 0 2px #ffd36a, 0 0 12px rgba(255, 210, 110, 0.5); }
#char-select .cs-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); justify-content: center; gap: 16px; }
#char-select .cs-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0; min-height: 150px; cursor: pointer; color: #f3e9d2;
  border: 20px solid transparent; border-image: url(assets/ui/shop-card-blue.png) 56 / 20px stretch; border-radius: 14px; background: radial-gradient(closest-side, #1d4fa8, #14347b) padding-box; transition: transform .15s, filter .15s; }
#char-select .cs-slot.gold { border-image-source: url(assets/ui/shop-card-gold.png); background: radial-gradient(closest-side, #bb7f2d, #814f19) padding-box; }
#char-select .cs-slot:hover { transform: translateY(-3px); filter: brightness(1.1); }
#char-select .cs-slot.on { transform: translateY(-4px); filter: drop-shadow(0 0 14px rgba(255, 210, 110, 0.85)); }
#char-select .cs-slot canvas { width: 92px; height: 92px; margin-top: -8px; }
#char-select .cs-slot b { font: 700 16px 'Noto Serif Thai', serif; color: #fff3cf; }
#char-select .cs-slot small { font-size: 12px; color: #d8e2ff; }
#char-select .cs-slot em { font-style: normal; font-size: 11.5px; color: #ff9a8a; }
#char-select .cs-slot.dying { filter: grayscale(.7) brightness(.8); }
#char-select .cs-slot.empty { border-image-source: url(assets/ui/shop-card-purple.png); background: rgba(30, 14, 60, 0.6) padding-box; justify-content: center; opacity: .85; }
#char-select .cs-slot.empty i { font: 300 46px/1 sans-serif; font-style: normal; color: #ffe08a; text-shadow: 0 0 12px rgba(255, 210, 110, 0.7); }
#char-select .cs-slot.empty.on { opacity: 1; }
#char-select .cs-err { margin: 0; min-height: 18px; text-align: center; }
@keyframes cs-turn { to { transform: rotate(360deg); } }
@keyframes cs-pulse { 50% { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 14px rgba(255, 210, 110, 0.8)); } }
/* the circle lies on the ground: squashed, turning */
#char-select .cs-circle { transform-origin: 50% 50%; animation: none; }
#char-select .cs-hero::before { content: ''; position: absolute; bottom: 7%; width: min(320px, 60%); aspect-ratio: 3 / 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 210, 110, 0.45), transparent); }
/* phones and short screens: everything tighter, the slots small */
@media (max-height: 560px), (max-width: 760px) {
  #char-select { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  #char-select .cs-top h1 { font-size: 20px; }
  #char-select .cs-stage { grid-template-columns: 1fr minmax(260px, 340px); gap: 12px; }
  #char-select .cs-hero { min-height: 150px; }
  #char-select .cs-card { padding: 6px 10px; gap: 4px; border-width: 16px; border-image-width: 16px; }
  #char-select .cs-card h2 { font-size: 22px; }
  #char-select .cs-card p { font-size: 12px; }
  #char-select .cs-go { height: 42px; font-size: 17px; }
  #char-select .cs-cls canvas { width: 40px; height: 40px; }
  #char-select .cs-slots { gap: 10px; }
  #char-select .cs-slot { min-height: 0; flex-direction: row; gap: 6px; border-width: 12px; border-image-width: 14px; padding: 0 6px; }
  #char-select .cs-slot canvas { width: 46px; height: 46px; margin: 0; }
  #char-select .cs-slot b { font-size: 13px; } #char-select .cs-slot small { display: none; }
  #char-select .cs-slot.empty i { font-size: 28px; }
}
#char-select:not(#_) { background: radial-gradient(60% 55% at 35% 55%, rgba(10, 14, 36, 0.55), rgba(5, 7, 20, 0.9)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#char-select :is(.cs-card, .cs-slot):not(#_) { background-clip: border-box !important; background-origin: border-box; }
#char-select .cs-card:not(#_) { background: radial-gradient(closest-side, #5a2a8a, #2c1250) border-box; }
#char-select .cs-slot:not(#_) { background: radial-gradient(closest-side, #1d4fa8, #14347b) border-box; }
#char-select .cs-slot.gold:not(#_) { background: radial-gradient(closest-side, #bb7f2d, #814f19) border-box; }
#char-select .cs-slot.empty:not(#_) { background: radial-gradient(closest-side, #3a1a66, #1e0c3a) border-box; }
#char-select .cs-stage:not(#_) { min-height: 0; overflow: hidden; }
#char-select .cs-hero:not(#_) { height: 100%; min-height: 0; overflow: hidden; }
#char-select .cs-fig:not(#_) { height: 100%; max-height: 440px; width: auto; }
#char-select .cs-fig:not(#_):not(#__) { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: contain; object-position: 50% 100%; }

/* The STELLARIA logo (generated, assets/ui/logo.png from art/source/logo-stellaria.png) on the sign-in card */
.logo.logo-art { margin: -8px auto 0; font-size: 0; line-height: 0; text-shadow: none; }
.logo.logo-art img { width: min(420px, 80%); height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px rgba(255, 200, 90, 0.35)); animation: logo-breathe 4s ease-in-out infinite; }
@keyframes logo-breathe { 50% { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 28px rgba(255, 210, 110, 0.6)); } }

/* ===================== Character select v2 (user 2026-11-17 "the best design for the game"): from the generated
   mockup art/source/ui-charselect-mock.png; scene assets/ui/cs-bg.webp, parts assets/ui/cs-*.png ===================== */
#char-select:not(#_):not(#__) { display: grid; grid-template-rows: auto 1fr auto; gap: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: #070b1a url(assets/ui/cs-bg.webp) center 60% / cover no-repeat; font-family: 'IBM Plex Sans Thai', Kanit, sans-serif; color: #f3e9d2; overflow: hidden; }
#char-select:not(#_):not(#__)::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 30% 55%, transparent 40%, rgba(4, 6, 20, 0.55)); }
#char-select .cs-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
/* top bar */
#char-select .cs-top:not(#_) { position: relative; z-index: 4; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 76px; padding: calc(4px + env(safe-area-inset-top)) calc(22px + env(safe-area-inset-right)) 0 calc(22px + env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(6, 10, 30, 0.88), rgba(6, 10, 30, 0.35) 75%, transparent); }
#char-select .cs-top::after { content: ''; position: absolute; left: 16px; right: 16px; top: 54px; height: 1.5px; background: linear-gradient(90deg, transparent, #c9a24a 15%, #ffe08a 50%, #c9a24a 85%, transparent); }
#char-select .cs-acc { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 5px 14px 5px 8px; border-radius: 99px; font: 600 15px 'IBM Plex Sans Thai', sans-serif; color: #f3e6c4; background: rgba(10, 16, 40, 0.75); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.6); }
#char-select .cs-acc .ui-ico { width: 24px; height: 24px; }
#char-select .cs-title { position: relative; z-index: 1; display: grid; place-items: center; width: 470px; height: 78px; margin-top: 10px; background: url(assets/ui/cs-title.png) center / contain no-repeat; }
#char-select .cs-title span { margin-top: 10px; font: 800 28px 'Noto Serif Thai', serif; letter-spacing: .03em; background: linear-gradient(180deg, #fffbe6, #ffe08a 50%, #d9962c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(30, 10, 0, 0.8)); }
#char-select .cs-out { justify-self: end; padding: 7px 18px; border: 0; border-radius: 99px; cursor: pointer; font: 600 14px 'IBM Plex Sans Thai', sans-serif; color: #f3e6c4; background: rgba(10, 16, 40, 0.75); box-shadow: inset 0 0 0 1.5px #c9a24a; }
#char-select .cs-out:hover { color: #fff; box-shadow: inset 0 0 0 1.5px #ffe08a, 0 0 10px rgba(255, 210, 110, 0.5); }
/* stage: the hero on its dais, the panel */
#char-select .cs-stage:not(#_) { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr minmax(360px, 30vw); gap: 2vw; align-items: center; max-width: none; min-height: 0; overflow: visible; padding: 0 4vw 0 2vw; }
#char-select .cs-hero:not(#_) { position: relative; height: 100%; min-height: 0; overflow: visible; display: block; }
#char-select .cs-podium { position: absolute; left: 50%; bottom: 3%; width: min(34vw, 56vh, 520px); transform: translateX(-60%); }
#char-select .cs-dais { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.5)); }
#char-select .cs-fig:not(#_):not(#__) { position: absolute; inset: auto; left: 50%; bottom: 40%; width: 108%; height: auto; aspect-ratio: 560 / 640; transform-origin: 50% 95%; margin-left: -54%; object-fit: initial; z-index: 2; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); }
/* the panel */
#char-select .cs-panel { position: relative; z-index: 2; width: 100%; aspect-ratio: 0.78; max-height: calc(100% - 10px); justify-self: end; background: url(assets/ui/cs-panel.png) center / 100% 100% no-repeat; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.55)); }
#char-select .cs-panel.make { aspect-ratio: 0.7; }
#char-select .cs-panel-in { position: absolute; inset: 15% 11% 7%; display: flex; flex-direction: column; align-items: center; gap: 1.2vh; text-align: center; }
#char-select .cs-name-big { margin: 0; font: 400 clamp(26px, 3.4vw, 48px)/1.15 'Chonburi', 'Noto Serif Thai', serif; letter-spacing: .02em; background: linear-gradient(180deg, #fffdf0 10%, #ffe7a0 50%, #e2a94a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(30, 10, 0, 0.8)) drop-shadow(0 0 14px rgba(255, 200, 90, 0.35)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#char-select .cs-rule { width: 86%; height: 1.5px; flex: none; background: linear-gradient(90deg, transparent, #c9a24a 20%, #ffe08a 50%, #c9a24a 80%, transparent); }
#char-select .cs-class { display: flex; align-items: center; gap: 8px; font: 600 clamp(15px, 1.35vw, 20px) 'IBM Plex Sans Thai', sans-serif; color: #fff3cf; }
#char-select .cs-class b { color: #ffe08a; }
#char-select .cs-badge { display: grid; place-items: center; width: 38px; height: 42px; background: url(assets/ui/cs-badge.png) center / contain no-repeat; }
#char-select .cs-badge img { width: 22px; height: 22px; }
#char-select .cs-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
#char-select .cs-chips.four { grid-template-columns: repeat(4, 1fr); gap: 6px; }
#char-select .cs-chip { display: flex; flex-direction: column; align-items: center; padding: 8px 4px 7px; background: url(assets/ui/cs-chip.png) center / 100% 100% no-repeat; }
#char-select .cs-chip span { display: inline-flex; align-items: center; gap: 4px; font: 700 12px 'IBM Plex Sans Thai', sans-serif; color: #e9dcb8; letter-spacing: .05em; }
#char-select .cs-chip svg { width: 15px; height: 15px; fill: #ffd36a; stroke: #8a5a12; stroke-width: 1; }
#char-select .cs-chip b { font: 700 clamp(15px, 1.4vw, 21px) 'Noto Serif Thai', serif; color: #fff; }
#char-select .cs-power { font: 600 14px 'IBM Plex Sans Thai', sans-serif; color: #e4d6f5; }
#char-select .cs-power b { font: 800 18px 'Noto Serif Thai', serif; color: #ffe08a; margin-left: 4px; }
#char-select .cs-map { display: flex; align-items: center; gap: 10px; text-align: left; font: 700 clamp(15px, 1.3vw, 19px) 'Noto Serif Thai', serif; color: #fff3cf; }
#char-select .cs-map small { display: block; font: 500 12px 'IBM Plex Sans Thai', sans-serif; color: #cdb9ef; }
#char-select .cs-pin { width: 30px; height: 36px; background: url(assets/ui/cs-pin.png) center / contain no-repeat; flex: none; }
#char-select .cs-desc { margin: 0; font-size: 13.5px; line-height: 1.5; color: #e4d6f5; }
#char-select .cs-dying { margin: 0; color: #ff9a8a; font-weight: 700; }
#char-select .cs-enter { position: relative; width: 92%; height: clamp(54px, 8vh, 74px); margin-top: auto; border: 0; cursor: pointer; overflow: hidden; background: url(assets/ui/shop-btn-gold.png) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)); animation: cs-glow 2.2s ease-in-out infinite; }
#char-select .cs-enter span { position: relative; z-index: 1; font: 400 clamp(22px, 2.2vw, 32px) 'Chonburi', 'Noto Serif Thai', serif; color: #2a1600; letter-spacing: .04em; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.8); }
#char-select .cs-enter::after { content: ''; position: absolute; inset: 12% 6%; border-radius: 10px; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.65) 50%, transparent 65%); background-size: 250% 100%; animation: cs-sheen 2.6s ease-in-out infinite; mix-blend-mode: overlay; }
#char-select .cs-enter:hover { filter: brightness(1.08) drop-shadow(0 0 16px rgba(255, 210, 110, 0.9)); }
#char-select .cs-enter:active { transform: translateY(2px) scale(0.99); }
#char-select .cs-del { min-width: 46%; height: 38px; border: 0; cursor: pointer; font: 700 14px 'IBM Plex Sans Thai', sans-serif; color: #fff; text-shadow: 0 1px 0 rgba(80, 0, 0, 0.7); background: url(assets/ui/cs-delete.png) center / 100% 100% no-repeat; }
#char-select .cs-del.big { width: 80%; height: 50px; font-size: 18px; margin-top: auto; }
#char-select .cs-del:hover { filter: brightness(1.15); }
#char-select .cs-link { border: 0; background: none; cursor: pointer; color: #cdb9ef; font: 600 14px 'IBM Plex Sans Thai', sans-serif; text-decoration: underline; }
#char-select .cs-input { width: 100%; }
#char-select .cs-input input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px; border: 0; border-radius: 12px; font: 600 17px 'IBM Plex Sans Thai', sans-serif; color: #fff; text-align: center; background: rgba(6, 4, 22, 0.72); box-shadow: inset 0 0 0 1.5px #c9a24a; outline: none; }
#char-select .cs-input input:focus { box-shadow: inset 0 0 0 2px #ffe08a, 0 0 12px rgba(255, 210, 110, 0.55); }
#char-select .cs-classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
#char-select .cs-cls:not(#_) { display: flex; flex-direction: column; align-items: center; padding: 2px 2px 5px; border: 0; border-radius: 12px; cursor: pointer; font: 700 12.5px 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; background: rgba(8, 12, 32, 0.7); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.4); }
#char-select .cs-cls canvas { width: 58px; height: 58px; }
#char-select .cs-cls.on:not(#_) { color: #fff3cf; background: radial-gradient(circle at 50% 40%, rgba(255, 210, 110, 0.4), rgba(30, 20, 60, 0.9)); box-shadow: inset 0 0 0 2px #ffd36a, 0 0 14px rgba(255, 210, 110, 0.55); }
#char-select .cs-err:not(#_) { margin: 0; min-height: 0; font-size: 13px; color: #ff9a8a; }
/* the slots */
#char-select .cs-slots:not(#_) { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, clamp(140px, 15vw, 230px)); justify-content: center; gap: 1.6vw; padding: 0 0 calc(18px + env(safe-area-inset-bottom)); transform: translateX(-12vw); }
#char-select .cs-slot:not(#_):not(#__) { position: relative; display: block; aspect-ratio: 0.95; min-height: 0; padding: 0; border: 0; border-radius: 0; cursor: pointer; background: url(assets/ui/cs-slot.png) center / 100% 100% no-repeat !important; color: #f3e9d2; transition: transform .18s, filter .18s; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
#char-select .cs-slot.on:not(#_):not(#__) { background-image: url(assets/ui/cs-slot-on.png) !important; transform: translateY(-8px); filter: drop-shadow(0 0 16px rgba(255, 210, 110, 0.8)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); animation: cs-slotglow 2.4s ease-in-out infinite; }
#char-select .cs-slot:hover:not(.on) { transform: translateY(-4px); filter: brightness(1.12) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
#char-select .cs-slot canvas:not(#_) { position: absolute; left: 8%; right: 8%; top: 6%; width: 84%; height: 66%; margin: 0; }
#char-select .cs-plate { position: absolute; left: 12%; right: 12%; bottom: 7%; height: 22%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
#char-select .cs-plate b { font: 700 clamp(13px, 1.25vw, 18px) 'Noto Serif Thai', serif; color: #fff3cf; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#char-select .cs-plate small { font: 600 clamp(10px, 0.85vw, 12.5px) 'IBM Plex Sans Thai', sans-serif; color: #ffe08a; white-space: nowrap; }
#char-select .cs-slot em { position: absolute; top: 4%; left: 0; right: 0; font-style: normal; font-size: 11.5px; font-weight: 700; color: #ff9a8a; }
#char-select .cs-slot.dying canvas { filter: grayscale(.8) brightness(.7); }
#char-select .cs-slot.empty:not(#_):not(#__) { background-image: url(assets/ui/cs-slot-empty.png) !important; opacity: .92; }
#char-select .cs-slot.empty b { position: absolute; left: 0; right: 0; bottom: 14%; font: 700 clamp(13px, 1.2vw, 17px) 'Noto Serif Thai', serif; color: #fff3cf; }
#char-select .cs-slot.empty .cs-plus { display: none; }
#char-select .cs-slot.empty.on { opacity: 1; }
@keyframes cs-glow { 50% { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 18px rgba(255, 210, 110, 0.85)); } }
@keyframes cs-sheen { 0%, 40% { background-position: 150% 0; } 100% { background-position: -60% 0; } }
@keyframes cs-slotglow { 50% { filter: drop-shadow(0 0 24px rgba(255, 220, 130, 1)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); } }
/* short / phone screens */
@media (max-height: 600px), (max-width: 820px) {
  #char-select .cs-top:not(#_) { height: 52px; }
  #char-select .cs-top::after { top: 40px; }
  #char-select .cs-title { width: 300px; height: 52px; margin-top: 4px; }
  #char-select .cs-title span { font-size: 19px; margin-top: 6px; }
  #char-select .cs-acc, #char-select .cs-out { font-size: 12px; padding: 4px 10px; }
  #char-select .cs-stage:not(#_) { grid-template-columns: 1fr minmax(250px, 34vw); padding: 0 2vw; }
  #char-select .cs-podium { width: min(30vw, 46vh); }
  #char-select .cs-panel-in { inset: 14% 10% 6%; gap: 0.8vh; }
  #char-select .cs-chip { padding: 4px 2px; }
  #char-select .cs-chip b { font-size: 14px; }
  #char-select .cs-power, #char-select .cs-desc { font-size: 11.5px; }
  #char-select .cs-map { font-size: 13px; } #char-select .cs-pin { width: 20px; height: 24px; }
  #char-select .cs-enter { height: 44px; } #char-select .cs-enter span { font-size: 19px; }
  #char-select .cs-del { height: 30px; font-size: 12px; }
  #char-select .cs-input input { height: 36px; font-size: 16px; }
  #char-select .cs-cls canvas { width: 38px; height: 38px; }
  #char-select .cs-slots:not(#_) { grid-template-columns: repeat(3, clamp(96px, 13vw, 150px)); padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { #char-select .cs-enter, #char-select .cs-enter::after, #char-select .cs-slot.on { animation: none !important; } }

/* fitted to the cut parts */
#char-select .cs-panel:not(#_) { aspect-ratio: 354 / 361; width: min(30vw, 62vh, 480px); }
#char-select .cs-panel.make:not(#_) { aspect-ratio: 354 / 361; }
#char-select .cs-panel-in:not(#_) { inset: 13% 9% 7%; gap: 1vh; }
#char-select .cs-title:not(#_) { width: min(520px, 46vw); height: auto; aspect-ratio: 750 / 151; margin-top: 6px; }
#char-select .cs-title span:not(#_) { margin-top: 9%; }
#char-select .cs-slot:not(#_):not(#__):not(#___) { aspect-ratio: 353 / 328; }
#char-select .cs-slot canvas:not(#_):not(#__) { left: 9%; right: 9%; top: 6%; width: 82%; height: 60%; }
#char-select .cs-plate:not(#_) { left: 10%; right: 10%; bottom: 9%; height: 23%; }
/* maker: the six classes in a column at the left of the hero */
#char-select .cs-hero .cs-classes:not(#_) { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 3; display: grid; grid-template-columns: repeat(2, 76px); gap: 8px; width: auto; }
#char-select .cs-hero .cs-cls:not(#_) { padding: 4px 2px 6px; }
#char-select .cs-hero .cs-cls canvas { width: 60px; height: 60px; }
@media (max-height: 600px), (max-width: 820px) {
  #char-select .cs-hero .cs-classes:not(#_) { grid-template-columns: repeat(2, 54px); gap: 4px; }
  #char-select .cs-hero .cs-cls canvas { width: 38px; height: 38px; }
  #char-select .cs-hero .cs-cls { font-size: 10px; }
  #char-select .cs-panel:not(#_) { width: min(36vw, 74vh); }
}

/* name: room for Thai marks above and below (Chonburi's lower vowels were clipped) */
#char-select .cs-name-big:not(#_) { line-height: 1.5; padding: 0 4px 2px; overflow: visible; }
/* phones / short screens: the slots stack on the left, the hero in the middle, the panel right; nothing overlaps */
@media (max-height: 600px), (max-width: 820px) {
  #char-select:not(#_):not(#__) { grid-template-rows: auto 1fr; }
  #char-select .cs-slots:not(#_):not(#__) { position: absolute; z-index: 4; left: calc(10px + env(safe-area-inset-left)); top: 58px; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none;
    display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 0; width: clamp(84px, 13vw, 118px); }
  #char-select .cs-slot:not(#_):not(#__):not(#___) { width: 100%; flex: none; }
  #char-select .cs-slot.on:not(#_):not(#__) { transform: translateX(6px); }
  #char-select .cs-plate b { font-size: 11px; } #char-select .cs-plate small { display: none; }
  #char-select .cs-slot.empty b { font-size: 10.5px; bottom: 8%; }
  #char-select .cs-stage:not(#_) { padding-left: calc(clamp(84px, 13vw, 118px) + 18px + env(safe-area-inset-left)); padding-right: calc(10px + env(safe-area-inset-right)); padding-bottom: 6px; }
  #char-select .cs-podium:not(#_) { width: min(32vw, 50vh); bottom: 6%; transform: translateX(-50%); }
  #char-select .cs-panel:not(#_) { width: min(40vw, 78vh); }
  #char-select .cs-panel-in:not(#_) { inset: 14% 9% 6%; gap: 4px; }
  #char-select .cs-name-big:not(#_) { font-size: 22px; line-height: 1.45; }
  #char-select .cs-rule, #char-select .cs-power { display: none; }
  #char-select .cs-class:not(#_) { font-size: 13px; } #char-select .cs-badge { width: 24px; height: 27px; }
  #char-select .cs-chip span { font-size: 9.5px; } #char-select .cs-chip svg { width: 11px; height: 11px; }
  #char-select .cs-hero .cs-classes:not(#_) { left: -6px; }
}

/* No stretched art (user 2026-11-17 "the pictures are stretched"): the panel frame is 9-sliced with its slices scaled to
   the panel's width (so the gem crest and corners keep their shape and the panel grows with its content); the ENTER
   button and the delete pill keep their ends and stretch only their middles; the stat chips are 9-sliced. */
#char-select .cs-panel:not(#_):not(#__) { --pw: min(30vw, 62vh, 460px); width: var(--pw); aspect-ratio: auto; height: auto; max-height: none; box-sizing: border-box; background: none;
  border-style: solid; border-color: transparent; border-width: calc(var(--pw) * 70 / 354) calc(var(--pw) * 44 / 354) calc(var(--pw) * 44 / 354);
  border-image: url(assets/ui/cs-panel.png) 70 44 44 fill / 1 / 0 stretch; }
#char-select .cs-panel-in:not(#_):not(#__) { position: relative; inset: auto !important; padding: 0 4px 2px; margin-top: calc(var(--pw) * -14 / 354); }
#char-select .cs-panel-in > * { flex-shrink: 0; }
#char-select .cs-chip:not(#_) { box-sizing: border-box; background: none; padding: 2px 2px 1px; border: 12px solid transparent; border-image: url(assets/ui/cs-chip.png) 40 fill / 12px stretch; }
#char-select .cs-enter:not(#_):not(#__) { --h: clamp(50px, 7.2vh, 64px); height: var(--h); width: 90%; margin-top: 8px; box-sizing: border-box; background: none;
  border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * 38 / 76); border-image: url(assets/ui/shop-btn-gold.png) 0 38 fill / 0 calc(var(--h) * 38 / 76) stretch; }
#char-select .cs-enter::after { inset: 14% 0; }
#char-select .cs-del:not(#_):not(#__) { --h: 34px; height: var(--h); min-width: 0; width: auto; padding: 0 4px; box-sizing: border-box; background: none;
  border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * 46 / 95); border-image: url(assets/ui/cs-delete.png) 0 46 fill / 0 calc(var(--h) * 46 / 95) stretch; }
#char-select .cs-del.big:not(#_):not(#__) { --h: 46px; width: 80%; }
@media (max-height: 600px), (max-width: 820px) {
  #char-select .cs-panel:not(#_):not(#__) { --pw: min(40vw, 78vh); }
  #char-select .cs-enter:not(#_):not(#__) { --h: 42px; margin-top: 4px; }
  #char-select .cs-del:not(#_):not(#__) { --h: 28px; }
  #char-select .cs-chip:not(#_) { border-width: 8px; border-image-width: 8px; }
}
@media (max-height: 600px), (max-width: 820px) {
  #char-select .cs-panel:not(#_):not(#__):not(#___) { --pw: min(37vw, 64vh); align-self: center; }
  #char-select .cs-panel-in:not(#_):not(#__) { gap: 2px; }
  #char-select .cs-name-big:not(#_):not(#__) { font-size: 20px; }
}
#char-select .cs-fig:not(#_):not(#__):not(#___) { aspect-ratio: 560 / 760; }

/* The ENTER button (user 2026-11-17 "cooler, makes you want to press it"): its own generated art at its own
   proportions (assets/ui/cs-enter.png from art/source/ui-enter-btn.png — gold blade frame, winged compass gem, blue
   enamel face), a breathing aura, a light sweep across the face, gold-white lettering; sparks run round the face and
   embers rise off it on the effects canvas (ui charSelect), faster on hover, a ring bursts on press. */
#char-select .cs-enter:not(#_):not(#__):not(#___) { --h: auto; width: 104%; height: auto; aspect-ratio: 1308 / 289; margin: 6px -2% 0; padding: 0; border: 0; border-image: none; overflow: visible;
  background: url(assets/ui/cs-enter.png) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)); animation: cs-enter-glow 2.4s ease-in-out infinite; isolation: isolate; }
#char-select .cs-enter-aura { position: absolute; z-index: -1; left: 6%; right: 6%; top: 30%; bottom: -4%; border-radius: 40%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(120, 170, 255, 0.85), rgba(80, 120, 255, 0.35) 55%, transparent); filter: blur(10px); animation: cs-aura 2.4s ease-in-out infinite; }
#char-select .cs-enter span:not(#_) { position: absolute; left: 15%; right: 15%; top: 42%; bottom: 10%; display: grid; place-items: center; z-index: 1;
  font: 400 clamp(20px, 2.2vw, 32px)/1 'Chonburi', 'Noto Serif Thai', serif; letter-spacing: .06em; color: transparent; text-shadow: none;
  background: linear-gradient(180deg, #ffffff 15%, #fff1bf 55%, #ffd36a 90%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 2px 0 rgba(10, 10, 60, 0.9)) drop-shadow(0 0 8px rgba(255, 220, 140, 0.8)); }
#char-select .cs-enter::after:not(#_) { content: none; }
#char-select .cs-enter::after { content: '' !important; position: absolute; left: 15%; right: 15%; top: 42%; bottom: 10%; inset: 42% 15% 10% !important; border-radius: 6px; z-index: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, rgba(190, 220, 255, 0.35) 52%, transparent 70%) !important; background-size: 260% 100% !important;
  mix-blend-mode: screen !important; animation: cs-sheen 2.4s ease-in-out infinite !important; }
#char-select .cs-enter:hover:not(#_):not(#__) { filter: brightness(1.15) drop-shadow(0 0 18px rgba(130, 180, 255, 0.95)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)); transform: translateY(-2px) scale(1.02); }
#char-select .cs-enter:hover .cs-enter-aura { animation-duration: 1.1s; }
#char-select .cs-enter:active:not(#_):not(#__) { transform: translateY(2px) scale(0.97); filter: brightness(1.3) drop-shadow(0 0 24px rgba(255, 230, 160, 1)); }
@keyframes cs-enter-glow { 50% { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 16px rgba(130, 180, 255, 0.75)); } }
@keyframes cs-aura { 0%, 100% { opacity: .55; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
@media (max-height: 600px), (max-width: 820px) { #char-select .cs-enter:not(#_):not(#__):not(#___) { margin-top: 2px; } #char-select .cs-enter span:not(#_) { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { #char-select .cs-enter, #char-select .cs-enter-aura, #char-select .cs-enter::after { animation: none !important; } }
#char-select .cs-enter:not(#_):not(#__):not(#___):not(#e4) { width: 114%; margin: 8px -7% 2px; }
#char-select .cs-enter span:not(#_):not(#__) { font: 800 clamp(22px, 2.5vw, 36px)/1 'Kanit', 'Noto Serif Thai', sans-serif; letter-spacing: .04em;
  background: linear-gradient(180deg, #fffdf2 10%, #ffe9a6 48%, #ffc23a 52%, #fff0b8 92%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #1a1060) drop-shadow(0 -1px 0 #1a1060) drop-shadow(1px 0 0 #1a1060) drop-shadow(-1px 0 0 #1a1060) drop-shadow(0 0 10px rgba(255, 210, 110, 0.9)); }
#char-select .cs-enter-aura:not(#_) { left: 2%; right: 2%; top: 20%; bottom: -14%; background: radial-gradient(closest-side, rgba(140, 190, 255, 0.95), rgba(90, 130, 255, 0.45) 55%, transparent); filter: blur(14px); }
@media (max-height: 600px), (max-width: 820px) { #char-select .cs-enter span:not(#_):not(#__) { font-size: 19px; } }
/* (No light sweep on the ENTER button, user 2026-11-17: its box ends showed at the face's angled ends. Aura + twinkles only.) */
html body #char-select .cs-enter::after { display: none !important; content: none !important; }

/* ===================== Loading into the world (user 2026-11-17) ===================== */
#loading-screen { position: fixed; inset: 0; z-index: 200; overflow: hidden; background: #070b1a url(assets/ui/loading.webp) center 35% / cover no-repeat; transition: opacity .6s ease; font-family: 'IBM Plex Sans Thai', Kanit, sans-serif; }
#loading-screen[hidden] { display: none; }
#loading-screen.out { opacity: 0; }
#loading-screen::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4, 6, 20, 0.35), transparent 28%, transparent 58%, rgba(4, 6, 20, 0.92) 92%); }
#loading-screen .ld-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#loading-screen .ld-logo { position: absolute; left: calc(3vw + env(safe-area-inset-left)); top: calc(3vh + env(safe-area-inset-top)); width: min(30vw, 420px); filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 22px rgba(255, 200, 90, 0.45)); animation: logo-breathe 4s ease-in-out infinite; }
#loading-screen .ld-foot { position: absolute; left: 50%; bottom: calc(4vh + env(safe-area-inset-bottom)); width: min(820px, 86vw); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; }
#loading-screen .ld-who { display: flex; align-items: baseline; gap: 12px; }
#loading-screen .ld-who b { font: 400 clamp(22px, 2.6vw, 34px)/1.3 'Chonburi', 'Noto Serif Thai', serif; background: linear-gradient(180deg, #fffdf0, #ffe7a0 55%, #e2a94a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(20, 8, 0, 0.8)); }
#loading-screen .ld-who span { font: 600 15px 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; text-shadow: 0 1px 3px #000; }
#loading-screen .ld-bar { position: relative; height: 16px; border-radius: 99px; background: rgba(6, 10, 30, 0.85); box-shadow: inset 0 0 0 1.5px #c9a24a, inset 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 14px rgba(0, 0, 0, 0.5); }
#loading-screen .ld-bar i { position: absolute; left: 3px; top: 3px; bottom: 3px; width: 0; max-width: calc(100% - 6px); border-radius: 99px; overflow: hidden;
  background: linear-gradient(180deg, #fff6d0, #ffd36a 45%, #d9962c 55%, #ffcf5a); box-shadow: 0 0 12px rgba(255, 210, 110, 0.7); }
#loading-screen .ld-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%); background-size: 200% 100%; animation: ld-sheen 1.4s linear infinite; }
#loading-screen .ld-bar em { position: absolute; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 12%, rgba(255, 236, 170, 0.9) 22%, rgba(255, 200, 90, 0.35) 45%, transparent 70%); animation: ld-spark .9s ease-in-out infinite; }
#loading-screen .ld-row { display: flex; justify-content: space-between; font: 600 13.5px 'IBM Plex Sans Thai', sans-serif; color: #f3e6c4; text-shadow: 0 1px 3px #000; }
#loading-screen .ld-pct { font: 700 15px 'Noto Serif Thai', serif; color: #ffe08a; }
#loading-screen .ld-tip { margin: 4px 0 0; display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: #e8e2d4; text-shadow: 0 1px 3px #000; }
#loading-screen .ld-tip b { flex: none; padding: 1px 10px; border-radius: 99px; font: 700 12px 'IBM Plex Sans Thai', sans-serif; color: #2a1a00; background: linear-gradient(#ffe08a, #c9a24a); text-shadow: none; }
#loading-screen .ld-tip span.in { animation: ld-tip .5s ease; }
@keyframes ld-sheen { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@keyframes ld-spark { 50% { transform: scale(1.25); } }
@keyframes ld-tip { from { opacity: 0; transform: translateY(6px); } }
@media (max-height: 600px) { #loading-screen .ld-foot { gap: 4px; bottom: calc(2vh + env(safe-area-inset-bottom)); } #loading-screen .ld-tip { font-size: 12px; } #loading-screen .ld-logo { width: min(26vw, 260px); } }
#char-select .cs-fig:not(#_):not(#__):not(#___):not(#f4) { transform-origin: 50% 80%; }

/* Notification counts (user 2026-11-17 "clearer, prettier, more vivid"): a glossy red disc with a white number, a gold
   ring and a red glow that breathes; it pops in when the number changes. Menu buttons take data-n (ui menuAlert); the
   event / mail buttons keep their .badge. */
html body .menu-btn.alert:not(#_)::after, html body .top-btn .badge:not([hidden]):not(#_) {
  content: attr(data-n); position: absolute; top: -6px; right: -6px; z-index: 3; box-sizing: border-box; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px;
  display: grid; place-items: center; font: 800 12px/1 'Kanit', 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 0 rgba(90, 0, 0, 0.8);
  background: radial-gradient(circle at 35% 28%, #ffb0a8 0%, #ff4646 32%, #e0102a 70%, #a8001a 100%);
  box-shadow: 0 0 0 1.5px #fff3c8, 0 0 0 3px #c9902a, 0 0 10px 2px rgba(255, 40, 60, 0.85), 0 2px 4px rgba(0, 0, 0, 0.6);
  animation: badge-breathe 1.8s ease-in-out infinite; width: auto; }
html body .menu-btn.alert-pop:not(#_)::after, html body .top-btn .badge:not([hidden]):not(#_) { animation: badge-pop .45s cubic-bezier(.3, 1.8, .5, 1), badge-breathe 1.8s ease-in-out .45s infinite; }
@keyframes badge-breathe { 50% { box-shadow: 0 0 0 1.5px #fff3c8, 0 0 0 3px #e2b84e, 0 0 16px 4px rgba(255, 50, 70, 1), 0 2px 4px rgba(0, 0, 0, 0.6); } }
@keyframes badge-pop { 0% { transform: scale(0.2); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
html.touch #quickmenu .menu-btn.alert:not(#_)::after { top: -4px; right: -2px; min-width: 18px; height: 18px; font-size: 11px; }
@media (prefers-reduced-motion: reduce) { html body .menu-btn.alert::after, html body .top-btn .badge { animation: none !important; } }

/* ===================== Sign-in screen (user 2026-11-17: its own picture, the six classes fighting a boss) =====================
   Key art assets/ui/title.webp (art/source/ui-title-battle.png), the sign-in card on its calmer right side in the
   character-select panel style, embers drifting up (main.js titleFx). */
#title-screen:not(.cs-mode):not(#_) { place-items: center end; padding: 0 calc(4vw + env(safe-area-inset-right)) 0 0;
  background: linear-gradient(90deg, transparent 45%, rgba(5, 7, 20, 0.55) 75%, rgba(5, 7, 20, 0.75)), url(assets/ui/title.webp) 30% center / cover no-repeat, #070b1a; }
#title-screen .title-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#title-screen:not(.cs-mode) .title-card:not(#_):not(#__) { position: relative; z-index: 1; width: min(460px, 90vw); padding: 0; text-align: center; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-radius: 0;
  border: calc(min(460px, 90vw) * 44 / 354) solid transparent; border-top-width: calc(min(460px, 90vw) * 70 / 354); border-image: url(assets/ui/cs-panel.png) 70 44 44 fill / 1 / 0 stretch; background: none;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6)); }
#title-screen:not(.cs-mode) .title-card > * { position: relative; }
#title-screen .logo.logo-art:not(#_) { margin: -34px auto 4px; }
#title-screen .logo.logo-art img { width: 100%; animation: none; filter: none; } /* the animated glow drew a dark box behind the logo (user 2026-11-18) */
/* The card scrolls (overflow-y auto), so a logo pulled up into the frame lost the tip of its star (user 2026-11-18). */
#title-screen .logo.logo-art:not(#_):not(#__):not(#___) { margin-top: 0; }
#title-screen .logo-sub:not(#_) { margin: 0 0 14px; font: 600 14px 'IBM Plex Sans Thai', sans-serif; color: #e4d6f5; letter-spacing: .06em; }
#title-screen .auth-tabs:not(#_) { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 14px; padding: 3px; border-radius: 99px; background: rgba(6, 4, 22, 0.6); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.55); }
#title-screen .auth-tabs button:not(#_) { height: 36px; border: 0; border-radius: 99px; cursor: pointer; font: 700 14px 'IBM Plex Sans Thai', sans-serif; color: #d9cbe8; background: none; }
#title-screen .auth-tabs button.on:not(#_) { color: #2a1600; background: linear-gradient(180deg, #fff3c4, #ffd36a 50%, #d99a2b); box-shadow: 0 0 10px rgba(255, 210, 110, 0.55); }
#title-screen .auth .field:not(#_) { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 0 0 10px; text-align: left; font: 600 13px 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; }
#title-screen .auth .field input:not(#_) { width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; font: 500 16px 'IBM Plex Sans Thai', sans-serif; color: #fff;
  background: rgba(6, 4, 22, 0.72); box-shadow: inset 0 0 0 1.5px #c9a24a; outline: none; }
#title-screen .auth .field input:focus { box-shadow: inset 0 0 0 2px #ffe08a, 0 0 12px rgba(255, 210, 110, 0.5); }
#title-screen .auth .title-actions:not(#_) { margin-top: 6px; }
#title-screen #auth-go:not(#_):not(#__) { position: relative; width: 108%; margin: 4px -4% 0; height: auto; aspect-ratio: 1308 / 289; padding: 0 0 2%; border: 0; border-radius: 0; cursor: pointer;
  background: url(assets/ui/cs-enter.png) center / 100% 100% no-repeat; box-shadow: none; color: transparent;
  font: 800 clamp(18px, 1.7vw, 24px)/1 'Kanit', sans-serif; letter-spacing: .04em; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)); animation: cs-enter-glow 2.4s ease-in-out infinite; }
#title-screen #auth-go:not(#_):not(#__)::after { content: attr(data-label); position: absolute; left: 15%; right: 15%; top: 42%; bottom: 10%; display: grid; place-items: center;
  background: linear-gradient(180deg, #fffdf2 10%, #ffe9a6 48%, #ffc23a 52%, #fff0b8 92%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #1a1060) drop-shadow(0 -1px 0 #1a1060) drop-shadow(1px 0 0 #1a1060) drop-shadow(-1px 0 0 #1a1060) drop-shadow(0 0 8px rgba(255, 210, 110, 0.85)); }
#title-screen #auth-go:hover:not(#_):not(#__) { filter: brightness(1.15) drop-shadow(0 0 18px rgba(130, 180, 255, 0.95)); transform: translateY(-2px); }
#title-screen #auth-go:disabled:not(#_):not(#__) { filter: saturate(.4) brightness(.8); }
#title-screen .auth .muted:not(#_) { margin: 10px 0 0; font-size: 12.5px; color: #cdb9ef; }
#title-screen .error:not(#_) { color: #ff9a8a; font-weight: 700; margin: 6px 0 0; }
@media (max-width: 760px), (max-height: 560px) {
  #title-screen:not(.cs-mode):not(#_) { place-items: center; padding: 8px; background-position: center, 25% center, 0 0; }
  #title-screen:not(.cs-mode) .title-card:not(#_):not(#__) { width: min(380px, 70vw); border-width: calc(min(380px, 70vw) * 36 / 354); border-top-width: calc(min(380px, 70vw) * 60 / 354); }
  #title-screen .logo.logo-art:not(#_) { margin: -26px auto 0; } #title-screen .logo.logo-art img { width: 70%; }
  #title-screen .logo-sub:not(#_) { margin-bottom: 6px; font-size: 12px; }
  #title-screen .auth .field input:not(#_) { height: 36px; }
  #title-screen .auth .field:not(#_) { margin-bottom: 6px; flex-direction: row; align-items: center; gap: 8px; } #title-screen .auth .field input:not(#_) { flex: 1; }
}
@media (max-width: 760px), (max-height: 560px) {
  #title-screen:not(.cs-mode):not(#_):not(#__) { place-items: center end; padding: 4px calc(10px + env(safe-area-inset-right)) 4px 0; background-position: center, 20% center, 0 0; }
  #title-screen:not(.cs-mode) .title-card:not(#_):not(#__):not(#___) { width: min(330px, 46vw); max-height: calc(var(--vh, 100dvh) - 8px); overflow-y: auto; box-sizing: border-box;
    border-width: 14px 18px 16px; border-image: url(assets/ui/cs-panel.png) 70 44 44 fill / 34px 22px 22px / 0 stretch; scrollbar-width: none; }
  #title-screen .logo.logo-art:not(#_):not(#__) { margin: 0 auto; } #title-screen .logo.logo-art img { width: 62%; }
  #title-screen .logo-sub:not(#_):not(#__) { display: none; }
  #title-screen .auth-tabs:not(#_):not(#__) { margin-bottom: 6px; } #title-screen .auth-tabs button:not(#_) { height: 30px; font-size: 13px; }
  #title-screen #auth-go:not(#_):not(#__):not(#___) { width: 92%; margin: 2px 4% 0; }
  #title-screen .auth .muted:not(#_) { display: none; }
}

/* Sign-in art alive without particles (user 2026-11-17): .title-par (mouse shift) > .title-art (picture-sized, slow
   camera drift) with lights over the fire, the eye, the shield hit, the mage's circle, the cleric's book; .title-shade
   darkens the right side under the card. */
#title-screen:not(.cs-mode):not(#_):not(#__):not(#___) { background: #070b1a !important; overflow: hidden; }
#title-screen.cs-mode .title-par { display: none; }
#title-screen .title-par { position: absolute; inset: 0; z-index: 0; pointer-events: none; transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform .8s ease-out; }
#title-screen .title-art { position: absolute; width: max(104vw, 156vh); aspect-ratio: 1536 / 1024; left: calc((100vw - max(104vw, 156vh)) * 0.3); top: 50%; margin-top: calc(max(104vw, 156vh) / -3);
  background: url(assets/ui/title.webp) center / 100% 100% no-repeat; transform-origin: 38% 40%; animation: title-drift 26s ease-in-out infinite alternate; }
#title-screen .title-shade { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 45%, rgba(5, 7, 20, 0.5) 75%, rgba(5, 7, 20, 0.72)); }
#title-screen .tg { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; mix-blend-mode: screen; }
#title-screen .tg.lava { background: radial-gradient(closest-side, rgba(255, 110, 30, 0.22), transparent); animation: tg-breathe 4.5s ease-in-out infinite; }
#title-screen .tg.fire { background: radial-gradient(closest-side, rgba(255, 190, 80, 0.55), rgba(255, 110, 20, 0.25) 55%, transparent); animation: tg-flicker 1.7s linear infinite; }
#title-screen .tg.hit { background: radial-gradient(closest-side, rgba(255, 250, 210, 0.75), rgba(255, 190, 70, 0.3) 50%, transparent); animation: tg-flicker .8s linear infinite reverse; }
#title-screen .tg.eye { background: radial-gradient(closest-side, rgba(255, 220, 120, 0.95), rgba(255, 120, 20, 0.4) 50%, transparent); animation: tg-breathe 2.2s ease-in-out infinite; }
#title-screen .tg.mage { background: radial-gradient(closest-side, rgba(120, 190, 255, 0.6), rgba(60, 120, 255, 0.25) 55%, transparent); animation: tg-breathe 2.8s ease-in-out infinite; }
#title-screen .tg.book { background: radial-gradient(closest-side, rgba(255, 236, 160, 0.6), rgba(255, 200, 90, 0.25) 55%, transparent); animation: tg-breathe 3.3s ease-in-out .6s infinite; }
@keyframes title-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.09) translate(-1.4%, 0.8%); } }
@keyframes tg-breathe { 0%, 100% { opacity: .45; transform: translate(-50%, -50%) scale(.92); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes tg-flicker { 0% { opacity: .55; } 12% { opacity: .85; } 24% { opacity: .6; } 38% { opacity: .95; } 52% { opacity: .65; } 66% { opacity: .9; } 80% { opacity: .58; } 100% { opacity: .55; } }
@media (max-width: 760px), (max-height: 560px) { #title-screen .title-art { left: calc((100vw - max(104vw, 156vh)) * 0.2); } }
@media (prefers-reduced-motion: reduce) { #title-screen .title-art, #title-screen .tg { animation: none !important; } }

/* Server news bar (launch prep 2026-11-17): a new build (reload) or a maintenance countdown, across the top. */
#sys-banner { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 250; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px);
  padding: 8px 10px 8px 18px; border-radius: 99px; font: 600 14px 'IBM Plex Sans Thai', Kanit, sans-serif; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); animation: sys-in .4s ease; }
#sys-banner[hidden] { display: none; }
#sys-banner b { font-weight: 800; white-space: nowrap; }
#sys-banner span { opacity: .9; font-size: 13px; }
#sys-banner.new { background: linear-gradient(90deg, #1d3d8a, #3a2a7a); box-shadow: inset 0 0 0 1.5px #ffd36a, 0 6px 18px rgba(0, 0, 0, 0.5); }
#sys-banner.maint { padding-right: 18px; background: linear-gradient(90deg, #8a1d1d, #a8501a); box-shadow: inset 0 0 0 1.5px #ffd36a, 0 6px 18px rgba(0, 0, 0, 0.5); }
#sys-banner button { flex: none; height: 32px; padding: 0 16px; border: 0; border-radius: 99px; cursor: pointer; font: 800 13px 'IBM Plex Sans Thai', sans-serif; color: #2a1600; background: linear-gradient(180deg, #fff3c4, #ffd36a 50%, #d99a2b); }
@keyframes sys-in { from { opacity: 0; transform: translate(-50%, -12px); } }

/* Sign-in card, set 2 (2026-11-17): the forgot / reset heading, two password boxes side by side, Turnstile, the links,
   the hidden bot field, a green note. */
#title-screen .auth-head { margin: 0 0 12px; text-align: center; }
#title-screen .auth-head b { display: block; font: 800 20px 'Kanit', sans-serif; color: #ffe3a0; letter-spacing: .03em; }
#title-screen .auth-head span { display: block; margin-top: 4px; font-size: 13px; color: #d6c8ee; line-height: 1.45; }
#title-screen .auth-pair.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
#title-screen .auth-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#title-screen .auth-captcha { display: flex; justify-content: center; margin: 2px 0 6px; min-height: 65px; }
#title-screen .auth-captcha[hidden] { display: none; }
#title-screen .auth-links { display: flex; justify-content: center; margin-top: 6px; }
#title-screen .auth-link { border: 0; background: none; cursor: pointer; font: 600 13px 'IBM Plex Sans Thai', sans-serif; color: #ffd78a; text-decoration: underline; text-underline-offset: 3px; }
#title-screen .auth-link:hover { color: #fff3c4; }
#title-screen .auth-link[hidden] { display: none; }
#title-screen .error.ok:not(#_) { color: #8ff0b0; }
#title-screen:not(.cs-mode) .title-card:not(#_):not(#__) { max-height: calc(var(--vh, 100dvh) - 24px); overflow-y: auto; scrollbar-width: none; }
@media (max-width: 760px), (max-height: 560px) {
  #title-screen .auth-pair.two { grid-template-columns: 1fr; }
  #title-screen .auth-head b { font-size: 16px; } #title-screen .auth-head span { font-size: 11.5px; }
}
/* Settings, the account rows. */
.set-acct { flex-wrap: wrap; gap: 6px; }
.set-acct .set-warn { color: #ff9a7a; font-style: normal; font-weight: 700; }
.set-acct-btns { display: flex; gap: 6px; }
.set-acct-form { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.set-acct-form input { flex: 1 1 140px; min-width: 0; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(201, 162, 74, 0.6); background: rgba(10, 8, 24, 0.55); color: inherit; font: inherit; }
/* Admin, invite codes. */
.adm-invites { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.adm-inv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.adm-inv code { font: 700 14px ui-monospace, Consolas, monospace; letter-spacing: .06em; color: #ffd36a; }
.adm-inv small { flex: 1; min-width: 120px; }
.adm-inv.full { opacity: .55; }
#adm-inv-max { width: 64px; }
#title-screen .title-card .auth:not(#_) { width: 100%; max-width: none; box-sizing: border-box; margin: 6px 0 0; }
#title-screen:not(.cs-mode) .title-card:not(#_):not(#__) { overflow-x: hidden; }
#title-screen #auth-go:not(#_):not(#__):not(#___) { width: 100%; margin: 4px 0 0; }
/* Sign-up and the reset faces are taller: a smaller logo, no subtitle. */
#title-screen:is([data-face="register"], [data-face="forgot"], [data-face="reset"]) .logo.logo-art img { width: 66%; }
#title-screen:is([data-face="register"], [data-face="forgot"], [data-face="reset"]) .logo-sub:not(#_):not(#__) { display: none; }
#title-screen[data-face="register"] .auth .field:not(#_):not(#__) { margin-bottom: 7px; }
@media (max-width: 760px), (max-height: 560px) {
  #title-screen[data-face="register"] .title-card .auth:not(#_):not(#__) { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
  #title-screen[data-face="register"] .auth > :not(.field):not(.auth-pair) { grid-column: 1 / -1; }
  #title-screen[data-face="register"] .auth .auth-pair { display: contents; }
  #title-screen[data-face="register"] .auth .field:not(#_):not(#__):not(#___) { flex-direction: column; align-items: stretch; gap: 2px; font-size: 11px; margin-bottom: 5px; }
  #title-screen[data-face="register"] .auth .field input:not(#_):not(#__) { height: 32px; }
  #title-screen[data-face="register"] .logo.logo-art img { width: 50%; }
}
@media (max-width: 760px), (max-height: 560px) { #title-screen[data-face="register"] #auth-invite-row:not(#_) { grid-column: 1 / -1; } }
.set-acct .set-warn:not(#_) { color: #d8442a; }
html[data-ui="a"] .set-acct .set-warn:not(#_) { color: #ff9a7a; }

/* Sign-up consent and the legal links (launch prep set 3). */
#title-screen .auth-agree { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 8px; text-align: left; font: 500 13px/1.45 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; cursor: pointer; }
#title-screen .auth-agree[hidden] { display: none; }
#title-screen .auth-agree input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #e2b84e; }
#title-screen .auth-agree a, #title-screen .auth-legal a { color: #ffd78a; margin: 0 3px; }
#title-screen .auth-legal { margin: 6px 0 0; text-align: center; font-size: 12px; color: #b9afd6; }
#title-screen .auth-legal a { margin: 0; text-decoration: none; }
#title-screen .auth-legal a:hover { text-decoration: underline; }
@media (max-width: 760px), (max-height: 560px) { #title-screen .auth-legal { display: none; } #title-screen .auth-agree { font-size: 11.5px; margin-bottom: 4px; } }

/* Redeem codes (2026-11-18): the box at the top of the mail list; the admin's gift-code form. */
.mail-redeem { display: flex; gap: 6px; margin: 0 0 8px; }
.mail-redeem input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(201, 162, 74, 0.7); background: rgba(10, 8, 24, 0.5); color: inherit; font: 600 14px 'IBM Plex Sans Thai', sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.mail-redeem input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
html:not([data-ui="a"]) .mail-redeem input { background: #fffaf0; color: #1f2a52; }
.rd-form { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.rd-form textarea { flex: 1; min-height: 44px; resize: vertical; font: inherit; padding: 6px 8px; border-radius: 6px; }
.rd-found { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 4px 74px; }
.rd-pick { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 6px; border: 1px solid rgba(201, 162, 74, 0.5); background: rgba(0, 0, 0, 0.25); color: inherit; cursor: pointer; font-size: 12px; }
.rd-pick:hover { border-color: #ffd36a; }
.rd-pick img, .rd-item img { width: 26px; height: 26px; }
.rd-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px 74px; }
.rd-item { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.25); font-size: 13px; }
.rd-item input { width: 64px; }
.rd-go .qc-rewards { flex: 1; }
.rd-gift { flex: 1; min-width: 160px; }
.adm-inv .rd-gift:not(#_) { display: flex; flex-flow: row wrap; gap: 4px; }
#rd-gold, #rd-gems { width: 110px; }

/* Guest play on the sign-in card (user 2026-11-18): a quiet outlined button under the gold one. */
#title-screen .auth-guest:not(#_) { display: block; width: 100%; margin: 10px 0 0; height: 40px; border-radius: 99px; cursor: pointer;
  font: 700 14px 'IBM Plex Sans Thai', sans-serif; color: #f3e6c4; background: rgba(10, 6, 30, 0.55); border: 1.5px solid rgba(201, 162, 74, 0.75); }
#title-screen .auth-guest:hover:not(#_) { background: rgba(40, 26, 80, 0.7); border-color: #ffe08a; color: #fff; }
#title-screen .auth-guest[hidden] { display: none !important; }

/* Every theme fits a window to the screen (user 2026-11-18: Settings ran off the bottom in noir gilt): the same
   whole-pixel placing and zoom (--fit, ui fitWindows) theme C has used since 2026-11-15, for A and B too. */
html:is([data-ui="a"], [data-ui="b"]):not(.touch) .window:not(#win-dungeon, #win-waygate, #win-admin, #win-book, #win-today):not(#_) { max-height: none !important; transform: none !important;
  right: auto !important; bottom: auto !important; margin: 0 !important; left: var(--wx, 0) !important; top: var(--wy, 0) !important; height: fit-content !important; zoom: var(--fit, 1); }
/* Settings in A and B: wide enough for a label on one line, the account buttons wrap under the address. */
html:is([data-ui="a"], [data-ui="b"]) #win-settings:not(#_) { width: 540px; }
html:is([data-ui="a"], [data-ui="b"]) #win-settings .set-acct:not(#_) { flex-wrap: wrap; gap: 8px; }

/* ===== First-play tutorial (user 2026-11-18): one card top-centre under the target bar, the same in every theme. ===== */
#hud #tutorial { position: absolute; left: 50%; top: 64px; translate: -50% 0; z-index: 8; width: min(440px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 10px 14px 12px; border-radius: 12px; background: linear-gradient(180deg, rgba(22, 18, 44, 0.94), rgba(10, 8, 24, 0.94));
  border: 1px solid rgba(214, 178, 96, 0.75); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 200, 90, 0.18);
  color: #ece4d2; font: 500 14px/1.5 'IBM Plex Sans Thai', 'Kanit', sans-serif; pointer-events: auto; }
#hud #tutorial[hidden] { display: none; }
#hud #tutorial.pop { animation: tut-pop .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tut-pop { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
#tutorial .tut-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
#tutorial .tut-step { font: 700 11.5px 'Kanit', sans-serif; letter-spacing: .08em; color: #d9b45f; }
#tutorial .tut-skip { border: 0; background: none; padding: 2px 0; cursor: pointer; font: 600 12px 'IBM Plex Sans Thai', sans-serif; color: #a99fc0; text-decoration: underline; text-underline-offset: 3px; }
#tutorial .tut-skip:hover { color: #fff; }
#tutorial .tut-title { display: block; font: 700 17px 'Kanit', sans-serif; color: #ffe39a; }
#tutorial .tut-text { margin: 4px 0 8px; color: #e6dece; }
#tutorial .tut-text b { color: #fff; }
#tutorial .tut-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #ffcf4a; color: #2a1600 !important; font-weight: 800; }
#tutorial kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; text-align: center; font: 700 12px/1.6 'Kanit', sans-serif;
  color: #ffe9b0; background: rgba(255, 220, 140, 0.12); border: 1px solid rgba(214, 178, 96, 0.6); }
#tutorial .tut-next { display: block; margin-left: auto; padding: 6px 18px; border-radius: 99px; cursor: pointer; border: 0;
  font: 700 14px 'Kanit', sans-serif; color: #2a1600; background: linear-gradient(180deg, #fff1c0, #ffcf5a 55%, #d99a2b); box-shadow: 0 0 10px rgba(255, 200, 90, 0.4); }
#tutorial .tut-next:hover { filter: brightness(1.08); }
#tutorial .tut-wait { display: block; text-align: right; font-size: 12px; color: #9d93b8; }
/* What the lesson points at glows gold. */
.tut-hl { animation: tut-glow 1.2s ease-in-out infinite !important; border-radius: 10px; }
#skillbar .slot:is([data-id="attack"], [data-id="auto"], [data-id="dash"]).tut-hl { border-radius: 50%; }
@keyframes tut-glow { 0%, 100% { box-shadow: 0 0 0 2px rgba(255, 210, 100, 0.85), 0 0 10px rgba(255, 200, 90, 0.5); } 50% { box-shadow: 0 0 0 3px #ffe08a, 0 0 22px rgba(255, 210, 110, 0.9); } }
@media (max-width: 1399px) { #hud #tutorial { top: 132px; } }
/* Phones: under the round top buttons, between the quest box and the corner notices. */
html.touch #hud #tutorial { top: calc(58px + env(safe-area-inset-top)); left: calc(50% + 48px); width: min(320px, 38vw); font-size: 12.5px; line-height: 1.4; padding: 7px 10px 8px; }
html.touch #tutorial .tut-title { font-size: 14px; }
html.touch #tutorial .tut-text { margin: 2px 0 5px; }
html.touch #tutorial .tut-wait { display: none; }
html.touch #tutorial .tut-next { padding: 4px 14px; font-size: 13px; }

/* ===== Shop quantity (user 2026-11-18 "ปรับให้สมดุล จัดดีๆ"), every theme: − amount + on the same four columns as the
   x1 · x10 · x50 · max presets under it (the amount spans two), one height per row, the total's label and sum on one
   centre line. Each theme keeps its own button look. ===== */
html .window .qty:not(#_):not(#__):not(#___) { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important;
  width: auto !important; margin: 6px 0 0 !important; align-items: stretch; }
html .window .qty:not(#_):not(#__):not(#___) input { grid-column: span 2; width: 100%; min-width: 0; height: 36px; box-sizing: border-box; padding: 0 4px;
  text-align: center; font-size: 17px !important; font-weight: 700; -moz-appearance: textfield; }
html .window .qty:not(#_):not(#__):not(#___) input::-webkit-inner-spin-button, html .window .qty:not(#_):not(#__):not(#___) input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
html .window .qty:not(#_):not(#__):not(#___) .btn { display: grid; place-items: center; height: 36px; min-height: 36px; min-width: 0; padding: 0 !important; font-size: 21px !important; font-weight: 700; line-height: 1; }
html .window .qty-presets:not(#_):not(#__):not(#___) { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; margin-top: 6px !important; }
html .window .qty-presets:not(#_):not(#__):not(#___) .btn { height: 30px; min-height: 30px; min-width: 0; padding: 0 2px !important; font-size: 12.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html #win-shop .shop-total:not(#_) { align-items: center; margin-top: 10px; }

/* ===== Rewards window (user 2026-11-18, ui renderRewards), redone the same day: "เรียบกว่านี้ แต่ยังพรีเมี่ยม". One deep
   navy panel with a hairline gold edge in every theme; slim tabs with a gold accent bar; a milestone rail; plain rows of
   square gift slots. The top-up tab: a spotlight card for the next tier beside a metal ladder of every tier. ===== */
html #win-rewards:not(#_):not(#__) { width: min(920px, calc(100vw - 32px)) !important; }
html #win-rewards .rw:not(#_) { display: grid; grid-template-columns: 172px 1fr; gap: 14px; padding: 12px; border-radius: 14px; color: #efe6d2;
  background: radial-gradient(ellipse 60% 40% at 78% 0%, rgba(255, 214, 120, 0.08), transparent 70%), linear-gradient(170deg, #182240, #0f1629 60%, #141128);
  box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.35); font-family: 'IBM Plex Sans Thai', Kanit, sans-serif; }
html #win-rewards .rw :is(b, small, span, p, i, div):not(#_):not(#__) { text-shadow: none; }
/* Tabs: quiet rows; the chosen one lit by a gold bar on its left and a soft wash, not a solid gold pill. */
html #win-rewards .rw-tabs { display: flex; flex-direction: column; gap: 4px; }
html #win-rewards .rw-tab:not(#_) { position: relative; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px 6px 12px;
  border: 0; border-radius: 9px; cursor: pointer; text-align: left; font: 600 14px Kanit, sans-serif; background: transparent; box-shadow: none; }
html #win-rewards .rw-tab:hover:not(#_) { background: rgba(255, 255, 255, 0.04); }
html #win-rewards .rw-tab.on:not(#_) { background: linear-gradient(90deg, rgba(255, 214, 120, 0.16), rgba(255, 214, 120, 0.02)); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.28); }
html #win-rewards .rw-tab.on:not(#_)::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: linear-gradient(#ffe7a0, #d9a43a); box-shadow: 0 0 8px rgba(255, 200, 90, 0.7); }
html #win-rewards .rw:not(#_) .rw-tab span:not(#_):not(#__) { color: #b7ae98 !important; }
html #win-rewards .rw:not(#_) .rw-tab.on span:not(#_):not(#__) { color: #ffe39a !important; }
html #win-rewards .rw-ic { width: 34px; height: 34px; }
html #win-rewards .rw:not(#_) .rw-dot:not(#_):not(#__) { position: absolute; right: 10px; top: 50%; translate: 0 -50%; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 99px;
  display: grid; place-items: center; font: 700 11px Kanit, sans-serif; font-style: normal; color: #fff !important; background: #e0392b; box-shadow: 0 0 0 2px #0f1629, 0 0 8px rgba(255, 70, 50, 0.6); }
/* The main column. */
html #win-rewards .rw-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
html #win-rewards .rw-head { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 12px; padding: 4px 4px 12px; border-bottom: 1px solid rgba(226, 184, 78, 0.22); }
html #win-rewards .rw-head .rw-ic { width: 44px; height: 44px; }
html #win-rewards .rw:not(#_) .rw-title b:not(#_):not(#__) { display: block; font: 700 19px/1.2 'Noto Serif Thai', Kanit, serif; color: #ffe39a !important; letter-spacing: 0.01em; }
html #win-rewards .rw:not(#_) .rw-title small:not(#_):not(#__) { font-size: 12.5px; color: #9f977f !important; }
html #win-rewards .rw-now { text-align: right; line-height: 1.15; }
html #win-rewards .rw:not(#_) .rw-now small:not(#_):not(#__) { display: block; font-size: 11.5px; color: #9f977f !important; }
html #win-rewards .rw:not(#_) .rw-now b:not(#_):not(#__) { font: 700 22px Kanit, sans-serif; color: #fff !important; }
/* Buttons: one gold style, the claim button gently breathing. */
html #win-rewards :is(.rw-all, .rw-claim, .rw-topup):not(#_) { border: 0; border-radius: 99px; cursor: pointer; font: 700 14px Kanit, sans-serif; color: #2a1600;
  background: linear-gradient(180deg, #fff1bd, #f5c451 55%, #cf912a); box-shadow: 0 2px 0 #8a5a14, 0 0 10px rgba(255, 200, 90, 0.35); }
html #win-rewards .rw-all:not(#_) { padding: 8px 16px; }
html #win-rewards .rw-claim:not(#_) { padding: 5px 18px; animation: rw-glow 1.8s ease-in-out infinite; }
html #win-rewards :is(.rw-claim, .rw-all):disabled:not(#_) { animation: none; filter: saturate(.3) brightness(.85); cursor: default; }
@keyframes rw-glow { 50% { box-shadow: 0 2px 0 #8a5a14, 0 0 18px rgba(255, 210, 110, 0.75); } }
html #win-rewards .rw:not(#_) .rw-done:not(#_):not(#__) { font: 700 15px Kanit, sans-serif; color: #7fd48a !important; }
html #win-rewards .rw:not(#_) .rw-left:not(#_):not(#__) { font-size: 12px; color: #8f8770 !important; white-space: nowrap; }
html #win-rewards .rw:not(#_) .rw-note:not(#_):not(#__) { margin: 0 4px; font-size: 12px; color: #8f8770 !important; }
/* The milestone rail. */
html #win-rewards .rw-rail { position: relative; height: 46px; margin: 0 22px; }
html #win-rewards .rw-track { position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }
html #win-rewards .rw-track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #c99a3a, #ffe39a); box-shadow: 0 0 8px rgba(255, 210, 110, 0.6); }
html #win-rewards .rw-node { position: absolute; top: 3px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
html #win-rewards .rw:not(#_) .rw-node i:not(#_):not(#__) { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 800 11px Kanit, sans-serif; font-style: normal;
  color: #2a1600 !important; background: #1a2340; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
html #win-rewards .rw-node.done i { background: linear-gradient(#ffe7a0, #d9a43a) !important; box-shadow: none !important; }
html #win-rewards .rw-node.ready i { background: #ffe39a !important; box-shadow: 0 0 0 3px rgba(255, 214, 120, 0.3), 0 0 12px rgba(255, 214, 120, 0.9) !important; animation: rw-node 1.4s ease-in-out infinite; }
html #win-rewards .rw-node.next i { background: #1a2340 !important; box-shadow: inset 0 0 0 2px #ffe39a !important; }
@keyframes rw-node { 50% { box-shadow: 0 0 0 5px rgba(255, 214, 120, 0.15), 0 0 16px rgba(255, 214, 120, 1); } }
html #win-rewards .rw:not(#_) .rw-node small:not(#_):not(#__) { font: 600 11px Kanit, sans-serif; color: #8f8770 !important; white-space: nowrap; }
html #win-rewards .rw:not(#_) .rw-node:is(.done, .ready, .next) small:not(#_):not(#__) { color: #e9d9a8 !important; }
/* Milestone rows. */
html #win-rewards .rw-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
html #win-rewards .rw-list.two { grid-template-columns: 1fr 1fr; }
html #win-rewards .rw-row { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; min-height: 50px; padding: 5px 12px 5px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
html #win-rewards .rw-row.ready { background: linear-gradient(90deg, rgba(255, 214, 120, 0.14), rgba(255, 214, 120, 0.03)); box-shadow: inset 0 0 0 1px rgba(255, 214, 120, 0.6); }
html #win-rewards .rw-row.next { box-shadow: inset 0 0 0 1px rgba(255, 214, 120, 0.3); }
html #win-rewards .rw-row.done { opacity: 0.45; }
html #win-rewards .rw:not(#_) .rw-mark:not(#_):not(#__) { font: 700 15px Kanit, sans-serif; color: #ffe39a !important; }
html #win-rewards .rw:not(#_) .rw-row.wait .rw-mark:not(#_):not(#__) { color: #a59c84 !important; }
html #win-rewards .rw:not(#_) .rw-mark small:not(#_):not(#__) { display: block; font: 500 11px Kanit, sans-serif; color: #8f8770 !important; }
html #win-rewards .rw-row:not(.ready):not(.done) { grid-template-columns: 78px 1fr; }
html #win-rewards .rw-list.two .rw-row { grid-template-columns: 72px 1fr auto; gap: 8px; padding-right: 8px; }
html #win-rewards .rw-list.two .rw-row:not(.ready):not(.done) { grid-template-columns: 72px 1fr; }
html #win-rewards .rw-list.two .rw-slot { width: 34px; height: 34px; } html #win-rewards .rw-list.two .rw-slot img { width: 25px; height: 25px; }
html #win-rewards .rw-list.two .rw-gifts { gap: 5px; }
html #win-rewards .rw-gifts { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
/* A gift: a square slot, the icon in it, the amount in its corner. */
html #win-rewards .rw-slot { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25)); box-shadow: inset 0 0 0 1px rgba(226, 184, 78, 0.28); }
html #win-rewards .rw-slot img { width: 28px; height: 28px; }
html #win-rewards .rw:not(#_) .rw-slot b:not(#_):not(#__) { position: absolute; right: -3px; bottom: -4px; padding: 0 4px; border-radius: 5px; font: 700 10.5px/1.45 Kanit, sans-serif;
  color: #fff !important; background: rgba(8, 12, 26, 0.92); box-shadow: 0 0 0 1px rgba(226, 184, 78, 0.35); }
/* ---- The top-up tab: spotlight + ladder. Metals per tier (m-bronze … m-diamond) tint the coin and the spotlight. ---- */
html #win-rewards .rw-tu { display: grid; grid-template-columns: 250px 1fr; gap: 12px; }
html #win-rewards .rw-spot { --m1: #ffe9a8; --m2: #d8a03a; --mg: rgba(255, 210, 110, 0.35); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px 14px; border-radius: 14px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, var(--mg), transparent 65%), linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2));
  box-shadow: inset 0 0 0 1px var(--m2), 0 0 22px -6px var(--mg); }
html #win-rewards .rw:not(#_) .rw-spot-k:not(#_):not(#__) { font: 600 12px Kanit, sans-serif; letter-spacing: 0.08em; color: var(--m1) !important; }
html #win-rewards .rw:not(#_) .rw-spot-at:not(#_):not(#__) { font: 700 34px/1 'Noto Serif Thai', Kanit, serif; background: linear-gradient(180deg, #fff, var(--m1) 45%, var(--m2));
  -webkit-background-clip: text; background-clip: text; color: transparent !important; }
html #win-rewards .rw-spot-gifts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 52px; align-content: center; }
html #win-rewards .rw-spot-gifts .rw-slot { width: 48px; height: 48px; border-radius: 10px; }
html #win-rewards .rw-spot-gifts .rw-slot img { width: 36px; height: 36px; }
html #win-rewards .rw-spot-bar { width: 100%; height: 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); overflow: hidden; }
html #win-rewards .rw-spot-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--m2), var(--m1)); box-shadow: 0 0 8px var(--mg); }
html #win-rewards .rw:not(#_) .rw-spot-num:not(#_):not(#__) { font-size: 12.5px; color: #cfc6ad !important; }
html #win-rewards .rw-topup:not(#_), html #win-rewards .rw-claim.big:not(#_) { width: 100%; padding: 10px 0; font-size: 16px; }
html #win-rewards .rw-topup:not(#_) { animation: rw-glow 1.8s ease-in-out infinite; }
html #win-rewards .rw-done.big { font-size: 14px; }
html #win-rewards .rw-more:not(#_) { border: 0; background: none; cursor: pointer; font: 600 13px Kanit, sans-serif; color: #e9d9a8; padding: 2px 6px; }
html #win-rewards .rw-more:hover:not(#_) { color: #fff; text-decoration: underline; }
html #win-rewards .rw-ladder { display: flex; flex-direction: column; gap: 5px; }
html #win-rewards .rw-step { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 10px; min-height: 46px; padding: 4px 12px 4px 6px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
html #win-rewards .rw-step.ready { box-shadow: inset 0 0 0 1px rgba(255, 214, 120, 0.6); background: linear-gradient(90deg, rgba(255, 214, 120, 0.12), rgba(255, 214, 120, 0.02)); }
html #win-rewards .rw-step.next { box-shadow: inset 0 0 0 1px rgba(255, 214, 120, 0.3); }
html #win-rewards .rw-step.done { opacity: 0.45; }
html #win-rewards .rw-step .rw-slot { width: 34px; height: 34px; } html #win-rewards .rw-step .rw-slot img { width: 25px; height: 25px; }
/* The tier coin: a metal plate with the amount, one metal finer per tier. */
html #win-rewards .rw:not(#_) .rw-coin:not(#_):not(#__) { display: grid; place-items: center; height: 32px; border-radius: 8px; font: 700 14px Kanit, sans-serif; color: #1c1208 !important;
  background: linear-gradient(180deg, var(--m1), var(--m2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 10px -2px var(--mg); }
html #win-rewards :is(.rw-step, .rw-spot).m-bronze { --m1: #f2c39a; --m2: #b06a3a; --mg: rgba(220, 140, 80, 0.35); }
html #win-rewards :is(.rw-step, .rw-spot).m-silver { --m1: #f2f4f8; --m2: #9aa6b8; --mg: rgba(200, 215, 235, 0.35); }
html #win-rewards :is(.rw-step, .rw-spot).m-gold { --m1: #fff0b0; --m2: #d6a034; --mg: rgba(255, 205, 90, 0.4); }
html #win-rewards :is(.rw-step, .rw-spot).m-plat { --m1: #e6fbff; --m2: #6fb8d8; --mg: rgba(120, 210, 255, 0.4); }
html #win-rewards :is(.rw-step, .rw-spot).m-diamond { --m1: #ffffff; --m2: #b48cff; --mg: rgba(190, 150, 255, 0.5); }
html #win-rewards .rw-step.m-diamond .rw-coin { animation: rw-shine 2.6s ease-in-out infinite; }
@keyframes rw-shine { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 16px 0 var(--mg); } }
@media (max-width: 760px) { html #win-rewards .rw:not(#_) { grid-template-columns: 1fr; } html #win-rewards .rw-tabs { flex-direction: row; overflow-x: auto; }
  html #win-rewards .rw-tab:not(#_) { min-width: 128px; } html #win-rewards :is(.rw-list.two, .rw-tu) { grid-template-columns: 1fr; } }
/* A class outfit's tag in the Astra shop (graded outfits are one class's own, user 2026-11-18). */
html #win-gems .av-card .av-cls:not(#_) { display: block; width: max-content; margin: -6px auto 2px; padding: 1px 9px; border-radius: 999px;
  font: 600 11px/1.5 'IBM Plex Sans Thai', 'Kanit', sans-serif; font-style: normal; color: #1d1405;
  background: linear-gradient(#ffe7a6, #d9a441); box-shadow: 0 0 0 1px rgba(80, 50, 10, .45), 0 2px 6px rgba(0, 0, 0, .35); }
/* (The bag's Avatar grid shows only owned looks, user 2026-11-18: an empty slot filter says so across the grid.) */
html .bag-grid .bag-empty-av:not(#_) { grid-column: 1 / -1; padding: 14px 8px; text-align: center; font-size: 13px; opacity: 0.75; }
/* Settings and how-to-play live in the top row on a computer (user 2026-11-18), so the bottom menu drops its copies;
   on touch the bottom bar (#quickmenu) and the menu grid keep them, and the crowded top row does not take them. */
html:not(.touch) #menu .menu-btn.moved-top:not(#_) { display: none !important; }
html.touch #top-buttons :is(#top-settings, #top-help):not(#_) { display: none !important; }
/* How to play and settings stacked in a column at the end of the top row (user 2026-11-18). */
#top-buttons { align-items: flex-start; }
#top-side:not(#_) { display: flex; flex-direction: column; gap: 4px; }
html.touch #top-side:not(#_) { display: none !important; }
/* (The settings column sits right by the minimap, user 2026-11-18 "ชิดกว่านี้": the row moves 24 px closer, a 6 px gap.) */
@media (min-width: 701px) { html:not(.touch) #top-buttons:not(#_) { right: 238px; } }
/* The bottom-right menu in balanced rows (user 2026-11-18 "จัดดีหน่อยให้สมดุล", after settings and help moved up):
   6 over 5, centred, your own things on top (bag, status, skills, quests, map, auto), people and content below
   (friends, guild, book, ranking, dungeon). Narrower screens 4·4·3, then 3 a row, centred too. */
@media (min-width: 701px) {
  html:not(.touch) #hud #menu:not(#_) { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; width: calc(6 * 56px + 5 * 6px); }
  html:not(.touch) #menu .menu-btn:not(#_) { order: 2; }
  html:not(.touch) #menu :is([data-win="bag"], [data-win="stats"], [data-win="skills"], [data-win="quests"], [data-win="map"]):not(#_):not(#__) { order: 0; }
  html:not(.touch) #menu [data-win="auto"]:not(#_):not(#__) { order: 1; }
}
@media (min-width: 701px) and (max-width: 1300px) { html:not(.touch) #hud #menu:not(#_):not(#__) { width: calc(4 * 56px + 3 * 6px); } }
@media (min-width: 701px) and (max-width: 1100px) { html:not(.touch) #hud #menu:not(#_):not(#__):not(#___) { width: calc(3 * 56px + 2 * 6px); } }
/* The buff row (user 2026-11-18 "icon บางจางๆ 60%"): potions, skill buffs, the EXP card and premium sit faint under the
   portrait, light up under the mouse, and the tip says what each one is (ui renderBuffs / buffItems). Boss statuses stay loud. */
#hud #buffs:not(#_) { gap: 4px; align-items: flex-start; }
/* (No square frame, just the icon: user 2026-11-18.) */
#hud #buffs .buff:not(.debuff):not(#_) { width: 28px; height: 28px; opacity: 0.6; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; cursor: default; transition: opacity 0.15s, filter 0.15s; }
#hud #buffs .buff:not(.debuff):hover { opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 220, 140, 0.55)); }
#hud #buffs .buff:not(.debuff):not(#_) span { bottom: -3px; right: 1px; font: 600 9.5px/1 Kanit, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000; }
/* Premium: the gold card, a little wider than a square, the days in its corner. */
#hud #buffs .buff.prem:not(#_):not(#__) { width: 38px; }
#hud #buffs .buff.prem:not(#_):not(#__) span { color: #ffe08a; }
/* Avatar shop: a row to look at another class's outfits (user 2026-11-18); bought by a character of that class. */
#win-gems .av-clsbar:not(#_) { margin-top: -4px; align-items: center; }
#win-gems .av-clsbar em { font-style: normal; font-size: 12px; color: #cdb98a; margin-right: 4px; white-space: nowrap; }
#win-gems .av-clsbar button small { font-size: 10px; opacity: 0.75; }
#win-gems .av-none { grid-column: 1 / -1; padding: 40px 0; text-align: center; }

/* Avatar shop cards, premium (user 2026-11-19 "ทำหน้าพวกนี้ให้ดูดี พื้นหลังขายชุด ICON APEX, OMEGA น่าซื้อ"): a painted
   showroom behind each card (art/source/ui-shop-av-backdrops.png: a violet spotlight stage for APEX, a crimson-and-gold
   throne with a halo for OMEGA) fitted to the card's width so its stage lands under the figure's feet at any card
   width (stage at 0.973 W, feet at 0.95 W + 8), painted grade plates (ui-shop-av-kit.png), and a little life: the
   spotlight breathes, twinkles over APEX, turning gold rays behind the OMEGA halo and gold motes rising. */
#win-gems .av-card:is(.r-apex, .r-omega):not(#_):not(#__):not(#___):not(#____) { overflow: hidden; background-origin: border-box !important;
  background: url(assets/ui/shop-av-apex.webp) center 4px / 100% auto no-repeat border-box, linear-gradient(#2c174d, #1d0e34) border-box !important; }
#win-gems .av-card.r-omega:not(#_):not(#__):not(#___):not(#____) {
  background: url(assets/ui/shop-av-omega.webp) center 4px / 100% auto no-repeat border-box, linear-gradient(#3f0816, #2a040d) border-box !important; }
#win-gems .av-card:is(.r-apex, .r-omega) canvas:not(#_):not(#__) { position: relative; z-index: 1; background: none !important; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
#win-gems .av-card:is(.r-apex, .r-omega) > :is(b, i, .btn, .av-zoom) { position: relative; z-index: 2; }
#win-gems .av-card:is(.r-apex, .r-omega) > .av-zoom:not(#_):not(#__) { position: absolute; z-index: 3; }
#win-gems .av-card:is(.r-apex, .r-omega) b:not(#_):not(#__) { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6); }

/* The painted grade plates, the letters set on them. */
#win-gems .av-card .rarity-tag:is(.r-apex, .r-omega):not(#_):not(#__):not(#___) { z-index: 3; justify-content: center; width: 76px; height: 19px; padding: 0 0 0 9px; border-radius: 0;
  background: url(assets/ui/shop-av-tag-apex.png) center / 100% 100% no-repeat !important; box-shadow: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)) !important;
  color: #4a2400 !important; font: 900 11px/1 'IBM Plex Sans Thai', sans-serif !important; letter-spacing: 0.16em; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.75); }
#win-gems .av-card .rarity-tag.r-omega:not(#_):not(#__):not(#___) { top: -5px; left: -4px; width: 86px; height: 28px; padding: 7px 0 0;
  background-image: url(assets/ui/shop-av-tag-omega.png) !important; color: #fff6e0 !important; text-shadow: 0 1px 0 #5a0010, 0 0 6px rgba(255, 120, 140, 0.8); }
#win-gems .av-card .rarity-tag:is(.r-apex, .r-omega):not(#_):not(#__):not(#___)::before { display: none; }

/* The spotlight breathing on the stage (both), stars twinkling (APEX). */
#win-gems .av-card:is(.r-apex, .r-omega)::before { content: ''; position: absolute; z-index: 0; left: -20px; right: -20px; top: -20px; aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(ellipse 46% 30% at 50% 78%, rgba(255, 236, 190, 0.5), transparent 70%); mix-blend-mode: screen; animation: avc-breathe 3.2s ease-in-out infinite; }
#win-gems .av-card.r-apex::after { content: ''; position: absolute; z-index: 0; left: -20px; right: -20px; top: -20px; aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(1.6px 1.6px at 18% 22%, #fff, transparent), radial-gradient(1.4px 1.4px at 80% 16%, #ffe9b8, transparent), radial-gradient(1.2px 1.2px at 30% 44%, #e9d8ff, transparent),
    radial-gradient(1.6px 1.6px at 72% 40%, #fff, transparent), radial-gradient(1.2px 1.2px at 58% 10%, #e9d8ff, transparent);
  animation: avc-twinkle 2.6s ease-in-out infinite alternate; }
/* OMEGA: gold rays turning round the halo and gold motes rising through the light. */
#win-gems .av-card.r-omega::before { background: radial-gradient(ellipse 46% 30% at 50% 78%, rgba(255, 214, 140, 0.55), transparent 70%),
    repeating-conic-gradient(from 0deg at 50% 46%, rgba(255, 220, 140, 0) 0deg, rgba(255, 220, 140, 0.26) 3deg, rgba(255, 220, 140, 0) 7deg, rgba(255, 220, 140, 0) 20deg);
  -webkit-mask: radial-gradient(circle at 50% 46%, #000 0 12%, rgba(0, 0, 0, 0.4) 28%, transparent 46%); mask: radial-gradient(circle at 50% 46%, #000 0 12%, rgba(0, 0, 0, 0.4) 28%, transparent 46%);
  transform-origin: 50% 46%; animation: avc-turn 18s linear infinite; }
#win-gems .av-card.r-omega::after { content: ''; position: absolute; z-index: 0; left: -20px; right: -20px; top: -20px; aspect-ratio: 1; pointer-events: none;
  background-image: radial-gradient(1.8px 1.8px at 20% 80%, #ffe08a, transparent), radial-gradient(1.4px 1.4px at 74% 70%, #fff3c4, transparent), radial-gradient(1.6px 1.6px at 40% 92%, #ffd36a, transparent),
    radial-gradient(1.2px 1.2px at 86% 88%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 60%, #ffe08a, transparent);
  background-size: 100% 60%; mix-blend-mode: screen; animation: avc-rise 4.8s linear infinite; }
@keyframes avc-breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes avc-twinkle { 0% { opacity: 0.25; } 100% { opacity: 1; } }
@keyframes avc-turn { to { transform: rotate(360deg); } }
@keyframes avc-rise { 0% { background-position: 0 100%; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { background-position: 0 -60%; opacity: 0; } }
#win-gems .av-card:is(.r-apex, .r-omega):hover:not(#_):not(#__) { transform: translateY(-4px); }

/* =====================================================================================================================
   Today · วันนี้ (user 2026-11-19 "ทำ 1" + "เจน UI ประจำระบบ ทำให้สวยละเอียด"): the daily planner, built after the GPT
   mockup art/source/ui-today-mock.png. The same in every theme (kept out of the themes' window rules): the navy-gold
   frame with gem corners (c2-frame) and the compass crest, the running event's painting on top with its ribbon and
   clock, the checklist as gold-rimmed cards with painted icons in round wells (kit ui-today-kit.png → td-*.png), and
   the week's event calendar down the right.
   ===================================================================================================================== */
html #win-today.window:not(#_):not(#__) {
  width: min(1060px, 97vw); box-sizing: border-box; padding: 8px 18px 18px !important; overflow: visible !important; color: #eadfc4;
  border-style: solid !important; border-color: transparent !important; border-width: 60px 16px 18px !important; border-radius: 0 !important;
  border-image: url(assets/ui/c2-frame.png) 115 110 100 110 / 60px 56px 52px 56px / 0 stretch !important;
  background: radial-gradient(120% 70% at 50% 0%, #15284c 0%, #0c1630 50%, #070d1d 100%) padding-box !important;
  box-shadow: 0 34px 90px rgba(3, 7, 18, .72) !important; backdrop-filter: none !important; font-family: 'IBM Plex Sans Thai', Kanit, sans-serif; }
html #win-today.window:not(#_):not(#__)::before, html #win-today.window:not(#_):not(#__)::after { display: none !important; content: none !important; }
html #win-today:not(#_) > .panel-title {
  position: absolute; left: 0; right: 0; top: -51px; height: 52px; margin: 0; padding: 0 22px 0 26px; z-index: 3; border: 0; background: none;
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; color: #fbefd0; padding-left: 46px; padding-right: 40px; }
html #win-today:not(#_) > .panel-title::before { content: ''; position: absolute; left: 50%; top: -48px; width: 210px; height: 66px; transform: translateX(-50%); pointer-events: none;
  background: url(assets/ui/c2-crest.png) center / contain no-repeat; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
#win-today .td-emb .ci-icon { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
#win-today .td-title { font: 700 27px/1 'Noto Serif Thai', Georgia, serif; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff6d6 10%, #f2cd78 55%, #c8902f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45)); }
#win-today .td-date { font: 500 14px/1 'Noto Serif Thai', serif; color: #cdbf9c; padding-left: 12px; border-left: 1px solid rgba(232, 196, 116, .35); }
#win-today .td-reset { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 500 14px/1.1 'Noto Serif Thai', serif; color: #e9d9b0; padding-right: 8px; }
#win-today .td-reset .ci-icon { width: 28px; height: 28px; }
#win-today .td-reset b { font: 700 17px/1 'IBM Plex Sans Thai', sans-serif; color: #ffe39a; font-variant-numeric: tabular-nums; }
html #win-today:not(#_) > .panel-title .close { position: static; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #d9b25c; padding: 0;
  background: radial-gradient(circle at 35% 30%, #e8664a, #8e1e12); color: #fff3d8; font: 700 16px/1 sans-serif; box-shadow: 0 3px 8px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .35); }
html #win-today:not(#_) > .panel-title .close:hover { filter: brightness(1.15); }
html #win-today:not(#_) > .body.td { padding: 0; }

/* The running event: its painting, a dark wash under the ribbon at the left, the time left in a capsule at the right. */
#win-today .td-banner { position: relative; height: 132px; border-radius: 10px; overflow: hidden; background: var(--art) center 42% / cover, #10203e;
  border: 2px solid #d4ad5a; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 22px rgba(255, 196, 90, .28), inset 0 0 30px rgba(0, 0, 0, .35); }
#win-today .td-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 11, 26, .78), rgba(6, 11, 26, .35) 44%, transparent 68%); }
#win-today .td-banner::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 240, 200, .22) 48%, transparent 60%);
  background-size: 260% 100%; animation: td-sweep 5.5s ease-in-out infinite; }
@keyframes td-sweep { 0%, 55% { background-position: 130% 0; } 100% { background-position: -40% 0; } }
#win-today .td-banner.quiet::after { animation: none; }
#win-today .td-blabel { position: absolute; left: 14px; bottom: 14px; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 64%; }
#win-today .td-blabel small { font: 600 12.5px/1 'Noto Serif Thai', serif; letter-spacing: .08em; color: #ffd98a; text-shadow: 0 1px 3px #000; padding-left: 8px; }
#win-today .td-blabel b { display: block; font: 700 22px/1.15 'Noto Serif Thai', serif; color: #fff4d6; text-shadow: 0 2px 4px rgba(0, 0, 0, .7);
  border-style: solid; border-color: transparent; border-width: 12px 40px; border-image: url(assets/ui/td-label.png) 30 72 fill / 12px 40px stretch; margin: 0 -10px; padding: 1px 4px 2px; white-space: nowrap; }
#win-today .td-blabel span { font: 500 13.5px/1.2 'IBM Plex Sans Thai', sans-serif; color: #f1e6cc; text-shadow: 0 1px 3px #000; padding-left: 8px; }
#win-today .td-bpill { position: absolute; right: 16px; bottom: 16px; z-index: 1; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 26px;
  border-style: solid; border-color: transparent; border-width: 0; border-image: url(assets/ui/td-pill.png) 50 70 fill / 23px 33px stretch;
  font: 500 15px/1 'Noto Serif Thai', serif; color: #e8dcbc; text-shadow: 0 1px 2px #000; }
#win-today .td-bpill b { font: 700 21px/1 'IBM Plex Sans Thai', sans-serif; color: #fff1c4; font-variant-numeric: tabular-nums; }
#win-today .td-bmore { position: absolute; right: 14px; top: 12px; z-index: 1; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
#win-today .td-bmore span { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 999px; font: 500 12.5px/1 'IBM Plex Sans Thai', sans-serif; color: #f5ead0;
  background: rgba(8, 14, 30, .78); border: 1px solid rgba(230, 192, 110, .7); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
#win-today .td-bmore .ci-icon { width: 24px; height: 24px; }
#win-today .td-bmore b { color: #ffd98a; }

/* The two halves: the checklist and the calendar. */
#win-today .td-main { display: grid; grid-template-columns: 1fr 292px; gap: 16px; margin-top: 12px; }
#win-today .td-sec { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; height: 40px; width: fit-content; min-width: 230px; padding: 0 12px 0 0;
  border-style: solid; border-color: transparent; border-width: 13px 30px 13px 68px; border-image: url(assets/ui/td-ribbon.png) 26 60 26 135 fill / 13px 30px 13px 68px stretch;
  font: 600 17px/1 'Noto Serif Thai', serif; color: #fbefd0; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); box-sizing: border-box; }
#win-today .td-sec span { margin-left: -14px; }
#win-today .td-sec em { font: 500 12.5px/1 'IBM Plex Sans Thai', sans-serif; font-style: normal; color: #ffcf6e; margin-left: 4px; }
#win-today .td-sec em.ok { color: #8fe0a0; }
#win-today .td-list .td-grid + .td-sec { margin-top: 12px; }
#win-today .td-cal .td-sec { width: 100%; }
#win-today .td-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* A checklist card: the painted plate, the icon in its gold well, name, note and bar, the gold button or the seal. */
#win-today .td-card { position: relative; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 3px 4px 3px 0;
  border-style: solid; border-color: transparent; border-width: 8px 10px; border-image: url(assets/ui/td-card.png) 26 fill / 8px 10px stretch; transition: filter .15s; }
#win-today .td-card:hover { filter: brightness(1.12); }
#win-today .td-well { position: relative; flex: none; width: 54px; height: 54px; margin: -4px 0 -4px -4px; display: grid; place-items: center; background: url(assets/ui/td-well.png) center / contain no-repeat; }
#win-today .td-well .ci-icon { width: 38px; height: 38px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
#win-today .td-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#win-today .td-txt > b { font: 600 15px/1.15 'Noto Serif Thai', serif; color: #fbefd0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-today .td-txt > small { font: 500 12.5px/1.2 'IBM Plex Sans Thai', sans-serif; color: #b9b09a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-today .td-txt > small em { font-style: normal; color: #9ff0b4; font-weight: 600; }
#win-today .td-txt > small b { color: #ffe39a; font-variant-numeric: tabular-nums; }
#win-today .td-bar { display: block; position: relative; height: 9px; margin-top: 2px; border-style: solid; border-color: transparent; border-width: 0;
  border-image: url(assets/ui/td-track.png) 20 40 fill / 4.5px 9px stretch; }
#win-today .td-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-style: solid; border-color: transparent; border-width: 0;
  border-image: url(assets/ui/td-fill.png) 20 40 fill / 4.5px 9px stretch; filter: drop-shadow(0 0 4px rgba(255, 205, 90, .45)); }
#win-today .td-go { flex: none; height: 34px; min-width: 76px; padding: 0 14px; cursor: pointer; border-style: solid; border-color: transparent; border-width: 0;
  border-image: url(assets/ui/td-btn.png) 52 80 fill / 17px 26px stretch; background: none;
  font: 700 14px/1 'Noto Serif Thai', serif; color: #3d2507; text-shadow: 0 1px 0 rgba(255, 240, 200, .6); transition: filter .12s, transform .08s; }
#win-today .td-go:hover { filter: brightness(1.12) drop-shadow(0 0 6px rgba(255, 210, 110, .55)); }
#win-today .td-go:active { transform: translateY(1px); }
#win-today .td-seal { flex: none; width: 38px; height: 44px; margin-right: 6px; background: url(assets/ui/td-seal.png) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)); }
#win-today .td-card.done .td-well, #win-today .td-card.done .td-txt { opacity: .58; }
#win-today .td-card.done .td-txt > b { color: #d8ccaa; }
#win-today .td-card.lock { filter: saturate(.25) brightness(.8); }
#win-today .td-card.lock .td-well .ci-icon { filter: grayscale(1) brightness(.75); }
#win-today .td-lock { flex: none; padding: 4px 10px; margin-right: 4px; border-radius: 999px; font: 500 12px/1 'IBM Plex Sans Thai', sans-serif; color: #c8bfa8; border: 1px solid rgba(200, 180, 130, .35); background: rgba(0, 0, 0, .3); }
#win-today .td-card.ready, #win-today .td-card.live { animation: td-glow 2.2s ease-in-out infinite; }
#win-today .td-card.ready { --tg: rgba(120, 230, 150, .6); }
#win-today .td-card.live { --tg: rgba(255, 205, 100, .65); }
@keyframes td-glow { 0%, 100% { filter: drop-shadow(0 0 1px transparent); } 50% { filter: drop-shadow(0 0 7px var(--tg)); } }

/* The calendar: a tile per weekday (today's glowing), its events as coloured chips; the every-day one at the foot. */
#win-today .td-week { display: flex; flex-direction: column; gap: 5px; }
#win-today .td-day { display: grid; grid-template-columns: 42px 1fr; gap: 7px; align-items: center; min-height: 44px; }
#win-today .td-dname { display: grid; place-items: center; width: 42px; height: 42px; background: url(assets/ui/td-tile.png) center / 100% 100% no-repeat;
  font: 700 16px/1 'Noto Serif Thai', serif; color: #e9dcb8; text-shadow: 0 1px 2px #000; }
#win-today .td-day.today .td-dname { background-image: url(assets/ui/td-tile-on.png); color: #ffe7a8; transform: scale(1.06); }
#win-today .td-day.today .td-chips { filter: drop-shadow(0 0 6px rgba(255, 210, 110, .35)); }
#win-today .td-chips { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#win-today .td-none { color: #6f6a5c; font-size: 13px; padding-left: 6px; }
#win-today .td-chip, #win-today .td-every { --c1: #1d2b4a; --c2: #101a30; --ce: #8fa6d8; display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 3px 10px 3px 4px; border-radius: 9px;
  background: linear-gradient(90deg, var(--c1), var(--c2)); border: 1.5px solid var(--ce); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 6px rgba(0, 0, 0, .35); min-width: 0; }
#win-today .td-chip .ci-icon, #win-today .td-every .ci-icon { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
#win-today .td-chip > span, #win-today .td-every > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#win-today .td-chip b, #win-today .td-every b { font: 600 13.5px/1.15 'Noto Serif Thai', serif; color: #fff4dc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
#win-today .td-chip small, #win-today .td-every small { font: 500 11.5px/1.15 'IBM Plex Sans Thai', sans-serif; color: rgba(255, 240, 210, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-today .td-every { margin-top: 8px; min-height: 48px; }
#win-today .t-gold { --c1: #7a5512; --c2: #3a280a; --ce: #f0c766; }
#win-today .t-blue { --c1: #1e4590; --c2: #0f2251; --ce: #7fa8ff; }
#win-today .t-amber { --c1: #8a5a10; --c2: #432907; --ce: #ffc65a; }
#win-today .t-green { --c1: #23663b; --c2: #10321d; --ce: #86dc96; }
#win-today .t-red { --c1: #84202a; --c2: #3e0c12; --ce: #ff8170; }
#win-today .t-ember { --c1: #8a3b12; --c2: #401a08; --ce: #ffa058; }
#win-today .t-violet { --c1: #4a3290; --c2: #221545; --ce: #b29aff; }
#win-today .td-chip.on, #win-today .td-every.on { animation: td-on 1.8s ease-in-out infinite; }
@keyframes td-on { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 4px var(--ce); } 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 14px var(--ce); } }
#win-today .td-chip.on::after, #win-today .td-every.on::after { content: 'ตอนนี้'; margin-left: auto; flex: none; padding: 3px 7px; border-radius: 999px; font: 700 10.5px/1 'IBM Plex Sans Thai', sans-serif; color: #2a1a04; background: linear-gradient(#ffe9a8, #e8b84e); }

/* The HUD's chip for a running event (under the top buttons): click opens Today. */
#ev-chip { position: absolute; top: 62px; right: 62px; z-index: 6; display: flex; align-items: center; gap: 8px; max-width: 340px; padding: 4px 12px 4px 5px; cursor: pointer;
  --ce: #f0c766; --c1: rgba(70, 48, 12, .88); border-radius: 999px; border: 1.5px solid var(--ce); background: linear-gradient(90deg, var(--c1), rgba(10, 14, 28, .86));
  color: #fff3d8; text-align: left; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); animation: evc-glow 2.4s ease-in-out infinite; font-family: 'IBM Plex Sans Thai', sans-serif; }
#ev-chip[hidden] { display: none; }
#ev-chip .ci-icon { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
#ev-chip > span { display: flex; flex-direction: column; min-width: 0; }
#ev-chip b { font: 600 13.5px/1.15 'Noto Serif Thai', serif; white-space: nowrap; }
#ev-chip small { font-size: 11.5px; color: rgba(255, 240, 210, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ev-chip em { font-style: normal; font: 700 13px/1 'IBM Plex Sans Thai', sans-serif; color: #ffe39a; padding-left: 8px; border-left: 1px solid rgba(255, 220, 150, .3); font-variant-numeric: tabular-nums; white-space: nowrap; }
#ev-chip .ev-more { font-style: normal; font: 700 11px/1 sans-serif; color: #2a1a04; background: #f0c766; border-radius: 999px; padding: 3px 6px; }
#ev-chip:hover { filter: brightness(1.12); }
#ev-chip.t-blue { --ce: #7fa8ff; --c1: rgba(20, 44, 100, .88); } #ev-chip.t-amber { --ce: #ffc65a; --c1: rgba(90, 58, 10, .88); } #ev-chip.t-green { --ce: #86dc96; --c1: rgba(22, 74, 40, .88); }
#ev-chip.t-red { --ce: #ff8170; --c1: rgba(96, 22, 28, .88); } #ev-chip.t-ember { --ce: #ffa058; --c1: rgba(100, 42, 12, .88); } #ev-chip.t-violet { --ce: #b29aff; --c1: rgba(56, 36, 110, .88); }
@keyframes evc-glow { 0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, .4), 0 0 3px var(--ce); } 50% { box-shadow: 0 3px 10px rgba(0, 0, 0, .4), 0 0 13px var(--ce); } }
/* A narrow screen (a phone, a small window): the calendar goes under the checklist, its days two to a row. */
@media (max-width: 1080px) { #win-today .td-main { grid-template-columns: 1fr; } #win-today .td-week { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; } }
html.touch #win-today .td-main { grid-template-columns: 1fr !important; }
html.touch #win-today .td-week { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
html.touch #win-today .td-date { display: none; }
html.touch #ev-chip { display: none !important; }
/* Today, fixed (user 2026-11-19 "เส้นบัคไปหมด ตัวหนังสือไม่ตรง"): placed on whole pixels and shrunk to the screen like
   every other window (it had been left out, so it sat on half pixels, showing the painted slices' joins, and ran past
   the bottom of the screen with the frame's edge cutting through the cards); the gold button one picture at its own
   shape (sliced, its light top and darker bottom met in a hard line); the bars drawn (the painted track thinned to a
   stray hairline when empty); every card the same height, its text centred. */
html:not(.touch) #win-today.window:not(#_):not(#__) { max-height: none !important; transform: none !important; right: auto !important; bottom: auto !important; margin: 0 !important;
  left: var(--wx, 0) !important; top: var(--wy, 0) !important; height: fit-content !important; zoom: var(--fit, 1); width: 1060px; }
#win-today .td-banner { height: 128px; }
#win-today .td-main { margin-top: 10px; }
#win-today .td-grid { gap: 6px 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#win-today .td-main { grid-template-columns: minmax(0, 1fr) 292px; }
#win-today .td-card { min-height: 52px; height: 68px; box-sizing: border-box; padding: 0 4px 0 0; }
#win-today .td-well { width: 50px; height: 50px; margin: 0 0 0 -4px; }
#win-today .td-well .ci-icon { width: 34px; height: 34px; }
#win-today .td-txt { justify-content: center; gap: 2px; }
#win-today .td-txt > b { font-size: 14.5px; line-height: 1.25; }
#win-today .td-txt > small { line-height: 1.3; }
#win-today .td-bar { height: 6px; margin-top: 3px; max-width: 190px; border: 1px solid rgba(232, 196, 116, .38); border-image: none; border-radius: 4px; background: #060c1a; box-sizing: border-box; overflow: hidden; }
#win-today .td-bar > i { top: 0; bottom: 0; border: 0; border-image: none; border-radius: 3px; background: linear-gradient(90deg, #b9832a, #ffd66e); filter: none; box-shadow: 0 0 6px rgba(255, 205, 90, .5); }
#win-today .td-go { display: inline-grid; place-items: center; width: 92px; min-width: 0; height: 30px; padding: 0 0 2px; border: 0; border-image: none;
  background: url(assets/ui/td-btn.png) center / 100% 100% no-repeat; font-size: 13.5px; line-height: 1; white-space: nowrap; }
#win-today .td-seal { width: 34px; height: 40px; margin-right: 10px; }
/* (The title row in the frame's navy band, 17–55 px from the top: user 2026-11-19 "ตัวหนังสือไม่ตรงกลาง ล้ำเส้น"; the tone
   mark on นี้ had run over the band's top edge. Measured with the ink, not the box: Thai sits low in its line box.) */
html #win-today:not(#_) .td-title { font-size: 24px; position: relative; top: 1px; }
#win-today .td-lock { margin-right: 8px; }
#win-today .td-sec { height: 38px; margin-bottom: 6px; }
#win-today .td-list .td-grid + .td-sec { margin-top: 10px; }
/* (A desktop screen under 1080 px keeps the calendar beside the list and lets the window shrink to fit; under each other
   it ran twice as tall. Phones still stack, html.touch above.) */
@media (max-width: 1080px) { html:not(.touch) #win-today .td-main { grid-template-columns: minmax(0, 1fr) 292px; } html:not(.touch) #win-today .td-week { display: flex; } }

@media (max-width: 700px) { #ev-chip { display: none !important; } }
.fg-was { font-weight: 500; font-size: .8em; color: #9a9080; margin-left: 4px; text-decoration: line-through; }

/* Server-wide news (user 2026-11-19 "ทำ 2"): the royal banner (hd-banner.png, its medallion socket and text plate
   measured off the art: socket centre 20.1% / 64.8%, plate 28.8–86.1% × 45.2–84.3%) slides down, a shine sweeps it. */
#herald { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); width: min(600px, 80vw); z-index: 40; pointer-events: none; }
#herald .hd-card { position: relative; width: 100%; aspect-ratio: 1494 / 383; background: url(assets/ui/hd-banner.png) center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); animation: hd-in .7s cubic-bezier(.2, 1.35, .45, 1) both; }
#herald .hd-card.out { animation: hd-out .55s ease-in forwards; }
@keyframes hd-in { 0% { opacity: 0; transform: translateY(-40px) scale(.86); } 100% { opacity: 1; transform: none; } }
@keyframes hd-out { to { opacity: 0; transform: translateY(-26px) scale(.94); } }
#herald .hd-medal { position: absolute; left: 20.1%; top: 64.8%; width: 14.2%; transform: translate(-50%, -50%); animation: hd-medal 1s cubic-bezier(.2, 1.5, .4, 1) .25s both;
  filter: drop-shadow(0 0 10px var(--hg, rgba(255, 200, 90, .7))); }
@keyframes hd-medal { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-30deg); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; } }
#herald .hd-text { position: absolute; left: 29.6%; right: 14.6%; top: 45.2%; bottom: 15.7%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; text-align: center; padding: 0 4px; }
#herald .hd-text small { font: 700 12px/1 'Noto Serif Thai', serif; letter-spacing: .08em; background: linear-gradient(180deg, #fff2c2, #e8b34e); -webkit-background-clip: text; background-clip: text; color: transparent; }
#herald .hd-text span { font: 500 13px/1.25 'IBM Plex Sans Thai', sans-serif; color: #f4ead2; text-shadow: 0 1px 2px #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#herald .hd-who { color: #ffe39a; font-weight: 700; }
.hd-gold { color: #ffd76a; font-weight: 700; }
.hd-plus { color: #ffe39a; font-weight: 800; text-shadow: 0 0 8px rgba(255, 200, 80, .8); }
.hd-item { font-weight: 700; color: #ffd76a; } .hd-item.r-omega { color: #ff7a5c; text-shadow: 0 0 8px rgba(255, 90, 60, .5); } .hd-item.r-apex { color: #ffb24a; } .hd-item.r-nova { color: #7fc4ff; }
#herald .hd-shine { position: absolute; inset: 0; pointer-events: none; -webkit-mask: url(assets/ui/hd-banner.png) center / 100% 100% no-repeat; mask: url(assets/ui/hd-banner.png) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 246, 214, .55) 48%, transparent 58%); background-size: 300% 100%; animation: hd-shine 1.6s ease-out .45s both; mix-blend-mode: screen; }
@keyframes hd-shine { 0% { background-position: 120% 0; } 100% { background-position: -30% 0; } }
#herald .k-omega { --hg: rgba(255, 80, 60, .85); } #herald .k-class { --hg: rgba(120, 170, 255, .8); } #herald .k-tower { --hg: rgba(150, 190, 255, .8); } #herald .k-mvp { --hg: rgba(255, 90, 70, .8); }
html.touch #herald { top: 64px; width: min(560px, 80vw); }
.chat-herald { color: #f4e2b0; } .chat-herald .hd-who { color: #ffe39a; font-weight: 700; }

/* Emotes (user 2026-11-19 "ทำ 5"): the face button by the chat box, the 4×4 panel of bubbles above it. */
#chat-form #emote-btn { flex: none; width: 32px; height: 32px; padding: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  border: 1px solid rgba(232, 196, 116, .6); background: radial-gradient(circle at 40% 30%, rgba(255, 220, 140, .18), rgba(10, 14, 28, .6)); }
#chat-form #emote-btn svg { width: 20px; height: 20px; fill: none; stroke: #f0cf86; stroke-width: 1.7; }
#chat-form #emote-btn:hover { border-color: #f0cf86; filter: brightness(1.2); }
#emote-panel { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; width: 488px; max-width: calc(100vw - 24px); padding: 10px 10px 12px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 30, 56, .96), rgba(9, 14, 28, .97)); border: 1.5px solid #c9a24e; box-shadow: 0 12px 30px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08); }
#emote-panel[hidden] { display: none; }
#emote-panel .em-head { display: flex; align-items: baseline; gap: 8px; font: 600 15px/1 'Noto Serif Thai', serif; color: #fbefd0; margin: 0 2px 8px; }
#emote-panel .em-head small { font: 400 11.5px/1 'IBM Plex Sans Thai', sans-serif; color: #a59c88; }
#emote-panel .em-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
#emote-panel button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 5px; cursor: pointer; border-radius: 9px;
  border: 1px solid rgba(232, 196, 116, .22); background: rgba(255, 255, 255, .03); transition: transform .1s, background .12s, border-color .12s; }
#emote-panel button:hover { background: rgba(255, 215, 130, .12); border-color: rgba(240, 207, 134, .8); transform: translateY(-2px); }
#emote-panel canvas { width: 42px; height: 42px; }
#emote-panel small { font: 500 10.5px/1.1 'IBM Plex Sans Thai', sans-serif; color: #d8ccaf; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================================================================
   The special dungeons (user 2026-11-19): the dungeon window's "ดันพิเศษ" tab (two painted cards, the picked one's
   rooms, medals/grades, pay and the way in), a festival game's opening card, the tracker's points and lantern, the
   victory screen's medal and escape. Every picture is the dungeons' own (dg-banner-lantern/starship, the icon sheet).
   ===================================================================================================================== */
#win-dungeon .sp-main { display: grid; grid-template-columns: 250px 1fr; gap: 14px; margin-top: 10px; }
#win-dungeon .sp-list { display: flex; flex-direction: column; gap: 10px; }
#win-dungeon .sp-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 3px; height: 150px; padding: 12px 14px; cursor: pointer; text-align: left;
  border-radius: 12px; border: 2px solid rgba(232, 196, 116, .45); background: linear-gradient(180deg, rgba(5, 8, 20, .05) 30%, rgba(5, 8, 20, .88)), var(--bn) center / cover; color: #fff4dc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45); transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
#win-dungeon .sp-card:hover { transform: translateY(-2px); border-color: #f0cf86; }
#win-dungeon .sp-card.on { border-color: #ffd98a; box-shadow: 0 0 0 2px rgba(255, 217, 138, .35), 0 0 22px rgba(255, 200, 100, .45); }
#win-dungeon .sp-card.m-escape.on { border-color: #8ae8ff; box-shadow: 0 0 0 2px rgba(138, 232, 255, .35), 0 0 22px rgba(90, 232, 255, .45); }
#win-dungeon .sp-card b { font: 700 19px/1.1 'Noto Serif Thai', serif; text-shadow: 0 2px 4px #000; }
#win-dungeon .sp-card small { font: 500 12.5px/1 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; text-shadow: 0 1px 2px #000; }
#win-dungeon .sp-tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font: 700 11.5px/1 'IBM Plex Sans Thai', sans-serif; color: #2a1804; background: linear-gradient(#ffe7a0, #e8b84e); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
#win-dungeon .m-escape .sp-tag, #win-dungeon .sp-detail.m-escape .sp-tag { color: #04202a; background: linear-gradient(#c8f6ff, #5ad0ee); }
#win-dungeon .sp-detail { position: relative; border-radius: 14px; padding: 14px 16px 14px; overflow: hidden; color: #f0e6cc;
  background: linear-gradient(180deg, rgba(8, 12, 26, .55), rgba(8, 12, 26, .96) 150px), var(--bn) center top / 100% auto no-repeat, #0a1020; border: 1.5px solid rgba(232, 196, 116, .45); }
#win-dungeon .sp-detail.m-escape { border-color: rgba(120, 220, 255, .45); }
#win-dungeon .sp-head { display: flex; gap: 14px; align-items: flex-end; }
#win-dungeon .sp-portrait canvas { width: 110px; height: 110px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
#win-dungeon .sp-id b { display: block; font: 700 26px/1.15 'Noto Serif Thai', serif; color: #fff4dc; text-shadow: 0 2px 6px #000; margin: 6px 0 4px; }
#win-dungeon .sp-id p { margin: 0; font: 500 13.5px/1.4 'IBM Plex Sans Thai', sans-serif; color: #e8dcc0; text-shadow: 0 1px 3px #000; }
#win-dungeon .sp-steps { list-style: none; margin: 12px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
#win-dungeon .sp-steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 8px 6px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(232, 196, 116, .25); position: relative; }
#win-dungeon .sp-steps li + li::before { content: '›'; position: absolute; left: -7px; top: 34%; color: #f0cf86; font: 700 16px/1 sans-serif; }
#win-dungeon .sp-steps canvas { width: 44px; height: 44px; }
#win-dungeon .sp-steps b { font: 600 12.5px/1.2 'Noto Serif Thai', serif; color: #fff1d0; }
#win-dungeon .sp-steps small { font: 400 11px/1.3 'IBM Plex Sans Thai', sans-serif; color: #b8ae96; }
#win-dungeon .sp-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; }
#win-dungeon .sp-label { display: block; font: 600 13px/1 'Noto Serif Thai', serif; color: #ffd98a; margin: 0 0 7px; letter-spacing: .03em; }
#win-dungeon .sp-medals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#win-dungeon .sp-medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 7px 4px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
#win-dungeon .sp-medal canvas { width: 48px; height: 48px; }
#win-dungeon .sp-medal b { font: 700 13px/1.1 'Noto Serif Thai', serif; }
#win-dungeon .sp-medal small { font: 500 11px/1 'IBM Plex Sans Thai', sans-serif; color: #b8ae96; }
#win-dungeon .sp-medal em { font-style: normal; display: flex; align-items: center; gap: 2px; font: 600 11.5px/1 'IBM Plex Sans Thai', sans-serif; color: #fff1c4; }
#win-dungeon .sp-medal em canvas { width: 16px; height: 16px; }
#win-dungeon .sp-medal i { font-style: normal; font: 600 10.5px/1.2 'IBM Plex Sans Thai', sans-serif; color: #ffb6f0; }
#win-dungeon .sp-medal.m-bronze b { color: #e8a878; } #win-dungeon .sp-medal.m-silver b { color: #e6eef6; } #win-dungeon .sp-medal.m-gold b { color: #ffd76a; }
#win-dungeon .sp-medal.m-rainbow { border-color: rgba(255, 200, 240, .55); background: linear-gradient(135deg, rgba(255, 110, 110, .14), rgba(255, 220, 110, .14), rgba(110, 230, 160, .14), rgba(110, 170, 255, .14), rgba(200, 120, 255, .14)); }
#win-dungeon .sp-medal.m-rainbow b { background: linear-gradient(90deg, #ff8a8a, #ffd76a, #8af0b0, #8ac8ff, #d8a0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
#win-dungeon .sp-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#win-dungeon .sp-grade { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
#win-dungeon .sp-grade b { font: 800 24px/1 'Noto Serif Thai', serif; } #win-dungeon .sp-grade.g-S b { color: #ffd76a; } #win-dungeon .sp-grade.g-A b { color: #e6eef6; } #win-dungeon .sp-grade.g-B b { color: #e8a878; }
#win-dungeon .sp-grade small { font: 500 11px/1.2 'IBM Plex Sans Thai', sans-serif; color: #b8ae96; text-align: center; }
#win-dungeon .sp-grade em { font-style: normal; display: flex; align-items: center; gap: 2px; font: 600 12px/1 'IBM Plex Sans Thai', sans-serif; color: #fff1c4; } #win-dungeon .sp-grade em canvas { width: 16px; height: 16px; }
#win-dungeon .sp-escape { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: linear-gradient(90deg, rgba(90, 232, 255, .16), rgba(160, 120, 255, .12)); border: 1px solid rgba(138, 232, 255, .45); }
#win-dungeon .sp-escape canvas { width: 44px; height: 44px; } #win-dungeon .sp-escape b { display: block; font: 700 13.5px/1.2 'Noto Serif Thai', serif; color: #c8f6ff; }
#win-dungeon .sp-escape small { font: 500 11.5px/1.3 'IBM Plex Sans Thai', sans-serif; color: #c8d8e0; }
#win-dungeon .sp-loot { display: flex; gap: 6px; flex-wrap: wrap; }
#win-dungeon .sp-slot { width: 82px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); text-align: center; }
#win-dungeon .sp-slot canvas { width: 48px; height: 48px; } #win-dungeon .sp-slot small { font: 500 10.5px/1.2 'IBM Plex Sans Thai', sans-serif; color: #d8ccb0; }
#win-dungeon .sp-slot.hero { border-color: rgba(255, 217, 138, .6); background: radial-gradient(circle at 50% 35%, rgba(255, 210, 120, .22), rgba(255, 255, 255, .04)); }
#win-dungeon .sp-slot.super { border-color: rgba(255, 180, 240, .65); background: radial-gradient(circle at 50% 35%, rgba(255, 150, 230, .2), rgba(255, 255, 255, .04)); animation: sp-super 2.4s ease-in-out infinite; }
@keyframes sp-super { 50% { box-shadow: 0 0 14px rgba(255, 170, 240, .55); } }
#win-dungeon .sp-runs { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 8px; font: 500 12px/1.3 'IBM Plex Sans Thai', sans-serif; color: #c8bea4; }
#win-dungeon .sp-buy { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; border: 1px solid rgba(232, 196, 116, .55); background: rgba(0, 0, 0, .35); color: #fff1c4; font: 600 12.5px/1 'IBM Plex Sans Thai', sans-serif; }
#win-dungeon .sp-buy canvas { width: 30px; height: 30px; } #win-dungeon .sp-buy:disabled { opacity: .45; cursor: default; }
#win-dungeon .sp-gocol { display: flex; flex-direction: column; gap: 5px; }
#win-dungeon .sp-go { height: 48px; border-radius: 12px; cursor: pointer; border: 2px solid #f6d27a; background: linear-gradient(180deg, #ffe596, #e0a73a 60%, #b57a1e); color: #3a2205;
  font: 800 17px/1 'Noto Serif Thai', serif; text-shadow: 0 1px 0 rgba(255, 240, 200, .6); box-shadow: 0 4px 12px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .6); transition: filter .12s, transform .08s; }
#win-dungeon .sp-detail.m-escape .sp-go { border-color: #a8f0ff; background: linear-gradient(180deg, #c8f6ff, #4ec4e8 60%, #2a7aa8); color: #04202a; }
#win-dungeon .sp-go:hover:not(:disabled) { filter: brightness(1.1); } #win-dungeon .sp-go:active:not(:disabled) { transform: translateY(1px); }
#win-dungeon .sp-go:disabled { filter: grayscale(.7) brightness(.7); cursor: default; } #win-dungeon .sp-go.leave { background: linear-gradient(#e86a5a, #a82a1e); color: #fff1e8; border-color: #ff9a8a; }
#win-dungeon .sp-gocol small { font: 400 11.5px/1.3 'IBM Plex Sans Thai', sans-serif; }
/* (Fitted to the window, 2026-11-19: a step's title over its line, the line at most three rows (all of it on hover);
   the medals as a 2×2 of small cards, the medal by its numbers.) */
#win-dungeon .sp-steps li > span { display: flex; flex-direction: column; gap: 3px; }
#win-dungeon .sp-steps small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#win-dungeon .sp-medals { grid-template-columns: repeat(2, 1fr); }
#win-dungeon .sp-medal { display: grid; grid-template-columns: 40px 1fr; column-gap: 8px; row-gap: 2px; text-align: left; align-items: center; justify-items: start; padding: 6px 8px; }
#win-dungeon .sp-medal > canvas { grid-row: 1 / span 3; width: 40px; height: 40px; }
#win-dungeon .sp-medal i { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
#win-dungeon .sp-loot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
#win-dungeon .sp-slot { width: auto; padding: 5px 3px; } #win-dungeon .sp-slot canvas { width: 40px; height: 40px; }

/* A festival game's opening card, then 3-2-1 and go. */
#dg-game { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(20, 8, 4, .55), rgba(0, 0, 0, 0) 60%); animation: dgg-fade 3.6s ease forwards; }
#dg-game .dgg-in { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 46px 20px; border-radius: 18px; text-align: center; min-width: 360px;
  background: radial-gradient(circle at 50% 0%, rgba(120, 40, 14, .95), rgba(40, 10, 6, .95)); border: 2px solid #f0c766; box-shadow: 0 0 40px rgba(255, 180, 80, .45), 0 16px 40px rgba(0, 0, 0, .6); animation: dgg-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
#dg-game canvas { width: 76px; height: 76px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
#dg-game small { font: 600 14px/1 'Noto Serif Thai', serif; letter-spacing: .1em; color: #ffd98a; }
#dg-game b { font: 800 34px/1.1 'Noto Serif Thai', serif; color: #fff4dc; text-shadow: 0 3px 8px rgba(0, 0, 0, .7); }
#dg-game p { margin: 0; max-width: 420px; font: 500 15px/1.4 'IBM Plex Sans Thai', sans-serif; color: #f4e6c8; }
#dg-game .dgg-count { font-style: normal; font: 900 54px/1 'Noto Serif Thai', serif; color: #ffe27a; text-shadow: 0 0 18px rgba(255, 200, 80, .8), 0 4px 0 #6a2a08; margin-top: 4px; }
#dg-game .dgg-count.go { color: #9dffb8; text-shadow: 0 0 18px rgba(120, 255, 170, .8), 0 4px 0 #0a4a20; animation: dgg-go .5s ease both; }
@keyframes dgg-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dgg-go { from { transform: scale(1.8); } to { transform: none; } }
@keyframes dgg-fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* The tracker in a special run: points, the lantern so far, how far to the next. */
.sp-track { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; margin: 5px 0 3px; }
.sp-track .sp-score { font: 600 12.5px/1 'IBM Plex Sans Thai', sans-serif; color: #f0e6cc; } .sp-track .sp-score b { font: 800 18px/1 'Noto Serif Thai', serif; color: #ffe27a; }
.sp-track .sp-lamp { justify-self: end; padding: 2px 8px; border-radius: 999px; font: 700 11px/1.3 'IBM Plex Sans Thai', sans-serif; color: #2a1804; background: #e8a878; }
.sp-track .sp-lamp.m-silver { background: #dde6ef; } .sp-track .sp-lamp.m-gold { background: linear-gradient(#ffe7a0, #e8b84e); }
.sp-track .sp-lamp.m-rainbow { background: linear-gradient(90deg, #ff8a8a, #ffd76a, #8af0b0, #8ac8ff, #d8a0ff); }
.sp-track .sp-bar { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.sp-track .sp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb04a, #ffe27a); box-shadow: 0 0 6px rgba(255, 210, 100, .6); }
.sp-track small { grid-column: 1 / -1; font: 400 11px/1.2 'IBM Plex Sans Thai', sans-serif; color: #c8bea4; }
.quest-prog.sp-alarm { color: #ff9ad8 !important; animation: sp-alarm .8s ease-in-out infinite; } @keyframes sp-alarm { 50% { color: #ffffff; } }

/* The victory screen: the festival's lantern medal, the vessel's escape, a new title. */
#dg-victory .dgv-medal { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#dg-victory .dgv-medal canvas { width: 86px; height: 86px; filter: drop-shadow(0 0 12px rgba(255, 210, 120, .6)); animation: dgv-medal 1s cubic-bezier(.2, 1.5, .4, 1) .5s both; }
#dg-victory .dgv-medal b { font: 800 20px/1.1 'Noto Serif Thai', serif; color: #ffd76a; } #dg-victory .dgv-medal.m-rainbow b { background: linear-gradient(90deg, #ff8a8a, #ffd76a, #8af0b0, #8ac8ff, #d8a0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
#dg-victory .dgv-medal small { font: 600 13px/1 'IBM Plex Sans Thai', sans-serif; color: #f0e6cc; }
@keyframes dgv-medal { from { transform: scale(.2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
#dg-victory .dgv-escape { padding: 6px 14px; border-radius: 999px; font: 800 15px/1 'Noto Serif Thai', serif; color: #ffd0d0; background: rgba(120, 20, 30, .6); border: 1px solid #ff8a8a; }
#dg-victory .dgv-escape.ok { color: #c8fff0; background: rgba(20, 90, 100, .6); border-color: #8af0ff; }
#dg-victory .dgv-title { font: 700 13.5px/1.2 'Noto Serif Thai', serif; color: #ffb6f0; text-shadow: 0 0 8px rgba(255, 150, 230, .6); }
#dg-victory .dgv-slot.escape { border-color: rgba(138, 232, 255, .7); }
/* The dungeon window fitted to the screen like the others (playtest 2026-11-19: centred a little high at its full height it
   started above the top of a 905 px screen and its foot was clipped; a 768 px laptop would lose much more). */
html:not(.touch) #win-dungeon.window:not(#_):not(#__) { max-height: none !important; transform: none !important; right: auto !important; bottom: auto !important; margin: 0 !important;
  left: var(--wx, 0) !important; top: var(--wy, 0) !important; height: fit-content !important; zoom: var(--fit, 1); width: 920px; }
