/* Infinity Ragnar Online — UI theme: carved dark wood panels, gold trim, parchment text.
   Works in portrait and landscape on phones, tablets and desktops. */
:root {
  --wood-0: #140d07; --wood-1: #22170d; --wood-2: #2f2114; --wood-3: #3d2b1a;
  --gold-1: #8a6324; --gold-2: #c99a3b; --gold-3: #f0cf72; --gold-4: #fff0b8;
  --ink: #f4e6c4; --ink-dim: #b8a27a; --ink-mute: #8a7655;
  --hp: #e8404f; --sp: #3f8ff0; --jexp: #8f63e8; --bexp: #2bb5a0;
  --good: #6fdc7e; --bad: #ff6464; --warn: #ffb347;
  --r-common: #e9e4d6; --r-good: #6fdc7e; --r-rare: #5ab0ff; --r-epic: #b27cff; --r-legend: #ff9a3c; --r-divine: #ff4d5e;
  --f-ui: "Kanit", "Noto Sans Thai", "Noto Sans Lao", "Noto Sans Myanmar", "Noto Sans SC", "Noto Sans KR", "Noto Sans JP", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --shade: rgba(0, 0, 0, .32); --shade2: rgba(0, 0, 0, .45);
  --screen-bg: radial-gradient(ellipse at 50% 0%, rgba(240, 207, 114, .16), transparent 60%), radial-gradient(ellipse at 50% 120%, rgba(43, 181, 160, .14), transparent 55%), linear-gradient(#1f150c, #120b06);
  --title-bg: linear-gradient(#3a2a19, #1b120a);
  --btn-bg: linear-gradient(#4a3520, #2b1d10); --btn-ink: var(--gold-4);
  color-scheme: dark;
}
/* Day mode (default): parchment panels with gold trim. Night mode: carved dark wood. */
:root[data-theme="light"] {
  --wood-0: #ecdcb8; --wood-1: #f6ead0; --wood-2: #fff7e6; --wood-3: #f1e1bf;
  --gold-1: #c7a159; --gold-2: #c08f2e; --gold-3: #8f5f0e; --gold-4: #6e4508;
  --ink: #3b2a17; --ink-dim: #725a3c; --ink-mute: #9a8566;
  --shade: rgba(140, 95, 30, .09); --shade2: rgba(140, 95, 30, .16);
  --screen-bg: radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, .9), transparent 60%), radial-gradient(ellipse at 50% 120%, rgba(120, 190, 110, .35), transparent 60%), linear-gradient(#f9eed6, #e6d2a8);
  --title-bg: linear-gradient(#fff8e8, #f0dcb0);
  --btn-bg: linear-gradient(#fff8ea, #ecd9b2); --btn-ink: #5a3a0a;
  color-scheme: light;
}
/* The in-game HUD floats over the world, so it always keeps the dark wood look. */
#hud {
  --wood-0: #140d07; --wood-1: #22170d; --wood-2: #2f2114; --wood-3: #3d2b1a;
  --gold-1: #8a6324; --gold-2: #c99a3b; --gold-3: #f0cf72; --gold-4: #fff0b8;
  --ink: #f4e6c4; --ink-dim: #b8a27a; --ink-mute: #8a7655; --shade: rgba(0, 0, 0, .32); --shade2: rgba(0, 0, 0, .45);
  --btn-bg: linear-gradient(#4a3520, #2b1d10); --btn-ink: #fff0b8;
  color: var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--wood-0); color: var(--ink); font-family: var(--f-ui); font-size: 15px; }
body { touch-action: manipulation; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold-3); outline-offset: 2px; }
[hidden] { display: none !important; }
#app, .screen { position: fixed; inset: 0; }
.screen { overflow: hidden; }
.center { display: grid; place-items: center; padding: 16px; }

/* ---------- backgrounds ---------- */
#scr-loading, #scr-login, #scr-select, #scr-create { background: var(--screen-bg); }
body { background: var(--wood-0); }
.logo { font-weight: 700; font-size: clamp(38px, 10vw, 64px); line-height: .95; text-align: center; letter-spacing: .04em;
  background: linear-gradient(#fff6cf, #f0cf72 45%, #b37a24); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #3a230c) drop-shadow(0 8px 24px rgba(240, 207, 114, .35)); }
.logo small { display: block; font-size: .38em; letter-spacing: .5em; margin-top: 8px; }
.logo .sub { display: block; font-size: .24em; letter-spacing: .05em; margin-top: 10px; color: var(--ink-dim); -webkit-text-fill-color: var(--ink-dim); filter: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--gold-1); border-top-color: var(--gold-3); animation: spin 1s linear infinite; margin-top: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- panels (carved frame) ---------- */
.panel { position: relative; background: linear-gradient(180deg, var(--wood-2), var(--wood-1)); border: 2px solid var(--gold-2); border-radius: 14px;
  box-shadow: inset 0 0 0 3px var(--wood-0), inset 0 0 0 4px rgba(240, 207, 114, .35), 0 12px 40px rgba(0, 0, 0, .55); }
.panel::before, .panel::after { content: ""; position: absolute; width: 18px; height: 18px; border: 3px solid var(--gold-3); pointer-events: none; }
.panel::before { left: -4px; top: -4px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.panel::after { right: -4px; bottom: -4px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.title-bar { display: flex; align-items: center; justify-content: center; position: relative; margin: 10px 12px 0; padding: 8px 52px;
  border: 2px solid var(--gold-2); border-radius: 10px; background: var(--title-bg); }
.title-bar h2 { margin: 0; font-size: 20px; font-weight: 700; text-align: center; color: var(--gold-3); text-shadow: 0 1px 0 rgba(0,0,0,.25); text-wrap: balance; }
.x-btn { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--gold-2); background: radial-gradient(circle at 35% 30%, #e45454, #8f1515 70%); color: #fff; font-size: 22px; font-weight: 700; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.btn { border: 2px solid var(--gold-2); border-radius: 999px; padding: 9px 18px; font-weight: 600; background: var(--btn-bg); color: var(--btn-ink); min-height: 42px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { filter: brightness(1.12); }
.btn.gold { background: linear-gradient(#ffe48f, #e3a93b 55%, #b8761c); color: #2a1300; border-color: #fff0b8; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.btn.red { background: linear-gradient(#c64242, #7e1616); color: #fff; border-color: #e7a0a0; }
.btn.green { background: linear-gradient(#4fc46a, #1f7a37); color: #fff; border-color: #a7f0b6; }
.btn.small { padding: 5px 12px; min-height: 32px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.btn.block { width: 100%; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-dim); }
.input, select.input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--gold-1); background: var(--shade2); color: var(--ink); font: inherit; min-height: 44px; }
.input::placeholder { color: var(--ink-mute); }
.muted { color: var(--ink-dim); font-size: 13px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.ok { color: var(--good); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--shade); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; border: 0; border-radius: 9px; padding: 8px 12px; background: transparent; color: var(--ink-dim); font-weight: 600; white-space: nowrap; }
.tab.on { background: linear-gradient(#ffe48f, #d39b35); color: #2a1300; }
.card { background: var(--shade); border: 1px solid rgba(201, 154, 59, .35); border-radius: 12px; padding: 10px 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; border: 1px solid var(--gold-1); color: var(--gold-3); background: var(--shade); }
.num { font-variant-numeric: tabular-nums; }
.sep { height: 1px; background: linear-gradient(90deg, transparent, var(--gold-1), transparent); margin: 6px 0; }

/* ---------- login ---------- */
.login-box { width: min(400px, 100%); padding: 18px 18px 20px; display: grid; gap: 12px; }
.lang-pick { position: fixed; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); z-index: 5; }
.lang-pick select { min-height: 38px; padding: 6px 10px; border-radius: 999px; }

/* ---------- character select ---------- */
.sel-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); gap: 8px; }
.topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; color: var(--gold-3); font-size: 18px; margin-right: auto; }
.credit-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--gold-2); background: var(--shade2); font-weight: 600; color: var(--gold-4); }
.credit-pill i { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4b8, #e3a93b 60%, #9a6416); display: inline-block; }
.sel-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 10px; min-height: 0; }
.slots { overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; align-content: start; }
.slot { position: relative; border: 2px solid rgba(201, 154, 59, .45); border-radius: 12px; background: var(--shade); padding: 6px; display: grid; justify-items: center; gap: 2px; min-height: 160px; }
.slot.on { border-color: var(--gold-3); box-shadow: 0 0 0 2px rgba(240, 207, 114, .3), 0 0 18px rgba(240, 207, 114, .3); }
.slot canvas { width: 96px; height: 104px; }
.slot .nm { font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .lv { font-size: 12px; color: var(--ink-dim); }
.slot.empty { place-content: center; color: var(--ink-dim); border-style: dashed; }
.slot.empty b { font-size: 34px; color: var(--gold-3); line-height: 1; }
.slot.locked { place-content: center; text-align: center; color: var(--ink-mute); border-style: dashed; font-size: 12px; }
.preview { padding: 12px; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-height: 0; }
.preview canvas { width: 100%; height: 100%; min-height: 200px; }
.ticker { display: flex; gap: 14px; overflow-x: auto; padding: 6px 10px; border-radius: 10px; background: var(--shade); font-size: 13px; scrollbar-width: none; white-space: nowrap; }
.ticker::-webkit-scrollbar { display: none; }
.ticker b { color: var(--gold-3); }
.up { color: var(--good); } .down { color: var(--bad); }

/* ---------- creator ---------- */
.cr-wrap { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 460px); gap: 10px; padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); }
.cr-stage { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.cr-stage canvas { width: 100%; height: 100%; }
.cr-opts { display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; padding: 12px; min-height: 0; }
.opt-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; align-content: start; padding: 2px; }
.opt { border: 2px solid rgba(201, 154, 59, .35); background: var(--shade); border-radius: 10px; padding: 2px; aspect-ratio: 1; display: grid; place-items: center; max-width: 100%; }
.opt.on { border-color: var(--gold-3); background: rgba(240, 207, 114, .14); }
.opt canvas { width: 100%; height: 100%; }
.swatch { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); }
.opt.on .swatch { border-color: var(--gold-4); }
.crop { display: grid; gap: 8px; }
.crop canvas { width: 180px; height: 180px; border-radius: 50%; border: 3px solid var(--gold-2); justify-self: center; background: #000; touch-action: none; }
input[type=range] { width: 100%; accent-color: var(--gold-3); }

/* ---------- game ---------- */
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-top { position: absolute; left: calc(6px + var(--safe-l)); right: calc(6px + var(--safe-r)); top: calc(6px + var(--safe-t)); display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.status { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 8px; padding: 6px 10px 8px 6px; border-radius: 14px; background: linear-gradient(rgba(34, 23, 13, .92), rgba(20, 13, 7, .9)); border: 2px solid var(--gold-2); width: min(430px, 64vw); }
.portrait { grid-row: span 2; position: relative; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--gold-3); background: radial-gradient(#6b4a2a, #2a1a0d); overflow: hidden; }
.portrait canvas { width: 100%; height: 100%; }
.portrait .lvb { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; background: #1b120a; border: 1px solid var(--gold-2); color: var(--gold-4); white-space: nowrap; }
.st-head { display: flex; gap: 6px; align-items: center; font-size: 13px; min-width: 0; }
.st-head .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-head .chip { font-size: 11px; padding: 0 8px; }
.bars { display: grid; gap: 3px; }
.bar { position: relative; height: 15px; border-radius: 8px; background: var(--shade2); overflow: hidden; border: 1px solid rgba(0, 0, 0, .6); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 8px; transition: width .2s; }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.bar.hp i { background: linear-gradient(#ff7a85, var(--hp)); }
.bar.sp i { background: linear-gradient(#7ab6ff, var(--sp)); }
.bar.thin { height: 12px; }
.bar.jx i { background: linear-gradient(#b493ff, var(--jexp)); }
.bar.bx i { background: linear-gradient(#5fe0cb, var(--bexp)); }
.hud-mid { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pillbar { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--gold-2); background: rgba(20, 13, 7, .85); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 5px; }
.hud-right { margin-left: auto; display: grid; justify-items: end; gap: 6px; }
.mini-wrap { position: relative; }
#minimap { width: 118px; height: 118px; border-radius: 50%; border: 4px solid #6b4a24; box-shadow: 0 0 0 2px var(--gold-2), 0 6px 16px rgba(0, 0, 0, .5); background: #0e1a0c; display: block; }
.zoom { display: flex; gap: 6px; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold-2); background: radial-gradient(circle at 40% 30%, #4a3520, #1b120a); color: var(--gold-4); font-size: 20px; font-weight: 700; display: grid; place-items: center; padding: 0; }
.menu-row { position: absolute; top: max(calc(176px + var(--safe-t)), calc(var(--hud-b, 0px) + 8px)); right: calc(8px + var(--safe-r)); display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
.mbtn { width: 56px; display: grid; justify-items: center; gap: 2px; background: none; border: 0; padding: 0; }
.mbtn .ic { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--gold-2); background: radial-gradient(circle at 40% 30%, #5a4128, #22170d); display: grid; place-items: center; color: var(--gold-3); box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.mbtn .ic svg { width: 26px; height: 26px; }
.mbtn .lb { font-size: 11px; font-weight: 600; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; }
/* The Guide button breathes a soft gold glow so it is easy to find (no motion for reduced-motion users). */
@keyframes guideGlow { 0%, 100% { box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 0 rgba(255, 214, 110, 0); } 50% { box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 12px 3px rgba(255, 214, 110, .55); } }
.mbtn.glow .ic { animation: guideGlow 2.8s ease-in-out infinite; border-color: var(--gold-3); }
@media (prefers-reduced-motion: reduce) { .mbtn.glow .ic { animation: none; box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 8px 2px rgba(255, 214, 110, .45); } }
.badge { position: absolute; right: -4px; top: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 1px solid #fff; }
.quest-card { position: absolute; right: calc(8px + var(--safe-r)); top: max(calc(296px + var(--safe-t)), calc(var(--menu-b, 0px) + 10px)); width: min(300px, 58vw); padding: 8px 12px 10px; border-radius: 12px; background: linear-gradient(rgba(40, 28, 16, .92), rgba(22, 15, 8, .9)); border: 1px solid var(--gold-2); display: grid; gap: 4px; }
.quest-card .qt { font-weight: 700; color: var(--gold-3); font-size: 14px; }
.quest-card .qo { font-size: 13px; }
.quest-card .btn { justify-self: end; }
.hud-bl { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); display: grid; gap: 10px; justify-items: start; }
.joy { position: relative; width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle, rgba(60, 42, 22, .55), rgba(20, 13, 7, .55)); border: 3px solid rgba(201, 154, 59, .8); touch-action: none; }
.joy .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a8743c, #4a2e14 70%); border: 3px solid var(--gold-3); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
.hud-br { position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); width: 250px; height: 250px; }
.abtn { position: absolute; border-radius: 50%; border: 3px solid var(--gold-2); background: radial-gradient(circle at 40% 30%, #5a4128, #1b120a 75%); color: var(--gold-4); display: grid; place-items: center; padding: 0; box-shadow: 0 4px 10px rgba(0, 0, 0, .55); overflow: hidden; }
.abtn .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0, 0, 0, .65); pointer-events: none; }
.abtn .k { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-weight: 700; background: #1b120a; border-radius: 8px; padding: 0 4px; border: 1px solid var(--gold-1); }
.abtn .lb { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 600; text-shadow: 0 1px 2px #000; line-height: 1.1; padding: 0 3px; }
.abtn svg { width: 46%; height: 46%; }
.a-attack { width: 96px; height: 96px; right: 0; bottom: 0; border-width: 4px; border-color: var(--gold-3); background: radial-gradient(circle at 40% 30%, #8a5a2a, #2a1608 75%); }
.a-attack svg { width: 52%; height: 52%; }
.a-sk { width: 58px; height: 58px; }
.a-sk .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9px; bottom: 6px; padding: 0 9px; }
.a-auto { width: 64px; height: 64px; }
.a-auto.on, .a-aq.on { border-color: #fff0b8; background: radial-gradient(circle at 40% 30%, #ffe48f, #c27a1c 75%); color: #2a1300; box-shadow: 0 0 18px rgba(255, 210, 100, .7); }
.a-aq { width: 52px; height: 52px; }
.a-pot { width: 50px; height: 50px; }
.a-pot .cnt { position: absolute; top: 2px; right: 6px; font-size: 11px; font-weight: 700; }
.chat-log { position: absolute; left: calc(10px + var(--safe-l)); bottom: calc(176px + var(--safe-b)); width: min(380px, 70vw); max-height: 132px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; pointer-events: none; font-size: 12.5px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.chat-log div { overflow-wrap: anywhere; }
.chat-log .sys { color: var(--gold-3); }
.chat-log .loot { color: var(--good); }
.chat-log .warn { color: var(--warn); }
.chat-input { display: flex; gap: 6px; width: min(380px, 80vw); }
.dead-box { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 16px 22px; text-align: center; display: grid; gap: 10px; }
#toast { position: fixed; left: 50%; top: calc(80px + var(--safe-t)); transform: translateX(-50%); z-index: 50; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
#toast div { padding: 8px 16px; border-radius: 999px; background: rgba(20, 13, 7, .92); border: 1px solid var(--gold-2); font-weight: 600; animation: tin .25s ease-out; max-width: 90vw; text-align: center; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- modal windows ---------- */
#modal-root { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.modal-back { position: absolute; inset: 0; background: var(--shade2); display: grid; place-items: center; padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); pointer-events: auto; }
.modal { width: min(560px, 100%); max-height: 100%; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.modal.wide { width: min(860px, 100%); }
.modal-body { overflow-y: auto; padding: 12px 14px 16px; display: grid; gap: 10px; align-content: start; grid-auto-rows: max-content; }
.dlg-say { line-height: 1.6; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat-box { border-left: 4px solid var(--gold-2); background: var(--shade); border-radius: 8px; padding: 6px 10px; display: grid; }
.stat-box .k { font-size: 12px; color: var(--ink-dim); font-weight: 600; }
.stat-box .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-box.c1 { border-color: #ff7a6a; } .stat-box.c2 { border-color: #6ab0ff; } .stat-box.c3 { border-color: #ffc06a; } .stat-box.c4 { border-color: #6fdc7e; } .stat-box.c5 { border-color: #ffe06a; } .stat-box.c6 { border-color: #c88aff; }
.stat-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(201, 154, 59, .15); }
.stat-row .s { font-weight: 700; color: var(--gold-3); }
.stat-row .v { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-row .bonus { color: var(--good); font-size: 12px; }
.equip-layout { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; align-items: center; }
.equip-col { display: grid; gap: 8px; }
.eslot { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--ink-dim); text-align: center; background: none; border: 0; padding: 0; }
.eslot .box { width: 62px; height: 62px; border-radius: 12px; border: 2px dashed rgba(201, 154, 59, .45); background: var(--shade); display: grid; place-items: center; }
.eslot.has .box { border-style: solid; border-color: var(--gold-2); background: var(--title-bg); }
.eslot .ref { color: var(--gold-3); font-weight: 700; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.icell { position: relative; aspect-ratio: 1; border-radius: 10px; border: 2px solid rgba(201, 154, 59, .4); background: var(--shade); display: grid; place-items: center; padding: 0; }
.icell .q { position: absolute; right: 4px; bottom: 2px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.icell .rf { position: absolute; left: 4px; top: 2px; font-size: 11px; font-weight: 700; color: var(--gold-3); }
.icell .eq { position: absolute; right: 3px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--good); }
.icell canvas { width: 70%; height: 70%; }
.rar-1 { border-color: var(--r-good); } .rar-2 { border-color: var(--r-rare); } .rar-3 { border-color: var(--r-epic); } .rar-4 { border-color: var(--r-legend); } .rar-5 { border-color: var(--r-divine); }
.list { display: grid; gap: 8px; }
.li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--shade); border: 1px solid rgba(201, 154, 59, .25); }
.li .grow small { display: block; color: var(--ink-dim); font-size: 12px; }
.li canvas { width: 40px; height: 40px; flex: none; }
.skill-ic { width: 52px; height: 52px; border-radius: 10px; border: 2px solid var(--gold-2); background: linear-gradient(135deg, #3a4b6b, #182235); display: grid; place-items: center; flex: none; color: var(--gold-4); }
.skill-ic svg { width: 30px; height: 30px; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.zone { text-align: left; border: 2px solid rgba(201, 154, 59, .35); background: var(--shade); border-radius: 12px; padding: 8px 10px; }
.zone.open { border-color: var(--good); }
.zone .lv { font-size: 12px; color: var(--ink-dim); }
.mapcard { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--shade); border: 1px solid rgba(201, 154, 59, .3); text-align: left; width: 100%; }
.mapcard.here { border-color: var(--gold-3); }
.mapcard .code { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: #1f3a22; border: 2px solid #4f9a5c; flex: none; }
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.jobcard { border: 2px solid rgba(201, 154, 59, .4); border-radius: 12px; background: var(--shade); padding: 8px; display: grid; gap: 4px; text-align: center; }
.jobcard.locked { opacity: .45; }
.jobcard b { color: var(--gold-3); }
.addr { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; padding: 8px 10px; border-radius: 8px; background: var(--shade2); border: 1px dashed var(--gold-1); user-select: text; -webkit-user-select: text; }
.big-amt { font-size: 24px; font-weight: 700; color: var(--gold-4); font-variant-numeric: tabular-nums; user-select: text; -webkit-user-select: text; }
.coin-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--shade); }
.coin-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 11px; color: #fff; }
.slip-prev { max-width: 100%; max-height: 240px; border-radius: 10px; justify-self: center; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { padding: 6px 8px; border-bottom: 1px solid rgba(201, 154, 59, .2); text-align: left; white-space: nowrap; }
.rotate-tip { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 20px; }
.rotate-tip .panel { padding: 22px; text-align: center; display: grid; gap: 12px; max-width: 360px; }

/* ---------- responsive: portrait phones ---------- */
@media (orientation: portrait) {
  .sel-main { grid-template-columns: 1fr; grid-template-rows: minmax(220px, 40%) 1fr; }
  .sel-main .preview { order: -1; }
  .cr-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(200px, 38%) 1fr; }
  .menu-row { top: max(calc(186px + var(--safe-t)), calc(var(--hud-b, 0px) + 8px)); max-width: 80vw; }
  .quest-card { top: max(calc(312px + var(--safe-t)), calc(var(--menu-b, 0px) + 10px)); }
  .status { width: min(430px, calc(100vw - 150px)); }
}
@media (max-width: 520px) {
  .hud-br { width: 220px; height: 220px; }
  .a-attack { width: 84px; height: 84px; }
  .a-sk { width: 52px; height: 52px; }
  .joy { width: 116px; height: 116px; }
  #minimap { width: 96px; height: 96px; }
  .round { width: 34px; height: 34px; font-size: 17px; }
  .mbtn { width: 48px; } .mbtn .ic { width: 42px; height: 42px; } .mbtn .ic svg { width: 22px; height: 22px; }
  .portrait { width: 52px; height: 52px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .menu-row { top: calc(8px + var(--safe-t)); right: calc(140px + var(--safe-r)); max-width: 46vw; }
  .quest-card { top: calc(132px + var(--safe-t)); width: min(260px, 40vw); }
  .hud-br { width: 210px; height: 210px; }
  .a-attack { width: 80px; height: 80px; }
  .a-sk { width: 50px; height: 50px; }
  .chat-log { bottom: calc(150px + var(--safe-b)); max-height: 90px; }
  .joy { width: 110px; height: 110px; }
  #minimap { width: 92px; height: 92px; }
  .status { width: min(380px, 44vw); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- logo, social login, theme toggle, guide ---------- */
.brand-logo { width: min(340px, 82vw); height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.brand-logo.small { width: 150px; margin: 0; filter: none; }
.social { display: grid; gap: 8px; }
.btn.google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn.discord { background: #5865f2; color: #fff; border-color: #8891f5; }
.btn .gl { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-mute); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--gold-1); opacity: .5; }
.linkbtn { background: none; border: 0; color: var(--gold-3); text-decoration: underline; font-size: 13px; padding: 4px; }
.top-tools { position: fixed; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); z-index: 5; display: flex; gap: 6px; align-items: center; }
.top-tools select { min-height: 38px; padding: 6px 10px; border-radius: 999px; width: auto; }
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold-2); background: var(--btn-bg); color: var(--btn-ink); display: grid; place-items: center; padding: 0; }
.theme-btn svg { width: 20px; height: 20px; }
.key-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .08em; text-align: center; padding: 12px; border-radius: 10px; border: 2px dashed var(--gold-2); background: var(--shade); user-select: all; -webkit-user-select: all; }
.guide h3 { margin: 4px 0 2px; color: var(--gold-3); font-size: 16px; }
.guide p { margin: 0 0 8px; line-height: 1.65; }
.stat-line { text-align: center; font-size: 13px; color: var(--ink-dim); }

/* ---------- credit shop, wardrobe, buffs, rankings, sound settings ---------- */
.shop-tabs { flex-wrap: wrap; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 4px; justify-items: center; text-align: center; padding: 10px 8px; border-radius: 12px; background: var(--shade); border: 1px solid rgba(201, 154, 59, .35); min-width: 0; }
.shop-card.rar-3, .shop-card.rar-4 { border-color: var(--gold-2); box-shadow: inset 0 0 18px rgba(255, 200, 90, .12); }
.shop-icon canvas { width: 64px; height: 64px; display: block; }
.shop-name { font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.shop-sub { font-size: 11.5px; line-height: 1.35; overflow-wrap: anywhere; }
.shop-card .btn { width: 100%; }
.icell.worn { border-color: var(--good); box-shadow: 0 0 10px rgba(80, 220, 140, .45); }
.buff-row { display: flex; flex-wrap: wrap; gap: 4px; max-width: min(420px, 60vw); }
.buff-chip { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; color: #1a0f05; background: linear-gradient(#ffe9a8, #e8b44a); border: 1px solid #fff2c8; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.buff-chip.b-exp, .buff-chip.b-jexp { background: linear-gradient(#e6d6ff, #a985ff); }
.buff-chip.b-drop { background: linear-gradient(#fff2b0, #ffbf1f); }
.buff-chip.b-atk, .buff-chip.b-matk, .buff-chip.b-crit { background: linear-gradient(#ffd0c0, #ff7a55); }
.buff-chip.b-def, .buff-chip.b-hp { background: linear-gradient(#e6eef8, #a9bcd6); }
.buff-chip.b-speed, .buff-chip.b-aspd { background: linear-gradient(#d8f8ff, #6be0ff); }
.auto-left { position: absolute; top: 5px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.a-auto.on .auto-left { color: #2a1300; text-shadow: none; }
.set-grid { display: grid; gap: 8px; }
.set-tog { gap: 10px; min-height: 36px; }
.set-tog input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--gold-2); }
.set-tog input[type=range] { width: min(180px, 45vw); accent-color: var(--gold-2); }
.rk-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rk-main .tab { min-height: 44px; font-size: 15px; }
.rk-main .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); vertical-align: middle; }
.rk-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.rk-cats .tab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-card { display: grid; gap: 4px; padding: 10px; border-radius: 12px; border: 1px solid rgba(201, 154, 59, .35); background: var(--shade); }
.rk-list { display: grid; gap: 4px; }
.rk-row { display: grid; grid-template-columns: 38px 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(0, 0, 0, .12); min-height: 46px; }
.rk-list .rk-row:not(:has(canvas)), .rk-row:not(:has(canvas)) { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
.rk-row.top { background: linear-gradient(90deg, rgba(255, 210, 90, .16), rgba(0, 0, 0, .08)); }
.rk-row.me { outline: 2px solid var(--good); }
.rk-pos { font-size: 18px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-row canvas { width: 34px; height: 34px; }
.rk-who { display: grid; min-width: 0; }
.rk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.rk-val { white-space: nowrap; font-weight: 800; color: var(--gold-3); font-variant-numeric: tabular-nums; text-align: right; }
.rk-tags .chip.afk { background: #7a3ca8; color: #fff; }
.rk-mine { padding: 8px 12px; border-radius: 10px; background: rgba(255, 200, 90, .16); border: 1px solid var(--gold-1); font-weight: 700; color: var(--gold-3); }
.rk-mine.sticky { position: sticky; bottom: 0; backdrop-filter: blur(4px); }
button.link { background: none; border: 0; color: var(--sp, #4fa3ff); font-weight: 600; padding: 4px; white-space: nowrap; }
.small { font-size: 11.5px; }
@media (max-width: 520px) and (orientation: portrait) {
  .menu-row { left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); max-width: none; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; }
  .menu-row::-webkit-scrollbar { display: none; }
  .mbtn { flex: 0 0 auto; }
  .quest-card { top: max(calc(262px + var(--safe-t)), calc(var(--menu-b, 0px) + 10px)); }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buff-row { max-width: calc(100vw - 20px - var(--safe-l) - var(--safe-r)); }
}

/* ---------- multi-screen ---------- */
body.multi-mode { background: #000; overflow: hidden; }
.multi-grid { position: fixed; inset: 0; display: grid; gap: 3px; background: #2a1c0e; padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); }
.multi-grid iframe { width: 100%; height: 100%; border: 0; background: #000; min-width: 0; min-height: 0; }
.multi-grid.l2 { grid-template-columns: 1fr 1fr; }
.multi-grid.l3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.multi-grid.l3 iframe:first-child { grid-row: span 2; }
.multi-grid.l4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
@media (orientation: portrait) {
  .multi-grid.l2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .multi-grid.l3 { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); }
  .multi-grid.l3 iframe:first-child { grid-row: auto; }
}
.multi-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(4px + var(--safe-b)); z-index: 10; opacity: .75; }
.multi-bar:hover { opacity: 1; }
.multi-prev { display: grid; gap: 4px; height: 110px; border-radius: 10px; overflow: hidden; }
.multi-prev div { background: var(--shade); border: 1px solid var(--gold-1); display: grid; place-items: center; font-weight: 800; color: var(--gold-3); font-size: 20px; }
.multi-prev.l2 { grid-template-columns: 1fr 1fr; }
.multi-prev.l3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.multi-prev.l3 div:first-child { grid-row: span 2; }
.multi-prev.l4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.embed-lost { height: 100%; display: grid; place-content: center; gap: 12px; text-align: center; }
.shop-filters { display: grid; gap: 6px; }
.tab.small { padding: 4px 10px; font-size: 12.5px; min-height: 32px; }
.st-head .chip { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 600px) and (orientation: portrait) {
  .hud-top { padding-bottom: 0; }
  .status { flex: 0 0 auto; width: calc(100vw - 132px - var(--safe-l) - var(--safe-r)); max-width: 430px; }
  .hud-mid { position: absolute; left: 0; top: calc(100% + 6px); }
  .bar span { font-size: 9.5px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .menu-row { top: auto; bottom: calc(4px + var(--safe-b)); left: calc(140px + var(--safe-l)); right: calc(252px + var(--safe-r)); max-width: none; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding-top: 4px; }
  .menu-row::-webkit-scrollbar { display: none; }
  .mbtn { flex: 0 0 auto; width: 46px; } .mbtn .ic { width: 38px; height: 38px; } .mbtn .ic svg { width: 20px; height: 20px; } .mbtn .lb { font-size: 10px; }
  .quest-card { top: max(calc(46px + var(--safe-t)), calc(var(--hud-b, 0px) + 6px)); right: calc(112px + var(--safe-r)); width: min(240px, 32vw); }
}
.rk-cats { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }

/* ---------- login page beginner corner, guide, world map, book, festival, tutorial ---------- */
#scr-login { overflow-y: auto; align-items: start; padding-top: calc(60px + var(--safe-t)); padding-bottom: calc(24px + var(--safe-b)); }
.login-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 400px) minmax(0, 380px); align-items: start; justify-content: center; width: 100%; }
.newbie-box { padding: 16px 18px; display: grid; gap: 10px; }
.newbie-box h2 { margin: 0; color: var(--gold-3); font-size: 18px; }
.newbie-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.newbie-steps li { display: grid; gap: 2px; line-height: 1.45; }
.newbie-steps .muted { font-size: 13px; }
@media (max-width: 860px) { .login-layout { grid-template-columns: minmax(0, 420px); } }
.guide-wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; min-height: 0; }
.guide-nav { display: grid; gap: 2px; align-content: start; position: sticky; top: 0; max-height: 70vh; overflow-y: auto; }
.guide-grp { font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
.guide-link { text-align: left; background: none; border: 0; color: var(--ink); padding: 5px 8px; border-radius: 8px; font-size: 13.5px; }
.guide-link:hover { background: var(--shade); }
.guide section { scroll-margin-top: 8px; }
@media (max-width: 700px) {
  .guide-wrap { grid-template-columns: minmax(0, 1fr); }
  .guide-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .guide-grp { width: 100%; }
  .guide-link { border: 1px solid var(--gold-1); padding: 4px 10px; border-radius: 999px; font-size: 12.5px; }
}
.map-list { display: grid; gap: 8px; }
.mapcard canvas.flag, canvas.flag { border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); flex: 0 0 auto; }
.row.wrap { flex-wrap: wrap; }
.icell .fl { position: absolute; right: 3px; top: 3px; line-height: 0; }
.drop-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.drop-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: var(--shade); border: 1px solid rgba(201, 154, 59, .3); font-size: 12px; }
.drop-chip canvas { width: 22px; height: 22px; }
.book-name { font-size: 18px; }
.center { text-align: center; }
.el-fire { color: #ff7a3c; } .el-water { color: #4fa3ff; } .el-wind { color: #8fdc6a; } .el-earth { color: #c9a66b; } .el-light { color: #e8b800; } .el-dark { color: #9a6bd6; } .el-neutral { color: var(--ink-dim); }
.fest-pill .fp-ic { display: inline-block; }
@keyframes festPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 120, 170, .0); } 50% { box-shadow: 0 0 0 4px rgba(255, 150, 190, .45); } }
@media (max-width: 600px) and (orientation: portrait), (orientation: landscape) and (max-height: 500px) {
  .fest-pill { padding: 3px 7px; animation: festPulse 2.4s ease-in-out infinite; }
  .fest-pill .fp-tx { display: none; }
  .pillbar .map-pill { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { .fest-pill { animation: none; } }
/* Short portrait phones (iPhone SE and similar): quest card shrinks to its title, controls shrink so
   the joystick and the action cluster never overlap on 320-360px wide screens. */
@media (orientation: portrait) and (max-height: 700px) {
  .quest-card { width: min(220px, 60vw); padding: 6px 10px; }
  .quest-card .qo, .quest-card .btn { display: none; }
}
@media (max-width: 360px) {
  .hud-br { transform: scale(.84); transform-origin: 100% 100%; }
  .joy { width: 96px; height: 96px; }
  .mbtn { width: 44px; } .mbtn .ic { width: 38px; height: 38px; } .mbtn .ic svg { width: 20px; height: 20px; } .mbtn .lb { font-size: 10px; }
}
.fest-pill { cursor: pointer; background: linear-gradient(90deg, rgba(255, 90, 160, .9), rgba(255, 190, 60, .9)); color: #2a1300; border-color: #fff2c8; }
.fest-now { font-size: 17px; color: var(--gold-3); }
.big-ic { font-size: 26px; width: 30px; text-align: center; }
.li.done { opacity: .6; }
.flag-prev { min-width: 30px; }
.tut { position: fixed; inset: 0; z-index: 80; pointer-events: auto; }
.tut-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62), 0 0 0 3px #ffd24a, 0 0 22px 6px rgba(255, 210, 74, .6); transition: all .25s; pointer-events: none; }
.tut-card { position: fixed; padding: 14px 16px; display: grid; gap: 8px; max-width: calc(100vw - 24px); }
.tut-card p { margin: 0; line-height: 1.5; }
.tut-title { font-size: 17px; color: var(--gold-3); }
.tut-step { font-size: 12px; color: var(--ink-dim); }
.rk-nm { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rk-nm canvas.flag { width: 18px; height: 12px; }

/* Daily login reward calendar */
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.daily-card { position: relative; display: grid; gap: 6px; align-content: start; justify-items: start; padding: 10px; border-radius: 12px; border: 1px solid var(--line, rgba(0,0,0,.15)); background: var(--card, rgba(255,255,255,.4)); }
.daily-card .daily-day { color: var(--gold-3, #b8860b); }
.daily-card.today { border: 2px solid var(--gold-3, #e0a82e); box-shadow: 0 0 0 3px rgba(255, 210, 94, .25); }
.daily-card.done { opacity: .62; }
.daily-items { display: grid; gap: 4px; width: 100%; }
.daily-it { display: flex; align-items: center; gap: 6px; }
.daily-it small { line-height: 1.25; }
.daily-z { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #5a3a00; background: radial-gradient(circle at 35% 30%, #ffe9a0, #e0a82e); flex: 0 0 auto; }
.daily-next { text-align: center; font-weight: 600; }
