:root {
  color-scheme: dark;
  --ink: #f7f1e3;
  --muted: #b9baaa;
  --faint: #a0a08d;
  --bg: #151815;
  --rail: #1c201d;
  --panel: #222822;
  --panel-hover: #2d352b;
  --line: #394237;
  --accent: #e4c08b;
  --accent-soft: #3c4230;
  --mint: #afd099;
  --theme-glow: var(--panel);
  --surface-inset: var(--rail);
  --on-accent: #201b22;
  --radius: 20px;
  --ease: cubic-bezier(.2,.75,.25,1);
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
@supports (color: color-mix(in srgb, #fff, #000)) {
  :root {
    --theme-glow: color-mix(in srgb, var(--panel) 77%, var(--accent));
    --panel-hover: color-mix(in srgb, var(--panel) 88%, var(--accent));
    --line: color-mix(in srgb, var(--panel) 72%, var(--accent));
    --accent-soft: color-mix(in srgb, var(--panel) 80%, var(--accent));
    --surface-inset: color-mix(in srgb, var(--rail) 76%, var(--bg));
  }
}
* { box-sizing: border-box; }
html, body { touch-action: pan-x pan-y; }
body { margin: 0; min-width: 280px; -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
button[hidden], span[hidden] { display: none !important; }
a { color: var(--accent); }
svg { display: block; width: 22px; height: 22px; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.rail {
  background: var(--rail); border-right: 1px solid var(--line); padding: 27px 16px 18px;
  padding-top: max(27px, var(--tg-content-safe-area-inset-top, 0px));
  height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; overflow: auto;
}
.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; padding: 0 9px; }
.brand img { filter: drop-shadow(0 5px 12px #c8aa7639); }
.brand strong { display: block; font-size: 19px; font-weight: 850; letter-spacing: -.6px; }
.player-brand { min-width: 0; border: 1px solid transparent; background: transparent; color: var(--ink); text-align: start; border-radius: 11px; }
.player-brand:not(:disabled):hover { border-color: var(--line); background: #94a38419; }
.player-brand strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-brand .avatar-frame { border-radius: 12px; padding: 2px; }
.player-brand .avatar-frame img { width: 35px; border-radius: 8px; }
.rail-label { margin: 40px 0 10px 13px; color: var(--faint); font-size: 10px; font-weight: 750; letter-spacing: 2px; }
#desktop-nav { display: grid; gap: 5px; }
.nav-btn {
  display: flex; width: 100%; gap: 12px; align-items: center; text-align: left; padding: 10px 12px;
  background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 12px;
  min-height: 47px; font-weight: 650; font-size: 14px; transition: .2s var(--ease);
}
.nav-btn svg, .icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn:hover { color: var(--ink); background: var(--panel-hover); }
.nav-btn.is-active { color: var(--accent); background: var(--accent-soft); border-color: var(--line); }
.rail-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; padding: 16px 10px 0; color: var(--faint); font-size: 12px; }
.rail-foot .quiet-btn { width: 100%; margin-top: 5px; }
.app-main { min-width: 0; }
.topbar {
  min-height: 72px; display: flex; gap: 12px; align-items: center; padding: 9px clamp(20px, 4vw, 54px);
  padding-top: max(9px, var(--tg-content-safe-area-inset-top, 0px));
  background: var(--rail); background: color-mix(in srgb,var(--rail) 94%,transparent);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3;
  backdrop-filter: blur(14px);
}
.top-location { color: var(--muted); font-size: 13px; display: flex; gap: 9px; align-items: center; }
.top-brand { display: none; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px #afd09988; flex: 0 0 auto; }
.wallet { display: flex; margin-left: auto; gap: 7px; align-items: center; min-width: 0; }
.wallet span {
  display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 12px; white-space: nowrap;
}
.wallet i { font-style: normal; }
.wallet-balance b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: inherit; }
.wallet-add {
  display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; padding: 0;
  color: var(--ink); background: var(--accent-soft); border: 1px solid var(--line); border-radius: 7px; font-size: 19px;
}
.wallet-add:hover { border-color: var(--accent); }
.ui-icon {
  display: block; width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.btn > .ui-icon, .filter-chip > .ui-icon { display: inline-block; vertical-align: middle; }
.filter-chip > .ui-icon { width: 14px; height: 14px; }
.wallet-add, #close-modal { padding: 0; line-height: 1; }
.help-links {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
  padding: clamp(10px,3vw,16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: radial-gradient(ellipse at top,var(--theme-glow),var(--panel) 75%);
}
.help-links .help-wide { grid-column: 1 / -1; }
.help-links .btn { gap: 8px; min-height: 52px; padding-inline: 6px; text-align: center; }
.help-links .btn span { font-size: 19px; flex-shrink: 0; }
.referral-panel { display: grid; gap: 12px; }
.referral-panel .feature-art { margin-bottom: 0; }
.referral-reward { display: grid; gap: 4px; text-align: center; margin: 0; color: var(--muted); }
.referral-reward strong { color: var(--accent); font-size: 42px; line-height: 1; }
.referral-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.referral-stats > div { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.referral-stats small, .referral-balance > span { color: var(--muted); font-size: 12px; }
.referral-stats strong { font-size: 20px; }
.referral-balance { display: flex; justify-content: space-between; gap: 8px; padding-block: 8px; }
.referral-panel .form-hint { margin: 0; text-align: center; }
.premium-benefits { display: grid; gap: 10px; }
.premium-benefits article { display: flex; align-items: center; gap: 12px; padding: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.premium-benefits article > span { font-size: 28px; }
.premium-benefits article > div { display: grid; gap: 5px; }
.premium-benefits small { color: var(--muted); line-height: 1.4; }
.icon-btn {
  border: 1px solid var(--line); color: var(--muted); background: var(--panel); width: 40px; height: 40px;
  border-radius: 11px; display: inline-grid; place-items: center; transition: .2s var(--ease); flex: 0 0 auto;
}
.icon-btn:hover { color: var(--ink); border-color: var(--accent); }
.inbox-btn { position: relative; }
.top-tools { display: flex; align-items: center; gap: 6px; }
.inbox-btn svg { width: 19px; height: 19px; }
#inbox-dot { position: absolute; right: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.settings-panel, .case-upgrade { display: grid; gap: 12px; }
.settings-card, .case-upgrade {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}
.settings-card h3 { margin: 0 0 8px; font-size: 15px; }
.settings-card p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.settings-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding-block: 7px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.settings-toggle:last-child { border-bottom: 0; }
.settings-toggle input[type=checkbox] {
  appearance: none; position: relative; flex: 0 0 auto; width: 40px; height: 24px; margin: 0;
  border: 1px solid var(--line); border-radius: 16px; background: var(--rail); cursor: pointer;
}
.settings-toggle input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--muted); transition: transform .16s ease;
}
.settings-toggle input:checked { background: var(--accent); }
.settings-toggle input:checked::after { transform: translateX(16px); background: var(--on-accent); }
.settings-toggle input:disabled { opacity: .6; cursor: wait; }
.case-upgrade { background: radial-gradient(ellipse at top,var(--theme-glow),var(--panel) 72%); }
.case-upgrade-heading { display: grid; justify-items: center; gap: 5px; text-align: center; }
.case-upgrade-heading span { font-size: 38px; line-height: 1.2; }
.case-upgrade-limits { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: center; text-align: center; }
.case-upgrade-limits div { display: grid; gap: 5px; padding: 10px 5px; border-radius: 10px; background: var(--rail); }
.case-upgrade-limits div:last-child { border: 1px solid var(--accent); }
.case-upgrade-limits strong { font-size: 26px; }
.case-upgrade small { color: var(--muted); text-align: center; }
.content { margin: 0 auto; max-width: 1390px; padding: 31px clamp(20px, 4vw, 54px) 54px; outline: none; transform-origin: 50% min(30vh, 220px); }
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  min-height: 330px; overflow: hidden; isolation: isolate; border-radius: 25px;
  border: 1px solid #54634d;
  background: radial-gradient(ellipse at 76% 48%, #526347 0%, #303d30 42%, #242b24 81%);
}
.hero::after, .cosmetic-banner-preview::after {
  position: absolute; content: ""; inset: 0; z-index: -1; opacity: .24;
  background-image: radial-gradient(#e0c4916e 1px, transparent 1px);
  background-size: 23px 23px; mask-image: linear-gradient(90deg, transparent 26%, black);
}
.hero-copy { z-index: 1; padding: clamp(25px, 4vw, 45px); align-self: center; }
.eyebrow { color: #dbbf91; font-size: 10px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; margin: 0 0 12px; }
.hero h1 { margin: 0; font-size: clamp(35px, 5.3vw, 74px); line-height: .98; font-weight: 880; letter-spacing: -.065em; }
.hero h1 span { display: block; color: #e4c08b; }
.hero-copy p:not(.eyebrow) { color: #e3d6bf; margin: 15px 0 22px; font-size: 15px; line-height: 1.55; max-width: 360px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-art { position: absolute; right: -1%; width: min(53%, 580px); top: 50%; transform: translateY(-50%); animation: float 8s ease-in-out infinite; pointer-events: none; }
@keyframes float { 0%,100% { transform: translateY(-50%); } 50% { transform: translateY(-53%); } }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; gap: 8px;
  padding: 9px 14px; border-radius: 10px; font-weight: 750; font-size: 13px; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.btn:not(:disabled):hover { background: var(--panel-hover); border-color: var(--accent); transform: translateY(-1px); }
.btn.primary {
  background: var(--accent); background: linear-gradient(135deg,var(--accent),color-mix(in srgb,var(--accent) 82%,var(--panel)));
  color: var(--on-accent); border-color: var(--accent); box-shadow: 0 6px 15px #0003;
}
.btn.primary:not(:disabled):hover { background: var(--accent); border-color: var(--ink); }
.btn.small { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.quiet-btn { border: 1px solid #3b4739; color: var(--muted); background: transparent; border-radius: 9px; min-height: 31px; font-size: 11px; padding: 5px 8px; }
.quiet-btn:hover { color: var(--ink); }
.heading { margin: 1px 0 24px; }
.heading h1, .section-head h2 { letter-spacing: -.036em; line-height: 1.06; }
.heading h1 { font-size: clamp(31px, 4vw, 49px); margin: 3px 0 9px; }
.heading p:not(.eyebrow), .section-head p { color: var(--muted); line-height: 1.5; margin: 0; }
.section-head { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: end; margin: 26px 0 13px; }
.section-head h2 { font-size: 23px; margin: 0; }
.section-head p { font-size: 12px; }
.summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 15px; }
.summary article, .card, .work-panel, .stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.summary article { padding: 14px 16px; min-width: 0; }
.summary article small { display: block; color: var(--muted); margin-bottom: 4px; }
.summary article strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.meter { height: 5px; margin-top: 8px; background: #393d2d; overflow: hidden; border-radius: 8px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg,#8ba472,#e2bd82); border-radius: 8px; }
.quick-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.quick-card {
  position: relative; min-height: 141px; text-align: left; border: 1px solid #3b2e4d; border-radius: 17px; color: var(--ink);
  padding: 14px; background: linear-gradient(148deg, #2e2240, #1b1525 86%);
  transition: transform .2s var(--ease), border .2s var(--ease);
}
.quick-card:hover { transform: translateY(-3px); border-color: #775594; }
.quick-card .orb { display: inline-grid; place-items: center; width: 41px; height: 41px; background: #3b4733; border: 1px solid #657354; border-radius: 12px; font-size: 23px; }
.quick-card strong { display: block; margin: 12px 0 3px; font-size: 15px; }
.quick-card small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.quick-card::after { content: "↗"; position: absolute; top: 16px; right: 15px; color: var(--faint); }
.action-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.action-btn {
  display: flex; align-items: center; gap: 10px; padding: 11px; min-height: 57px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--panel); font-size: 13px; font-weight: 650;
}
.action-btn:hover { background: var(--panel-hover); border-color: #768368; }
.action-btn span:first-child { display: grid; place-items: center; width: 31px; height: 31px; font-size: 18px; border-radius: 9px; background: #343e2f; flex: 0 0 auto; }
.workspace { display: grid; gap: 12px; scroll-margin-top: 85px; }
.work-panel { padding: clamp(14px, 2vw, 22px); min-width: 0; }
.work-panel.current { border-color: #66765b; }
.legacy { line-height: 1.55; overflow-wrap: anywhere; font-size: 14px; color: #e8e2d6; }
.legacy b, .legacy strong { color: var(--ink); }
.legacy i { color: #c8c4b5; }
.legacy code { padding: 1px 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); white-space: pre-wrap; }
.legacy hr { border: 0; border-top: 1px solid #474e3e; margin: 8px 0; }
.legacy blockquote { margin: 6px 0; padding: 7px 10px; border-inline-start: 2px solid var(--accent); background: var(--panel); border-radius: 4px 10px 10px 4px; }
.button-rows { display: grid; gap: 7px; margin-top: 13px; }
.button-row { display: flex; gap: 7px; flex-wrap: wrap; }
.button-row .btn { flex: 1 1 auto; }
.panel-form { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.panel-form input { min-width: 0; flex: 1; }
.dice { display: inline-flex; min-width: 100px; min-height: 70px; align-items: center; justify-content: center; gap: 10px; border-radius: 17px; background: #363f33; font-size: 29px; border: 1px solid #6a795e; }
.dice span { animation: roll-in .65s var(--ease) both; }
@keyframes roll-in { 0% { transform: rotate(-65deg) scale(.65); opacity: .3; } 70% { transform: rotate(12deg) scale(1.17); } 100% { transform: none; opacity: 1; } }
.media { display: grid; gap: 10px; color: var(--muted); }
.media audio { width: 100%; max-width: 430px; }
.inventory-grid, .market-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.card { padding: 13px; min-width: 0; }
.item-card { display: flex; flex-direction: column; gap: 8px; }
.item-visual { display: grid; place-items: center; height: 65px; border-radius: 12px; background: radial-gradient(ellipse at 50% 30%,#4a5743,#30392d 78%); font-size: 35px; }
.item-card h3 { margin: 0; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.item-card small { color: var(--muted); }
.item-card .btn { margin-top: auto; }
.item-card .value { color: #efd09e; font-weight: 750; font-size: 13px; }
.tag { padding: 4px 7px; display: inline-block; border-radius: 7px; font-size: 10px; font-weight: 720; color: #dfd4bd; background: #3a4535; }
.tools-row, .filters, .pager { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.world-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.recipe-list { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.recipe-list summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.recipe-list .inventory-grid { margin-top: 10px; }
.mines-board { width: 100%; max-width: 304px; margin-inline: auto; padding: 10px; background: #292f28; border: 1px solid #536349; border-radius: 15px; }
.mines-board .button-row { display: grid; grid-template-columns: repeat(4,1fr); }
.mines-board .btn { min-height: 45px; font-size: 20px; }
.filters { margin: 0 0 14px; }
.filters label { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 13px; }
.filters select { flex: 1; min-width: 120px; }
.pager { margin-top: 14px; justify-content: space-between; color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; border: 1px dashed #4e5848; border-radius: 13px; padding: 22px 13px; }
.loading { min-height: 56vh; display: grid; justify-items: center; align-content: center; text-align: center; color: var(--muted); }
.loading h1 { color: var(--ink); margin: 15px 0 0; }
#modal { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: transparent; }
#modal[open] { display: grid; place-items: center; }
#modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; appearance: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.world-map {
  position: relative;
  width: min(100%, max(520px, calc((100dvh - 145px) * 1.5)));
  margin-inline: auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  border: 1px solid #a7a77d69;
  border-radius: 20px;
  background: #273724;
  box-shadow: 0 12px 26px #0004;
}
.world-map-scene {
  position: absolute;
  inset: 0;
  background: #273724 url("./art/world-map.webp") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 32px #13221584;
  transform-origin: top left;
}
.map-controls { display: none; }
.world-trails { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; pointer-events: none; }
.map-spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: #fff2d2;
  background: none;
  transform: translate(-50%, -100%) scale(var(--map-label-scale, 1));
  transform-origin: center bottom;
}
.map-spot span {
  display: grid;
  place-items: center;
  width: clamp(29px, 5vw, 53px);
  aspect-ratio: 1;
  border: 1px solid #f3d691b3;
  border-radius: 50%;
  background: #212b20e8;
  box-shadow: 0 2px 8px #0009, inset 0 0 12px #eaba5d32;
  font-size: clamp(16px, 3.2vw, 29px);
  transition: transform .18s ease;
}
.map-spot strong {
  padding: 2px 6px;
  border-radius: 10px;
  background: #192219ef;
  font-size: clamp(10px, 1.9vw, 14px);
  line-height: 1.15;
  white-space: nowrap;
}
.map-spot:is(:hover,:focus-visible) span { transform: translateY(-3px); background: #394831; }
.map-spot-locked { color: #e1e1e1; }
.map-spot-locked span,.map-spot-locked:is(:hover,:focus-visible) span {
  filter: grayscale(1); border-color: #b5b5b5; background: #343434; transform: none;
}
.map-spot-locked strong { background: #303030; }
.map-player {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 4px;
  transform: translateX(-50%) scale(var(--map-label-scale, 1));
  transform-origin: center top;
  transition: left .25s linear, top .25s linear;
  pointer-events: none;
}
.map-pin {
  position: relative;
  width: clamp(14px, 2.6vw, 25px);
  aspect-ratio: 1;
  border: 2px solid #fff4de;
  border-radius: 50% 50% 50% 0;
  background: #e44837;
  box-shadow: 0 2px 8px #000b;
  transform: rotate(-45deg);
}
.map-pin::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; background: #fff4de; }
.map-player:has(.map-plane) { transform: translateX(-50%) scale(var(--map-label-scale, 1)) translateY(-6px); }
.map-plane { font-size: clamp(20px, 4vw, 36px); line-height: 1; filter: drop-shadow(0 2px 4px #000b); }
.map-player .countdown {
  padding: 2px 5px;
  border-radius: 6px;
  color: #fff4de;
  background: #182218f5;
  font-size: clamp(10px, 1.8vw, 14px);
  line-height: 1;
  white-space: nowrap;
}
.map-cancel.btn {
  position: absolute;
  z-index: 3;
  bottom: 8px;
  left: 8px;
  min-height: 32px;
  padding: 4px 8px;
  font-size: 11px;
}
@media (max-width: 760px) {
  .app-main:has(> .content[data-world]) {
    height: calc(100dvh - 68px - max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px)));
    display: flex;
    flex-direction: column;
  }
  .content[data-world] {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-height: 0;
    padding: 8px;
  }
  .content[data-world] .section-head { flex: none; margin: 0 4px; }
  .content[data-world] .section-head h2 { font-size: 19px; }
  .world-map {
    flex: 1;
    width: 100%;
    min-height: 0;
    aspect-ratio: auto;
    touch-action: none;
    overscroll-behavior: contain;
    user-select: none;
    -webkit-user-select: none;
  }
  .world-map-scene { inset: 0 auto auto 0; width: 100%; aspect-ratio: 3 / 2; }
  .map-controls { position: absolute; z-index: 4; right: 9px; bottom: 9px; display: grid; gap: 5px; }
  .map-controls .icon-btn { width: 44px; height: 44px; color: #fff4de; background: #192219ed; font-size: 22px; }
}
.city-places { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.city-place.btn { position: relative; display: grid; place-content: center; justify-items: center; gap: 4px; aspect-ratio: 1; padding: 4px; }
.city-icon { font-size: clamp(23px, 7vw, 40px); line-height: 1.2; }
.city-place strong { font-size: clamp(11px, 3.2vw, 15px); }
.city-place small { font-size: 10px; }
.city-lock { position: absolute; top: 5px; right: 5px; font-size: 12px; }
.city-places + .route-options { margin-top: 14px; }
.route-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.route-options .btn { display: grid; place-content: center; justify-items: center; gap: 5px; min-height: 60px; }
.route-options small { font-size: 11px; white-space: nowrap; }
.route-flight.btn { color: var(--ink); background: var(--panel-hover); }
@media (prefers-reduced-motion: reduce) {
  .map-player, .map-spot span { transition: none; }
}
.dialog-surface {
  position: relative; overflow: auto; overscroll-behavior: contain;
  color: var(--ink); border: 1px solid var(--line); border-radius: 20px; background: var(--rail); padding: 18px;
  width: min(530px, calc(100% - 24px)); max-height: calc(100% - 32px); box-shadow: 0 16px 70px #000a;
}
dialog::backdrop { background: #101410b5; backdrop-filter: blur(5px); }
.dialog-head { display: grid; grid-template-columns: minmax(0,70px) minmax(0,1fr) minmax(0,70px); align-items: start; gap: 4px; margin-bottom: 14px; }
.dialog-head h2 { grid-column: 2; margin: 4px 0 0; font-size: clamp(16px,5vw,21px); line-height: 1.2; text-align: center; overflow-wrap: anywhere; -webkit-user-select: none; user-select: none; }
.exchange-receipt { display: grid; gap: 14px; }
.exchange-receipt-flow {
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center; gap: clamp(5px,2vw,12px);
}
.exchange-receipt-flow > div {
  display: grid; justify-items: center; align-content: start; gap: 6px; min-height: 100%;
  padding: 12px 6px; text-align: center; border-radius: 14px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at top,var(--theme-glow),var(--panel) 78%);
}
.exchange-receipt-flow > div > span {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--rail); font-size: 24px;
}
.exchange-receipt-flow small { color: var(--muted); }
.exchange-receipt-flow strong {
  color: var(--ink); font-size: clamp(16px,5vw,26px); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere; min-width: 0; max-width: 100%;
}
.exchange-receipt-flow > div:last-child strong { color: var(--accent); }
.exchange-receipt-arrow { color: var(--accent); font-size: clamp(17px,5vw,23px); }
#close-modal { font-size: 22px; height: 32px; width: 32px; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
input:not([type=checkbox]), select, textarea {
  background: var(--surface-inset); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; min-height: 40px;
}
input::placeholder { color: #a8ab99; }
@media (max-width: 760px), (pointer: coarse) {
  input:not([type=checkbox]), select, textarea { font-size: 16px; }
}
.toast-region { position: fixed; z-index: 9; right: 18px; bottom: 18px; max-width: min(390px, calc(100% - 36px)); display: grid; gap: 8px; pointer-events: none; }
.toast { background: #333e32; border: 1px solid #728165; color: var(--ink); padding: 11px 14px; border-radius: 12px; font-size: 13px; box-shadow: 0 8px 24px #10130f99; animation: rise .25s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mobile-nav { display: none; }
@media(max-width: 1060px) {
  .shell { grid-template-columns: 182px minmax(0,1fr); }
  .rail { padding-inline: 12px; }
  .quick-grid, .inventory-grid, .market-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width: 760px) {
  .shell { display: block; }
  .rail, .top-location { display: none; }
  .topbar { padding: 7px 12px; min-height: 56px; gap: 7px; }
  .top-brand { display: flex; align-items: center; flex: 0 0 auto; max-width: 38%; gap: 6px; padding: 2px; font-size: 12px; }
  .top-brand .avatar-frame { border-radius: 10px; }
  .top-brand .avatar-frame img { width: 25px; border-radius: 6px; }
  .wallet { gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .wallet span { padding: 6px; font-size: 11px; gap: 3px; }
  .topbar .icon-btn { width: 31px; height: 32px; }
  .content { padding: 17px 13px calc(82px + env(safe-area-inset-bottom)); }
  .hero { min-height: 293px; grid-template-columns: minmax(0,1fr); }
  .hero-copy { padding: 21px 18px; max-width: 78%; }
  .hero-copy p:not(.eyebrow) { font-size: 13px; max-width: 240px; }
  .hero-art { right: -14%; width: 68%; opacity: .68; }
  .hero h1 { font-size: clamp(36px, 10vw, 60px); }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-grid, .market-grid, .action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); position: fixed; bottom: 0; inset-inline: 0; z-index: 5;
    background: var(--rail); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .mobile-nav .nav-btn { display: grid; justify-items: center; gap: 3px; padding: 5px 2px; min-height: 47px; font-size: 9px; border-radius: 8px; }
  .mobile-nav .nav-btn svg { width: 18px; height: 18px; }
  .toast-region { bottom: calc(65px + env(safe-area-inset-bottom)); }
}
@media(max-width: 365px) {
  .hero-copy { max-width: 88%; }
  .hero-art { opacity: .48; }
  .summary { gap: 6px; }
  .summary article { padding: 10px 8px; }
  .summary article strong { font-size: 14px; }
}
@media(prefers-reduced-motion: reduce) {
  *, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

body { background: radial-gradient(ellipse at 65% 0, var(--theme-glow) 0, transparent 55rem), var(--bg); }
[hidden] { display: none !important; }
.brand strong { font-size: clamp(15px, 1.65vw, 19px); white-space: nowrap; }
.profile-card { min-height: 322px; display: flex; }
.banner-forest { background: radial-gradient(ellipse at 77% 45%, #647557 0%, #344534 39%, #202a24 85%); }
.banner-creek { background: radial-gradient(ellipse at 76% 46%, #517572 0%, #2b4c49 46%, #202c29 84%); }
.banner-dusk { background: radial-gradient(ellipse at 77% 44%, #a57548 0%, #594330 43%, #2a2720 84%); }
.profile-card .hero-copy { width: min(55%, 530px); align-self: center; }
.profile-card .hero-art { width: min(65%, 660px); height: auto; right: -1%; }
.identity { display: flex; gap: 17px; align-items: center; min-width: 0; }
.profile-identity { min-width: 0; display: grid; gap: 4px; }
.identity h1 { margin: 0; font-size: clamp(29px, 5vw, 59px); line-height: 1; overflow-wrap: anywhere; }
.avatar-frame { border: 2px solid var(--frame-color); border-radius: 23px; padding: 3px; background: #202823; box-shadow: 0 0 0 3px #14181383, 0 0 24px color-mix(in srgb,var(--frame-color) 38%,transparent); flex: 0 0 auto; }
.avatar-frame img { display: block; width: clamp(46px, 6vw, 68px); height: auto; }
.frame-copper { outline: 1px dashed var(--frame-color); outline-offset: 4px; }
.frame-silver { border-style: double; border-width: 4px; padding: 1px; }
.frame-rose { position: relative; box-shadow: 0 0 0 2px #5c1f32, 0 0 17px #e64c7766; }
.frame-rose::before, .frame-rose::after { content: "🌹"; position: absolute; z-index: 1; line-height: 1; font-size: clamp(11px,3vw,18px); pointer-events: none; }
.frame-rose::before { top: -6px; right: -5px; transform: rotate(18deg); }
.frame-rose::after { bottom: -6px; left: -5px; transform: rotate(-16deg); }
.player-brand .frame-rose::before, .player-brand .frame-rose::after { font-size: 10px; }
.banner-rosarium { background: radial-gradient(ellipse at 77% 42%,#a3415b,#5a253b 54%,#261d2a 87%); }
.rosarium-art { container-type: inline-size; }
.rosarium-art > img { display: block; position: relative; width: 100%; height: auto; }
.rosarium-art > span {
  position: absolute; left: var(--x); top: var(--y); line-height: 1;
  font-size: clamp(12px,3.6vw,42px); font-size: clamp(12px,10cqi,46px);
  transform: translate(-50%,-50%) rotate(var(--angle)) scale(var(--scale));
  filter: drop-shadow(0 3px 5px #400f28a8);
}
.profile-card .player-title { color: #f6dfb7; font-weight: 700; overflow-wrap: anywhere; }
.profile-level { margin-top: 21px; color: #e6dfcd; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.profile-level strong { color: #f5d49e; }
.profile-progress {
  color: #fffbe9; font-weight: 800;
  text-shadow: 0 1px 1px #000, 1px 0 #000, -1px 0 #000, 0 -1px #000, 0 0 6px #000;
}
.profile-card .meter { background: #131912a0; height: 6px; }
.profile-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-pencil {
  width: 29px; height: 29px; padding: 0; color: #fff; background: #565b59; border-color: #737977;
}
.profile-pencil svg { width: 15px; height: 15px; }
.profile-open-card {
  position: absolute; z-index: 2; inset: 0; border: 0; border-radius: inherit; background: transparent;
}
.profile-open-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.status-strip { grid-template-columns: repeat(3, minmax(0,1fr)); margin: 13px 0 0; }
.status-strip article {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 90px; padding: 8px 5px; text-align: center; line-height: 1.15;
  background: linear-gradient(145deg,var(--panel-hover),var(--panel));
}
.status-strip article small { margin: 0; }
.status-strip article strong { font-size: clamp(12px, 2vw, 18px); }
.status-strip .countdown { white-space: normal; overflow-wrap: anywhere; }
.home-trails .scene-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.demo-switch { margin-top: 21px; }
.countdown { font-variant-numeric: tabular-nums; color: var(--mint); white-space: nowrap; }
.turn-clock { color: var(--muted); font-size: 13px; margin: 12px 0 0; text-align: center; }
.feature-card { border: 1px solid var(--line); background: var(--surface-inset); padding: 14px; border-radius: 14px; min-width: 0; }
.feature-card:has(> .dice):not(:has(> .legacy)) { background: none; border: 0; padding: 0; margin: 0 0 14px; }
.feature-footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.feature-footer > .btn { flex: 1 1 auto; }
.duel-banner { display: flex; gap: 10px; justify-content: space-between; align-items: center; background: #313d2e; border: 1px solid #5e7154; border-radius: 13px; padding: 11px; margin-bottom: 14px; }
.slot-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.slot-card { border: 1px dashed #525e4d; background: #222a23; border-radius: 13px; min-width: 0; display: flex; flex-direction: column; }
.slot-filled { border-style: solid; border-color: #647658; background: linear-gradient(155deg,#364333,#253025); }
.slot-locked { background: #1d231e; border-color: #42493d; }
.slot-select { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 9px 4px; width: 100%; min-height: 88px; border: 0; border-radius: inherit; color: var(--ink); background: transparent; }
.slot-select:not(:disabled):hover { background: #95ad831c; }
.slot-select:disabled { opacity: .78; }
.slot-icon { display: grid; place-items: center; font-size: 20px; width: 34px; height: 34px; border-radius: 10px; background: #121b1480; }
.slot-select strong { font-size: 12px; line-height: 1.1; overflow-wrap: anywhere; }
.slot-select small { font-size: 10px; color: var(--muted); line-height: 1.15; overflow-wrap: anywhere; }
.slot-locked small { color: #d5be95; }
.slot-use { margin: auto 4px 4px; color: #dce9cf; background: #2c422e; border-color: #698463; }
.inventory-bar { display: flex; justify-content: space-between; align-items: end; gap: 8px; margin: 25px 0 12px; }
.inventory-bar .section-head { margin: 0; display: grid; align-items: start; }
.sort-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.sort-trigger { min-width: 0; width: 100%; justify-content: space-between; font-size: 12px; }
.sort-trigger > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-trigger > span:last-child { color: var(--accent); }
.sort-options { display: grid; gap: 7px; }
.sort-options .btn { justify-content: space-between; text-align: start; }
.sort-options .btn[aria-pressed=true] { background: #405239; border-color: #8ba57a; }
.compact-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 9px; }
.compact-item { display: flex; text-align: left; flex-direction: column; gap: 5px; padding: 8px; color: var(--ink); transition: background .18s, border-color .18s; }
.compact-item:hover { background: var(--panel-hover); border-color: #748568; }
.compact-item .item-visual { width: 100%; height: 47px; border-radius: 8px; font-size: 26px; }
.compact-item strong { font-size: 12px; line-height: 1.1; overflow-wrap: anywhere; }
.compact-item small { font-size: 11px; color: var(--muted); margin-top: auto; }
.unit-price { color: var(--accent); font-size: 10px; }
.craft-progress { display: grid; gap: 7px; }
.craft-progress article { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.craft-progress .btn { justify-self: start; }
.market-head { margin-bottom: 12px; }
.market-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; max-width: 520px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.filter-chip { border: 1px solid #58654e; }
.own-toggle { min-height: 37px; }
.lot-filter-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: 1 1 175px; }
.own-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; font-size: 13px; cursor: pointer; }
.own-toggle:has(input:checked) { background: #354536; border-color: #78906a; }
input[type="checkbox"] {
  appearance: none; margin: 0; flex: 0 0 21px; inline-size: 21px; block-size: 21px;
  border: 1px solid #748269; border-radius: 6px; background: #202920; cursor: pointer;
}
input[type="checkbox"]:checked {
  border-color: #bdd6a0; background: #b5cc97 center / 14px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m3.5 9 3.4 3.5 7.6-8' stroke='%23213122' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.market-filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 7px 12px; margin-bottom: 12px; }
.market-filter-group { flex: 1 1 295px; min-width: 0; max-width: 490px; }
.market-filter-title { display: block; margin-bottom: 5px; color: var(--muted); text-align: center; font-size: 12px; }
.market-filter-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.market-filter-buttons .btn { min-height: 42px; padding-inline: 8px; font-size: 12px; }
.own-toggle input, .checklist input, input[type=range] { accent-color: #b3c99e; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open]::backdrop { animation: backdrop-in .24s ease-out; }
  dialog[open][data-closing]::backdrop { animation: backdrop-out .19s ease-in forwards; }
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { from { opacity: 1; } to { opacity: 0; } }
.form-hint, .dialog-notice { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dialog-notice { background: #384330; border: 1px solid #657453; color: var(--ink); padding: 8px 10px; border-radius: 8px; }
.form fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px 11px; }
.form legend { color: var(--muted); font-size: 12px; padding: 0 4px; }
.quantity { display: grid; gap: 8px; }
.quantity-preview { display: block; text-align: center; color: var(--ink); font-size: clamp(14px,4.4vw,19px); font-weight: 750; font-variant-numeric: tabular-nums; }
.slider-row { display: flex; align-items: center; gap: 9px; }
.slider-row input[type=range] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; margin: 0; min-height: 38px; }
.quantity small { color: var(--muted); font-size: 11px; }
.quantity input[type=number] { width: 100%; }
.picker { display: grid; gap: 9px; }
.search-field { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.picker-list { display: grid; gap: 6px; max-height: min(47dvh,400px); overflow: auto; padding-right: 3px; }
.picker-list > article, .picker-list > label { border: 1px solid var(--line); border-radius: 9px; background: #202820; display: flex; align-items: center; gap: 8px; padding: 7px; }
.picker-list > label { justify-content: space-between; min-height: 40px; cursor: pointer; }
.picker-list > article > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.picker-list strong { font-size: 13px; overflow-wrap: anywhere; }
.picker-list small { color: var(--muted); font-size: 11px; }
.picker-icon { display: grid; place-items: center; width: 32px; height: 32px; background: #374333; border-radius: 7px; flex: 0 0 auto; }
.item-detail { display: grid; justify-items: center; gap: 10px; }
.item-detail .item-visual { width: min(150px, 100%); height: 82px; font-size: 44px; }
.item-detail p { color: var(--muted); text-align: center; font-size: 13px; line-height: 1.5; margin: 0; }
.item-detail .feature-footer { width: 100%; margin-top: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.choice-grid label { display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 8px; min-height: 36px; padding: 4px; cursor: pointer; }
.choice-grid label:has(:checked) { border-color: var(--accent); color: var(--ink); }
.choice-grid input { margin: 0; accent-color: var(--accent); }
.frame-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
.profile-preview { min-height: 128px; border-radius: 13px; }
.profile-preview .hero-copy { padding: 12px; width: 72%; }
.profile-preview .hero-art { width: 72%; right: -14%; opacity: .64; }
.profile-preview .avatar-frame { border-radius: 14px; }
.profile-preview .avatar-frame img { width: 43px; }
.profile-preview .identity { gap: 9px; }
.profile-preview .identity h1 { font-size: clamp(17px, 4vw, 29px); }
.profile-preview .player-title { font-size: 11px !important; }
.profile-preview .eyebrow { font-size: 8px; letter-spacing: 1px; margin-bottom: 7px; }
.color-field input { padding: 3px !important; width: 76px; }
.case-animation { position: relative; isolation: isolate; min-height: 280px; display: grid; align-content: center; justify-items: center; gap: 14px; overflow: hidden; }
.case-halo { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 42%,#ba975058 0%,#a2783f18 42%,transparent 69%); animation: case-light 3s ease-in forwards; }
.case-emoji { display: grid; place-items: center; font-size: clamp(64px, 22vw, 105px); line-height: 1.1;
  transform-origin: center; filter: drop-shadow(0 9px 18px #0a1108); animation: case-shake 3s ease-in-out both; }
.case-timeline { height: 3px; width: min(180px, 75%); overflow: hidden; background: #414638; border-radius: 99px; }
.case-timeline::before { content: ""; display: block; height: 100%; background: var(--accent); transform-origin: left; animation: case-time 3s linear both; }
@keyframes case-time { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes case-light { from { opacity: .2; transform: scale(.75); } to { opacity: 1; transform: scale(1.2); } }
@keyframes case-shake {
  0%, 100% { transform: translateX(0); }
  13% { transform: translateX(-5px); }
  25% { transform: translateX(6px); }
  36% { transform: translateX(-7px); }
  46% { transform: translateX(8px); }
  55% { transform: translateX(-9px); }
  63% { transform: translateX(10px); }
  70% { transform: translateX(-11px); }
  76% { transform: translateX(12px); }
  81% { transform: translateX(-13px); }
  86% { transform: translateX(14px); }
  90% { transform: translateX(-15px); }
  94% { transform: translateX(15px); }
  97% { transform: translateX(-15px); }
}
.loot-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.loot-summary > span { font-size: 29px; }
.loot-summary div { display: grid; gap: 3px; }
.loot-summary small, .loot-grid small { color: var(--muted); }
.loot-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; max-height: 43dvh; overflow: auto; }
.loot-grid article { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 8px 4px; background: #303a2c; border: 1px solid #586650; border-radius: 10px; text-align: center; animation: rise .34s var(--ease) var(--delay) both; }
.loot-grid article span { font-size: 25px; }
.loot-grid article strong { font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 1060px) {
  .compact-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .profile-card .hero-copy { width: 62%; }
}
@media (max-width: 760px) {
  .topbar { padding-top: max(7px, var(--tg-content-safe-area-inset-top, 0px)); }
  .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 10px; padding-bottom: 8px; }
  .top-brand { grid-column: 1; grid-row: 1; max-width: 100%; min-width: 0; gap: 9px; }
  .top-brand strong { font-size: 16px; }
  .top-brand .avatar-frame img { width: 33px; }
  .top-tools { grid-column: 2; grid-row: 1; gap: 4px; }
  .top-tools .icon-btn { width: 36px; height: 36px; }
  .wallet { grid-column: 1 / -1; grid-row: 2; margin-left: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; overflow: visible; }
  .wallet .wallet-balance { padding: 3px 5px 3px 8px; gap: 5px; font-size: 12px; min-width: 0; }
  .wallet-balance b { flex: 1; }
  .wallet-balance b.wallet-long { font-size: 10px; letter-spacing: -.15px; }
  .wallet-add { width: 29px; height: 29px; }
  .mobile-nav { min-height: calc(68px + max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px))); }
  .mobile-nav .nav-btn { min-height: 58px; font-size: 11px; gap: 4px; }
  .mobile-nav .nav-btn svg { width: 22px; height: 22px; }
  .content { padding-bottom: calc(96px + max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px))); }
  .content[data-world] { padding-bottom: 8px; }
  .profile-card { min-height: 253px; }
  .profile-card .hero-copy { width: 72%; max-width: none; }
  .profile-card .hero-art { width: 80%; right: -23%; opacity: .78; }
  .profile-card .identity { gap: 10px; }
  .profile-card .identity h1 { font-size: clamp(26px, 7.5vw, 48px); }
  .profile-card .profile-level { font-size: 11px; }
  .profile-preview { min-height: 128px; }
  .profile-preview .identity h1 { font-size: 22px; }
  .compact-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
  .compact-item { padding: 6px; }
  .compact-item .item-visual { height: 38px; font-size: 22px; }
  .compact-item strong { font-size: 11px; }
  .slot-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .slot-select { min-height: 76px; }
  .slot-use { min-height: 36px; font-size: 11px; padding: 4px; }
  .inventory-bar .section-head h2 { font-size: 20px; }
  .market-head .btn { padding-inline: 9px; font-size: 12px; }
}
@media (max-width: 420px) { .compact-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 360px) { .profile-card .hero-copy { width: 82%; } .slot-select strong { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .case-emoji { animation: none !important; } .case-timeline::before { animation-duration: 3s !important; } }


.profile-card.banner-creek::after, .cosmetic-banner-preview.banner-creek::after { opacity: .32; background-image: repeating-radial-gradient(ellipse at 80% 100%,#c2e2d063 0 1px,transparent 2px 17px); background-size: auto; }
.profile-card.banner-dusk::after, .cosmetic-banner-preview.banner-dusk::after { opacity: .44; background-image: repeating-linear-gradient(0deg,#f6d6a756 0 1px,transparent 1px 6px); background-size: auto; mask-image: radial-gradient(ellipse at 77% 46%,black,transparent 64%); }
@media (max-width: 760px) {
  .mobile-nav { padding-bottom: calc(4px + max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px))); }
  .content { padding-bottom: calc(82px + max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px))); }
}

.btn, .action-btn, .feature-footer > *, .profile-level > *, .filters > * { min-width: 0; overflow-wrap: anywhere; }
.filters select, .inventory-bar select { min-width: 0; max-width: 100%; width: 100%; text-overflow: ellipsis; }
.filters > select { flex: 1 1 150px; }
.inventory-bar .sort-field { max-width: 57%; }
.feature-menu .btn { min-height: 43px; background: linear-gradient(145deg,var(--panel-hover),var(--panel)); }
.feature-menu .btn:not(:disabled):active { transform: scale(.97); }
.scene-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scene-card {
  --scene-glow: #758c5550;
  min-width: 0; min-height: 146px; isolation: isolate; overflow: hidden;
  background: radial-gradient(ellipse at 95% 20%, var(--scene-glow), transparent 70%), var(--panel);
  border-color: var(--line); transition: transform .24s var(--ease), border-color .24s, background-color .24s;
}
.scene-card:nth-child(3n + 2) { --scene-glow: #ba885243; }
.scene-card:nth-child(3n) { --scene-glow: #679b8844; }
.scene-card::after { color: #ddd4b6; }
.scene-card strong, .scene-card small { position: relative; overflow-wrap: anywhere; }
.scene-card strong { color: #fff0d2; text-shadow: 0 1px 8px #161c14; }
.scene-card .orb { width: 33px; height: 33px; font-size: 17px; background: var(--rail); border-color: var(--line); }
.scene-card .game-art {
  position: absolute; z-index: -1; right: 0; top: 0; width: min(55%, 124px); height: auto;
  filter: drop-shadow(0 9px 12px #171c17a0);
}
.scene-card:hover, .scene-card:focus-visible { border-color: #9eab7f; }
.scene-card:active { transform: scale(.97); }
.avatar-frame img { aspect-ratio: 1; object-fit: cover; border-radius: 17px; }
.profile-preview .avatar-frame img { border-radius: 10px; }
.profile-handle { color: var(--muted); overflow-wrap: anywhere; }
.profile-handle-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.username-eye { flex: 0 0 auto; width: 28px; height: 28px; padding: 4px; }
.username-eye svg { width: 17px; height: 17px; }
.compact-profile.profile-card { min-height: 0; }
.compact-profile.profile-card .hero-copy { width: min(88%, 500px); max-width: none; padding: clamp(13px,3vw,22px); }
.compact-profile .profile-level { margin-top: 12px; }
.visitor-profile .hero-art { opacity: .55; right: -16%; }
.visitor-profile .rosarium-art { opacity: .85; right: -7%; }
.compact-profile .identity h1 { font-size: clamp(25px, 6vw, 39px); }
.ranking-banner {
  position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(72px,26%); align-items: center; gap: 6px;
  padding: clamp(14px,4vw,34px); overflow: hidden; min-height: 128px; border-radius: 22px;
  background: radial-gradient(ellipse at 76% 20%, var(--accent-soft), transparent 62%), linear-gradient(130deg,var(--panel),var(--rail));
  border: 1px solid #6f7250; margin-bottom: 13px;
}
.ranking-banner h1 { margin: 5px 0; font-size: clamp(26px,5.4vw,48px); line-height: 1.04; overflow-wrap: anywhere; }
.ranking-banner p:not(.eyebrow) { margin: 7px 0 0; color: #d8c8ac; font-size: clamp(12px,2vw,15px); }
.ranking-banner .game-art { width: min(100%,170px); height: auto; justify-self: center; }
.ranking-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-bottom: 13px; }
.ranking-filters .btn { min-height: 43px; padding-inline: 4px; }
.ranking-filters .btn[aria-pressed=true] { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.ranking-list, .achievement-list { margin: 0; padding: 0; list-style: none; }
.ranking-list { display: grid; gap: 9px; }
.ranking-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(65px, .40fr); gap: 10px; align-items: center;
  min-height: 75px; padding: 9px 13px; border-radius: 16px; border: 1px solid #4c5b4a;
  background: linear-gradient(120deg,var(--panel),var(--rail)); animation: rise .26s var(--ease) both;
}
.ranking-row:nth-child(2) { animation-delay: .04s; }
.ranking-row:nth-child(3) { animation-delay: .08s; }
.rank-1 { --rank-tone:#d4ae68; background: linear-gradient(120deg,#4a3d28,#283126); }
.rank-2 { --rank-tone:#abbcba; background: linear-gradient(120deg,#354541,#283126); }
.rank-3 { --rank-tone:#cc9268; background: linear-gradient(120deg,#46382c,#283126); }
.rank-1, .rank-2, .rank-3 { min-height: 88px; border: 2px solid var(--rank-tone); }
.rank-you { box-shadow: inset 3px 0 #9eae73; }
.rank-place { justify-self: center; font-size: 20px; color: var(--muted); font-weight: 750; }
.rank-1 .rank-place, .rank-2 .rank-place, .rank-3 .rank-place { font-size: 29px; }
.rank-player {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 5px 6px;
  text-align: start; color: var(--ink); border: 1px solid transparent; background: none; border-radius: 12px;
  transition: background .2s, border-color .2s;
}
.rank-player:hover, .rank-player:focus-visible { background: #d6c69418; border-color: #d6c69455; }
.rank-player .avatar-frame { border-radius: 15px; }
.rank-player .avatar-frame img { width: clamp(35px,6vw,52px); border-radius: 10px; }
.rank-identity, .rank-score { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.rank-identity small, .rank-score small { color: var(--muted); font-size: 11px; }
.rank-score { text-align: end; font-variant-numeric: tabular-nums; }
.rank-score strong { font-size: clamp(14px,2.5vw,22px); color: #f3d6a1; }
.rank-back { margin-top: 14px; }
.achievement-grid { display: grid; gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
.achievement-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; }
.achievement-card summary {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 12px;
  cursor: pointer; list-style: none; overflow-wrap: anywhere;
}
.achievement-card summary::-webkit-details-marker { display: none; }
.achievement-card summary > span:nth-child(2), .achievement-list li > span:last-child { display: grid; gap: 3px; min-width: 0; }
.achievement-card small { color: var(--muted); }
.achievement-card summary .meter { grid-column: 1 / -1; margin-top: 2px; }
.achievement-icon { display: grid; place-items: center; width: 38px; height: 38px; background: #49533b; border-radius: 10px; font-size: 22px; }
.achievement-arrow { transition: transform .2s; }
.achievement-card[open] .achievement-arrow { transform: rotate(180deg); }
.achievement-list { border-top: 1px solid #526049; padding: 8px; display: grid; gap: 5px; }
.achievement-list li { display: flex; gap: 7px; padding: 6px; color: #e2dcca; overflow-wrap: anywhere; }
.achievement-list .achievement-earned { background: #627a4644; border-radius: 8px; }
.feature-art { display: grid; justify-items: center; margin-bottom: 10px; border-radius: 11px;
  background: radial-gradient(ellipse at center,var(--theme-glow),var(--panel) 68%); }
.feature-art .game-art { width: 108px; height: 78px; object-fit: contain; }
.illustrated-heading {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(65px,20%); align-items: center; gap: 7px;
  background: radial-gradient(ellipse at 86% 35%,var(--accent-soft),transparent 70%), var(--panel);
  border: 1px solid var(--line); border-radius: 19px; padding: clamp(13px,3vw,23px);
  overflow-wrap: anywhere;
}
.illustrated-heading .game-art { width: min(100%,145px); height: auto; justify-self: center; }
.game-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.game-choice-grid label { position: relative; cursor: pointer; }
.game-choice-grid input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; }
.game-choice-grid label > span { min-width: 0; min-height: 61px; display: grid; place-content: center; gap: 3px;
  border: 1px solid #506049; border-radius: 10px; background: #2c372c; text-align: center; padding: 5px;
  overflow-wrap: anywhere; transition: background .2s, border-color .2s, transform .2s; }
.game-choice-grid label:hover > span { transform: translateY(-2px); }
.game-choice-grid input:checked + span { background: #455036; border-color: #e3bb84; color: var(--ink); }
.game-choice-grid input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-symbol { font-size: 20px; }
@media (max-width: 630px) {
  .scene-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scene-card { min-height: 112px; padding: 10px; }
  .scene-card .game-art { width: min(57%, 94px); }
  .scene-card::after { top: 8px; right: 8px; }
  .scene-card strong { font-size: 13px; margin-top: 10px; }
  .scene-card small { font-size: 11px; }
  .ranking-row { grid-template-columns: 26px minmax(0,1fr) minmax(56px,.42fr); gap: 5px; padding: 7px 8px; }
  .rank-player { gap: 7px; padding-inline: 3px; }
  .rank-identity strong { font-size: 13px; }
  .rank-place { font-size: 14px; }
  .rank-1 .rank-place, .rank-2 .rank-place, .rank-3 .rank-place { font-size: 22px; }
  .achievement-grid { grid-template-columns: minmax(0,1fr); }
}

.ranking-row { grid-template-columns: 38px minmax(0,1fr) max-content; }
.rank-score strong { white-space: nowrap; overflow-wrap: normal; }
.rank-score-long strong { font-size: clamp(11px, 2vw, 17px); }
.dialog-tools { display: flex; grid-column: 3; justify-self: end; gap: 6px; align-items: center; }
.dialog-tools .icon-btn { width: 32px; height: 32px; }
.dialog-tools .trophy-btn { padding: 0; border-color: #f5cc74; background: #d9a646; color: #201407; box-shadow: 0 0 10px #f3ba5d40; }
.dialog-tools .trophy-btn:hover { background: #f1c66b; }
.status-strip .arrival-clock .countdown { white-space: nowrap; }
.scene-locked { opacity: .68; }
.scene-locked::after { content: none; }
.scene-locked:hover { transform: none; }
.ready-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px; padding: 12px 15px; border-radius: 12px; border: 1px solid #627851;
  background: linear-gradient(130deg,#394b32,#28352a); color: var(--ink); text-align: left;
  overflow-wrap: anywhere; transition: transform .2s, border-color .2s;
}
.ready-card:hover, .ready-card:focus-visible { border-color: var(--accent); }
.ready-card:active { transform: scale(.98); }
.ready-card > span:last-child { color: var(--accent); }
.slot-grid {
  grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; max-width: 520px; margin-inline: auto;
  grid-template-areas: "left left right right" ". third third ." "pocket pocket pocket2 pocket2";
}
.slot-left { grid-area: left; margin-right: 16%; }
.slot-right { grid-area: right; margin-left: 16%; }
.slot-third { grid-area: third; margin-inline: 8%; }
.slot-pocket { grid-area: pocket; margin-right: 16%; }
.slot-pocket2 { grid-area: pocket2; margin-left: 16%; }
.slot-card { display: grid; grid-template-rows: 84px 40px; }
.slot-select { min-height: 0; height: 100%; padding-block: 7px; align-content: center; gap: 6px; text-align: center; }
.slot-card:not(.slot-actionable) .slot-select { grid-row: 1 / -1; gap: 9px; }
.slot-durability { color: var(--mint); white-space: nowrap; }
.slot-use { align-self: center; margin: 0 4px; min-height: 32px; line-height: 1.05; padding: 3px 4px; }
.bag-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 0 0 10px; }
.bag-tabs .btn[aria-pressed=true] { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.compact-grid, .forge-grid, .catalog-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.compact-grid { max-width: 620px; }
.compact-grid .compact-item, .forge-grid .compact-item, .catalog-grid .compact-item {
  aspect-ratio: 1; min-width: 0; overflow: hidden; display: grid;
  grid-template-rows: minmax(12px,1fr) auto; align-content: center; gap: 2px;
  color: var(--ink); background: #263028; border: 1px solid #4c624c; border-radius: 9px; text-align: center; padding: 4px;
}
.compact-grid .compact-item, .forge-grid .compact-item { grid-template-rows: minmax(12px,1fr) auto auto; }
.compact-grid .compact-item .item-visual, .forge-grid .compact-item .item-visual, .catalog-grid .compact-item .item-visual {
  height: 100%; min-height: 0; max-height: 60px; font-size: clamp(17px,5vw,31px);
}
.compact-grid .compact-item strong, .forge-grid .compact-item strong, .catalog-grid .compact-item strong {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.1;
}
.compact-grid .compact-item small, .forge-grid .compact-item small { line-height: 1.05; overflow-wrap: anywhere; }
.tool-instance-id { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.compact-item .tool-instance-id { display: block; font-size: 10px; line-height: 1.1; }
.compact-grid .compact-item:has(.unit-price) { grid-template-rows: minmax(12px,1fr) auto auto auto; }
.forge-grid, .catalog-scroll { max-height: min(55dvh, 390px); overflow: auto; }
.catalog-scroll { overscroll-behavior: contain; }
.catalog-grid { align-content: start; align-items: start; grid-auto-rows: max-content; padding: 2px; }
.catalog-grid .compact-item { width: 100%; }
.forge-grid { padding: 2px; }
.workshop-card, .workshop-flow { display: grid; gap: 12px; }
.workshop-card {
  padding: 15px; border: 1px solid var(--line); border-radius: 15px;
  background: radial-gradient(ellipse at top,var(--theme-glow),var(--panel) 76%);
}
.workshop-card > strong, .workshop-card > small { text-align: center; }
.workshop-art { display: grid; place-items: center; }
.workshop-art .game-art { position: static; width: 100px; height: 84px; object-fit: contain; }
.workshop-cost, .repair-summary > div {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px;
  padding: 8px 10px; border-radius: 9px; background: var(--rail);
}
.workshop-cost { color: var(--muted); font-size: 13px; }
.workshop-cost strong, .repair-summary strong { color: var(--accent); flex-shrink: 0; }
.repair-summary { display: grid; gap: 5px; max-height: min(50dvh,340px); overflow: auto; }
.repair-summary span { overflow-wrap: anywhere; }
.repair-summary strong { font-size: 12px; }
.buyer-grid {
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  max-height: min(55dvh,390px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 2px;
}
.buyer-grid .compact-item {
  width: 100%;
  min-height: 80px;
  grid-template-rows: minmax(26px,1fr) auto auto;
}
.buyer-grid button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }
@media (max-width: 420px) {
  .buyer-grid, .workshop-flow .forge-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
.catalog-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 9px; }
.catalog-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; min-width: 0; }
.catalog-filters input, .catalog-filters select { width: 100%; min-width: 0; }
.catalog-grid .empty { grid-column: 1 / -1; }
.collection-tabs { margin-bottom: 12px; }
.collection-sort { width: min(100%, 228px); margin-bottom: 11px; }
.record-filters { max-width: 440px; margin-bottom: 11px; }
.record-filters .market-filter-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); }
.record-filters .own-toggle { justify-content: center; min-width: 0; padding-inline: 6px; font-size: 12px; }
.record-reward { display: flex; justify-content: space-between; gap: 9px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(145deg,#3e4733,#292f25); border: 1px solid #718061; border-radius: 12px; padding: 10px; margin-bottom: 11px; }
.record-reward div { display: grid; gap: 3px; }
.record-reward small, .record-value small { color: var(--muted); font-size: 11px; }
.record-list { display: grid; gap: 8px; }
.record-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: 10px;
  background: linear-gradient(120deg,#303a2e,#242c24); border: 1px solid #556950; border-radius: 12px; padding: 8px; }
.record-item { display: grid; gap: 4px; align-content: center; min-width: 0; height: 100%; padding: 8px;
  background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 9px; text-align: right; overflow-wrap: anywhere; }
.record-item:hover, .record-item:focus-visible { border-color: #7c8967; }
.record-item .record-amount { color: var(--accent); font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: clamp(12px,3.2vw,18px); }
.record-item small { color: var(--muted); font-size: 11px; }
.record-holder { width: 100%; }
.record-holder .rank-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-detail .profile-card { margin: 0; }
.record-profile { position: relative; }
.record-detail-score { display: grid; justify-items: center; gap: 6px; padding: 18px 8px; text-align: center; }
.record-detail-score strong { font-size: clamp(23px,6vw,36px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.record-detail-score span { color: var(--muted); font-size: 13px; }
.price-history-detail h3 { margin: 0; text-align: center; overflow-wrap: anywhere; }
.price-history-detail .record-detail-score { padding: 10px 8px 0; }
.starter-card {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px;
  margin-bottom: 16px; padding: 14px; background: linear-gradient(130deg,#313a29,#202f2b);
  border-color: #b4f592; box-shadow: 0 0 5px #b4f5a299, 0 0 21px #a3f48746, inset 0 0 15px #95f28616;
}
.starter-card h3, .starter-card p { margin: 0; }
.starter-card p { margin-top: 4px; color: #d1e8bc; font-size: 12px; }
.starter-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; font-size: 27px; background: #161c1880; }
.market-grid .item-card[tabindex]:focus, #crafting:focus {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.market-grid .item-card[tabindex]:focus { box-shadow: 0 0 24px #e4c08b66; }
.shop-picker { width: min(100%, 300px); }
.market-tabs .btn { min-width: 0; padding-inline: 4px; }
@media (max-width: 430px) {
  .starter-card { grid-template-columns: auto minmax(0,1fr); }
  .starter-card .btn { grid-column: 1 / -1; }
}
.profile-card[style*="--profile-accent"], .friend-profile-color[style*="--profile-accent"],
.cosmetic-product[style*="--profile-accent"] {
  background-color: var(--profile-accent);
  background-image: var(--profile-gradient,linear-gradient(135deg,color-mix(in srgb,var(--profile-accent) 72%,#111517),var(--profile-accent)));
  border-color: color-mix(in srgb,var(--profile-accent) 72%,#dfebcd);
}
.profile-sheet {
  --profile-accent: #3c5340; display: grid; gap: 12px; padding: 8px; border-radius: 18px;
  background: color-mix(in srgb,var(--profile-accent) 36%,#171e19);
}
.profile-sheet[style*="--profile-accent"] {
  border: 1px solid color-mix(in srgb,var(--profile-accent) 78%,#f5e8db);
  background: color-mix(in srgb,var(--profile-accent) 72%,#171e19);
  background-image: var(--profile-gradient,none);
}
.uploaded-banner { position:absolute; inset:0; z-index:-1; overflow:hidden; pointer-events:none; }
.uploaded-banner > img { width:100%; height:100%; display:block; object-fit:cover; object-position:var(--banner-x) var(--banner-y);
  transform:scale(var(--banner-scale)); transform-origin:var(--banner-x) var(--banner-y); }
.profile-card.banner-uploaded::after { z-index:0; opacity:1; mask-image:none; background:linear-gradient(90deg,#11160fd9, #11160f44 75%,#11160f1a); pointer-events:none; }
.profile-card[style*="--profile-gradient"] .uploaded-banner { opacity:.68; }
.profile-card[style*="--profile-gradient"] .profile-level { text-shadow:0 1px 3px #12150f,0 1px 8px #12150f; }
.cosmetic-banner-preview.banner-uploaded::after { content:none; }
.family-banner-left .uploaded-banner { transform:scaleX(-1); }
.uploaded-avatar-frame { position:relative; isolation:isolate; }
.avatar-frame.uploaded-avatar-frame { border-color:transparent; box-shadow:none; }
.uploaded-avatar-frame::after { content:""; position:absolute; z-index:1; inset:-2px; pointer-events:none;
  background:var(--avatar-frame-art) center / 100% 100% no-repeat;
  transform:translate(var(--avatar-frame-x,0%),var(--avatar-frame-y,0%)) scale(var(--avatar-frame-scale,1)); }
.profile-details { display: grid; gap: 10px; }
.profile-bond, .profile-detail-banner, .profile-stat {
  border: 1px solid color-mix(in srgb,var(--profile-accent) 55%,#9aad88);
  border-radius: 13px; background: color-mix(in srgb,var(--profile-accent) 57%,#1c241c);
  min-width: 0; color: var(--ink);
}
.profile-bond { display: grid; align-content: center; min-height: 94px; padding: 8px 12px; text-align: center; }
.profile-bond h3, .profile-bond p { margin: 0; }
.profile-bond p { color: var(--muted); margin-top: 5px; font-size: 13px; }
.marriage-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; margin-top: 6px; }
.marriage-person {
  display: grid; justify-items: center; align-content: start; min-width: 0; gap: 5px;
  padding: 2px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 10px;
}
button.marriage-person:hover { border-color: var(--accent); }
.marriage-person > span { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.marriage-person .avatar-frame { border-radius: 14px; }
.marriage-person img { width: clamp(32px,8vw,44px); border-radius: 9px; }
.marriage-ring { margin-top: 9px; font-size: clamp(23px,7vw,38px); filter: drop-shadow(0 0 8px #fff4ac); animation: marriage-shimmer 2.8s ease-in-out infinite; }
@keyframes marriage-shimmer {
  0%,100% { transform: rotate(-8deg) scale(1); filter: drop-shadow(0 0 4px #f5c779); }
  50% { transform: rotate(8deg) scale(1.13); filter: drop-shadow(0 0 13px #ffe9ab); }
}
.profile-banners { display: grid; grid-auto-rows: 1fr; gap: 10px; }
.profile-detail-banner { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center; padding: 10px 14px; min-height: 94px; }
.profile-detail-banner div { display: grid; gap: 4px; min-width: 0; }
.profile-detail-banner strong { overflow-wrap: anywhere; }
.profile-detail-banner small, .profile-detail-banner div > span { color: #dfddc7; font-size: 11px; }
.profile-detail-banner .game-art { position: absolute; z-index: -1; right: 3%; bottom: -12%; width: min(46%,140px); height: auto; opacity: .62; }
.clan-banner { background: linear-gradient(125deg,#343e2c,color-mix(in srgb,var(--profile-accent) 62%,#1c241c)); }
.pet-banner { background: linear-gradient(125deg,#473b2b,color-mix(in srgb,var(--profile-accent) 60%,#1c241c)); }
.profile-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; width: min(100%,440px); margin-inline: auto; }
@media (min-width: 761px) {
  .profile-stats { width: 100%; margin-inline: 0; }
}
.profile-stat { display: grid; align-content: center; justify-items: center; gap: 4px; aspect-ratio: 1; min-height: 78px; padding: 4px; text-align: center; }
.profile-stat > span { font-size: clamp(19px,5vw,30px); }
.profile-stat strong { font-size: clamp(11px,2.8vw,17px); overflow-wrap: anywhere; }
.profile-stat small { font-size: clamp(9px,2.4vw,12px); line-height: 1.1; color: #e2dfc8; }
button.profile-stat:hover { border-color: var(--accent); }
.favorite-btn { padding: 0; }
.favorite-btn svg { width: 20px; height: 20px; }
.favorite-btn[aria-pressed=true] { color: #ff707b; border-color: #bc626c; background: #5b3337; }
.favorite-btn[aria-pressed=true] svg { fill: currentColor; }
.friends-list { display: grid; gap: 8px; }
.friends-list article { padding: 7px; border-radius: 12px; }
.friends-list .feature-footer { margin: 5px; }
.friends-list article { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 7px; }
.friends-list .feature-footer { grid-column: 1 / -1; }
.duel-room-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.stake-types { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.stake-types .btn { display: grid; place-content: center; justify-items: center; gap: 6px; aspect-ratio: 1; padding: 4px; }
.stake-types span { font-size: clamp(24px,8vw,40px); }
.stake-types strong { font-size: clamp(9px,2.8vw,14px); overflow-wrap: anywhere; }
.stake-types + .form-hint { margin-top: 8px; }
.friends-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.friend-more { grid-column: 3; font-size: 24px; line-height: 1; padding: 0; }
.friend-favorite-label { grid-area: 1 / 2; }
.friend-actions { display: grid; gap: 7px; }
.friend-actions .btn { justify-content: flex-start; text-align: start; }
.favorite-friend .avatar-frame { border-radius: 11px; padding: 2px; }
.favorite-friend .avatar-frame img { width: clamp(24px,7vw,43px); border-radius: 7px; }
.favorite-friend strong { max-width: 100%; line-height: 1.1; }
.own-forest { margin-bottom: 14px; }
.own-forest .scene-card, .forest-trails .scene-card { min-height: 90px; }
.achievement-unread { border-color: #d5b968; box-shadow: 0 0 14px #d5b96829; }
.achievement-card summary { position: relative; }
.achievement-card summary .proposal-dot { top: 9px; right: 10px; }
.achievement-dot { z-index: 2; }
.achievement-new { outline: 1px solid #d5b9688c; border-radius: 8px; }
.proposal-dot {
  position: absolute; right: 6px; top: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: #ff5864; box-shadow: 0 0 8px #ff5864aa; animation: proposal-pulse 2.4s ease-in-out infinite;
}
@keyframes proposal-pulse { 50% { opacity: .36; } }
@media (prefers-reduced-motion: reduce) { .proposal-dot { animation: none; } }
.proposal-card .rank-player { width: 100%; }
.proposal-card > p { margin: 8px 0; color: var(--ink); }
.proposal-card > .proposal-caption { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.proposal-gift {
  padding: 10px 12px; border: 1px solid #53674d; border-radius: 10px;
  background: linear-gradient(135deg,#384835,#29372c); color: #f6ebd2;
}
.proposal-card > .proposal-level { color: var(--muted); font-size: 12px; }
.mines-result strong { font-size: clamp(21px,5vw,32px); font-variant-numeric: tabular-nums; }
.cosmetics { display: grid; gap: 14px; max-width: 940px; margin-inline: auto; }
.cosmetics-head, .cosmetic-cart { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.cosmetics-head h1 { margin: 0; font-size: clamp(21px, 4vw, 32px); }
.cosmetic-cart { padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.cosmetic-shop-link { color: #ffe7f0; border-color: #e3a0b9; background: #7f3454; }
.cosmetic-shop-link:hover, .cosmetic-shop-link:focus-visible { color: #fff; background: #973f65; }
.cosmetics-preview .profile-preview { min-height: 150px; }
.cosmetics-tabs, .cosmetics-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.cosmetics-tabs .btn { padding: 4px; font-size: clamp(10px,2.5vw,13px); }
.cosmetics-tabs .btn[aria-pressed=true] { background: #405239; border-color: #8ba57a; }
.cosmetic-choice {
  display: grid; justify-items: center; align-content: center; gap: 5px; min-height: 76px; min-width: 0;
  padding: 4px; background-color: #293629; border: 1px solid #52654b; border-radius: 11px; color: var(--ink);
}
.cosmetic-choice[aria-pressed=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cosmetic-choice span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--swatch,transparent); font-size: 21px; }
.cosmetic-choice strong { font-size: 11px; overflow-wrap: anywhere; }
.cosmetic-products { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr)); gap: 8px; }
.cosmetic-product { display: grid; gap: 10px; padding: 10px; }
.cosmetic-product-name { display: flex; align-items: center; gap: 10px; }
.cosmetic-product-name > span { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; background: var(--swatch,var(--accent-soft)); font-size: 21px; }
.cosmetic-product-name > .cosmetic-frame-preview { flex-basis: 43px; height: 43px; margin: 4px; background: #202823; }
.cosmetic-banner-preview {
  position: relative; height: clamp(96px, 29vw, 132px); overflow: hidden; isolation: isolate;
  border: 1px solid #ffffff26; border-radius: 10px;
}
.cosmetic-banner-preview .hero-art {
  right: 50%; width: min(85%, 270px); height: auto;
  transform: translate(50%,-50%); animation: none;
}
.cosmetic-product-name h3 { margin: 0 0 3px; overflow-wrap: anywhere; }
.cosmetic-product-name small { color: var(--muted); }
.cosmetic-product[style*="--profile-accent"] small { color: #f7f1e3; }
.cosmetic-product-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.cosmetic-product-actions .btn[aria-pressed=true] { border-color: var(--accent); }
.profile-editor .editor-tabs { grid-template-columns: repeat(5,minmax(0,1fr)); }
.profile-editor .cosmetics-options { max-height: 230px; overflow: auto; padding: 3px; }
.profile-editor [hidden] { display: none; }
.chips-wallet {
  display: grid; justify-items: center; gap: 9px; padding: 16px 10px; border-radius: 16px; text-align: center;
  border: 1px solid #657658; background: radial-gradient(ellipse at top,#40513b,#222d25 74%);
}
.chips-wallet > small { color: #d6ddc9; font-weight: 700; }
.chips-wallet > strong { font-size: clamp(22px,6vw,38px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.chips-wallet > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; width: min(100%,320px); }
.chips-wallet .chips-buy { color: #e1f9dc; background: #36593d; border-color: #6d9b6e; }
.chips-wallet .chips-sell { color: #ffe5df; background: #603d3a; border-color: #a77067; }
.chips-wallet .chips-buy:hover:not(:disabled) { background: #46754f; }
.chips-wallet .chips-sell:hover:not(:disabled) { background: #7c4b45; }
.mines-lobby-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.mines-lobby-toolbar .btn { flex: 0 0 auto; white-space: nowrap; }
.mines-rooms { display: grid; gap: 7px; }
.mines-rooms article { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); }
.mines-rooms article > div { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.mines-rooms small { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .marriage-ring { animation: none; } }
.bonus-wheel-wrap { position: relative; width: min(250px, 83%); margin: 12px auto; aspect-ratio: 1; }
.bonus-wheel { position: absolute; inset: 0; border: 4px solid #e1bc7c; border-radius: 50%; box-shadow: 0 0 22px #b08c5144; }
.bonus-wheel > span { position: absolute; translate: -50% -50%; font-size: clamp(21px,8vw,36px); }
.bonus-pointer { position: absolute; z-index: 2; top: -6px; left: 50%; translate: -50% 0; width: 22px; height: 29px;
  clip-path: polygon(0 0,100% 0,50% 100%); background: #ffe6a1; filter: drop-shadow(0 1px 2px #2b2313); }
.bonus-hub { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center;
  width: 38px; height: 38px; background: #36402d; border: 2px solid #e4bf87; border-radius: 50%; }
.bonus-result { text-align: center; color: var(--muted); margin: 10px 0; }
.bonus-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.bonus-actions > :only-child { grid-column: 1 / -1; }
.bonus-actions > * { min-height: 44px; }
.bonus-actions button:disabled { color: #c9c4b0; background: #2b3129; border-color: #55604e; opacity: .85; }
.bonus-odds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bonus-odds li { display: flex; justify-content: space-between; gap: 10px; padding: 9px; border: 1px solid #4e6248; border-radius: 8px; background: #313c30; }
.bonus-odds strong { color: var(--accent); white-space: nowrap; }
.tour-layer { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.tour-layer:has(.tour-ring[hidden]) { background: #121811d9; }
.tour-ring { position: absolute; border: 2px solid #ffe1a4; border-radius: 14px; box-shadow: 0 0 0 200vmax #121811d9, inset 0 0 0 3px #ffe1a444; }
.tour-tip { position: absolute; left: 50%; translate: -50% 0; width: min(calc(100% - 24px), 360px); pointer-events: auto;
  padding: 13px; border: 1px solid #e4bf87; border-radius: 13px; background: #303a2e; box-shadow: 0 10px 40px #151a14a0; }
.tour-step { color: var(--accent); font-size: 12px; font-weight: 750; }
.tour-tip h2 { margin: 3px 0 6px; font-size: 17px; }
.tour-tip p { margin: 0; color: #e1d9c1; line-height: 1.4; }
.tour-tip .feature-footer { margin-top: 9px; }
.lesson-list { display:grid; gap:7px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.lesson-list > .btn { min-height:64px; display:grid; align-content:center; gap:5px; padding:8px 6px; overflow-wrap:anywhere; }
.lesson-list small { font-size:11px; color:var(--muted); }
.lesson-offer { display:grid; gap:10px; }
.lesson-offer h3,.lesson-offer p { margin:0; }
.donation-hero { display:grid; justify-items:center; gap:5px; text-align:center; padding:18px 12px; border-radius:17px;
  border:1px solid #d885aa65; background:radial-gradient(ellipse at 50% 0%,#834264,#44283d 74%); color:#fff2e6; }
.donation-hero > span { font-size:45px; line-height:1.15; filter:drop-shadow(0 3px 10px #f2ab9470); }
.donation-hero > strong { font-size:clamp(17px,5vw,23px); }
.donation-hero small { color:#ffd7ba; }
.donation-presets { display:flex; flex-wrap:wrap; gap:6px; }
.donation-presets > button { flex:1 0 auto; }
.donation-presets > button[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-soft); }
.donation-total { text-align:center; font-size:clamp(18px,6vw,25px); font-weight:800; }
.donation-form .form-hint:empty { display:none; }
.donation-form > a { text-align:center; text-decoration:none; }
.lesson-offer p,.lesson-practice > p { color:var(--muted); line-height:1.4; }
.lesson-practice > p { margin:0 0 10px; padding:9px 10px; border:1px solid var(--line); border-radius:12px; }
.lesson-practice .lesson-highlight,
.lesson-practice :is([data-bakery-mix],[data-bakery-action="bake"],[data-bakery-action="take"],
  [data-bakery-action="heat"],[data-bakery-action="extract"],[data-smith-target],[data-smith-hold],
  [data-pond-hold],[data-pond-action="hook"]):not([disabled]) {
  outline:2px solid #ffe1a4; outline-offset:2px;
}
@media (max-width: 630px) {
  .ranking-row { grid-template-columns: 24px minmax(0,1fr) max-content; }
  .rank-score strong { font-size: clamp(11px,3.3vw,15px); }
  .rank-score-long strong { font-size: clamp(9px,2.9vw,12px); }
  .compact-grid .compact-item strong, .forge-grid .compact-item strong, .catalog-grid .compact-item strong { font-size: clamp(9px,2.8vw,12px); }
  .compact-grid .compact-item small, .forge-grid .compact-item small { font-size: 10px; }
  .record-card { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 4px; }
  .record-holder { gap: 5px; }
  .record-holder .avatar-frame img { width: 34px; }
  .record-item { padding: 6px 3px; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.coin-choices { min-width: 0; margin: 0; padding: 6px 0 12px; border: 0; }
.coin-choice-grid { display: flex; justify-content: center; gap: clamp(18px,6vw,32px); }
.coin-choice-grid label { position: relative; width: clamp(64px,20vw,96px); aspect-ratio: 1; cursor: pointer; }
.coin-choice-grid input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.coin-choice-grid .coin-face {
  transform: none; filter: brightness(.52) saturate(.8); box-shadow: inset 0 0 0 3px #ffebad38;
  transition: filter .2s, box-shadow .2s;
}
.coin-choice-grid input:checked + .coin-face { filter: brightness(1.13); box-shadow: inset 0 0 0 3px #ffebad38, 0 0 19px #edc27458; }
.coin-choice-grid input:focus-visible + .coin-face { outline: 2px solid var(--accent); outline-offset: 4px; }
.duel-card {
  display: grid; gap: 14px; padding: clamp(8px,3vw,18px); border-radius: 16px;
  background: radial-gradient(ellipse at 50% 26%,var(--theme-glow),var(--panel) 54%,var(--rail)); border: 1px solid var(--line);
  --coin-duration: 3s;
}
.duel-stage { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: start; gap: clamp(5px,2vw,18px); padding-top: 12px; }
.duel-player { min-width: 0; display: grid; justify-items: center; align-content: center; gap: 7px; text-align: center; }
.duel-player .avatar-frame { border-radius: 13px; }
.duel-player .avatar-frame img { width: clamp(28px,9vw,52px); border-radius: 9px; }
.duel-player strong { overflow-wrap: anywhere; font-size: clamp(11px,3vw,15px); }
.duel-center { display: grid; place-items: center; width: clamp(52px,19vw,104px); aspect-ratio: 1; align-self: center; }
.coin-side { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #e4c484; border-radius: 50%; color: #fff; font-weight: 800; }
.side-T { background: radial-gradient(circle at 34% 26%,#eb8b80,#a24549 55%,#60333a); }
.side-H { background: radial-gradient(circle at 34% 26%,#80beec,#35679b 55%,#273d65); }
.coin-perspective { perspective: 430px; }
.coin-spinner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(var(--coin-angle)); }
.coin-face {
  position: absolute; inset: 0; display: grid; place-items: center; border: 3px solid #efce85;
  border-radius: 50%; color: #fff8e5; font-size: clamp(24px,8vw,50px); font-weight: 900;
  text-shadow: 0 2px 3px #1b1a19; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 0 3px #ffebad38, 0 0 20px #edc27443;
}
.coin-face::after { content: ""; position: absolute; inset: 5px; border: 1px dashed #fff2bb7a; border-radius: 50%; }
.coin-token { position: relative; inset: auto; width: 46px; aspect-ratio: 1; font-size: 21px; }
.coin-token::after { inset: 3px; }
.coin-rooms, .game-history-list { display: grid; gap: 7px; }
.coin-rooms article, .game-history-list article {
  display: grid; align-items: center; gap: 9px; min-width: 0; padding: 9px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.coin-rooms article { grid-template-columns: auto minmax(0, 1fr) auto; }
.coin-room-owner { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.coin-room-owner small { color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.coin-room-name, .game-history-avatar, .game-history-icon, .duel-player, .coin-winner-name {
  color: inherit; background: transparent; border: 0; padding: 0; font: inherit;
}
.coin-room-name, .coin-winner-name { max-width: 100%; font-weight: 800; overflow-wrap: anywhere; }
.coin-room-name { text-align: start; }
button.coin-room-name:hover, button.duel-player:hover strong, button.coin-winner-name:hover { text-decoration: underline; }
.game-history-list article { grid-template-columns: max-content 32px max-content minmax(0, 1fr); }
.game-history-avatar, .game-history-icon { display: grid; place-items: center; border-radius: 10px; }
.game-history-avatar img { display: block; width: 36px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: inherit; }
.game-history-avatar.is-winner { outline: 2px solid #83d791; box-shadow: 0 0 12px #70d68b91; }
.game-history-icon { font-size: 22px; }
.game-history-icon .coin-token { width: 30px; border-width: 2px; font-size: 14px; }
.game-delta { text-align: end; overflow-wrap: anywhere; font-size: clamp(12px,3.5vw,15px); font-variant-numeric: tabular-nums; }
.game-delta.is-win { color: #a0e5a4; }
.game-delta.is-loss { color: #f1a59e; }
.catalog-grid .compact-item:has(> small) { grid-template-rows: minmax(12px, 1fr) auto auto; }
.tool-choice { position: relative; cursor: pointer; }
.tool-choice input[type="checkbox"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.tool-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.tool-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tool-choice:has(input:checked)::after { content: "✓"; position: absolute; top: 3px; right: 5px; color: var(--accent); }
.tool-choice:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.feature-card:has(> .mines-match) { padding: 0; border: 0; background: none; }
.mines-match .duel-player { padding: 6px 3px; border: 2px solid transparent; border-radius: 13px; }
.mines-match .duel-player.is-active { border-color: #9dfec2; background: #10281c; box-shadow: 0 0 13px #69ff9c5e; }
.mines-match .duel-player.is-active strong { color: #bdffd5; }
.mines-hearts { display: flex; gap: 2px; white-space: nowrap; font-size: clamp(12px,3.8vw,17px); }
.mines-match-bomb { font-size: clamp(34px, 12vw, 62px); line-height: 1; animation: mines-bomb-sway 1.6s ease-in-out infinite alternate; }
.mines-match-bet { justify-self: center; text-align: center; overflow-wrap: anywhere; font-size: clamp(16px, 5vw, 22px); color: var(--accent); font-variant-numeric: tabular-nums; }
.mines-finish { display: grid; gap: 14px; text-align: center; }
.mines-winner-profile { position: relative; text-align: start; }
.game-payout { font-size: clamp(21px, 5vw, 29px); color: #a8f1b5; font-variant-numeric: tabular-nums; }
.game-payout.is-loss { color: #ff8985; }
@media (min-width: 900px) {
  .mines-match .duel-player { padding: 10px 5px; border-width: 4px; }
  .mines-match .duel-player.is-active { box-shadow: 0 0 0 3px #0b2116, 0 0 22px 5px #66f69891, inset 0 0 16px #68e39635; }
}
@keyframes mines-bomb-sway {
  from { transform: translateY(3px) rotate(-10deg); }
  to { transform: translateY(-4px) rotate(10deg); }
}
@media (prefers-reduced-motion: reduce) { .mines-match-bomb { animation: none; } }
.coin-outcome .coin-winner-name { justify-self: center; font-size: 18px; }
.coin-animated .coin-winner-name { visibility: hidden; animation: coin-winner-show var(--coin-duration) steps(1, end) forwards; }
@keyframes coin-winner-show { to { visibility: visible; } }
@media (prefers-reduced-motion: reduce) { .coin-animated .coin-winner-name { visibility: visible; animation: none; } }
.coin-spinner .coin-face.side-H { transform: rotateY(180deg); }
.coin-animated .coin-spinner { animation: coin-spin var(--coin-duration) cubic-bezier(.2,.64,.19,1) both; }
@keyframes coin-spin {
  0% { transform: translateY(11px) rotateY(0deg) scale(.88); }
  48% { transform: translateY(-18px) rotateY(1060deg) scale(1.08); }
  84% { transform: translateY(2px) rotateY(calc(var(--coin-angle) - 62deg)) scale(1); }
  100% { transform: translateY(0) rotateY(var(--coin-angle)) scale(1); }
}
.coin-outcome { display: grid; gap: 4px; text-align: center; color: #f7e7ba; }
.coin-animated .coin-outcome { animation: coin-reveal .2s var(--coin-duration) ease-out both; }
@keyframes coin-reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .coin-perspective { perspective: none; }
  .coin-spinner { transform: none; }
  .coin-spinner .coin-face, .coin-spinner .coin-face.side-H {
    transform: none; backface-visibility: visible; -webkit-backface-visibility: visible;
    opacity: var(--face-on, 0);
  }
  .coin-spinner[data-result-side="T"] .side-T, .coin-spinner[data-result-side="H"] .side-H {
    --face-on: 1; --face-off: 0;
  }
  .coin-animated .coin-spinner { animation: coin-mobile-turn var(--coin-duration) ease-in-out both; }
  .coin-animated .coin-spinner .coin-face { animation: coin-mobile-face var(--coin-duration) steps(1, end) both; }
}
@keyframes coin-mobile-turn {
  0% { transform: translateY(10px) rotate(-12deg) scaleX(1); }
  8% { transform: translateY(-10px) rotate(8deg) scaleX(.10); }
  13% { transform: translateY(-16px) rotate(-8deg) scaleX(1); }
  18% { transform: translateY(-22px) rotate(8deg) scaleX(.10); }
  25% { transform: translateY(-25px) rotate(-8deg) scaleX(1); }
  31% { transform: translateY(-22px) rotate(8deg) scaleX(.10); }
  38% { transform: translateY(-18px) rotate(-8deg) scaleX(1); }
  45% { transform: translateY(-13px) rotate(8deg) scaleX(.10); }
  53% { transform: translateY(-9px) rotate(-8deg) scaleX(1); }
  61% { transform: translateY(-5px) rotate(8deg) scaleX(.10); }
  70% { transform: translateY(2px) rotate(-8deg) scaleX(1); }
  80% { transform: translateY(4px) rotate(7deg) scaleX(.10); }
  93% { transform: translateY(-2px) rotate(-3deg) scaleX(1.04); }
  100% { transform: translateY(0) rotate(0) scaleX(1); }
}
@keyframes coin-mobile-face {
  0%, 18%, 45%, 80%, 100% { opacity: var(--face-on, 0); }
  8%, 31%, 61% { opacity: var(--face-off, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .coin-animated .coin-spinner, .coin-animated .coin-spinner .coin-face, .coin-animated .coin-outcome { animation: none; }
}

.theme-picker { display: grid; gap: 13px; }
.theme-preview {
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  background: radial-gradient(ellipse at 70% 10%,var(--theme-glow),transparent 75%), var(--bg);
}
.theme-preview-top {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--rail); font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.theme-preview-top > span:last-child { margin-left: auto; color: var(--accent); }
.theme-preview-body { display: grid; gap: 4px; padding: 11px 12px; }
.theme-preview-body > span { color: var(--muted); font-size: 11px; }
.theme-preview-body > strong { font-size: 18px; }
.theme-preview-sample {
  display: flex; align-items: center; gap: 7px; margin-top: 3px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: 12px;
}
.theme-preview-sample i { margin-left: auto; width: 32px; height: 11px; border-radius: 5px; background: var(--accent); }
.theme-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; }
.theme-option {
  display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 5px 3px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--ink); font-size: clamp(9px,2.4vw,12px); overflow-wrap: anywhere;
}
.theme-option[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-swatch {
  display: grid; place-items: center; width: min(100%,52px); aspect-ratio: 1.7;
  border: 1px solid #ffffff33; border-radius: 5px;
}
.theme-swatch::after { content: ""; width: 32%; height: 32%; border-radius: 4px; background: var(--swatch-accent); }

.slot-card, .slot-locked, .picker-list > article, .picker-list > label, .mines-board,
.compact-grid .compact-item, .forge-grid .compact-item, .catalog-grid .compact-item,
.bonus-odds li, .cosmetic-choice:not([class*="banner-"]), .dialog-notice, .toast, .tour-tip {
  background: var(--panel); border-color: var(--line);
}
.slot-filled, .craft-progress article, .record-card, .record-reward, .proposal-gift {
  background: linear-gradient(130deg,var(--panel-hover),var(--panel)); border-color: var(--line);
}
.sort-options .btn[aria-pressed=true], .cosmetics-tabs .btn[aria-pressed=true],
.own-toggle:has(input:checked), .forge-grid button[aria-pressed=true] {
  background: var(--accent-soft); border-color: var(--accent);
}
.item-visual, .picker-icon, .achievement-icon, .tag { background: var(--accent-soft); }
.chips-wallet, .ready-card, .starter-card, .loot-grid article {
  background: linear-gradient(135deg,var(--panel-hover),var(--rail));
}
.rank-1, .rank-2, .rank-3 { background: linear-gradient(120deg,var(--accent-soft),var(--panel)); }
.status-strip .meter span, .achievement-card .meter span { background: var(--accent); }

@media (min-width: 900px) {
  .content { max-width: 1660px; }
  .inventory-grid.compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    max-width: none; gap: 9px;
  }
  .inventory-grid.compact-grid .compact-item { border-radius: 12px; padding: 7px; gap: 4px; }
  .inventory-grid.compact-grid .compact-item .item-visual { max-height: 82px; font-size: clamp(33px, 3vw, 46px); }
  .inventory-grid.compact-grid .compact-item strong { font-size: 13px; }
  .recipe-list .inventory-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .market-grid { grid-template-columns: repeat(auto-fill, minmax(max(124px, calc((100% - 84px) / 8)), 1fr)); }
  .market-grid .item-card { padding: 9px; }
  .market-grid .item-visual { height: 76px; font-size: 40px; }
  .market-grid .item-card small, .market-grid .item-card .value { overflow-wrap: anywhere; }
  .dialog-surface:has(.catalog-grid, .forge-grid, .loot-grid) { width: min(650px, calc(100% - 24px)); }
  .catalog-grid, .loot-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .catalog-grid .compact-item .item-visual, .forge-grid .compact-item .item-visual { max-height: 74px; font-size: 36px; }
}

@media (min-width: 1220px) {
  .record-list, .craft-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .craft-progress > .btn { grid-column: 1 / -1; }
}
