* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background:
    linear-gradient(rgba(36, 53, 86, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 53, 86, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(255, 159, 28, 0.16), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(47, 143, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #f4f7fb 0%, #e9eef7 52%, #f8f2e7 100%);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  color: var(--text);
  overscroll-behavior: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

button {
  font-family: inherit;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: transparent;
  position: relative;
  box-shadow: 0 0 0 1px rgba(28, 38, 64, 0.08), 0 24px 80px rgba(28, 38, 64, 0.18);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============ Splash / Onboarding ============ */

#splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: radial-gradient(circle at 50% 20%, #fff3d6 0%, #dff0ff 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

.splash-content {
  max-width: 340px;
  text-align: center;
  animation: splashIn 0.5s ease-out;
}

@keyframes splashIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-emoji {
  font-size: 56px;
  margin-bottom: var(--sp-3);
  animation: floatBob 2.4s ease-in-out infinite;
}

.splash-brand-mark {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 0 auto var(--sp-3);
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(145deg, rgba(14, 24, 39, 0.98), rgba(26, 43, 69, 0.96));
  background-size: 12px 12px, 12px 12px, auto;
  border: 1px solid rgba(246, 184, 75, 0.56);
  clip-path: polygon(12% 0, 88% 0, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0 88%, 0 12%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: floatBob 3.2s ease-in-out infinite;
}

.brand-ant-core {
  position: relative;
  width: 42px;
  height: 32px;
  background: linear-gradient(180deg, #f6b84b, #8a5a2b);
  clip-path: polygon(18% 0, 82% 0, 100% 30%, 100% 70%, 82% 100%, 18% 100%, 0 70%, 0 30%);
  box-shadow: 0 0 18px rgba(246, 184, 75, 0.36);
}

.brand-ant-core::before,
.brand-ant-core::after {
  content: '';
  position: absolute;
  left: -14px;
  width: 70px;
  height: 2px;
  background: rgba(246, 184, 75, 0.72);
}

.brand-ant-core::before {
  top: 9px;
  transform: rotate(18deg);
}

.brand-ant-core::after {
  bottom: 9px;
  transform: rotate(-18deg);
}

.brand-candle {
  position: absolute;
  bottom: 16px;
  width: 8px;
  background: #28d28f;
  box-shadow: 0 0 12px rgba(40, 210, 143, 0.36);
}

.brand-candle::before {
  content: '';
  position: absolute;
  left: 3px;
  top: -9px;
  width: 2px;
  height: calc(100% + 18px);
  background: currentColor;
  opacity: 0.75;
}

.brand-candle.one {
  left: 17px;
  height: 25px;
  color: #28d28f;
}

.brand-candle.two {
  right: 17px;
  height: 42px;
  color: #ff5d72;
  background: #ff5d72;
}

.brand-candle.three {
  right: 31px;
  height: 18px;
  color: #58a6ff;
  background: #58a6ff;
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.splash-content h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(90deg, #ff9f1c, #7c5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--sp-2);
}

.splash-tagline {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: var(--sp-5);
}

.splash-disclaimer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: var(--sp-6);
}

.privacy-link {
  color: var(--purple);
  font-weight: 700;
  text-decoration: none;
}

#splash-start-btn {
  width: 100%;
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(90deg, var(--gold), #ffb020);
  color: #201400;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 203, 71, 0.25);
}

#splash-start-btn:active {
  transform: scale(0.97);
}

/* ============ Top bar ============ */

#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(100% 80% at 12% -10%, rgba(255, 203, 71, 0.36), transparent 48%),
    linear-gradient(135deg, #111827 0%, #172033 52%, #233451 100%);
  background-size: 22px 22px, 22px 22px, auto, auto;
  border-bottom: none;
  padding: calc(var(--sp-3) + env(safe-area-inset-top)) var(--sp-4) var(--sp-4);
  box-shadow: 0 10px 26px rgba(10, 16, 28, 0.34);
  border-radius: 0;
  overflow: hidden;
}

/* 유리 광택 스윕 */
.hud-shine {
  position: absolute;
  top: -60%;
  left: -30%;
  width: 60%;
  height: 220%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(8deg);
  pointer-events: none;
  animation: hudShineSweep 6s ease-in-out infinite;
}

@keyframes hudShineSweep {
  0%, 65% { transform: translateX(-30%) rotate(8deg); opacity: 0; }
  80% { opacity: 1; }
  100% { transform: translateX(320%) rotate(8deg); opacity: 0; }
}

.topbar-row1 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

#asset-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff3c4;
  background: linear-gradient(180deg, rgba(255, 203, 71, 0.22), rgba(255, 203, 71, 0.08));
  padding: 5px var(--sp-3);
  border-radius: 4px;
  border: 1px solid rgba(255, 203, 71, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.topbar-btns {
  display: flex;
  gap: var(--sp-2);
}

#mute-btn,
#ranking-btn,
#invite-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  padding: 7px var(--sp-3);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(40, 30, 90, 0.18);
}

#invite-btn.glow {
  border-color: #fff2c6;
  box-shadow: 0 0 0 0 rgba(255, 226, 138, 0.6);
  animation: glowPulse 1.6s infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 240, 190, 0.6); }
  50% { box-shadow: 0 0 14px 3px rgba(255, 240, 190, 0.7); }
}

.topbar-row2 {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.networth-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.networth-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coin-glyph {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 226, 150, 0.86);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe3a4, #c98820);
  box-shadow: 0 2px 8px rgba(246, 184, 75, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  animation: coinSpin 3.5s ease-in-out infinite;
}

.coin-glyph::before {
  content: '₩';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #5f3700;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

@keyframes coinSpin {
  0%, 80%, 100% { transform: rotateY(0deg); }
  88% { transform: rotateY(180deg); }
}

.stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.stat-value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.stat-value.gold {
  color: #fff2c6;
  text-shadow: 0 1px 0 rgba(150, 100, 0, 0.35), 0 2px 8px rgba(255, 200, 60, 0.45);
}

.income-rate {
  font-size: 11px;
  font-weight: 800;
  color: #c8ffe9;
  text-shadow: 0 1px 3px rgba(10, 60, 40, 0.4);
}

.cash-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-sm);
  padding: 4px var(--sp-3);
}

.cash-action-wrap {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "cash"
    "sell";
  align-items: center;
  justify-items: end;
  gap: 5px;
  min-width: 142px;
}

.cash-action-wrap .cash-chip {
  grid-area: cash;
}

#topbar-sellall-btn {
  grid-area: sell;
  width: 100%;
  min-height: 31px;
  border: 1px solid rgba(255, 93, 114, 0.48);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 93, 114, 0.95), rgba(185, 42, 61, 0.95));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 0 rgba(0, 0, 0, 0.4);
}

#topbar-sellall-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.22);
}

#topbar-sellall-btn:disabled {
  opacity: 0.48;
  cursor: default;
  background: linear-gradient(180deg, rgba(52, 64, 84, 0.95), rgba(28, 38, 55, 0.95));
  border-color: rgba(160, 178, 210, 0.22);
  box-shadow: none;
}

.cash-chip .stat-label { color: rgba(255, 255, 255, 0.8); }

#cash-amount {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

#milestone-progress-wrap {
  position: relative;
  background: rgba(20, 16, 60, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
}

.milestone-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  margin-bottom: 5px;
}

#milestone-progress-pct {
  font-weight: 800;
  color: #fff2c6;
}

.progress-bar {
  height: 9px;
  background: rgba(10, 8, 40, 0.35);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd23f, #ff9f1c 60%, #ffca6b);
  border-radius: 999px;
  transition: width 0.4s ease-out;
  box-shadow: 0 0 8px rgba(255, 200, 60, 0.7);
}

.progress-fill.near-complete {
  animation: progressPulse 1s infinite;
}

@keyframes progressPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}

/* ============ Tip ticker ============ */

#tip-ticker {
  font-size: 12px;
  color: var(--text-faint);
  background: var(--surface);
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.tip-body {
  flex: 1;
  min-width: 0;
}

#help-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 4px 10px;
  cursor: pointer;
}

#tip-text {
  color: var(--text-dim);
}

/* ============ Action buttons ============ */

#action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) 0;
}

#action-buttons button.action-primary {
  background: linear-gradient(180deg, #fff, #f2f0ff);
  border-color: rgba(124, 92, 255, 0.35);
  color: #4a2f8f;
  font-weight: 800;
}

#action-buttons button {
  flex: 1;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-2);
  min-height: 46px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s;
}

#action-buttons button:active {
  transform: scale(0.96);
}

#action-buttons button:disabled {
  opacity: 0.5;
  cursor: default;
}

#action-buttons button.glow {
  border-color: var(--gold);
  animation: glowPulse 1.6s infinite;
}

.starter-mission-card {
  margin: var(--sp-2) var(--sp-4) 0;
  border: 1px solid rgba(204, 216, 238, 0.95);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
  box-shadow: 0 5px 16px rgba(31, 36, 55, 0.06);
}

.starter-mission-card.ready {
  border-left-color: #f5b544;
  background:
    linear-gradient(90deg, rgba(245, 181, 68, 0.13), rgba(255, 255, 255, 0) 48%),
    var(--surface);
}

.starter-mission-card.soft-goal {
  border-left-color: #6aa7ff;
  background:
    linear-gradient(90deg, rgba(49, 130, 246, 0.08), rgba(255, 255, 255, 0) 48%),
    var(--surface);
  box-shadow: 0 4px 12px rgba(31, 51, 77, 0.04);
}

.starter-mission-card.soft-goal .starter-mission-cta {
  border-color: #d6e7ff;
  background: #ffffff;
  color: #1f2a44;
}

.starter-mission-card.complete {
  border-left-color: #17b978;
}

.starter-mini-coach {
  position: sticky;
  top: calc(var(--sticky-topbar-height, 0px) + 6px);
  z-index: 82;
  display: grid;
  grid-template-columns: auto minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: 8px;
  margin: 6px var(--sp-4) 0;
  border: 1px solid rgba(245, 181, 68, 0.48);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 51, 77, 0.12);
  padding: 7px 9px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.starter-mini-coach:focus-visible {
  outline: 2px solid #f5b544;
  outline-offset: 2px;
}

.starter-mini-coach:active {
  transform: translateY(1px);
}

.starter-mini-coach.hidden {
  display: none;
}

.starter-mini-coach span {
  border-radius: 999px;
  background: #f5b544;
  color: #3f2900;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.starter-mini-coach strong,
.starter-mini-coach em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}

.starter-mini-coach strong {
  color: #5f4210;
  font-size: 12px;
  font-weight: 950;
}

.starter-mini-coach em {
  color: #64420a;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.starter-mission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.starter-eyebrow {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 900;
}

.starter-progress {
  height: 7px;
  margin: 7px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3fb;
}

.starter-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3182f6, #17b978);
  transition: width 0.3s ease;
}

.starter-mission-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  color: var(--text);
}

.starter-focus-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.starter-mission-visual {
  display: block;
  width: 92px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: 0 8px 16px rgba(31, 51, 77, 0.08);
}

.starter-mission-copy b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-mission-copy span {
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.3;
}

.starter-money-note {
  margin-top: 7px;
  border: 1px solid #e0ebf8;
  border-radius: 7px;
  background: #fbfdff;
  color: #4e6688;
  padding: 6px 8px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.35;
  word-break: keep-all;
}

.starter-money-note b {
  color: #1b64da;
  font-weight: 950;
}

.starter-mission-actions {
  margin-top: 8px;
}

.starter-mission-cta {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d6e7ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #eef6ff);
  color: #1b64da;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.starter-mission-card.ready .starter-mission-cta {
  border-color: #ffdfa3;
  background: linear-gradient(180deg, #fffaf0, #fff1d6);
  color: #9a5f00;
}

.starter-mission-chips {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.starter-mission-chip {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: #f4f7fb;
  color: #6b7684;
  padding: 4px 5px;
  font-size: 9.5px;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-mission-chip b {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 3px;
  border-radius: 50%;
  background: #dfe8f5;
  color: #4e5968;
  font-size: 9px;
}

.starter-mission-chip.active {
  background: #eef6ff;
  color: #1b64da;
}

.starter-mission-chip.active b {
  background: #3182f6;
  color: #fff;
}

.starter-mission-chip.done {
  background: #e8f8f0;
  color: #108957;
}

.starter-mission-chip.done b {
  background: #17b978;
  color: #fff;
}

.quest-focus {
  position: relative;
  outline: 2px solid rgba(245, 181, 68, 0.82) !important;
  outline-offset: 2px;
  box-shadow:
    0 0 0 3px rgba(245, 181, 68, 0.12),
    0 8px 18px rgba(245, 181, 68, 0.14) !important;
  animation: questFocusPulse 1.15s ease-in-out 2;
}

body[data-quest-priority="action"][data-quest-mission]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.54);
}

body[data-quest-priority="action"][data-quest-mission] .quest-focus {
  z-index: 70;
}

body[data-quest-priority="action"] #action-buttons:has(.quest-focus),
body[data-quest-priority="action"] #main-screen:has(.quest-focus),
body[data-quest-priority="action"] #main-screen:has(.quest-surface),
body[data-quest-priority="action"] #bottom-nav:has(.quest-focus),
body[data-quest-priority="action"] #sticky-sellall-bar:has(.quest-focus) {
  position: relative;
  z-index: 78 !important;
}

body[data-quest-priority="action"] #sticky-sellall-bar:has(.quest-focus) {
  position: fixed;
}

body[data-quest-priority="action"][data-quest-mission] .starter-mini-coach:not(.hidden) {
  position: sticky;
  z-index: 82;
}

body[data-quest-priority="action"] .quest-surface {
  position: relative;
  z-index: 79 !important;
  opacity: 1 !important;
  filter: none !important;
}

.starter-mission-card.quest-focus {
  outline-color: rgba(245, 181, 68, 0.82) !important;
  box-shadow:
    0 0 0 4px rgba(245, 181, 68, 0.16),
    0 12px 24px rgba(31, 51, 77, 0.12) !important;
}

.starter-mission-cta.quest-focus,
.trade-btn.quest-focus,
.ps-sellall-btn.quest-focus,
#sticky-sellall-btn.quest-focus,
#topbar-sellall-btn.quest-focus,
#work-btn.quest-focus,
.buy-btn.quest-focus,
.milestone-buy-btn.quest-focus,
.milestone-card.quest-focus,
.nav-btn.quest-focus {
  z-index: 6;
  border-color: #f5b544 !important;
}

body[data-quest-priority="action"][data-quest-mission] .nav-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] .starter-mission-cta.quest-focus,
body[data-quest-priority="action"][data-quest-mission] .trade-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] .ps-sellall-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] #sticky-sellall-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] #topbar-sellall-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] #work-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] .buy-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] .milestone-buy-btn.quest-focus,
body[data-quest-priority="action"][data-quest-mission] .milestone-card.quest-focus {
  z-index: 80;
  box-shadow:
    0 0 0 4px rgba(245, 181, 68, 0.28),
    0 0 24px rgba(245, 181, 68, 0.62),
    0 14px 30px rgba(15, 23, 42, 0.24) !important;
}

body[data-quest-priority="action"][data-quest-mission="buy"] .stock-card:not(.quest-surface),
body[data-quest-priority="action"][data-quest-mission="sell"] .stock-card:not(.quest-surface),
body[data-quest-priority="action"][data-quest-mission="analyst"] #panel-upgrades .item-row:not(.quest-surface) {
  opacity: 0.46;
  filter: saturate(0.78);
}

body[data-quest-priority="action"][data-quest-mission="buy"] .stock-card.quest-surface,
body[data-quest-priority="action"][data-quest-mission="sell"] .stock-card.quest-surface,
body[data-quest-priority="action"][data-quest-mission="analyst"] #panel-upgrades .item-row.quest-surface {
  background: #ffffff !important;
}

body[data-quest-priority="action"] #market-news-feed,
body[data-quest-priority="claim"] #market-news-feed {
  opacity: 0.86;
  filter: saturate(0.96);
}

body[data-quest-priority="action"] .starter-mission-card,
body[data-quest-priority="claim"] .starter-mission-card {
  border-color: rgba(245, 181, 68, 0.40);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 255, 255, 0.98)),
    #ffffff;
}

body[data-quest-priority="claim"] .starter-mission-card {
  border-color: rgba(245, 181, 68, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 255, 255, 0.98)),
    #ffffff;
}

body[data-quest-priority="action"][data-quest-mission] #tip-ticker,
body[data-quest-priority="claim"][data-quest-mission] #tip-ticker {
  opacity: 0.88;
  filter: saturate(0.96);
}

body[data-quest-priority="action"][data-quest-mission] #action-buttons button:not(.quest-focus) {
  opacity: 0.82;
  filter: saturate(0.94);
  box-shadow: none;
}

body[data-quest-priority="action"][data-quest-mission="work"] #main-screen {
  opacity: 0.92;
  filter: saturate(0.96);
}

body[data-quest-priority="action"][data-quest-mission="work"] #main-screen .stock-card {
  pointer-events: none;
}

body[data-quest-priority="action"][data-quest-mission] .toast:not(.tutorial),
body[data-quest-priority="claim"][data-quest-mission] .toast:not(.tutorial) {
  opacity: 0.78;
}

body[data-quest-priority="action"][data-quest-mission] .toast.tutorial,
body[data-quest-priority="claim"][data-quest-mission] .toast.tutorial {
  border-color: rgba(245, 181, 68, 0.55);
  background: rgba(71, 49, 12, 0.96);
  color: #fffaf0;
}

body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-mission-card,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-mission-card,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal {
  margin-top: 8px;
  padding: 8px 10px;
}

body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-focus-row,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-focus-row,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal .starter-focus-row {
  display: block;
}

body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-mission-visual,
body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-money-note,
body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-mission-chips,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-mission-visual,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-money-note,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-mission-chips,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal .starter-mission-visual,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal .starter-money-note,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal .starter-mission-chips {
  display: none;
}

body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-mission-copy,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-mission-copy,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal .starter-mission-copy {
  gap: 1px;
}

body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-mission-copy span,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-mission-copy span,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal .starter-mission-copy span {
  display: none;
}

body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-mission-actions,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-mission-actions,
body:not([data-active-panel="stocks"]) .starter-mission-card.soft-goal .starter-mission-actions {
  margin-top: 6px;
}

body:not([data-active-panel="stocks"])[data-quest-priority="action"][data-quest-mission] .starter-mission-card,
body:not([data-active-panel="stocks"])[data-quest-priority="claim"][data-quest-mission] .starter-mission-card {
  position: sticky;
  top: calc(var(--sticky-topbar-height, 0px) + 6px);
  z-index: 72;
}

body[data-quest-priority="action"] #avatar-scene,
body[data-quest-priority="claim"] #avatar-scene {
  order: 2;
}

body[data-quest-priority="action"] #main-screen,
body[data-quest-priority="claim"] #main-screen {
  order: 3;
}

@media (max-width: 520px) {
  body[data-quest-priority="action"] #avatar-scene,
  body[data-quest-priority="claim"] #avatar-scene {
    min-height: 184px !important;
    margin-top: 8px !important;
  }

  body[data-quest-priority="action"] #ant-avatar-wrap,
  body[data-quest-priority="claim"] #ant-avatar-wrap {
    margin-top: 22px !important;
    transform: scale(0.86);
    transform-origin: center bottom;
  }
}

@keyframes questFocusPulse {
  0%, 100% {
    outline-color: rgba(245, 181, 68, 0.72);
    box-shadow:
      0 0 0 3px rgba(245, 181, 68, 0.14),
      0 0 18px rgba(245, 181, 68, 0.22);
  }
  50% {
    outline-color: rgba(245, 181, 68, 0.96);
    box-shadow:
      0 0 0 3px rgba(245, 181, 68, 0.30),
      0 0 18px rgba(245, 181, 68, 0.46);
  }
}

@media (max-width: 430px) {
  .starter-mini-coach {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 7px 8px;
  }

  .starter-mini-coach span {
    width: fit-content;
  }

  .starter-mini-coach strong,
  .starter-mini-coach em {
    white-space: normal;
  }

  body[data-quest-priority="action"][data-quest-mission] .starter-mission-chips,
  body[data-quest-priority="claim"][data-quest-mission] .starter-mission-chips,
  .starter-mission-card.soft-goal .starter-mission-chips {
    display: none;
  }

  .starter-mission-chip {
    font-size: 0;
    padding: 4px 3px;
  }

  .starter-mission-chip b {
    margin-right: 0;
    font-size: 9px;
  }

  .starter-focus-row {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
  }

  .starter-mission-visual {
    width: 76px;
    height: 46px;
  }

  .starter-money-note {
    font-size: 10px;
  }

}

@media (max-width: 520px) and (max-height: 680px) {
  body[data-quest-priority="action"][data-quest-mission] .starter-mission-card,
  body[data-quest-priority="claim"][data-quest-mission] .starter-mission-card,
  .starter-mission-card.soft-goal {
    margin-top: 6px;
    padding: 8px 10px;
  }

  body[data-quest-priority="action"][data-quest-mission] .starter-focus-row,
  body[data-quest-priority="claim"][data-quest-mission] .starter-focus-row,
  .starter-mission-card.soft-goal .starter-focus-row {
    display: block;
  }

  body[data-quest-priority="action"][data-quest-mission] .starter-mission-visual,
  body[data-quest-priority="action"][data-quest-mission] .starter-money-note,
  body[data-quest-priority="action"][data-quest-mission] .starter-mission-chips,
  body[data-quest-priority="claim"][data-quest-mission] .starter-mission-visual,
  body[data-quest-priority="claim"][data-quest-mission] .starter-money-note,
  body[data-quest-priority="claim"][data-quest-mission] .starter-mission-chips,
  .starter-mission-card.soft-goal .starter-mission-visual,
  .starter-mission-card.soft-goal .starter-money-note,
  .starter-mission-card.soft-goal .starter-mission-chips {
    display: none;
  }

  body[data-quest-priority="action"][data-quest-mission] .starter-mission-copy span,
  body[data-quest-priority="claim"][data-quest-mission] .starter-mission-copy span,
  .starter-mission-card.soft-goal .starter-mission-copy span {
    display: none;
  }

  body[data-quest-priority="action"][data-quest-mission] .starter-mission-actions,
  body[data-quest-priority="claim"][data-quest-mission] .starter-mission-actions,
  .starter-mission-card.soft-goal .starter-mission-actions {
    margin-top: 6px;
  }

  body[data-quest-priority="action"][data-quest-mission] .starter-mission-cta,
  body[data-quest-priority="claim"][data-quest-mission] .starter-mission-cta,
  .starter-mission-card.soft-goal .starter-mission-cta {
    min-height: 30px;
  }
}

/* ============ Avatar scene (개미 캐릭터 + 사치템 씬) ============ */

#avatar-scene {
  position: relative;
  margin: 0 var(--sp-4);
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 60px;
  transition: background 0.6s;
}

/* 자산 등급에 따라 사는 곳이 바뀐다: 반지하 → 원룸 → 아파트 → 펜트하우스 */
#avatar-scene[data-tier="0"] {
  background: linear-gradient(180deg, #e9e7e2 0%, #efe9de 55%, #e3ddd2 100%);
}

#avatar-scene[data-tier="1"] {
  background: linear-gradient(180deg, #fff9ec 0%, #fdf3ff 60%, #eef8ff 100%);
}

#avatar-scene[data-tier="2"] {
  background: linear-gradient(180deg, #e8f4ff 0%, #f6fbff 55%, #fff6e8 100%);
  border-color: rgba(47, 143, 255, 0.3);
}

#avatar-scene[data-tier="3"] {
  background: linear-gradient(180deg, #2a2140 0%, #453069 70%, #5a3f7a 100%);
  border-color: rgba(255, 203, 71, 0.5);
  box-shadow: 0 6px 24px rgba(69, 48, 105, 0.4);
}

#avatar-scene[data-tier="3"] .scene-floor-item {
  filter: drop-shadow(0 0 6px rgba(255, 210, 63, 0.5));
}

#scene-wall {
  width: 100%;
  min-height: 4px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--sp-3);
}

/* 창문은 개미 머리와 겹치지 않게 씬 좌상단 벽에 건다 */
#scene-window {
  position: absolute;
  left: 14px;
  top: 12px;
  width: 52px;
  height: 44px;
  border: 3px solid #b99a72;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

#avatar-scene[data-tier="3"] #scene-window {
  border-color: #ffd23f;
  background: linear-gradient(180deg, #1c2340, #2c3560);
}

#wall-art {
  width: 64px;
  height: 46px;
  background: linear-gradient(135deg, #ff9f9f, #ffd6a5, #9bf6ff, #a0c4ff);
  border: 4px solid #7a5c3e;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  margin-bottom: -6px;
}

#ant-avatar-wrap {
  position: relative;
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  animation: antIdleBob 2.6s ease-in-out infinite;
}

#ant-avatar-wrap.ant-happy {
  animation: antHappyBounce 0.6s ease-out;
}

#ant-avatar-wrap.ant-sad {
  animation: antSadShake 0.5s ease-in-out;
}

@keyframes antIdleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes antHappyBounce {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-22px) scale(1.08); }
  55% { transform: translateY(0) scale(0.98); }
  75% { transform: translateY(-8px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes antSadShake {
  0%, 100% { transform: translateX(0) translateY(0); }
  20% { transform: translateX(-6px) translateY(4px); }
  40% { transform: translateX(6px) translateY(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

#gold-stack {
  position: absolute;
  left: -30px;
  bottom: 6px;
  width: 38px;
  height: 26px;
  filter: drop-shadow(0 3px 6px rgba(246, 184, 75, 0.34));
}

#gold-stack::before,
#gold-stack::after {
  content: '';
  position: absolute;
  left: 0;
  width: 34px;
  height: 9px;
  border: 1px solid rgba(255, 226, 150, 0.76);
  background: linear-gradient(180deg, #ffe08e, #b87913);
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
}

#gold-stack::before {
  bottom: 0;
}

#gold-stack::after {
  left: 5px;
  bottom: 8px;
}

.acc.hidden,
.ant-mouth.hidden,
#ant-avatar.hidden,
#ant-skin-avatar.hidden,
#skin-watch.hidden {
  display: none;
}

#ant-avatar {
  grid-area: 1 / 1;
}

#ant-skin-avatar {
  grid-area: 1 / 1;
  width: 126px;
  height: 126px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 12px 14px rgba(39, 52, 70, 0.14));
  transform: translateY(3px);
}

#skin-watch {
  position: absolute;
  z-index: 3;
  left: 13px;
  top: 82px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: url('../assets/ui/milestone-watch.svg') center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(122, 79, 18, 0.34)) drop-shadow(0 0 3px rgba(245, 181, 68, 0.44));
  transform: rotate(9deg);
  transform-origin: center;
}

/* 황제/신화 티어 오라 & 후광 & 날개 애니메이션 */
#acc-aura {
  transform-origin: 100px 108px;
  transform-box: view-box;
  animation: auraPulse 2.2s ease-in-out infinite;
}

@keyframes auraPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

#acc-halo ellipse {
  filter: drop-shadow(0 0 5px rgba(255, 210, 63, 0.9));
}

#acc-wings {
  transform-origin: 100px 120px;
  transform-box: view-box;
  animation: wingFlap 1.6s ease-in-out infinite;
}

@keyframes wingFlap {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.06) translateY(-2px); }
}

#scene-floor {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  min-height: 4px;
  margin-top: 2px;
}

.scene-floor-item {
  font-size: 26px;
  animation: floorItemPop 0.4s ease-out;
}

@keyframes floorItemPop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* ============ Main / panels ============ */

#main-screen {
  flex: 1;
  padding: var(--sp-4);
  padding-bottom: var(--sp-8);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: var(--sp-3);
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: var(--sp-4) 0 var(--sp-2);
}

.section-label:first-child {
  margin-top: 0;
}

/* ---- Stock cards ---- */

#stock-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.market-news-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 var(--sp-4) var(--sp-3);
  padding: 8px 10px;
  background: rgba(8, 14, 24, 0.56);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.market-news-feed-head {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.market-news-feed-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.market-news-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
}

.market-news-tag {
  min-width: 38px;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.market-news-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.market-news-meta:empty {
  display: none;
}

.market-news-time {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
}

.market-news-item.rumor {
  color: #ffe0a0;
}

.market-news-item.positive {
  color: var(--green);
}

.market-news-item.negative {
  color: var(--red);
}

.portfolio-summary {
  background: linear-gradient(150deg, #fff8e8, #fff);
  border: 1px solid rgba(255, 159, 28, 0.35);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: 0 4px 16px rgba(255, 159, 28, 0.1);
}

.ps-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ps-right {
  text-align: right;
}

.ps-label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 700;
}

.ps-value {
  font-size: 18px;
  font-weight: 900;
}

.ps-pl {
  font-size: 18px;
  font-weight: 900;
}

.ps-pl.up { color: var(--green); }
.ps-pl.down { color: var(--red); }

.ps-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin: 4px 0 var(--sp-2);
}

.ps-sub .up { color: var(--green); }
.ps-sub .down { color: var(--red); }

.ps-sellall-btn {
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffb85c, #ff9f1c);
  box-shadow: 0 3px 0 #c47408, 0 4px 10px rgba(255, 159, 28, 0.3);
  color: #3a2400;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.ps-sellall-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #c47408;
}

.stock-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(31, 36, 55, 0.06);
}

/* 방금 매수한 카드 하이라이트 (매수 → 바로 매도 동선) */
.stock-card.just-bought {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 203, 71, 0.35), 0 6px 20px rgba(255, 159, 28, 0.25);
  animation: justBoughtPulse 0.9s ease-in-out 2;
}

@keyframes justBoughtPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

.stock-card.is-held {
  border-color: rgba(255, 203, 71, 0.4);
  background: linear-gradient(180deg, rgba(255, 203, 71, 0.05), var(--surface) 60%);
}

.stock-card.surge-up {
  border-color: rgba(255, 77, 109, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.3), 0 0 22px rgba(255, 77, 109, 0.18);
}

.stock-card.surge-down {
  border-color: rgba(47, 143, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(47, 143, 255, 0.3), 0 0 22px rgba(47, 143, 255, 0.18);
}

.stock-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
}

.stock-logo {
  --stock-logo-bg: var(--logo-bg, #7fa2e8);
  --stock-logo-border: var(--logo-border, #6f90d0);
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background-color: var(--stock-logo-bg);
  border: 1px solid var(--stock-logo-border);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 14px rgba(31, 36, 55, 0.14);
  overflow: hidden;
}

.stock-logo span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  line-height: 42px;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(24, 32, 50, 0.36), 0 0 1px rgba(24, 32, 50, 0.3);
}

.stock-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.stock-identity-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.stock-name {
  font-size: 16px;
  line-height: 1.15;
  font-weight: 900;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.stock-ticker {
  flex: 0 0 auto;
  border: 1px solid rgba(160, 178, 210, 0.26);
  background: rgba(6, 12, 22, 0.6);
  border-radius: 3px;
  color: #aebbd0;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 5px;
}

.stock-sector {
  font-size: 12px;
  color: var(--text-faint);
}

.div-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffe0a0;
  background: var(--purple-soft);
  border: 1px solid rgba(246, 184, 75, 0.28);
  border-radius: 3px;
  padding: 1px 6px;
}

.stock-price-block {
  text-align: right;
  flex: 0 0 auto;
  min-width: 92px;
}

.stock-price {
  font-size: 18px;
  line-height: 1.08;
  font-weight: 950;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
}

.stock-price.flash-up {
  background-color: var(--green-soft);
  color: var(--green);
  animation: tickPopUp 0.45s ease-out;
}

.stock-price.flash-down {
  background-color: var(--red-soft);
  color: var(--red);
  animation: tickPopDown 0.45s ease-out;
}

@keyframes tickPopUp {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-3px) scale(1.09); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes tickPopDown {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(3px) scale(0.94); }
  100% { transform: translateY(0) scale(1); }
}

/* 가격 옆 상승/하락 화살표 틱 */
.tick-arrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  margin-right: 3px;
  opacity: 0;
  vertical-align: middle;
}

.tick-arrow.show-up {
  color: var(--green);
  animation: tickArrow 0.6s ease-out;
}

.tick-arrow.show-down {
  color: var(--red);
  animation: tickArrow 0.6s ease-out;
}

@keyframes tickArrow {
  0% { opacity: 0; transform: translateY(4px) scale(0.6); }
  30% { opacity: 1; transform: translateY(0) scale(1.2); }
  70% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-4px); }
}

.stock-change {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 950;
}

.stock-change.up { color: var(--green); }
.stock-change.down { color: var(--red); }

.sparkline-wrap {
  --chart-up: #ff4d6d;
  --chart-down: #2f8fff;
  position: relative;
  height: 76px;
  margin: var(--sp-3) 0;
  border-radius: 6px;
  overflow: hidden;
  /* 은은한 배경 그리드(수평선) — 진짜 차트 느낌 */
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 11px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 18px 100%,
    rgba(6, 11, 20, 0.52);
}

.candle-chart {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 꼬리(고가/저가)는 화면상 얇게 유지 (viewBox 가로 스트레치 무시) */
.candle-chart line {
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-impact {
  position: absolute;
  z-index: 2;
  right: 8px;
  top: 6px;
  min-width: 62px;
  text-align: right;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.sparkline-wrap.chart-shock-up {
  animation: chartRushUp 0.82s ease-out;
}

.sparkline-wrap.chart-shock-down {
  animation: chartRushDown 0.82s ease-out;
}

.sparkline-wrap.chart-shock-up .chart-impact {
  color: var(--chart-up);
  animation: chartImpactPop 0.82s ease-out;
}

.sparkline-wrap.chart-shock-down .chart-impact {
  color: var(--chart-down);
  animation: chartImpactPop 0.82s ease-out;
}

.sparkline-wrap.chart-big-shock .chart-impact {
  font-size: 28px;
}

@keyframes chartRushUp {
  0% { box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.28), 0 0 0 rgba(255, 77, 109, 0); }
  35% { box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.72), 0 0 24px rgba(255, 77, 109, 0.24); filter: brightness(1.22); }
  100% { box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0), 0 0 0 rgba(255, 77, 109, 0); filter: brightness(1); }
}

@keyframes chartRushDown {
  0% { box-shadow: inset 0 0 0 1px rgba(47, 143, 255, 0.28), 0 0 0 rgba(47, 143, 255, 0); }
  35% { box-shadow: inset 0 0 0 1px rgba(47, 143, 255, 0.72), 0 0 24px rgba(47, 143, 255, 0.24); filter: brightness(1.18); }
  100% { box-shadow: inset 0 0 0 1px rgba(47, 143, 255, 0), 0 0 0 rgba(47, 143, 255, 0); filter: brightness(1); }
}

@keyframes chartImpactPop {
  0% { opacity: 0; transform: translateY(10px) scale(0.84); }
  28% { opacity: 1; transform: translateY(0) scale(1.16); }
  72% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

.news-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px var(--sp-2);
  border-radius: 999px;
  margin-bottom: var(--sp-2);
}

.news-badge.positive {
  background: var(--green-soft);
  color: var(--green);
}

.news-badge.negative {
  background: var(--red-soft);
  color: var(--red);
}

.news-countdown-track {
  width: 32px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.news-countdown-fill {
  height: 100%;
  background: currentColor;
}

.holding-info {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.holding-pl.up { color: var(--green); font-weight: 700; }
.holding-pl.down { color: var(--red); font-weight: 700; }

.trade-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
}

/* 매수 3버튼 줄과 매도 1버튼 줄 사이 명확한 간격 (겹침 방지) */
.trade-actions + .trade-actions {
  margin-top: var(--sp-3);
}

.trade-group {
  display: flex;
  gap: 6px;
  flex: 1;
}

.trade-btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--sp-2) 0;
  min-height: 44px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.08s;
}

/* 상단 하이라이트 광택 */
.trade-btn::before {
  content: '';
  position: absolute;
  inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

.trade-btn:active {
  transform: translateY(2px) scale(0.98);
  filter: brightness(0.96);
}

.trade-btn.buy {
  background: linear-gradient(180deg, #24d089, #12a566);
  box-shadow: 0 4px 0 #0c7d4d, 0 6px 12px rgba(18, 165, 102, 0.35);
}

.trade-btn.buy:active {
  box-shadow: 0 1px 0 #0c7d4d, 0 3px 7px rgba(18, 165, 102, 0.3);
}

.trade-btn.sell {
  background: linear-gradient(180deg, #ff6b85, #e63757);
  box-shadow: 0 4px 0 #b31f3c, 0 6px 12px rgba(230, 55, 87, 0.32);
}

.trade-btn.sell:active {
  box-shadow: 0 1px 0 #b31f3c, 0 3px 7px rgba(230, 55, 87, 0.28);
}

.trade-btn:disabled {
  background: #e6e9f2;
  color: #b3b9cc;
  box-shadow: 0 3px 0 #d2d6e2;
  cursor: default;
}

.trade-btn:disabled::before {
  display: none;
}

/* ---- Generic item rows (upgrades/milestones) ---- */

.item-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  box-shadow: 0 3px 12px rgba(31, 36, 55, 0.05);
}

.item-row.unaffordable {
  opacity: 0.55;
}

.item-row.owned {
  border-color: rgba(46, 230, 166, 0.4);
}

.item-row.achievable {
  border-color: rgba(255, 203, 71, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 203, 71, 0.15) inset;
}

.item-icon {
  font-size: 26px;
  width: 34px;
  text-align: center;
}

.item-icon.text-icon {
  display: inline-grid;
  place-items: center;
  height: 28px;
  border: 1px solid rgba(160, 178, 210, 0.28);
  background: rgba(8, 14, 24, 0.58);
  color: #aebbd0;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  border-radius: 2px;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 14px;
  font-weight: 700;
}

.item-level {
  color: var(--purple);
  font-weight: 600;
  font-size: 12px;
}

.item-sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.mini-progress {
  height: 4px;
  background: #e5e8eb;
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
}

.buy-btn {
  background: var(--gold);
  color: #201400;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  min-height: 44px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  min-width: 80px;
  transition: transform 0.08s;
}

.buy-btn:active {
  transform: scale(0.94);
}

.buy-btn:disabled {
  background: var(--surface-alt);
  color: var(--text-faint);
  cursor: default;
}

.buy-btn .cost {
  font-weight: 600;
  display: block;
  font-size: 12px;
}

.milestone-resell-btn {
  width: 100%;
  margin-top: var(--sp-2);
  padding: var(--sp-2);
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* ---- Milestone cards ---- */

.milestone-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  box-shadow: 0 4px 16px rgba(31, 36, 55, 0.06);
}

.milestone-card.purchased {
  border-color: rgba(46, 230, 166, 0.4);
  background: linear-gradient(180deg, rgba(46, 230, 166, 0.06), var(--surface));
}

.milestone-card.achievable {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(255, 203, 71, 0.12);
}

.milestone-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.milestone-emoji {
  font-size: 30px;
}

.milestone-name {
  font-weight: 700;
  font-size: 15px;
}

.milestone-sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.milestone-bar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.milestone-buy-btn {
  width: 100%;
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gold);
  color: #201400;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.milestone-buy-btn:disabled {
  background: var(--surface-alt);
  color: var(--text-faint);
  cursor: default;
}

/* ---- 도움말 (게임 설명서) ---- */

.help-content {
  max-width: 400px;
  text-align: left;
}

.help-content h2 {
  text-align: center;
}

#help-body {
  max-height: 56vh;
  overflow-y: auto;
  margin-bottom: var(--sp-3);
  padding-right: 4px;
}

.help-section {
  margin-bottom: var(--sp-3);
}

.help-section h3 {
  font-size: 14px;
  color: var(--purple);
  margin-bottom: 4px;
}

.help-section p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 0 !important;
}

.help-disclaimer {
  font-size: 11px;
  color: var(--text-faint);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  line-height: 1.6;
  margin-bottom: 0 !important;
}

/* ---- 온보딩 가이드 / 출석 보상 ---- */

.guide-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--sp-4);
}

.guide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.guide-dot.active {
  background: var(--purple);
  transform: scale(1.25);
}

.daily-streak-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--sp-4);
}

.daily-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-alt);
  color: var(--text-faint);
  border: 1px solid var(--border);
}

.daily-dot.filled {
  background: linear-gradient(180deg, #ffd23f, #ff9f1c);
  color: #3a2400;
  border-color: #e8a41c;
  box-shadow: 0 2px 6px rgba(255, 159, 28, 0.4);
}

/* ---- 세이브 코드 모달 ---- */

.save-content {
  max-width: 380px;
}

.save-desc {
  font-size: 12px;
  margin-bottom: var(--sp-3) !important;
}

#save-code-area {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-dim);
  padding: var(--sp-2);
  resize: none;
  margin-bottom: var(--sp-3);
  word-break: break-all;
  user-select: text;
  -webkit-user-select: text;
}

/* ---- 환생 / 업적 ---- */

.prestige-card {
  background: linear-gradient(150deg, #f3edff, #e8f4ff);
  border: 1px solid rgba(124, 92, 255, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.12);
}

.prestige-card.ready {
  border-color: var(--purple);
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.3);
}

.prestige-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.prestige-emoji {
  font-size: 30px;
  animation: prestigeSpin 6s linear infinite;
}

@keyframes prestigeSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.prestige-btn {
  width: 100%;
  margin-top: var(--sp-3);
  min-height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #a685ff, #7c5cff);
  box-shadow: 0 4px 0 #5a3fd1, 0 6px 14px rgba(124, 92, 255, 0.35);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.prestige-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #5a3fd1;
}

.prestige-btn:disabled {
  background: #e6e9f2;
  color: #b3b9cc;
  box-shadow: 0 3px 0 #d2d6e2;
  cursor: default;
}

/* ============ 진화 도감 ============ */

.codex-row {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: var(--sp-1) var(--sp-1) var(--sp-3);
  margin-bottom: var(--sp-4);
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.codex-card {
  flex: 0 0 96px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  box-shadow: 0 2px 8px rgba(34, 38, 58, 0.05);
}

.codex-card.locked {
  filter: grayscale(1);
  opacity: 0.5;
  background: var(--surface-alt);
}

.codex-card.achieved {
  border-color: rgba(255, 159, 28, 0.35);
  background: linear-gradient(180deg, rgba(255, 203, 71, 0.08), var(--surface));
}

.codex-card.current {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-soft), var(--surface));
  box-shadow: 0 0 0 2px rgba(255, 159, 28, 0.35), 0 0 20px rgba(255, 159, 28, 0.4);
  transform: translateY(-2px);
}

.codex-emoji {
  font-size: 30px;
  line-height: 1;
}

.codex-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.codex-threshold {
  display: block;
  max-width: 100%;
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 700;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.achievement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.achievement-chip {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  flex-direction: column;
  opacity: 0.55;
}

.achievement-chip.unlocked {
  opacity: 1;
  border-color: rgba(255, 203, 71, 0.55);
  background: linear-gradient(180deg, rgba(255, 203, 71, 0.1), var(--surface));
}

.achievement-emoji {
  font-size: 20px;
}

.achievement-name {
  font-size: 12px;
  font-weight: 800;
}

.achievement-desc {
  font-size: 10px;
  color: var(--text-faint);
}

/* ============ Bottom nav ============ */

#bottom-nav {
  display: flex;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  position: sticky;
  bottom: 0;
}

.nav-btn {
  position: relative;
  flex: 1;
  background: transparent;
  color: var(--text-faint);
  border: none;
  padding: var(--sp-3) 0;
  padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  min-height: 52px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.nav-btn.active {
  color: var(--gold);
  border-top: 2px solid var(--gold);
  margin-top: -1px;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 22%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--surface);
}

/* ============ Toasts ============ */

#toast-container {
  position: fixed;
  top: var(--toast-top, calc(env(safe-area-inset-top) + 12px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 90%;
  max-width: 440px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: rgba(20, 24, 38, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.25s ease-out, toastOut 0.3s ease-in 3.2s forwards;
  white-space: normal;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  word-break: keep-all;
}

.toast.income { border-color: rgba(46, 230, 166, 0.4); color: var(--green); }
.toast.reward { border-color: rgba(255, 203, 71, 0.5); color: var(--gold); }
.toast.info { border-color: rgba(93, 168, 255, 0.4); color: var(--blue); }

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}

.screen-flash {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: radial-gradient(circle, rgba(255, 241, 214, 0.9), rgba(255, 159, 28, 0.15) 60%, transparent 80%);
  pointer-events: none;
  animation: screenFlashFade 0.5s ease-out forwards;
}

@keyframes screenFlashFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============ Particles ============ */

.particle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 260;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: particleBurst 750ms ease-out forwards;
}

@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ============ Modals ============ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 10, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--sp-4);
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  max-width: 340px;
  width: 100%;
  text-align: center;
  animation: modalPop 0.25s ease-out;
  box-shadow: 0 20px 60px rgba(31, 36, 55, 0.2);
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.94); }
  100% { opacity: 1; transform: scale(1); }
}

.modal-emoji {
  font-size: 52px;
  margin-bottom: var(--sp-2);
}

.modal-badge {
  display: inline-grid;
  place-items: center;
  min-width: 76px;
  height: 42px;
  margin-bottom: var(--sp-3);
  padding: 0 var(--sp-3);
  border: 1px solid rgba(246, 184, 75, 0.5);
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(246, 184, 75, 0.16), rgba(246, 184, 75, 0.06));
  background-size: 10px 10px, 10px 10px, auto;
  color: #ffe0a0;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
  border-radius: 3px;
}

/* ---- 플렉스(사치템 구매) 레벨업 연출 ---- */

.flex-content {
  overflow: visible;
  position: relative;
}

.tier-next {
  font-size: 13px;
  font-weight: 800;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: 999px;
  padding: 6px var(--sp-3);
  margin-bottom: var(--sp-4);
  display: inline-block;
}

.flex-glow-ring {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-glow-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 159, 28, 0.35), rgba(124, 92, 255, 0.15) 60%, transparent 75%);
  animation: flexGlowPulse 1.4s ease-in-out infinite;
}

@keyframes flexGlowPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

.flex-emoji {
  position: relative;
  font-size: 64px;
  margin-bottom: 0;
  animation: flexEmojiSpin 0.7s ease-out;
}

@keyframes flexEmojiSpin {
  0% { transform: scale(0.2) rotate(-25deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.modal-content h2 {
  margin-bottom: var(--sp-3);
  color: var(--gold);
  font-size: 19px;
}

.modal-content p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: var(--sp-5);
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

#offline-text,
#daily-text,
#sell-reward-text,
#loss-cut-text,
#guide-text {
  display: grid;
  gap: 3px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#offline-text span,
#daily-text span,
#sell-reward-text span,
#loss-cut-text span,
#milestone-modal-text span,
#guide-text span,
.offline-breakdown-note span {
  display: block;
}

.modal-highlight {
  font-size: 26px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: var(--sp-5);
}

.modal-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
}

.modal-actions button {
  flex: 1;
  padding: var(--sp-3);
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface-alt);
  color: var(--text);
}

.modal-actions button.highlight {
  background: var(--gold);
  color: #201400;
}

/* ============ 매도 시트 (bottom sheet) ============ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 10, 0.55);
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(31, 36, 55, 0.25);
  animation: sheetUp 0.25s ease-out;
}

@keyframes sheetUp {
  0% { transform: translateY(60%); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  margin: 0 auto var(--sp-3);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-3);
}

.sheet-title {
  font-size: 17px;
  font-weight: 800;
}

.sheet-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.sheet-price-block {
  text-align: right;
}

.sheet-price {
  font-size: 17px;
  font-weight: 800;
}

.sheet-pl {
  font-size: 13px;
  font-weight: 800;
}

.sheet-pl.up, .sell-preview-row .up { color: var(--green); }
.sheet-pl.down, .sell-preview-row .down { color: var(--red); }

.sell-portion-chips {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.sell-portion-chips button {
  flex: 1;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
}

.sell-portion-chips button.active {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}

#sell-slider {
  width: 100%;
  margin-bottom: var(--sp-3);
  accent-color: var(--red);
  height: 32px;
}

.sell-preview {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sell-preview-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
}

.sell-preview-row span:last-child {
  font-weight: 800;
  color: var(--text);
}

.sell-preview-row span.up { color: var(--green); }
.sell-preview-row span.down { color: var(--red); }

#sell-preview-leverage {
  font-size: 11px;
  color: var(--purple);
}

.sell-confirm-btn {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ff6b85, #e63757);
  box-shadow: 0 4px 0 #b31f3c, 0 6px 12px rgba(230, 55, 87, 0.32);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.sell-confirm-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #b31f3c, 0 3px 7px rgba(230, 55, 87, 0.28);
}

/* ============ 장중 단타 미니게임 ============ */

.daytrade-content {
  max-width: 380px;
  padding: var(--sp-4);
}

.daytrade-content h2 {
  color: var(--purple);
  margin-bottom: var(--sp-1);
}

.daytrade-desc {
  font-size: 12px;
  margin-bottom: var(--sp-3) !important;
}

.daytrade-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: var(--sp-2);
}

#daytrade-timer {
  color: var(--text-dim);
}

#daytrade-earned {
  color: var(--green);
  font-size: 16px;
}

.daytrade-timebar {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--sp-3);
}

#daytrade-timebar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 999px;
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.1s linear;
  will-change: transform;
}

#daytrade-field {
  position: relative;
  height: 320px;
  background:
    linear-gradient(rgba(124, 92, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #f6f9ff, #eef2ff);
  background-size: 24px 24px, 24px 24px, 100% 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: manipulation;
}

#daytrade-field.done {
  opacity: 0.45;
  height: 120px;
  transition: height 0.25s ease-out, opacity 0.25s;
}

/* ============ 2026-07-02 Launch Polish: sharp market HUD skin ============ */

.modal {
  overflow-y: auto;
  align-items: flex-start;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.modal-content {
  margin: auto;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

:root {
  --bg: #0b111c;
  --surface: #111a28;
  --surface-alt: #172234;
  --surface-raised: #1c2a3f;
  --border: #2f405a;
  --border-soft: #26364d;

  --gold: #f6b84b;
  --gold-soft: rgba(246, 184, 75, 0.14);
  --green: #28d28f;
  --green-soft: rgba(40, 210, 143, 0.14);
  --red: #ff5d72;
  --red-soft: rgba(255, 93, 114, 0.14);
  --purple: #8f7cff;
  --purple-soft: rgba(143, 124, 255, 0.14);
  --blue: #58a6ff;

  --text: #eef4ff;
  --text-dim: #a9b6ca;
  --text-faint: #75849a;

  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
}

body {
  background:
    linear-gradient(rgba(160, 180, 215, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 180, 215, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #070b12 0%, #0d1522 42%, #121d2d 100%);
  background-size: 24px 24px, 24px 24px, auto;
  color: var(--text);
}

#app {
  background: linear-gradient(180deg, rgba(13, 21, 34, 0.98), rgba(16, 27, 43, 0.98));
  box-shadow: 0 0 0 1px rgba(130, 153, 190, 0.16), 0 22px 70px rgba(0, 0, 0, 0.48);
}

#splash {
  background:
    linear-gradient(rgba(190, 204, 230, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 204, 230, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(5, 9, 16, 0.92) 0%, rgba(8, 13, 22, 0.72) 42%, rgba(8, 13, 22, 0.28) 100%),
    url('../assets/splash-key-visual.png'),
    linear-gradient(180deg, #090e17 0%, #111c2d 63%, #192941 100%);
  background-size: 24px 24px, 24px 24px, auto, cover, auto;
  background-position: center, center, center, center bottom, center;
  align-items: flex-start;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.splash-content {
  width: min(100%, 336px);
  margin-top: clamp(8px, 6dvh, 54px);
  position: relative;
  z-index: 1;
}

.splash-emoji {
  margin-bottom: 18px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.46));
  animation-duration: 3.2s;
}

.splash-content h1 {
  color: #fff;
  background: none;
  letter-spacing: 0;
  font-size: clamp(28px, 7vw, 32px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72), 0 0 26px rgba(246, 184, 75, 0.42);
}

.splash-tagline,
.splash-disclaimer {
  color: rgba(235, 242, 255, 0.88);
}

.splash-tagline {
  font-size: 15px;
  margin-bottom: 18px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.78);
}

.splash-disclaimer {
  background: rgba(5, 10, 18, 0.9);
  border-color: rgba(246, 184, 75, 0.42);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.34);
  overflow-wrap: break-word;
  word-break: keep-all;
}

.privacy-link {
  color: #b7a8ff;
  display: inline;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: keep-all;
}

#splash-start-btn {
  background: linear-gradient(180deg, #ffc85b 0%, #f0a22b 100%);
  border: 1px solid rgba(255, 231, 166, 0.55);
  color: #160f06;
  box-shadow: 0 3px 0 #8f5208, 0 12px 24px rgba(240, 162, 43, 0.25);
}

#splash-start-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8f5208, 0 6px 14px rgba(240, 162, 43, 0.22);
}

#splash-start-btn,
#action-buttons button,
.trade-btn,
.buy-btn,
.bank-btn,
.modal-actions button,
.sell-confirm-btn,
.nav-btn {
  border-radius: 3px !important;
  text-transform: none;
}

#topbar {
  background:
    linear-gradient(rgba(170, 191, 225, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 191, 225, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #0b111b 0%, #101b2b 58%, #15233a 100%);
  background-size: 20px 20px, 20px 20px, auto;
  border-bottom: 1px solid rgba(246, 184, 75, 0.22);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}

.hud-shine {
  opacity: 0.34;
}

#asset-title {
  background: rgba(246, 184, 75, 0.11);
  border-color: rgba(246, 184, 75, 0.42);
  color: #ffe0a0;
  border-radius: 3px;
}

#mute-btn,
#ranking-btn,
#invite-btn {
  background: rgba(12, 20, 33, 0.72);
  border-color: rgba(160, 178, 210, 0.3);
  border-radius: 3px;
  box-shadow: none;
  color: #eaf1ff;
}

#invite-btn.glow,
#action-buttons button.glow {
  animation: glowPulse 2s infinite;
  box-shadow: 0 0 0 1px rgba(246, 184, 75, 0.32);
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(246, 184, 75, 0.28); }
  50% { box-shadow: 0 0 0 1px rgba(246, 184, 75, 0.64), 0 0 14px rgba(246, 184, 75, 0.22); }
}

.stat-value {
  letter-spacing: 0;
}

.stat-value.gold {
  color: #ffe1a4;
  text-shadow: 0 0 16px rgba(246, 184, 75, 0.28);
}

.income-rate {
  color: #8df1c6;
  text-shadow: none;
}

.cash-chip,
#milestone-progress-wrap {
  background: rgba(6, 12, 22, 0.52);
  border-color: rgba(160, 178, 210, 0.24);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.progress-bar,
.progress-fill,
.mini-progress,
.mini-progress-fill,
.daytrade-timebar,
#daytrade-timebar-fill {
  border-radius: 2px !important;
}

.progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.36);
}

.progress-fill {
  background: linear-gradient(90deg, #f3a83a, #ffe08e);
  box-shadow: 0 0 10px rgba(246, 184, 75, 0.34);
}

#tip-ticker {
  background: #0e1725;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
}

#help-btn,
#nickname-btn {
  background: #141f31;
  border-color: var(--border);
  color: var(--text-dim);
  border-radius: 3px;
}

#action-buttons {
  background: rgba(9, 15, 25, 0.74);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#action-buttons button {
  background: linear-gradient(180deg, #1b2a40, #121c2d);
  border-color: rgba(135, 155, 190, 0.26);
  color: #e8f0ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 rgba(0, 0, 0, 0.38);
}

#action-buttons button.action-primary {
  background: linear-gradient(180deg, #254360, #18283d);
  border-color: rgba(88, 166, 255, 0.42);
  color: #f2f7ff;
}

#action-buttons button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.22);
}

#tip-ticker,
.portfolio-summary,
.stock-card,
.item-row,
.bank-card,
.modal-content,
.sheet,
#avatar-scene {
  border-radius: 4px !important;
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.stock-card,
.item-row,
.bank-card,
.portfolio-summary,
.milestone-card,
.prestige-card,
.codex-card,
.achievement-chip {
  background:
    linear-gradient(90deg, rgba(88, 166, 255, 0.065), transparent 42%),
    linear-gradient(180deg, rgba(26, 39, 59, 0.98), rgba(15, 24, 38, 0.98));
  border-color: var(--border-soft);
}

.panel-desc,
.ps-label,
.ps-sub,
.stock-sector,
.holding-info,
.item-sub,
.bank-rate,
.milestone-sub,
.ranking-worth,
.ranking-rank,
.achievement-desc {
  color: var(--text-dim);
}

.section-label {
  color: #7f90aa;
  letter-spacing: 0.04em;
}

.portfolio-summary {
  border-color: var(--border);
}

.ps-value,
.stock-name,
.item-name,
.milestone-name,
.codex-name,
.achievement-name,
.sheet-title,
.sheet-price,
.modal-content h2 {
  color: var(--text);
}

.ps-pl.up,
.stock-change.up,
.holding-pl.up,
.sheet-pl.up,
.sell-preview-row .up,
.ps-sub .up {
  color: var(--green);
}

.ps-pl.down,
.stock-change.down,
.holding-pl.down,
.sheet-pl.down,
.sell-preview-row .down,
.ps-sub .down {
  color: var(--red);
}

.stock-card.is-held {
  background:
    linear-gradient(90deg, rgba(246, 184, 75, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(29, 42, 63, 0.98), rgba(15, 24, 38, 0.98));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

.stock-card.just-bought,
.milestone-card.achievable,
.item-row.achievable,
.prestige-card.ready {
  box-shadow: 0 0 0 1px rgba(246, 184, 75, 0.42), 0 0 18px rgba(246, 184, 75, 0.14);
}

.stock-card.surge-up,
.stock-card.is-held.surge-up {
  border-color: rgba(255, 77, 109, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.38), 0 0 24px rgba(255, 77, 109, 0.22);
}

.stock-card.surge-down,
.stock-card.is-held.surge-down {
  border-color: rgba(47, 143, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(47, 143, 255, 0.38), 0 0 24px rgba(47, 143, 255, 0.22);
}

.stock-name,
.item-name,
.bank-label {
  letter-spacing: 0;
}

.stock-name-block,
.stock-price-block,
.item-info,
.milestone-head > div,
.ps-head > div {
  min-width: 0;
}

.stock-name,
.item-name,
.milestone-name,
.achievement-name {
  overflow-wrap: anywhere;
}

.stock-price {
  border-radius: 3px;
  color: var(--text);
}

.stock-price.flash-up {
  background-color: var(--green-soft);
}

.stock-price.flash-down {
  background-color: var(--red-soft);
}

.sparkline-wrap {
  background:
    linear-gradient(rgba(160, 178, 210, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 178, 210, 0.055) 1px, transparent 1px),
    #0a111d;
  background-size: 16px 16px;
  border: 1px solid rgba(160, 178, 210, 0.12);
  border-radius: 3px;
}

.news-badge,
.div-badge,
.item-level,
.sell-portion-chips button,
.daily-dot,
.guide-dot,
.toast {
  border-radius: 3px !important;
}

.div-badge {
  background: var(--purple-soft);
  color: #bdb2ff;
}

.news-badge.positive {
  background: var(--green-soft);
}

.news-badge.negative {
  background: var(--red-soft);
}

.holding-info,
.sell-preview,
.help-disclaimer,
.ranking-myrank,
#save-code-area {
  background: rgba(8, 14, 24, 0.58);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
}

.trade-btn,
.ps-sellall-btn,
.buy-btn,
.bank-btn,
.milestone-buy-btn,
.prestige-btn,
.sell-confirm-btn,
.modal-actions button.highlight {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 rgba(0, 0, 0, 0.42);
}

.trade-btn::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
}

.trade-btn.buy {
  background: linear-gradient(180deg, #2fd996, #139961);
}

.trade-btn.sell,
.sell-confirm-btn {
  background: linear-gradient(180deg, #ff667b, #d9344f);
}

.trade-btn:active,
.ps-sellall-btn:active,
.buy-btn:active,
.bank-btn:active,
.milestone-buy-btn:active,
.prestige-btn:active,
.sell-confirm-btn:active,
.modal-actions button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.24);
}

.trade-btn:disabled,
.buy-btn:disabled,
.milestone-buy-btn:disabled,
.prestige-btn:disabled {
  background: #182233;
  color: #68778d;
  box-shadow: none;
  border-color: var(--border-soft);
}

.sell-portion-chips button {
  background: #111a28;
  border-color: var(--border);
  color: var(--text-dim);
}

.sell-portion-chips button.active {
  background: #21324a;
  border-color: var(--gold);
  color: #ffe0a0;
  box-shadow: none;
}

.bank-label,
.help-section h3,
.daytrade-content h2 {
  color: #ffe0a0;
  text-shadow: none;
}

.bank-card {
  text-align: left;
}

.bank-balance {
  color: var(--text);
}

.codex-card.current,
.achievement-chip.unlocked,
.milestone-card.purchased,
.item-row.owned {
  background:
    linear-gradient(90deg, rgba(40, 210, 143, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(26, 39, 59, 0.98), rgba(15, 24, 38, 0.98));
  border-color: rgba(40, 210, 143, 0.38);
  box-shadow: none;
}

.guide-dot,
.daily-dot {
  background: #172234;
  border-color: var(--border);
}

.daily-dot.filled {
  background: linear-gradient(180deg, #ffc85b, #f0a22b);
  color: #160f06;
  box-shadow: none;
}

#avatar-scene {
  background:
    linear-gradient(rgba(175, 193, 225, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(175, 193, 225, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #0a101b 0%, #142034 46%, #101824 100%) !important;
  background-size: 22px 22px, 22px 22px, auto !important;
  overflow: hidden;
}

#scene-wall {
  border-radius: 0 !important;
}

#scene-window {
  border-color: rgba(246, 184, 75, 0.48);
  background: linear-gradient(180deg, #101c2d, #0a111d);
  border-radius: 3px;
}

#wall-art {
  border-radius: 3px;
  border-color: rgba(246, 184, 75, 0.5);
}

.sheet {
  border-radius: 6px 6px 0 0 !important;
}

.sheet-handle {
  background: var(--border);
  border-radius: 2px;
}

.modal-content {
  background:
    linear-gradient(90deg, rgba(88, 166, 255, 0.06), transparent 44%),
    linear-gradient(180deg, #182337, #101927);
}

.modal-content p {
  color: var(--text-dim);
}

.modal-actions button {
  background: #19253a;
  color: var(--text);
}

#bottom-nav {
  background: rgba(8, 14, 23, 0.96);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.26);
}

.nav-btn {
  color: var(--text-faint);
}

.nav-btn.active {
  color: #ffe0a0;
  background: linear-gradient(180deg, rgba(246, 184, 75, 0.12), rgba(246, 184, 75, 0.02));
  border-top-color: var(--gold);
}

.nav-badge {
  border-radius: 50%;
  box-shadow: 0 0 0 2px #08101a;
}

.toast {
  background: rgba(8, 13, 22, 0.96);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

#daytrade-field {
  height: clamp(190px, 48dvh, 300px);
  border-radius: 4px;
  background:
    linear-gradient(rgba(160, 178, 210, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 178, 210, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, #0b1320, #101a2a);
  border-color: var(--border);
}

.daytrade-target {
  position: absolute;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.04em;
  color: #062414;
  cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #d9fff0, #2ee6a6 70%);
  box-shadow: 0 4px 14px rgba(23, 185, 120, 0.45);
  animation: daytradeTargetPop 1.05s ease-out forwards;
  padding: 0;
  contain: layout paint style;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}

.daytrade-target.gold {
  background: radial-gradient(circle at 35% 30%, #fff6d9, #ffcb47 70%);
  box-shadow: 0 4px 18px rgba(255, 159, 28, 0.65);
  color: #4c2d00;
}

@keyframes daytradeTargetPop {
  0% { transform: scale(0); opacity: 0; }
  12% { transform: scale(1.15); opacity: 1; }
  20% { transform: scale(1); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.4); opacity: 0; }
}

.daytrade-pop {
  position: absolute;
  font-size: 14px;
  font-weight: 900;
  color: var(--green);
  text-shadow: 0 1px 0 #fff;
  pointer-events: none;
  animation: daytradePopRise 0.7s ease-out forwards;
  z-index: 5;
}

@keyframes daytradePopRise {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-36px); opacity: 0; }
}

#daytrade-result p {
  margin-bottom: var(--sp-2);
}

/* ============ UI chrome de-emoji pass ============ */

.splash-brand-mark {
  margin-bottom: 18px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.48));
}

#asset-title {
  white-space: nowrap;
}

#mute-btn,
#ranking-btn,
#invite-btn {
  min-height: 32px;
  white-space: nowrap;
  letter-spacing: 0;
}

#mute-btn {
  min-width: 60px;
  color: #8df1c6;
}

#mute-btn.muted {
  color: #ff9cab;
  border-color: rgba(255, 93, 114, 0.34);
}

#ranking-btn,
#invite-btn {
  min-width: 44px;
}

.tip-body {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tip-body b {
  flex: 0 0 auto;
  color: #ffe0a0;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border: 1px solid rgba(246, 184, 75, 0.34);
  background: rgba(246, 184, 75, 0.08);
  border-radius: 2px;
}

#action-buttons button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-items: start;
  gap: 7px;
  min-height: 50px;
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.1;
  text-align: left;
}

#action-buttons button::before {
  content: attr(data-icon);
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(160, 178, 210, 0.34);
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(28, 43, 64, 0.96), rgba(7, 12, 20, 0.96));
  color: #dce8f8;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

#action-buttons button.action-primary::before {
  color: #fff1bd;
  border-color: rgba(246, 184, 75, 0.54);
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.3), transparent 30%),
    linear-gradient(180deg, rgba(246, 184, 75, 0.34), rgba(13, 22, 35, 0.96));
}

#free-cash-btn.glow::before,
#boost-btn.glow::before {
  color: #ffe0a0;
  border-color: rgba(246, 184, 75, 0.58);
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.32), transparent 30%),
    linear-gradient(180deg, rgba(246, 184, 75, 0.28), rgba(13, 22, 35, 0.96));
}

.ps-sellall-btn,
.trade-btn,
.sell-confirm-btn {
  font-size: 15px;
  letter-spacing: 0;
}

#bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.nav-btn {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding-top: 7px;
  font-size: 11px;
  line-height: 1.05;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 19px;
  padding: 0 4px;
  border: 1px solid rgba(160, 178, 210, 0.26);
  background: rgba(17, 26, 40, 0.8);
  color: #7f90aa;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.04em;
  border-radius: 2px;
}

.nav-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.nav-btn.active .nav-icon {
  border-color: rgba(246, 184, 75, 0.58);
  background: rgba(246, 184, 75, 0.14);
  color: #ffe0a0;
}

.nav-badge {
  top: 6px;
  right: 18%;
}

.daytrade-content h2 {
  font-size: 20px;
  letter-spacing: 0;
}

/* App-style visual badges for the sticky HUD. */
#asset-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 154px;
  padding: 5px 9px 5px 6px;
}

.tier-ant-mark {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 32px;
  overflow: hidden;
  border: 1px solid rgba(246, 184, 75, 0.58);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 226, 143, 0.14), rgba(7, 12, 20, 0.04)),
    url('../assets/generated/ant-badge.png') center 54% / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 10px rgba(0, 0, 0, 0.24);
}

.tier-ant-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 38%, rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.tier-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
}

.tier-name {
  font-size: 13px;
  font-weight: 950;
  color: #fff0bd;
  line-height: 1.05;
}

.tier-progress-text {
  font-size: 9px;
  font-weight: 850;
  color: #aebbd0;
  line-height: 1.1;
  white-space: nowrap;
}

#mute-btn {
  min-width: 38px;
  width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.sound-icon {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
}

.sound-body {
  fill: currentColor;
}

.sound-wave,
.sound-slash {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-slash {
  opacity: 0;
}

#mute-btn.muted .sound-wave {
  opacity: 0;
}

#mute-btn.muted .sound-slash {
  opacity: 1;
}

.ps-sellall-btn:disabled {
  background: rgba(35, 47, 66, 0.95);
  box-shadow: none;
  color: #8290a5;
  cursor: default;
}

.portfolio-summary {
  min-height: 154px;
}

.stock-logo {
  background-color: var(--stock-logo-bg);
  border-color: var(--stock-logo-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 14px rgba(0, 0, 0, 0.2);
}

.stock-logo span {
  color: #fff;
  line-height: 42px;
  text-shadow: 0 1px 2px rgba(24, 32, 50, 0.36), 0 0 1px rgba(24, 32, 50, 0.3);
}

.sparkline-wrap {
  height: 80px;
  margin: 12px 0;
  border: 1px solid rgba(160, 178, 210, 0.16);
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    rgba(6, 11, 20, 0.52);
  background-size: 100% 13px, 20px 100%, auto;
}

.candle-chart line {
  stroke-width: 1.2;
  opacity: 0.9;
}

.candle-trend {
  fill: none;
  stroke: rgba(255, 225, 139, 0.82);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.86;
  filter: drop-shadow(0 0 2px rgba(255, 199, 84, 0.24));
}

.candle-chart rect {
  rx: 0.4px;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.1));
}

.candle-chart rect.candle-body.up {
  filter: drop-shadow(0 0 2px rgba(255, 77, 109, 0.38));
}

.candle-chart rect.candle-body.down {
  filter: drop-shadow(0 0 2px rgba(47, 143, 255, 0.34));
}

.holding-info {
  min-height: 46px;
  align-items: center;
}

.holding-info:not(.is-held) {
  color: #7f90aa;
  border-style: dashed;
}

.sell-row {
  min-height: 38px;
}

.sell-row:not(.is-held) .trade-btn.sell {
  background: rgba(35, 47, 66, 0.92);
  box-shadow: none;
  color: #7f90aa;
}

.item-icon,
.milestone-emoji,
.prestige-emoji,
.codex-emoji,
.achievement-emoji,
.modal-emoji,
.modal-badge,
.scene-floor-item {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(160, 178, 210, 0.34);
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(19, 31, 49, 0.98), rgba(9, 15, 25, 0.98));
  background-size: 9px 9px, 9px 9px, auto;
  color: #dbe7f7;
  font-weight: 950;
  letter-spacing: 0.02em;
  font-family: inherit;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.item-icon,
.milestone-emoji {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 4px;
  font-size: 11px;
}

.prestige-emoji,
.codex-emoji,
.achievement-emoji {
  border-radius: 3px;
  color: #ffe0a0;
  border-color: rgba(246, 184, 75, 0.42);
  background:
    linear-gradient(rgba(246, 184, 75, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 184, 75, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(246, 184, 75, 0.12), rgba(5, 10, 18, 0.9));
  background-size: 9px 9px, 9px 9px, auto;
}

.prestige-emoji {
  width: 44px;
  height: 44px;
  font-size: 12px;
  animation: none;
}

.codex-emoji {
  width: 46px;
  height: 28px;
  font-size: 11px;
}

.achievement-emoji {
  width: 42px;
  height: 30px;
  margin-bottom: 8px;
  font-size: 9px;
}

.achievement-chip:not(.unlocked) .achievement-emoji,
.codex-card.locked .codex-emoji {
  color: #8fa0b8;
  border-color: rgba(160, 178, 210, 0.2);
  background: rgba(10, 17, 28, 0.9);
}

.modal-emoji,
.flex-emoji {
  width: 82px;
  height: 56px;
  margin: 0 auto;
  border-radius: 4px;
  font-size: 16px;
  color: #ffe0a0;
  border-color: rgba(246, 184, 75, 0.5);
  animation: none;
}

.scene-floor-item {
  width: 52px;
  height: 34px;
  border-color: rgba(246, 184, 75, 0.38);
  color: #ffe0a0;
  font-size: 10px;
}

.item-icon[data-icon],
.milestone-emoji[data-icon],
.prestige-emoji[data-icon],
.codex-emoji[data-icon],
.achievement-emoji[data-icon],
.modal-emoji[data-icon],
.modal-badge[data-icon],
.scene-floor-item[data-icon] {
  position: relative;
  font-size: 0;
  overflow: hidden;
}

.item-icon[data-icon]::before,
.milestone-emoji[data-icon]::before,
.prestige-emoji[data-icon]::before,
.codex-emoji[data-icon]::before,
.achievement-emoji[data-icon]::before,
.modal-emoji[data-icon]::before,
.modal-badge[data-icon]::before,
.scene-floor-item[data-icon]::before {
  content: '';
  display: block;
  width: var(--ui-icon-size, 28px);
  height: var(--ui-icon-size, 28px);
  background: var(--ui-icon) center / contain no-repeat;
}

.modal-emoji[data-icon]::before,
.flex-emoji[data-icon]::before {
  --ui-icon-size: 46px;
}

.modal-badge[data-icon] {
  min-width: 82px;
  height: 50px;
  padding: 0;
}

.modal-badge[data-icon]::before {
  --ui-icon-size: 34px;
}

.prestige-emoji[data-icon]::before {
  --ui-icon-size: 30px;
}

.codex-emoji[data-icon]::before {
  --ui-icon-size: 24px;
}

.achievement-emoji[data-icon]::before {
  --ui-icon-size: 22px;
}

.scene-floor-item[data-icon]::before {
  --ui-icon-size: 30px;
}

[data-icon="achievement-locked"] { --ui-icon: url('../assets/ui/achievement-locked.svg'); }
[data-icon="achievement-unlocked"] { --ui-icon: url('../assets/ui/achievement-unlocked.svg'); }
[data-icon="analyst-aibot"] { --ui-icon: url('../assets/ui/analyst-aibot.svg'); }
[data-icon="analyst-intern"] { --ui-icon: url('../assets/ui/analyst-intern.svg'); }
[data-icon="analyst-junior"] { --ui-icon: url('../assets/ui/analyst-junior.svg'); }
[data-icon="analyst-quant"] { --ui-icon: url('../assets/ui/analyst-quant.svg'); }
[data-icon="analyst-senior"] { --ui-icon: url('../assets/ui/analyst-senior.svg'); }
[data-icon="codex-ant"] { --ui-icon: url('../assets/ui/codex-ant.svg'); }
[data-icon="codex-lock"] { --ui-icon: url('../assets/ui/codex-lock.svg'); }
[data-icon="guide-buy"] { --ui-icon: url('../assets/ui/guide-buy.svg'); }
[data-icon="guide-flex"] { --ui-icon: url('../assets/ui/guide-flex.svg'); }
[data-icon="icon-cash"] { --ui-icon: url('../assets/ui/icon-cash.svg'); }
[data-icon="icon-trade"] { --ui-icon: url('../assets/ui/icon-trade.svg'); }
[data-icon="icon-work"] { --ui-icon: url('../assets/ui/icon-work.svg'); }
[data-icon="milestone-art"] { --ui-icon: url('../assets/ui/milestone-art.svg'); }
[data-icon="milestone-gold"] { --ui-icon: url('../assets/ui/milestone-gold.svg'); }
[data-icon="milestone-jet"] { --ui-icon: url('../assets/ui/milestone-jet.svg'); }
[data-icon="milestone-penthouse"] { --ui-icon: url('../assets/ui/milestone-penthouse.svg'); }
[data-icon="milestone-sportscar"] { --ui-icon: url('../assets/ui/milestone-sportscar.svg'); }
[data-icon="milestone-watch"] { --ui-icon: url('../assets/ui/milestone-watch.svg'); }
[data-icon="milestone-yacht"] { --ui-icon: url('../assets/ui/milestone-yacht.svg'); }
[data-icon="milestone-tailored-suit"] { --ui-icon: url('../assets/ui/milestone-tailored-suit.svg'); }
[data-icon="milestone-office"] { --ui-icon: url('../assets/ui/milestone-office.svg'); }
[data-icon="milestone-garage"] { --ui-icon: url('../assets/ui/milestone-garage.svg'); }
[data-icon="milestone-villa"] { --ui-icon: url('../assets/ui/milestone-villa.svg'); }
[data-icon="milestone-vault"] { --ui-icon: url('../assets/ui/milestone-vault.svg'); }
[data-icon="milestone-tower"] { --ui-icon: url('../assets/ui/milestone-tower.svg'); }
[data-icon="milestone-island"] { --ui-icon: url('../assets/ui/milestone-island.svg'); }
[data-icon="prestige-reset"] { --ui-icon: url('../assets/ui/prestige-reset.svg'); }
[data-icon="research-brokerage"] { --ui-icon: url('../assets/ui/research-brokerage.svg'); }
[data-icon="research-insider"] { --ui-icon: url('../assets/ui/research-insider.svg'); }
[data-icon="research-report"] { --ui-icon: url('../assets/ui/research-report.svg'); }
[data-icon="upgrade-info"] { --ui-icon: url('../assets/ui/upgrade-info.svg'); }
[data-icon="upgrade-leverage"] { --ui-icon: url('../assets/ui/upgrade-leverage.svg'); }
[data-icon="upgrade-slot"] { --ui-icon: url('../assets/ui/upgrade-slot.svg'); }
[data-icon="utility-notify"] { --ui-icon: url('../assets/ui/utility-notify.svg'); }
[data-icon="utility-save"] { --ui-icon: url('../assets/ui/utility-save.svg'); }
[data-icon="sound-on"] { --ui-icon: url('../assets/ui/sound-on.svg'); }
[data-icon="sound-off"] { --ui-icon: url('../assets/ui/sound-off.svg'); }
[data-icon="icon-boost"] { --ui-icon: url('../assets/ui/icon-boost.svg'); }

#scene-window-view {
  display: inline-grid;
  min-width: 36px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(160, 178, 210, 0.24);
  background: rgba(7, 12, 20, 0.58);
  color: #aebbd0;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.flex-glow-ring {
  height: 88px;
}

/* ============ Visual asset polish pass ============ */

#asset-title {
  flex: 1 1 auto;
  max-width: 202px;
  min-width: 0;
}

.tier-ant-mark {
  flex: 0 0 42px;
  width: 42px;
  height: 32px;
  background:
    linear-gradient(180deg, rgba(255, 226, 143, 0.08), rgba(7, 12, 20, 0.02)),
    url('../assets/generated/ant-badge.png') center 48% / cover no-repeat;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.34));
}

.tier-ant-mark::before,
.tier-ant-mark::after,
.tier-ant-mark span {
  display: none;
}

.tier-copy {
  min-width: 0;
}

.tier-progress-text {
  display: block;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mute-btn {
  color: #73e8bd;
}

#mute-btn.muted {
  color: #ff8fa3;
}

.sound-icon {
  width: 22px;
  height: 22px;
  background: none;
  -webkit-mask: none;
  mask: none;
}

.sound-icon::before,
.sound-icon::after {
  display: none;
}

#mute-btn.muted .sound-icon {
  -webkit-mask-image: none;
  mask-image: none;
}

#work-btn { --button-icon: url('../assets/ui/icon-work.svg'); --button-accent: #8cc8ff; }
#daytrade-btn { --button-icon: url('../assets/ui/icon-trade.svg'); --button-accent: #8cc8ff; }
#free-cash-btn { --button-icon: url('../assets/ui/icon-cash.svg'); --button-accent: #ffd67b; }
#boost-btn { --button-icon: url('../assets/ui/icon-boost.svg'); --button-accent: #a9f4d0; }

#action-buttons button {
  position: relative;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  min-height: 56px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 950;
}

#action-buttons button::before {
  content: '';
  grid-column: 1;
  grid-row: 1;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--button-accent, #8cc8ff) 58%, transparent);
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--button-accent, #8cc8ff) 18%, transparent), rgba(5, 10, 18, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#action-buttons button::after {
  content: '';
  grid-column: 1;
  grid-row: 1;
  width: 22px;
  height: 22px;
  align-self: center;
  justify-self: center;
  background: var(--button-accent, #d4e8ff);
  -webkit-mask: var(--button-icon) center / contain no-repeat;
  mask: var(--button-icon) center / contain no-repeat;
}

#action-buttons button.action-primary::before,
#free-cash-btn.glow::before,
#boost-btn.glow::before {
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--button-accent, #8cc8ff) 22%, transparent), rgba(5, 10, 18, 0.74));
}

.nav-btn[data-panel="stocks"] .nav-icon { --nav-icon: url('../assets/ui/icon-market.svg'); }
.nav-btn[data-panel="bank"] .nav-icon { --nav-icon: url('../assets/ui/icon-bank.svg'); }
.nav-btn[data-panel="upgrades"] .nav-icon { --nav-icon: url('../assets/ui/icon-upgrade.svg'); }
.nav-btn[data-panel="milestones"] .nav-icon { --nav-icon: url('../assets/ui/icon-flex.svg'); }

.nav-icon {
  width: 34px;
  min-width: 34px;
  height: 24px;
  padding: 0;
  font-size: 0;
  color: #8798b1;
}

.nav-icon::before {
  content: '';
  display: block;
  width: 26px;
  height: 26px;
  background: currentColor;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
  mask: var(--nav-icon) center / contain no-repeat;
}

.nav-btn.active .nav-icon {
  color: #ffcf68;
}

/* ============ Style A Toss clean UI pass ============ */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;
  --surface-raised: #ffffff;
  --border: #dfe6f2;
  --border-soft: #edf1f7;
  --gold: #f5b544;
  --gold-soft: #fff6df;
  --green: #f04452;
  --green-soft: #fff0f1;
  --red: #3182f6;
  --red-soft: #eef6ff;
  --purple: #5f6fed;
  --purple-soft: #f0f2ff;
  --blue: #3182f6;
  --text: #191f28;
  --text-dim: #4e5968;
  --text-faint: #8b95a1;
}

body {
  background: #eef2f7;
  color: var(--text);
}

#app {
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(25, 31, 40, 0.05), 0 22px 60px rgba(25, 31, 40, 0.12);
}

#topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(223, 230, 242, 0.9);
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.08);
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.hud-shine {
  display: none;
}

.topbar-row1 {
  margin-bottom: 10px;
  gap: 10px;
}

#asset-title {
  max-width: none;
  min-width: 0;
  padding: 0;
  gap: 9px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text);
}

.tier-ant-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 38px;
  overflow: visible;
  border: 1px solid #eadfcc;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8ea, #f3e8d7);
  box-shadow: inset 0 -2px 0 rgba(122, 92, 62, 0.08), 0 5px 12px rgba(122, 92, 62, 0.12);
  filter: none;
}

.tier-ant-mark::before {
  content: '';
  position: absolute;
  left: 12px;
  bottom: 8px;
  width: 24px;
  height: 14px;
  border-radius: 50%;
  background: #9c7248;
  box-shadow: inset 0 -2px 0 rgba(92, 66, 41, 0.16);
}

.tier-ant-mark::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 5px;
  width: 14px;
  height: 12px;
  border-top: 2px solid #5c4229;
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  border-radius: 50% 50% 0 0;
}

.tier-ant-mark span {
  display: block;
  position: relative;
  z-index: 1;
  width: 23px;
  height: 21px;
  border-radius: 50%;
  background: #a97e50;
  box-shadow: inset 0 -2px 0 rgba(92, 66, 41, 0.16);
}

.tier-ant-mark span::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #191f28;
  box-shadow: 8px 0 0 #191f28, 1px -1px 0 1px #fff, 9px -1px 0 1px #fff;
}

.tier-ant-mark span::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 14px;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #191f28;
  border-radius: 0 0 8px 8px;
}

.tier-copy {
  gap: 3px;
}

.tier-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.tier-progress-text {
  max-width: none;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
}

.topbar-btns {
  gap: 6px;
}

#mute-btn,
#ranking-btn,
#invite-btn {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-dim);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

#mute-btn {
  min-width: 40px;
  width: 40px;
  color: var(--blue);
}

#mute-btn.muted {
  color: #f04452;
  border-color: #ffd5d9;
}

.topbar-row2 {
  align-items: stretch;
  gap: 12px;
  margin-bottom: 10px;
}

.networth-block {
  min-width: 0;
  justify-content: center;
}

.stat-label {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
}

.networth-line {
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
}

.coin-glyph {
  width: 22px;
  height: 22px;
  border: 1px solid #ffd17a;
  background: linear-gradient(180deg, #ffe8a8, #f6ba49);
  box-shadow: inset 0 -2px 0 rgba(121, 83, 0, 0.12);
  animation: none;
}

.stat-value {
  color: var(--text);
  min-width: 0;
  font-size: 24px;
  line-height: 1.04;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: none;
}

.stat-value.gold {
  color: var(--text);
  text-shadow: none;
}

.income-rate {
  color: #0ca678;
  font-size: 12px;
  font-weight: 800;
  text-shadow: none;
}

.cash-action-wrap {
  min-width: 134px;
  gap: 6px;
}

.cash-chip {
  align-items: flex-end;
  min-height: 45px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  box-shadow: none;
}

.cash-chip .stat-label {
  color: var(--text-faint);
}

#cash-amount {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

#topbar-sellall-btn {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

#topbar-sellall-btn:disabled {
  background: #e8edf5;
  color: #9aa4b2;
  box-shadow: none;
}

#topbar-sellall-btn:active {
  transform: scale(0.98);
  box-shadow: none;
}

#milestone-progress-wrap {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-alt);
  box-shadow: none;
}

.milestone-progress-label {
  color: var(--text-dim);
}

#milestone-progress-pct {
  color: var(--blue);
}

.progress-bar {
  height: 7px;
  background: #e8edf5;
  box-shadow: none;
}

.progress-fill {
  background: linear-gradient(90deg, #3182f6, #62a1ff);
  box-shadow: none;
}

#tip-ticker {
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-faint);
}

.tip-body b {
  border-color: #d7e7ff;
  background: #f2f7ff;
  color: var(--blue);
}

#help-btn {
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--text-dim);
}

#action-buttons {
  background: transparent;
  border-bottom: 0;
  padding: 12px 16px 0;
  gap: 8px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#action-buttons button,
#action-buttons button.action-primary {
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 8px !important;
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.04);
  font-size: 14px;
  font-weight: 900;
}

#action-buttons button::before {
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--button-accent, #3182f6) 16%, #ffffff);
  box-shadow: none;
}

#action-buttons button::after {
  background: color-mix(in srgb, var(--button-accent, #3182f6) 72%, #1b64da);
}

#main-screen {
  padding: 14px 16px 88px;
}

#avatar-scene {
  margin: 12px 16px 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px !important;
  background: linear-gradient(180deg, #fffaf1 0%, #fff 58%, #f7f9fc 100%) !important;
  background-size: auto !important;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.05);
}

#scene-window {
  border-color: #eadfcc;
  border-radius: 6px;
  background: #f7fbff;
}

#scene-window-view {
  background: #fff;
  color: var(--text-faint);
}

.market-news-feed {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.market-news-feed-head,
.market-news-time {
  color: var(--text-faint);
}

.market-news-item {
  color: var(--text-dim);
}

.market-news-item.rumor {
  color: #b7791f;
}

.portfolio-summary,
.stock-card,
.item-row,
.bank-card,
.milestone-card,
.prestige-card,
.codex-card,
.achievement-chip {
  border: 1px solid var(--border-soft);
  border-radius: 8px !important;
  background: #fff;
  box-shadow: 0 5px 16px rgba(25, 31, 40, 0.05);
}

.portfolio-summary {
  min-height: 0;
  padding: 14px;
  border-left: 0;
}

.ps-label {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
}

.ps-value,
.ps-pl {
  color: var(--text);
  font-size: 21px;
  line-height: 1.15;
}

.ps-pl.up,
.stock-change.up,
.holding-pl.up,
.sheet-pl.up,
.sell-preview-row .up,
.ps-sub .up {
  color: #f04452;
}

.ps-pl.down,
.stock-change.down,
.holding-pl.down,
.sheet-pl.down,
.sell-preview-row .down,
.ps-sub .down {
  color: #3182f6;
}

.ps-sub {
  color: var(--text-faint);
  margin: 6px 0 10px;
}

.ps-sellall-btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px !important;
  background: #3182f6;
  color: #fff;
  box-shadow: none;
  font-size: 15px;
}

.ps-sellall-btn:disabled {
  background: #e8edf5;
  color: #9aa4b2;
}

#stock-list {
  gap: 10px;
}

.stock-card {
  padding: 13px 14px;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.stock-card.is-held {
  border-color: #b8d8ff;
  background: #fff;
  box-shadow: 0 8px 18px rgba(49, 130, 246, 0.08);
}

.stock-card.just-bought,
.stock-card.surge-up,
.stock-card.is-held.surge-up {
  border-color: rgba(240, 68, 82, 0.4);
  box-shadow: 0 0 0 1px rgba(240, 68, 82, 0.15), 0 10px 24px rgba(240, 68, 82, 0.12);
}

.stock-card.surge-down,
.stock-card.is-held.surge-down {
  border-color: rgba(49, 130, 246, 0.42);
  box-shadow: 0 0 0 1px rgba(49, 130, 246, 0.16), 0 10px 24px rgba(49, 130, 246, 0.12);
}

.stock-card-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.stock-logo {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--stock-logo-border);
  border-radius: 8px;
  background: var(--stock-logo-bg);
  box-shadow: none;
}

.stock-logo span {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  line-height: 46px;
  text-shadow: 0 1px 2px rgba(25, 31, 40, 0.18);
}

.stock-name-block {
  gap: 4px;
}

.stock-name {
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.16;
}

.stock-ticker {
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #f7f9fc;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 5px;
}

.stock-sector {
  color: var(--text-faint);
  font-size: 12px;
}

.div-badge {
  border-color: #d9e9ff;
  background: #f2f7ff;
  color: #3182f6;
}

.stock-price-block {
  min-width: 96px;
}

.stock-price {
  color: var(--text);
  padding: 0;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 950;
}

.stock-price.flash-up {
  background: var(--green-soft);
  color: #f04452;
}

.stock-price.flash-down {
  background: var(--red-soft);
  color: #3182f6;
}

.tick-arrow.show-up {
  color: #f04452;
}

.tick-arrow.show-down {
  color: #3182f6;
}

.stock-change {
  font-size: 15px;
  font-weight: 950;
}

.sparkline-wrap {
  --chart-up: #f04452;
  --chart-down: #3182f6;
  height: 92px;
  margin: 12px 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background:
    linear-gradient(rgba(139, 149, 161, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 149, 161, 0.10) 1px, transparent 1px),
    #ffffff;
  background-size: 100% 18px, 24px 100%, auto;
}

.candle-trend {
  stroke: rgba(49, 130, 246, 0.42);
  filter: none;
}

.candle-chart line {
  stroke-width: 1.15;
  opacity: 0.95;
}

.candle-chart rect {
  rx: 0.3px;
  filter: none;
}

.candle-chart rect.candle-body.up {
  filter: drop-shadow(0 0 2px rgba(240, 68, 82, 0.18));
}

.candle-chart rect.candle-body.down {
  filter: drop-shadow(0 0 2px rgba(49, 130, 246, 0.16));
}

.chart-impact {
  color: var(--text);
  text-shadow: none;
}

.news-badge {
  border-radius: 8px !important;
  font-size: 11px;
}

.news-badge.positive {
  background: #fff0f1;
  color: #f04452;
}

.news-badge.negative {
  background: #eef6ff;
  color: #3182f6;
}

.holding-info {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 6px;
  min-height: 42px;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #f9fbfd;
  color: var(--text);
}

.holding-info:not(.is-held) {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--text-faint);
}

.holding-metric,
.holding-pl {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.holding-metric.qty,
.holding-metric.avg {
  color: var(--text-dim);
}

.holding-metric.value {
  color: var(--text);
}

.holding-pl {
  text-align: right;
}

.holding-empty {
  font-size: 13px;
  font-weight: 800;
}

.trade-actions {
  gap: 8px;
}

.trade-actions + .trade-actions {
  margin-top: 8px;
}

.trade-group {
  gap: 7px;
}

.trade-btn,
.buy-btn,
.milestone-buy-btn,
.sell-confirm-btn,
.bank-btn,
.modal-actions button.highlight {
  border-radius: 8px !important;
  box-shadow: none;
}

.trade-btn {
  min-height: 44px;
  border: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.trade-btn::before {
  display: none;
}

.trade-btn.buy {
  background: #f04452;
  box-shadow: none;
}

.trade-btn.sell,
.sell-confirm-btn {
  background: #3182f6;
  box-shadow: none;
}

.trade-btn:disabled,
.buy-btn:disabled,
.milestone-buy-btn:disabled,
.prestige-btn:disabled,
.sell-row:not(.is-held) .trade-btn.sell {
  background: #edf1f7;
  border-color: #edf1f7;
  color: #a7b0bd;
  box-shadow: none;
}

.item-icon,
.milestone-emoji,
.prestige-emoji,
.codex-emoji,
.achievement-emoji,
.modal-emoji,
.modal-badge,
.scene-floor-item {
  border-color: var(--border-soft);
  background: #f7f9fc;
  color: var(--text-dim);
  box-shadow: none;
}

.item-icon.text-icon {
  border-color: var(--border-soft);
  background: #f2f7ff;
  color: #3182f6;
}

#bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -8px 22px rgba(25, 31, 40, 0.06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.nav-btn {
  color: var(--text-faint);
}

.nav-btn.active {
  border-top-color: #3182f6;
  background: #f2f7ff;
  color: #3182f6;
}

.nav-icon {
  border-color: transparent;
  background: transparent;
  color: currentColor;
}

.nav-btn.active .nav-icon {
  color: #3182f6;
}

@media (min-width: 900px) {
  #app {
    max-width: 1040px;
  }

  #topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.82fr);
    grid-template-areas:
      "row1 row2"
      "progress progress";
    gap: 12px 20px;
    align-items: center;
    padding-left: 24px;
    padding-right: 24px;
  }

  .topbar-row1 {
    grid-area: row1;
    margin-bottom: 0;
  }

  .topbar-row2 {
    grid-area: row2;
    margin-bottom: 0;
  }

  #milestone-progress-wrap {
    grid-area: progress;
  }

  #action-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-left: 24px;
    padding-right: 24px;
  }

  #avatar-scene {
    margin-left: 24px;
    margin-right: 24px;
    min-height: 190px;
  }

  #main-screen {
    padding-left: 24px;
    padding-right: 24px;
  }

  #stock-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
  }

  .portfolio-summary {
    grid-column: 1 / -1;
  }

  .stock-card {
    min-height: 344px;
  }

  .sparkline-wrap {
    height: 116px;
  }

  .holding-info {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ============ Ad banner / overlay ============ */

#ad-banner {
  background: #0e1725;
  color: var(--text-faint);
  text-align: center;
  font-size: 11px;
  padding: 6px;
  border-top: 1px dashed var(--border);
}

#ad-banner:not(.hidden) {
  position: fixed;
  right: auto;
  bottom: calc(64px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 89;
  width: min(100vw, 480px);
  transform: translateX(-50%);
}

@media (max-width: 380px) {
  #topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar-row1,
  .topbar-row2 {
    gap: 8px;
  }

  .topbar-btns {
    gap: 6px;
  }

  #ranking-btn,
  #invite-btn {
    padding-left: 8px;
    padding-right: 8px;
    min-width: 38px;
  }

  #mute-btn {
    min-width: 36px;
    width: 36px;
    padding-left: 0;
    padding-right: 0;
  }

  .stat-value {
    font-size: 20px;
  }

  .cash-chip {
    max-width: none;
  }

  .cash-action-wrap {
    min-width: 132px;
    gap: 4px 5px;
  }

  #topbar-sellall-btn {
    min-height: 29px;
    font-size: 11px;
  }

  #cash-amount {
    overflow-wrap: anywhere;
  }

  .stock-card {
    padding-left: 10px;
    padding-right: 10px;
  }

  .stock-card-head {
    gap: 8px;
  }

  .market-news-feed {
    padding-left: 8px;
    padding-right: 8px;
  }

  .market-news-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 3px 6px;
  }

  .market-news-time {
    grid-column: 3;
  }

  .stock-logo {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .stock-logo span {
    font-size: 11px;
    line-height: 36px;
  }

  .stock-name {
    font-size: 15px;
  }

  .stock-price {
    font-size: 16px;
  }

  .stock-price-block {
    min-width: 82px;
  }

  #action-buttons {
    padding-left: 12px;
    padding-right: 12px;
  }

  #action-buttons button {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px;
    font-size: 12px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #action-buttons button::before {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  #action-buttons button::after {
    width: 20px;
    height: 20px;
  }

  .nav-icon {
    min-width: 29px;
    height: 22px;
  }

  .nav-label {
    font-size: 11px;
  }

  .trade-actions {
    flex-direction: column;
  }

  .trade-btn {
    min-width: 0;
  }
}

/* ============ v76 imagegen asset pass: richer non-character game objects ============ */

#gold-stack {
  width: 54px !important;
  height: 44px !important;
  background: url('../assets/generated/luxury-gold-bars.png') center / contain no-repeat !important;
  filter: drop-shadow(0 8px 10px rgba(246, 184, 75, 0.22)) !important;
}

#gold-stack::before,
#gold-stack::after {
  content: none !important;
}

#scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
  background: url('../assets/generated/luxury-sportscar.png') center / contain no-repeat !important;
  filter: drop-shadow(0 13px 13px rgba(240, 68, 82, 0.20)) !important;
}

#scene-yacht {
  width: 176px !important;
  height: 92px !important;
  background: url('../assets/generated/luxury-yacht.png') center / contain no-repeat !important;
}

#scene-jet {
  background: url('../assets/generated/luxury-jet.png') center / contain no-repeat !important;
}

#scene-penthouse {
  background: url('../assets/generated/luxury-apartment.png') center bottom / contain no-repeat !important;
}

#scene-penthouse .penthouse-wing,
#scene-penthouse .penthouse-entrance,
#scene-penthouse::before,
#scene-penthouse::after {
  display: none !important;
  content: none !important;
}

.estate-object {
  border: 0 !important;
  box-shadow: none !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
}

.estate-object::before,
.estate-object::after {
  display: none !important;
  content: none !important;
}

.estate-office {
  background-image: url('../assets/generated/luxury-office.png') !important;
}

.estate-garage {
  background-image: url('../assets/generated/luxury-sportscar.png') !important;
}

.estate-villa {
  background-image: url('../assets/generated/luxury-villa.png') !important;
}

.estate-vault {
  background-image: url('../assets/generated/luxury-vault.png') !important;
}

.estate-tower {
  background-image: url('../assets/generated/luxury-tower.png') !important;
}

.estate-island {
  background-image: url('../assets/generated/luxury-island.png') !important;
}

/* ============ 2026-07-04 white UI mobile QA pass ============ */

.modal {
  background: rgba(25, 31, 40, 0.46);
}

.modal-content {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 22px 60px rgba(25, 31, 40, 0.18);
}

.modal-content h2,
.modal-content p,
.bank-label,
.help-section h3,
.daytrade-content h2 {
  color: var(--text);
  text-shadow: none;
}

.modal-content p {
  color: var(--text-dim);
}

.modal-actions button {
  background: #f7f9fc;
  border: 1px solid var(--border);
  color: var(--text);
}

.modal-actions button.highlight {
  background: #3182f6;
  color: #ffffff;
}

.guide-dot,
.daily-dot {
  background: #edf1f7;
  border-color: #edf1f7;
}

#asset-title {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
}

.topbar-row1 {
  align-items: flex-start;
}

.topbar-btns {
  flex: 0 0 auto;
}

.tier-ant-mark {
  flex-basis: 46px;
  width: 46px;
  height: 40px;
}

.tier-copy {
  width: 100%;
  min-width: 0;
  gap: 3px;
}

.tier-name {
  line-height: 1.08;
}

.tier-next-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-progress-text {
  display: none;
}

.tier-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.tier-progress-track {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
  box-shadow: inset 0 1px 1px rgba(25, 31, 40, 0.07);
}

.tier-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3182f6, #17b978);
  transition: width 0.35s ease;
}

.tier-progress-pct {
  min-width: 32px;
  color: #3182f6;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-align: right;
}

#action-buttons button {
  background: #ffffff;
  border-color: #dfe6f2;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.04);
}

#action-buttons button.action-primary {
  background: #ffffff;
  border-color: #dfe6f2;
  color: var(--text);
}

#work-btn { --button-accent: #3182f6; }
#daytrade-btn { --button-accent: #f04452; }
#free-cash-btn { --button-accent: #f5b544; }
#boost-btn { --button-accent: #17b978; }

#action-buttons button::before,
#action-buttons button.action-primary::before,
#free-cash-btn.glow::before,
#boost-btn.glow::before {
  border-color: color-mix(in srgb, var(--button-accent, #3182f6) 24%, #dfe6f2);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--button-accent, #3182f6) 13%, #ffffff));
  box-shadow: inset 0 -1px 0 rgba(25, 31, 40, 0.05);
}

#action-buttons button::after {
  background: var(--button-accent, #3182f6);
}

.stock-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.stock-card-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) minmax(150px, auto);
  align-items: start;
  gap: 10px;
  min-width: 0;
  overflow: visible;
}

.stock-logo {
  width: 62px;
  height: 44px;
  border-color: var(--stock-logo-border);
  border-radius: 10px;
  background: var(--stock-logo-bg);
}

.stock-logo span {
  color: var(--logo-text, #fff);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.01em;
  padding: 0 3px;
  text-shadow: 0 1px 2px rgba(25, 31, 40, 0.16);
}

.stock-name-block {
  min-width: 0;
}

.stock-name {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.stock-sector {
  min-height: 16px;
  line-height: 1.28;
  word-break: keep-all;
}

.div-badge-slot {
  display: flex;
  align-items: flex-start;
  min-height: 22px;
}

.div-badge {
  min-height: 20px;
  border-color: #d9e9ff;
  border-radius: 999px;
  background: #f2f7ff;
  color: #3182f6;
  font-size: 10px;
  letter-spacing: 0;
  padding: 2px 8px;
}

.stock-price-block {
  width: 150px;
  min-width: 0;
  max-width: 36vw;
}

.stock-price {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(14px, 3.85vw, 19px);
  text-overflow: clip;
  white-space: nowrap;
}

.tick-arrow {
  margin-right: 1px;
  font-size: 0.72em;
}

.stock-change {
  font-size: clamp(13px, 3.6vw, 15px);
}

.sparkline-wrap {
  height: 118px;
  margin: 16px 0 12px;
  overflow: hidden;
}

.candle-chart {
  display: block;
  overflow: hidden;
}

.chart-impact {
  top: 10px;
  right: 10px;
  min-width: 0;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 1px 0 #ffffff, 0 3px 10px rgba(25, 31, 40, 0.12);
}

.sell-portion-chips button {
  background: #f7f9fc;
  border-color: var(--border);
  color: var(--text-dim);
}

.sell-portion-chips button.active {
  background: #f2f7ff;
  border-color: #3182f6;
  color: #3182f6;
}

@media (min-width: 900px) {
  #stock-list {
    align-items: stretch;
  }

  .stock-card {
    height: 100%;
    min-height: 384px;
  }

  .stock-card-head {
    min-height: 88px;
  }

  .sparkline-wrap {
    height: 140px;
  }

  .sell-row {
    margin-top: auto;
  }

  .holding-info {
    grid-template-columns: repeat(3, max-content) minmax(0, 1fr);
  }

  .holding-pl {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .tier-ant-mark {
    flex-basis: 42px;
    width: 42px;
    height: 38px;
  }

  .tier-name {
    font-size: 13px;
  }

  .tier-next-label {
    font-size: 10px;
  }

  .tier-progress-pct {
    min-width: 28px;
    font-size: 9px;
  }

  .stock-card-head {
    grid-template-columns: 54px minmax(0, 1fr) minmax(120px, auto);
    gap: 8px;
  }

  .stock-logo {
    width: 54px;
    height: 40px;
  }

  .stock-logo span {
    font-size: 7.2px;
    padding: 0 2px;
  }

  .stock-price-block {
    width: 120px;
    max-width: 36vw;
  }

  .sparkline-wrap {
    height: 112px;
  }
}

/* ============ 2026-07-05 help carousel and toss nav polish ============ */

body[data-review-safe-mode="toss"] #bottom-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.market-news-feed {
  gap: 9px;
  margin: 10px var(--sp-4) var(--sp-3);
  padding: 12px 12px 11px;
}

.market-news-feed-head {
  margin-bottom: 1px;
  font-size: 11px;
}

.market-news-feed-list {
  gap: 8px;
}

.market-news-item {
  gap: 8px;
  min-height: 28px;
  padding: 6px 0;
}

.stock-logo span {
  display: block;
  max-width: 100%;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
}

.help-content {
  width: min(92vw, 430px);
  max-width: 430px;
}

.help-content h2 {
  margin-bottom: 12px;
  color: var(--text);
}

#help-body.help-carousel {
  display: flex;
  max-height: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--sp-3);
  overflow: visible;
  padding-right: 0;
}

.help-slide-window {
  overflow: hidden;
}

.help-slide-card {
  display: grid;
  gap: 13px;
  min-height: 404px;
}

.help-visual-frame {
  display: grid;
  position: relative;
  min-height: 154px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(242, 247, 255, 0.92), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 18% 18%, rgba(49, 130, 246, 0.12), transparent 38%);
}

.help-slide-copy {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.help-kicker {
  display: inline-flex;
  margin-bottom: 7px;
  border-radius: 999px;
  background: #f2f7ff;
  color: #3182f6;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 6px 9px;
}

.help-slide-copy h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.help-slide-copy ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-slide-copy li {
  position: relative;
  padding-left: 17px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
}

.help-slide-copy li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3182f6;
}

.help-carousel-controls {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.help-arrow {
  display: inline-grid;
  width: 42px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.help-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.help-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.help-dot {
  width: 7px;
  height: 7px;
  border: none;
  border-radius: 50%;
  background: #d5deea;
  padding: 0;
  cursor: pointer;
}

.help-dot.active {
  width: 20px;
  border-radius: 999px;
  background: #3182f6;
}

.help-disclaimer {
  border: 1px solid var(--border-soft);
  background: #f7f9fc;
  color: var(--text-faint) !important;
}

.help-ant-figure {
  display: grid;
  position: relative;
  width: 86px;
  height: 62px;
  place-items: center;
}

.help-ant-figure::before,
.help-ant-figure::after,
.help-ant-figure i {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #252d3a;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.help-ant-figure::before {
  top: 18px;
  left: 8px;
  width: 27px;
  height: 27px;
}

.help-ant-figure i:first-child {
  top: 15px;
  left: 31px;
  width: 33px;
  height: 33px;
  background: #364254;
}

.help-ant-figure::after {
  top: 12px;
  right: 2px;
  width: 37px;
  height: 37px;
  background: #475569;
}

.help-ant-figure i:nth-child(2),
.help-ant-figure i:nth-child(3) {
  width: 42px;
  height: 3px;
  border-radius: 999px;
  background: #68758a;
  box-shadow: none;
}

.help-ant-figure i:nth-child(2) {
  top: 46px;
  left: 18px;
  transform: rotate(-17deg);
}

.help-ant-figure i:nth-child(3) {
  top: 46px;
  right: 1px;
  transform: rotate(17deg);
}

.help-goal-panel,
.help-evolve-panel,
.help-save-panel {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 0.9fr);
  align-items: center;
  gap: 12px;
  padding: 18px;
}

.help-goal-card,
.help-evolve-card,
.help-safe-code {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.06);
}

.help-goal-card span,
.help-evolve-card span,
.help-safe-code span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 900;
}

.help-goal-card strong,
.help-evolve-card strong,
.help-safe-code strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.help-goal-card em {
  color: #3182f6;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.help-chart-panel {
  position: relative;
  width: min(290px, 86%);
  height: 124px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.06);
}

.help-chart-grid {
  display: grid;
  height: 100%;
  grid-template-rows: repeat(3, 1fr);
}

.help-chart-grid span {
  border-top: 1px solid #edf2f7;
}

.help-candles {
  display: flex;
  position: absolute;
  right: 18px;
  bottom: 28px;
  left: 18px;
  align-items: end;
  justify-content: space-between;
}

.help-candles i {
  display: block;
  width: 18px;
  border-radius: 4px;
  background: #3182f6;
}

.help-candles i:nth-child(1) { height: 34px; }
.help-candles i:nth-child(2) { height: 52px; background: #e85347; }
.help-candles i:nth-child(3) { height: 44px; }
.help-candles i:nth-child(4) { height: 74px; }
.help-candles i:nth-child(5) { height: 58px; background: #e85347; }
.help-candles i:nth-child(6) { height: 86px; }

.help-trade-chips {
  display: flex;
  position: absolute;
  right: 12px;
  bottom: 10px;
  gap: 6px;
}

.help-trade-chips span {
  border-radius: 999px;
  background: #f2f7ff;
  color: #3182f6;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 8px;
}

.help-income-grid {
  display: grid;
  width: min(300px, 90%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.help-income-grid span {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 7px 18px rgba(25, 31, 40, 0.05);
}

.help-income-grid span::before,
.help-flex-icons span::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  background: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
}

.help-evolve-card em {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.help-evolve-card b {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3182f6, #21c875);
}

.help-flex-icons {
  display: flex;
  position: absolute;
  right: 16px;
  bottom: 13px;
  gap: 8px;
}

.help-flex-icons span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  color: #3182f6;
}

.help-save-panel {
  grid-template-columns: minmax(0, 1.05fr) minmax(108px, 0.95fr);
}

.help-rank-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-rank-list li {
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 900;
  padding: 8px 10px;
}

@media (max-width: 380px) {
  .market-news-feed {
    margin-right: 12px;
    margin-left: 12px;
  }

  .stock-logo span {
    font-size: 10px;
    padding: 0 3px;
  }

  .help-content {
    width: min(94vw, 430px);
  }

  .help-slide-card {
    min-height: 386px;
  }

  .help-visual-frame {
    min-height: 142px;
  }

  .help-slide-copy {
    padding: 12px;
  }
}

/* ============ 2026-07-05 logo spacing, help UX, main polish ============ */

#topbar {
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: 16px;
}

.topbar-row1 {
  align-items: center;
  margin-bottom: 12px;
}

#main-screen {
  padding-top: 18px;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
}

#tip-ticker {
  min-height: 46px;
  padding-top: 10px;
  padding-bottom: 10px;
}

#action-buttons {
  gap: 10px;
  padding-top: 14px;
}

#action-buttons button,
#action-buttons button.action-primary {
  min-height: 66px;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-color: #d8e2ef;
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 254, 0.98)),
    linear-gradient(90deg, color-mix(in srgb, var(--button-accent, #3182f6) 9%, transparent), transparent 46%);
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.06);
  font-size: 15px;
}

#action-buttons button::before,
#action-buttons button.action-primary::before,
#free-cash-btn.glow::before,
#boost-btn.glow::before {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-color: color-mix(in srgb, var(--button-accent, #3182f6) 20%, #dfe6f2);
  border-radius: 12px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), transparent 31%),
    linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--button-accent, #3182f6) 15%, #ffffff));
}

#action-buttons button::after {
  width: 24px;
  height: 24px;
}

#avatar-scene {
  min-height: 194px;
  margin-top: 16px;
  overflow: hidden;
  border-color: #cfe3ff;
  border-radius: 12px !important;
  background:
    linear-gradient(rgba(49, 130, 246, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 130, 246, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 74% 18%, rgba(255, 203, 71, 0.18), transparent 30%),
    linear-gradient(180deg, #fffaf2 0%, #ffffff 56%, #f3f7fc 100%) !important;
  background-size: 24px 24px, 24px 24px, auto, auto !important;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.08);
}

#avatar-scene::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(49, 130, 246, 0.2), transparent);
  pointer-events: none;
}

#scene-window {
  top: 14px;
  left: 16px;
  border-color: #e7d8bf;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(88, 68, 38, 0.12);
}

.portfolio-summary,
.stock-card {
  border-color: #dfe8f5;
  border-radius: 12px !important;
  box-shadow: 0 8px 22px rgba(25, 31, 40, 0.06);
}

.stock-card {
  isolation: isolate;
  overflow: hidden;
  padding-top: 14px;
}

.sparkline-wrap {
  contain: paint;
  isolation: isolate;
  z-index: 0;
}

.candle-chart {
  z-index: 1;
}

#bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 90;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(64px + env(safe-area-inset-bottom));
  border-top: 1px solid #dfe6f2;
  background: #ffffff;
  box-shadow: 0 -10px 26px rgba(25, 31, 40, 0.12);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: translateZ(0);
}

#bottom-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffff;
}

.nav-btn {
  z-index: 1;
  background: #ffffff;
}

.nav-btn.active {
  background: #f2f7ff;
}

.stock-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  box-sizing: border-box;
}

.stock-logo span {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  padding: 0;
  box-sizing: border-box;
  color: var(--logo-text, #ffffff);
  font-size: 8.2px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.12;
  overflow: hidden;
  overflow-wrap: normal;
  text-align: center;
  text-overflow: clip;
  text-shadow: 0 1px 2px rgba(25, 31, 40, 0.18);
  text-transform: uppercase;
  white-space: nowrap;
  word-break: normal;
}

.stock-card[data-logo="LGENSOLU"] .stock-logo span,
.stock-card[data-logo="CELTRIGON"] .stock-logo span {
  font-size: 7.55px;
}

.help-content {
  width: min(94vw, 448px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px 24px 20px;
}

.help-content h2 {
  margin-bottom: 12px;
  font-size: 20px;
  letter-spacing: 0;
}

#help-body.help-carousel {
  gap: 10px;
  margin-bottom: 10px;
}

.help-slide-card {
  min-height: 0;
  gap: 12px;
}

.help-visual-frame {
  isolation: isolate;
  min-height: 156px;
  padding: 10px;
  border-color: #dfeaff;
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 18%, rgba(49, 130, 246, 0.16), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  box-shadow: inset 0 -1px 0 rgba(49, 130, 246, 0.08);
}

.help-visual-frame::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 42%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent);
  pointer-events: none;
}

.help-visual-frame::after {
  content: "";
  position: absolute;
  bottom: 12px;
  left: 50%;
  z-index: 1;
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(49, 130, 246, 0.32), transparent);
  transform: translateX(-50%);
  pointer-events: none;
}

.help-step-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border: 1px solid #d7e7ff;
  border-radius: 999px;
  background: #ffffff;
  color: #3182f6;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  padding: 6px 8px;
}

.help-slide-trade .help-visual-frame {
  background:
    radial-gradient(circle at 86% 18%, rgba(232, 83, 71, 0.16), transparent 30%),
    linear-gradient(180deg, #fff8f7 0%, #ffffff 100%);
}

.help-slide-income .help-visual-frame {
  background:
    radial-gradient(circle at 16% 18%, rgba(23, 185, 120, 0.16), transparent 34%),
    linear-gradient(180deg, #f6fffb 0%, #ffffff 100%);
}

.help-slide-evolve .help-visual-frame {
  background:
    radial-gradient(circle at 74% 20%, rgba(255, 203, 71, 0.2), transparent 34%),
    linear-gradient(180deg, #fffbf1 0%, #ffffff 100%);
}

.help-slide-save .help-visual-frame {
  background:
    radial-gradient(circle at 78% 22%, rgba(127, 93, 239, 0.16), transparent 34%),
    linear-gradient(180deg, #f8f6ff 0%, #ffffff 100%);
}

.help-slide-copy {
  display: grid;
  gap: 0;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.04);
}

.help-kicker {
  margin-bottom: 8px;
}

.help-slide-copy h3 {
  margin-bottom: 10px;
  font-size: 17px;
  line-height: 1.32;
  word-break: keep-all;
}

.help-slide-copy ul {
  gap: 8px;
}

.help-slide-copy li {
  min-height: 38px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px 8px 32px;
  font-size: 12.5px;
  line-height: 1.48;
  word-break: keep-all;
}

.help-slide-copy li::before {
  top: 14px;
  left: 14px;
  width: 8px;
  height: 8px;
}

.help-carousel-controls {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
}

.help-arrow {
  width: 42px;
  height: 38px;
  border-radius: 10px;
}

.help-arrow {
  box-sizing: border-box;
  flex: 0 0 42px;
  width: 42px !important;
  min-width: 42px;
  max-width: 42px;
  padding: 0;
}

.daytrade-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.daytrade-modal-head h2 {
  margin: 0;
  text-align: left;
}

#daytrade-close-btn {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #f7f9fc;
  color: #4e5968;
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
}

.help-disclaimer {
  border-radius: 10px;
  margin-bottom: 0;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.48;
}

.help-journey-panel {
  grid-template-columns: 96px minmax(0, 1fr);
  padding: 14px 16px;
}

.help-journey-path {
  display: grid;
  gap: 8px;
}

.help-journey-path span {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #e6eef8;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 9px;
  box-shadow: 0 6px 16px rgba(25, 31, 40, 0.04);
}

.help-journey-path b {
  color: #3182f6;
  font-size: 11px;
}

.help-journey-path em {
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.help-news-pill {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  border-radius: 999px;
  background: #fff1f0;
  color: #e85347;
  font-size: 11px;
  font-weight: 950;
  padding: 6px 9px;
}

.help-income-grid {
  gap: 12px;
}

.help-income-grid span {
  min-height: 64px;
  border-radius: 12px;
  padding: 8px;
}

.help-ant-figure {
  transform: scale(1.02);
}

#help-modal .modal-actions {
  gap: 8px;
}

#help-modal .modal-actions button {
  min-height: 48px;
}

.help-safe-code em {
  color: #7f5def;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 380px) {
  #topbar {
    padding-top: calc(17px + env(safe-area-inset-top));
  }

  #action-buttons {
    gap: 8px;
  }

  #action-buttons button,
  #action-buttons button.action-primary {
    min-height: 58px;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #action-buttons button::before,
  #action-buttons button.action-primary::before {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .stock-logo span {
    font-size: 7.35px;
  }

  .stock-card[data-logo="LGENSOLU"] .stock-logo span,
  .stock-card[data-logo="CELTRIGON"] .stock-logo span {
    font-size: 6.55px;
  }

  .help-visual-frame {
    min-height: 150px;
  }

  .help-slide-copy h3 {
    font-size: 16.5px;
  }

  .help-slide-copy li {
    padding-right: 10px;
    font-size: 12.2px;
  }
}

.sheet-backdrop {
  background: rgba(25, 31, 40, 0.36);
  z-index: 140;
  padding: 10px 10px 0;
}

.sheet {
  width: min(100%, 480px);
  max-height: calc(100dvh - 18px);
  box-sizing: border-box;
  overflow-y: auto;
  border: 1px solid #dfe8f5;
  border-bottom: 0;
  border-radius: 16px 16px 0 0 !important;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 -18px 44px rgba(25, 31, 40, 0.18);
  overscroll-behavior: contain;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
}

.sheet-head {
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.sheet-title {
  color: var(--text);
}

.sheet-sub,
.sheet-pl {
  color: var(--text-dim);
}

.sheet-price {
  color: var(--text);
}

.sell-portion-chips button {
  border-color: #dfe8f5;
  border-radius: 10px !important;
  background: #f8fafc;
  color: var(--text-dim);
  min-height: 38px;
}

.sell-portion-chips button.active {
  border-color: #3182f6;
  background: #f2f7ff;
  color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.10);
}

#sell-slider {
  accent-color: #3182f6;
  height: 26px;
  margin-bottom: 10px;
}

.sell-preview {
  display: grid;
  gap: 7px;
  border: 1px solid #dfe8f5;
  border-radius: 12px;
  background: #ffffff;
  margin-bottom: 10px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.04);
}

.sell-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-dim);
  padding: 7px 10px;
}

.sell-preview-row span:last-child {
  color: var(--text);
  font-weight: 950;
  white-space: nowrap;
}

.sell-preview-row span.up,
.sheet-pl.up {
  color: #f04452;
}

.sell-preview-row span.down,
.sheet-pl.down {
  color: #3182f6;
}

#sell-preview-leverage {
  display: inline-block;
  margin-left: 4px;
  border-radius: 999px;
  background: #f0f2ff;
  color: #5f6fed;
  font-size: 10px;
  font-weight: 950;
  padding: 2px 5px;
}

.sell-confirm-btn {
  min-height: 48px;
  border-radius: 10px !important;
  background: #3182f6;
  box-shadow: none;
  color: #ffffff;
}

.help-ant-figure {
  width: 112px;
  height: 78px;
  transform: none;
}

.help-ant-figure::before,
.help-ant-figure::after,
.help-ant-figure i {
  box-shadow: inset 0 -5px 0 rgba(68, 45, 26, 0.16);
}

.help-ant-figure::before {
  top: 29px;
  left: 8px;
  width: 28px;
  height: 28px;
  background:
    radial-gradient(circle at 36% 36%, #1f2937 0 8%, transparent 9%),
    radial-gradient(circle at 62% 36%, #1f2937 0 8%, transparent 9%),
    #a87645;
}

.help-ant-figure i:first-child {
  top: 25px;
  left: 36px;
  width: 34px;
  height: 34px;
  background: #8f623b;
}

.help-ant-figure::after {
  top: 19px;
  right: 5px;
  width: 44px;
  height: 44px;
  background: #5b6b80;
}

.help-ant-figure i:nth-child(2),
.help-ant-figure i:nth-child(3) {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.help-ant-figure i:nth-child(2) {
  top: 12px;
  left: 12px;
  width: 38px;
  height: 22px;
}

.help-ant-figure i:nth-child(2)::before,
.help-ant-figure i:nth-child(2)::after {
  content: "";
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: #6b4a2e;
}

.help-ant-figure i:nth-child(2)::before {
  left: 1px;
  transform: rotate(-36deg);
  transform-origin: right center;
}

.help-ant-figure i:nth-child(2)::after {
  left: 14px;
  transform: rotate(36deg);
  transform-origin: left center;
}

.help-ant-figure i:nth-child(3) {
  top: 39px;
  left: 18px;
  width: 84px;
  height: 34px;
  background:
    linear-gradient(28deg, transparent 46%, #6b4a2e 47% 53%, transparent 54%) 0 0 / 100% 33% no-repeat,
    linear-gradient(0deg, transparent 46%, #6b4a2e 47% 53%, transparent 54%) 0 50% / 100% 33% no-repeat,
    linear-gradient(-28deg, transparent 46%, #6b4a2e 47% 53%, transparent 54%) 0 100% / 100% 33% no-repeat;
}

/* Text-heavy cards stay centered as components, but copy reads left-to-right. */
.help-slide-copy,
.help-slide-copy h3,
.help-slide-copy li,
.help-disclaimer,
#guide-text,
.panel-desc,
.market-news-feed,
.market-news-text,
.help-goal-card,
.help-evolve-card,
.help-safe-code,
.help-rank-list li {
  text-align: left;
}

#guide-text {
  margin: 4px 0 18px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #f8fafc;
  padding: 13px 14px;
  line-height: 1.58;
  word-break: keep-all;
}

.help-slide-copy {
  padding: 16px;
}

.help-slide-copy li,
.help-disclaimer,
.panel-desc {
  line-height: 1.58;
}

.help-goal-card,
.help-evolve-card,
.help-safe-code,
.help-rank-list li {
  padding-right: 13px;
  padding-left: 13px;
}

#toast-container {
  top: auto;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 240;
  gap: 5px;
  width: min(88vw, 360px);
}

.toast {
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(25, 31, 40, 0.16);
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 12px;
}

.toast.income {
  color: #008f5d;
}

.toast.reward {
  border-color: #ffe2a3;
  background: #fff8e8;
  color: #b36b00;
}

.toast.info {
  border-color: #dbeafe;
  background: #f2f7ff;
  color: #3182f6;
}

.toast.tutorial {
  border-color: #b9dcff;
  background: linear-gradient(180deg, #ffffff, #eef7ff);
  color: #1769d8;
  font-weight: 900;
}

.screen-flash {
  z-index: 130;
  background: radial-gradient(circle at 50% 44%, rgba(255, 226, 163, 0.32), rgba(255, 248, 232, 0.10) 42%, transparent 70%);
  animation-duration: 0.38s;
}

.particle-layer {
  z-index: 135;
}

.sheet-backdrop {
  z-index: 260;
  background: rgba(25, 31, 40, 0.48);
}

.help-content {
  background: #ffffff !important;
  opacity: 1;
}

/* ============ 2026-07-05 help evolution codex polish ============ */

.help-evolution-route,
.help-tier-codex-panel {
  position: relative;
  z-index: 2;
  grid-template-columns: 1fr !important;
  align-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
}

.help-tier-route,
.help-tier-codex {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 7px;
}

.help-tier-route {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.help-tier-codex {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.help-tier-card {
  --ant-head: #b9854f;
  --ant-body: #9c7248;
  --ant-back: #a87645;
  --ant-dark: #5c4229;
  --tier-accent: #3182f6;
  display: grid;
  position: relative;
  min-width: 0;
  min-height: 78px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  overflow: hidden;
  border: 1px solid #e4ebf5;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 6px 14px rgba(25, 31, 40, 0.05);
  padding: 6px 4px 5px;
}

.help-tier-card.featured {
  min-height: 92px;
  border-color: #dce8f8;
  background: #ffffff;
}

.help-tier-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--tier-accent);
}

.help-tier-card strong {
  max-width: 100%;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 950;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: center;
}

.help-tier-card em {
  color: var(--text-faint);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.help-tier-ant-svg {
  display: block;
  width: 46px;
  height: 46px;
  overflow: visible;
}

.help-tier-card.featured .help-tier-ant-svg {
  width: 58px;
  height: 58px;
}

.help-tier-ant {
  display: block;
  position: relative;
  width: 40px;
  height: 27px;
  margin-top: 1px;
}

.help-tier-ant::before,
.help-tier-ant::after,
.help-tier-ant i {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--ant-body);
  box-shadow: inset 0 -2px 0 rgba(68, 45, 26, 0.16);
}

.help-tier-ant::before {
  top: 10px;
  left: 13px;
  width: 17px;
  height: 14px;
  background: var(--ant-body);
}

.help-tier-ant::after {
  top: 8px;
  right: 1px;
  width: 21px;
  height: 16px;
  background: var(--ant-back);
}

.help-tier-ant i {
  top: 8px;
  left: 1px;
  width: 16px;
  height: 15px;
  background: var(--ant-head);
}

.help-tier-ant i::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #191f28;
  box-shadow: 6px 0 0 #191f28;
}

.help-tier-ant b {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(22deg, transparent 47%, var(--ant-dark) 48% 52%, transparent 53%) 5px 18px / 32px 4px no-repeat,
    linear-gradient(0deg, transparent 47%, var(--ant-dark) 48% 52%, transparent 53%) 5px 21px / 32px 4px no-repeat,
    linear-gradient(-22deg, transparent 47%, var(--ant-dark) 48% 52%, transparent 53%) 5px 24px / 32px 4px no-repeat;
}

.help-tier-ant b::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 16px;
  height: 8px;
  border-top: 2px solid var(--ant-dark);
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  border-radius: 50% 50% 0 0;
}

.help-tier-ant b::after,
.help-tier-ant i::after {
  content: none;
  position: absolute;
}

.help-tier-card[data-tier="0"] {
  --tier-accent: #9b6b43;
}

.help-tier-card[data-tier="0"] .help-tier-ant b::after {
  content: "";
  right: 5px;
  bottom: 4px;
  width: 12px;
  height: 9px;
  border: 1px dashed #7a5c3e;
  border-radius: 2px;
  background: #e8d9b5;
  transform: rotate(10deg);
}

.help-tier-card[data-tier="1"] {
  --tier-accent: #f4b800;
}

.help-tier-card[data-tier="1"] .help-tier-ant i::after {
  content: "";
  top: -6px;
  left: -2px;
  width: 20px;
  height: 10px;
  border: 1px solid #e0a800;
  border-radius: 10px 10px 3px 3px;
  background: #ffd23f;
}

.help-tier-card[data-tier="2"] {
  --tier-accent: #e0435c;
}

.help-tier-card[data-tier="2"] .help-tier-ant b::after {
  content: "";
  left: 17px;
  bottom: 4px;
  width: 6px;
  height: 13px;
  clip-path: polygon(50% 0, 100% 42%, 68% 100%, 32% 100%, 0 42%);
  background: #e0435c;
}

.help-tier-card[data-tier="3"] {
  --tier-accent: #475569;
}

.help-tier-card[data-tier="3"] .help-tier-ant i::after {
  content: "";
  top: 4px;
  left: 1px;
  width: 14px;
  height: 6px;
  border: 2px solid #252d3a;
  border-right-width: 1px;
  border-radius: 999px;
  background: transparent;
}

.help-tier-card[data-tier="4"] {
  --tier-accent: #f0b429;
}

.help-tier-card[data-tier="4"] .help-tier-ant i::after,
.help-tier-card[data-tier="7"] .help-tier-ant i::after {
  content: "";
  top: 4px;
  left: 2px;
  width: 13px;
  height: 6px;
  border-radius: 4px;
  background: #111827;
}

.help-tier-card[data-tier="4"] .help-tier-ant b::after,
.help-tier-card[data-tier="7"] .help-tier-ant b::after {
  content: "";
  left: 16px;
  top: 15px;
  width: 12px;
  height: 7px;
  border-bottom: 3px solid #ffd23f;
  border-radius: 0 0 999px 999px;
}

.help-tier-card[data-tier="5"] {
  --tier-accent: #e0435c;
  --ant-back: #d7445f;
}

.help-tier-card[data-tier="5"] .help-tier-ant b::after {
  content: "S";
  left: 18px;
  top: 12px;
  display: grid;
  width: 11px;
  height: 11px;
  place-items: center;
  border-radius: 50%;
  background: #ffd23f;
  color: #e0435c;
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
}

.help-tier-card[data-tier="6"] {
  --tier-accent: #8b5cf6;
  --ant-back: #8060c9;
}

.help-tier-card[data-tier="6"] .help-tier-ant i::after,
.help-tier-card[data-tier="8"] .help-tier-ant i::after {
  content: "";
  top: -7px;
  left: -1px;
  width: 18px;
  height: 9px;
  clip-path: polygon(0 100%, 16% 25%, 36% 82%, 50% 0, 64% 82%, 84% 25%, 100% 100%);
  background: #ffd23f;
}

.help-tier-card[data-tier="7"] {
  --tier-accent: #111827;
}

.help-tier-card[data-tier="7"] .help-tier-ant::before {
  background: #243047;
}

.help-tier-card[data-tier="8"] {
  --tier-accent: #ffb000;
  --ant-head: #f7c948;
  --ant-body: #f0b429;
  --ant-back: #ffd23f;
  background: linear-gradient(180deg, #fff8e8 0%, #ffffff 100%);
}

.help-tier-card[data-tier="8"] .help-tier-ant {
  filter: drop-shadow(0 0 7px rgba(255, 203, 71, 0.55));
}

.help-tier-card[data-tier="9"] {
  --tier-accent: #7c5cff;
  --ant-head: #f7c948;
  --ant-body: #f0b429;
  --ant-back: #ffd23f;
  background: linear-gradient(180deg, #f6f3ff 0%, #ffffff 100%);
}

.help-tier-card[data-tier="9"] .help-tier-ant::before {
  box-shadow:
    -12px -2px 0 -4px rgba(180, 220, 255, 0.9),
    12px -2px 0 -4px rgba(180, 220, 255, 0.9),
    inset 0 -2px 0 rgba(68, 45, 26, 0.16);
}

.help-tier-card[data-tier="9"] .help-tier-ant b::after {
  content: "";
  left: 7px;
  top: -3px;
  width: 24px;
  height: 6px;
  border: 2px solid #ffd23f;
  border-radius: 50%;
  background: transparent;
}

.help-evolution-route .help-journey-path {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.help-evolution-route .help-journey-path span {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 2px;
  padding: 7px 6px;
  text-align: center;
}

#help-modal .help-content {
  display: flex;
  height: min(812px, calc(100dvh - 32px));
  flex-direction: column;
}

#help-body.help-carousel {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.help-slide-window,
.help-slide-track {
  min-height: 0;
  height: 100%;
}

.help-slide-card {
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.help-slide-copy {
  min-height: 0;
  overflow-y: auto;
}

.help-slide-evolve .help-step-count {
  display: none;
}

.help-slide-copy {
  align-content: start;
  padding: 18px 16px;
}

.help-kicker {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  margin-bottom: 11px;
  padding: 7px 11px;
}

.help-slide-copy h3 {
  margin-top: 0;
}

@media (max-width: 380px) {
  .help-tier-codex {
    gap: 5px;
  }

  .help-tier-card {
    min-height: 72px;
    padding-right: 3px;
    padding-left: 3px;
  }

  .help-tier-card.featured {
    min-height: 86px;
  }

  .help-tier-card strong {
    font-size: 9.4px;
  }

  .help-tier-card em {
    font-size: 7.8px;
  }

  .help-tier-ant {
    width: 35px;
    height: 24px;
    transform: scale(0.9);
  }

  .help-tier-ant-svg {
    width: 40px;
    height: 40px;
  }

  .help-tier-card.featured .help-tier-ant-svg {
    width: 52px;
    height: 52px;
  }

  .help-evolution-route .help-journey-path span {
    padding-right: 4px;
    padding-left: 4px;
  }

  .sell-preview-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

/* ============ Final brand asset pass ============ */

.tier-ant-mark {
  overflow: hidden;
  background: #fff8ea;
}

.tier-ant-mark::before,
.tier-ant-mark::after,
.tier-ant-mark span,
.tier-ant-mark span::before,
.tier-ant-mark span::after {
  display: none;
  content: none;
}

/* ============ Retention and mobile interaction polish ============ */

html,
body,
button,
a,
input,
textarea,
select,
.stock-card,
.modal-content {
  touch-action: manipulation;
}

.stock-name {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}

.stock-logo span {
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

@media (max-width: 520px) {
  .stock-card-head {
    grid-template-columns: 58px minmax(0, 1fr) minmax(120px, auto);
    gap: 8px;
  }

  .stock-logo {
    width: 58px;
    height: 42px;
  }

  .stock-logo span {
    font-size: 7.4px;
  }

  .stock-card[data-logo="LGENSOLU"] .stock-logo span,
  .stock-card[data-logo="CELTRIGON"] .stock-logo span {
    font-size: 6.8px;
  }
}

@media (max-width: 380px) {
  .stock-card-head {
    grid-template-columns: 54px minmax(0, 1fr) minmax(112px, auto);
  }

  .stock-logo {
    width: 54px;
    height: 40px;
  }

  .stock-name {
    font-size: 14px;
  }
}

/* ============ 2026-07-06 final UX correction pass ============ */

body:not([data-active-panel="stocks"]) #action-buttons,
body:not([data-active-panel="stocks"]) #avatar-scene,
body:not([data-active-panel="stocks"]) #market-news-feed {
  display: none !important;
}

body:not([data-active-panel="stocks"]) .starter-mission-card.complete {
  display: none !important;
}

#market-news-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

#market-news-toggle small {
  min-width: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-news-feed.collapsed {
  padding-top: 10px;
  padding-bottom: 10px;
}

.offline-breakdown {
  display: grid;
  gap: 7px;
  margin: 12px 0 4px;
  padding: 11px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #f8fafc;
  text-align: left;
}

.offline-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
}

.offline-breakdown-row b {
  color: #0ca678;
  white-space: nowrap;
}

.offline-breakdown-note {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.item-icon[data-icon]::before,
.milestone-emoji[data-icon]::before,
.prestige-emoji[data-icon]::before,
.codex-emoji[data-icon]::before,
.achievement-emoji[data-icon]::before,
.modal-emoji[data-icon]::before,
.modal-badge[data-icon]::before,
.scene-floor-item[data-icon]::before {
  background: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
}

.codex-emoji,
.achievement-emoji,
.prestige-emoji {
  border-color: #dbe7ff;
  background: #f2f7ff;
  color: #3182f6;
}

.codex-card.locked .codex-emoji,
.achievement-chip:not(.unlocked) .achievement-emoji {
  border-color: #e5eaf2;
  background: #f7f9fc;
  color: #9aa4b2;
}

.codex-card.current .codex-emoji,
.achievement-chip.unlocked .achievement-emoji {
  border-color: #ffe0a3;
  background: #fff7e6;
  color: #f5a400;
}

.sell-row:not(.is-held) {
  display: none;
}

#topbar-sellall-btn {
  white-space: nowrap;
}

#boost-btn:disabled {
  opacity: 1;
  cursor: default;
}

#avatar-scene {
  isolation: isolate;
}

#avatar-scene.has-watch #acc-watch {
  transform: scale(1.55);
  transform-box: view-box;
  transform-origin: 30px 110px;
  filter: drop-shadow(0 0 4px rgba(245, 181, 68, 0.65));
}

#avatar-scene.has-penthouse {
  border-color: #b9d7ff;
  background:
    linear-gradient(rgba(49, 130, 246, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(49, 130, 246, 0.10), rgba(255, 255, 255, 0) 44%),
    linear-gradient(180deg, #f2f8ff 0%, #ffffff 56%, #eef6ff 100%) !important;
}

#avatar-scene.has-yacht #scene-window-view,
#avatar-scene.has-jet #scene-window-view {
  font-size: 0;
}

#avatar-scene.has-yacht #scene-window-view::before {
  content: "";
  color: #3182f6;
  font-size: 10px;
  font-weight: 950;
}

#avatar-scene.has-jet #scene-window-view::before {
  content: "";
  color: #4e5968;
  font-size: 11px;
  font-weight: 950;
}

#avatar-scene.has-gold #gold-stack {
  filter: drop-shadow(0 8px 12px rgba(245, 181, 68, 0.28));
}

#scene-floor {
  position: relative;
  z-index: 2;
  align-items: end;
  gap: 8px;
  min-height: 44px;
  margin-top: -2px;
}

.scene-floor-item {
  border-radius: 10px;
  background: #f8fafc;
  color: #3182f6;
}

.scene-floor-sportscar {
  width: 112px;
  height: 38px;
  border-color: #ffd6db;
  background: linear-gradient(180deg, #fff5f6, #ffe9ec);
  color: #f04452;
}

.scene-floor-sportscar::before {
  --ui-icon-size: 82px;
}

.scene-floor-yacht {
  width: 102px;
  height: 40px;
  border-color: #cfe3ff;
  background: linear-gradient(180deg, #f2f8ff, #e8f3ff);
  color: #3182f6;
}

.scene-floor-yacht::before {
  --ui-icon-size: 74px;
}

.scene-floor-penthouse {
  width: 86px;
  height: 48px;
  border-color: #d8e2ef;
  background: linear-gradient(180deg, #ffffff, #edf4ff);
  color: #4e5968;
}

.scene-floor-penthouse::before {
  --ui-icon-size: 52px;
}

.scene-floor-jet {
  width: 112px;
  height: 36px;
  border-color: #d8e2ef;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
  color: #4e5968;
}

.scene-floor-jet::before {
  --ui-icon-size: 80px;
}

.scene-floor-gold {
  width: 70px;
  height: 44px;
  border-color: #ffe0a3;
  background: linear-gradient(180deg, #fff9e8, #fff1c8);
  color: #f5a400;
}

@media (max-width: 520px) {
  .stock-card-head {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas:
      "logo name"
      "price price";
    align-items: center;
  }

  .stock-logo {
    grid-area: logo;
  }

  .stock-name-block {
    grid-area: name;
  }

  .stock-price-block {
    grid-area: price;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border-soft);
    text-align: left;
  }

  .stock-price {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stock-change {
    text-align: right;
  }

  .stock-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .trade-actions + .trade-actions {
    margin-top: 6px;
  }

  #scene-floor {
    min-height: 38px;
  }

  .scene-floor-sportscar,
  .scene-floor-jet {
    width: 94px;
  }

  .scene-floor-yacht {
    width: 88px;
  }
}

/* ============ 2026-07-06 splash and price ticker polish ============ */

#splash {
  background:
    radial-gradient(circle at 50% -8%, rgba(49, 130, 246, 0.16), transparent 40%),
    radial-gradient(circle at 50% 78%, rgba(247, 178, 46, 0.1), transparent 34%),
    linear-gradient(180deg, #f6f9ff 0%, #ffffff 48%, #eef5ff 100%);
  background-size: auto;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}

.splash-content {
  display: grid;
  justify-items: center;
  gap: 13px;
  width: min(100%, 390px);
  max-width: 390px;
  margin-top: 0;
  border: 1px solid #dbe7f5;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 58px rgba(57, 76, 96, 0.14);
  padding: 20px 18px 18px;
  text-align: center;
}

.splash-brand-mark {
  width: 194px;
  height: 194px;
  margin: 0;
  border: 1px solid rgba(210, 224, 242, 0.88);
  border-radius: 34px;
  clip-path: none;
  background:
    url('../assets/generated/app-logo-splash.png') center / cover no-repeat,
    #ffffff;
  box-shadow:
    0 18px 38px rgba(49, 130, 246, 0.12),
    0 7px 18px rgba(25, 31, 40, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  animation: floatBob 3.6s ease-in-out infinite;
}

.splash-brand-mark::before,
.splash-brand-mark::after {
  display: none;
}

.brand-candle,
.brand-ant-core {
  display: none;
}

.splash-content h1 {
  margin: 0;
  color: #191f28;
  background: none;
  font-size: clamp(27px, 7vw, 34px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.12;
  text-shadow: none;
}

.splash-tagline {
  max-width: 310px;
  margin: 0;
  color: #4e5968;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  text-shadow: none;
  word-break: keep-all;
}

.splash-disclaimer {
  width: 100%;
  margin: 0;
  border-color: #e2eaf5;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: none;
  color: #6b7684;
  font-size: 11px;
  line-height: 1.62;
  text-align: left;
}

.splash-disclaimer .privacy-link {
  color: #3182f6;
  font-weight: 900;
}

#splash-start-btn {
  min-height: 52px;
  border: 1px solid #2272eb;
  border-radius: 14px;
  background: linear-gradient(180deg, #3b8cff 0%, #1f6feb 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(49, 130, 246, 0.25);
}

#splash-start-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 7px 16px rgba(49, 130, 246, 0.22);
}

.market-news-title {
  min-width: 0;
}

.market-news-title em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  background: #edf4ff;
  color: #3182f6;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  padding: 0 7px;
  vertical-align: middle;
  white-space: nowrap;
}

.stock-price-block {
  display: grid;
  justify-items: end;
  align-content: start;
  row-gap: 2px;
}

.stock-price-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.tick-arrow {
  flex: 0 0 15px;
  width: 15px;
  margin-right: 2px;
  text-align: center;
  transform-origin: center;
}

.tick-arrow:not(.show-up):not(.show-down) {
  visibility: hidden;
}

@media (max-width: 520px) {
  .stock-price-block {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "price change";
    column-gap: 8px;
    align-items: baseline;
  }

  .stock-price-line {
    grid-area: price;
    justify-self: start;
    justify-content: flex-start;
  }

.stock-change {
    grid-area: change;
    justify-self: end;
  }
}

/* Keep transient feedback below blocking dialogs and hide stock-only actions elsewhere. */
#toast-container {
  z-index: 280;
}

.modal {
  z-index: 320;
}

.sheet-backdrop {
  z-index: 340;
}

body:not([data-active-panel="stocks"]) #topbar-sellall-btn {
  display: none !important;
}

@media (max-width: 380px) {
  .splash-content {
    padding: 18px 14px 14px;
  }

  .splash-brand-mark {
    width: 164px;
    height: 164px;
    border-radius: 30px;
  }

}

@media (max-height: 680px) {
  .splash-content {
    gap: 10px;
    padding-top: 16px;
  }

  .splash-brand-mark {
    width: 152px;
    height: 152px;
    border-radius: 28px;
  }
}

/* ============ 2026-07-06 topbar evolution ant badge ============ */

.tier-ant-mark {
  --tier-accent: #9b6b43;
  --ant-head: #a97e50;
  --ant-body: #9c7248;
  --ant-back: #8f653d;
  --ant-dark: #6d4d30;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-color: #dbe7f5;
  background:
    radial-gradient(circle at 50% 10%, rgba(49, 130, 246, 0.1), transparent 54%),
    linear-gradient(180deg, #fffdf8 0%, #fff8ea 100%);
}

.tier-ant-mark .tier-ant-mini {
  display: block;
  position: relative;
  z-index: 1;
  width: 38px;
  height: 28px;
  transform: translateY(2px);
}

.tier-ant-mark .tier-ant-mini::before,
.tier-ant-mark .tier-ant-mini::after,
.tier-ant-mark .tier-ant-mini i {
  content: "";
  display: block;
  position: absolute;
  border-radius: 50%;
  background: var(--ant-body);
  box-shadow: inset 0 -2px 0 rgba(68, 45, 26, 0.16);
}

.tier-ant-mark .tier-ant-mini::before {
  top: 11px;
  left: 13px;
  width: 17px;
  height: 14px;
}

.tier-ant-mark .tier-ant-mini::after {
  top: 10px;
  right: 0;
  width: 21px;
  height: 16px;
  background: var(--ant-back);
}

.tier-ant-mark .tier-ant-mini i {
  top: 9px;
  left: 1px;
  width: 16px;
  height: 15px;
  background: var(--ant-head);
}

.tier-ant-mark .tier-ant-mini i::before {
  content: "";
  display: block;
  position: absolute;
  top: 5px;
  left: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #191f28;
  box-shadow: 6px 0 0 #191f28;
}

.tier-ant-mark .tier-ant-mini b {
  display: block;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(22deg, transparent 47%, var(--ant-dark) 48% 52%, transparent 53%) 5px 19px / 32px 4px no-repeat,
    linear-gradient(0deg, transparent 47%, var(--ant-dark) 48% 52%, transparent 53%) 5px 22px / 32px 4px no-repeat,
    linear-gradient(-22deg, transparent 47%, var(--ant-dark) 48% 52%, transparent 53%) 5px 25px / 32px 4px no-repeat;
}

.tier-ant-mark .tier-ant-mini b::before {
  content: "";
  display: block;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 8px;
  border-top: 2px solid var(--ant-dark);
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  border-radius: 50% 50% 0 0;
}

.tier-ant-mark .tier-ant-mini b::after,
.tier-ant-mark .tier-ant-mini i::after {
  content: none;
  display: block;
  position: absolute;
}

.tier-ant-mark[data-tier="0"] .tier-ant-mini b::after {
  content: "";
  right: 5px;
  bottom: 3px;
  width: 12px;
  height: 9px;
  border: 1px dashed #7a5c3e;
  border-radius: 2px;
  background: #e8d9b5;
  transform: rotate(10deg);
}

.tier-ant-mark[data-tier="1"] {
  --tier-accent: #f4b800;
}

.tier-ant-mark[data-tier="1"] .tier-ant-mini i::after {
  content: "";
  top: -6px;
  left: -2px;
  width: 20px;
  height: 10px;
  border: 1px solid #e0a800;
  border-radius: 10px 10px 3px 3px;
  background: #ffd23f;
}

.tier-ant-mark[data-tier="2"] {
  --tier-accent: #e0435c;
}

.tier-ant-mark[data-tier="2"] .tier-ant-mini b::after {
  content: "";
  left: 17px;
  bottom: 3px;
  width: 6px;
  height: 13px;
  clip-path: polygon(50% 0, 100% 42%, 68% 100%, 32% 100%, 0 42%);
  background: #e0435c;
}

.tier-ant-mark[data-tier="3"] {
  --tier-accent: #475569;
}

.tier-ant-mark[data-tier="3"] .tier-ant-mini i::after {
  content: "";
  top: 4px;
  left: 1px;
  width: 14px;
  height: 6px;
  border: 2px solid #252d3a;
  border-right-width: 1px;
  border-radius: 999px;
  background: transparent;
}

.tier-ant-mark[data-tier="4"],
.tier-ant-mark[data-tier="7"] {
  --tier-accent: #f0b429;
}

.tier-ant-mark[data-tier="4"] .tier-ant-mini i::after,
.tier-ant-mark[data-tier="7"] .tier-ant-mini i::after {
  content: "";
  top: 4px;
  left: 2px;
  width: 13px;
  height: 6px;
  border-radius: 4px;
  background: #111827;
}

.tier-ant-mark[data-tier="4"] .tier-ant-mini b::after,
.tier-ant-mark[data-tier="7"] .tier-ant-mini b::after {
  content: "";
  left: 16px;
  top: 16px;
  width: 12px;
  height: 7px;
  border-bottom: 3px solid #ffd23f;
  border-radius: 0 0 999px 999px;
}

.tier-ant-mark[data-tier="5"] {
  --tier-accent: #e0435c;
  --ant-back: #d7445f;
}

.tier-ant-mark[data-tier="5"] .tier-ant-mini b::after {
  content: "S";
  left: 18px;
  top: 13px;
  display: grid;
  width: 11px;
  height: 11px;
  place-items: center;
  border-radius: 50%;
  background: #ffd23f;
  color: #e0435c;
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
}

.tier-ant-mark[data-tier="6"] {
  --tier-accent: #8b5cf6;
  --ant-back: #8060c9;
}

.tier-ant-mark[data-tier="6"] .tier-ant-mini i::after,
.tier-ant-mark[data-tier="8"] .tier-ant-mini i::after {
  content: "";
  top: -7px;
  left: -1px;
  width: 18px;
  height: 9px;
  clip-path: polygon(0 100%, 16% 25%, 36% 82%, 50% 0, 64% 82%, 84% 25%, 100% 100%);
  background: #ffd23f;
}

.tier-ant-mark[data-tier="7"] {
  --tier-accent: #111827;
}

.tier-ant-mark[data-tier="7"] .tier-ant-mini::before {
  background: #243047;
}

.tier-ant-mark[data-tier="8"] {
  --tier-accent: #ffb000;
  --ant-head: #f7c948;
  --ant-body: #f0b429;
  --ant-back: #ffd23f;
}

.tier-ant-mark[data-tier="8"] .tier-ant-mini {
  filter: drop-shadow(0 0 6px rgba(255, 203, 71, 0.55));
}

.tier-ant-mark[data-tier="9"] {
  --tier-accent: #7c5cff;
  --ant-head: #f7c948;
  --ant-body: #f0b429;
  --ant-back: #ffd23f;
}

.tier-ant-mark[data-tier="9"] .tier-ant-mini::before {
  box-shadow:
    -12px -2px 0 -4px rgba(180, 220, 255, 0.92),
    12px -2px 0 -4px rgba(180, 220, 255, 0.92),
    inset 0 -2px 0 rgba(68, 45, 26, 0.16);
}

.tier-ant-mark[data-tier="9"] .tier-ant-mini b::after {
  content: "";
  left: 7px;
  top: -3px;
  width: 24px;
  height: 6px;
  border: 2px solid #ffd23f;
  border-radius: 50%;
  background: transparent;
}

/* ============ 2026-07-06 luxury item scene and light state audit ============ */

#avatar-scene {
  min-height: 232px;
  padding: 18px 16px 10px;
  border-color: #dbe7f5 !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 48%),
    linear-gradient(90deg, rgba(49, 130, 246, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(49, 130, 246, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #f4f8ff 0%, #ffffff 56%, #eef5ff 57%, #e5eefc 100%) !important;
  background-size: auto, 28px 28px, 28px 28px, auto !important;
  box-shadow: 0 16px 36px rgba(49, 73, 101, 0.12) !important;
  overflow: hidden;
}

#avatar-scene::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(210, 222, 239, 0.54)),
    repeating-linear-gradient(90deg, rgba(156, 177, 204, 0.28) 0 1px, transparent 1px 38px);
  border-top: 1px solid rgba(191, 208, 229, 0.7);
}

#avatar-scene[data-tier="0"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 48%),
    linear-gradient(90deg, rgba(120, 98, 76, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(120, 98, 76, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, #f2eee6 0%, #fffaf1 56%, #ece3d4 57%, #dfd3c0 100%) !important;
}

#avatar-scene[data-tier="1"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 48%),
    linear-gradient(90deg, rgba(49, 130, 246, 0.048) 1px, transparent 1px),
    linear-gradient(rgba(49, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 56%, #eef5ff 57%, #e4eefc 100%) !important;
}

#avatar-scene[data-tier="2"],
#avatar-scene[data-tier="3"] {
  background:
    radial-gradient(circle at 74% 20%, rgba(255, 210, 92, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 46%),
    linear-gradient(90deg, rgba(49, 130, 246, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(49, 130, 246, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #f2f8ff 0%, #ffffff 56%, #eaf3ff 57%, #dfeafb 100%) !important;
}

#scene-wall {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
}

#scene-window {
  position: absolute;
  left: 16px;
  top: 16px;
  width: 78px;
  height: 58px;
  border: 2px solid #b9d7ff !important;
  border-radius: 12px;
  background:
    radial-gradient(circle at 72% 22%, #ffd76a 0 8px, transparent 9px),
    linear-gradient(180deg, #dff1ff 0%, #bfe2ff 54%, #d8f5ff 55%, #eaf9ff 100%) !important;
  box-shadow: 0 8px 18px rgba(49, 130, 246, 0.12);
}

#scene-window::before,
#scene-window::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.74);
}

#scene-window::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
}

#scene-window::after {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
}

#scene-window-view {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
}

#avatar-scene.has-yacht #scene-window-view::before,
#avatar-scene.has-jet #scene-window-view::before,
#scene-window-view::before,
#scene-window-view::after {
  content: none !important;
  display: none !important;
}

.scene-owned-object.hidden {
  display: none !important;
}

.scene-owned-object {
  position: absolute;
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

#scene-sportscar {
  z-index: 5;
  left: max(8px, calc(50% - 176px));
  bottom: 8px;
  width: 176px;
  height: 82px;
  background-image: url('../assets/ui/milestone-sportscar.svg');
  filter: drop-shadow(0 12px 12px rgba(240, 68, 82, 0.18));
}

#scene-sportscar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 10px;
  bottom: 2px;
  height: 12px;
  border-radius: 50%;
  background: rgba(39, 52, 70, 0.13);
  z-index: -1;
}

#scene-yacht {
  z-index: 4;
  right: max(10px, calc(50% - 170px));
  bottom: 12px;
  width: 132px;
  height: 78px;
  border-radius: 22px;
  background:
    url('../assets/ui/milestone-yacht.svg') center 44% / 112px 112px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.1) 42%),
    linear-gradient(180deg, rgba(190, 228, 255, 0.72), rgba(79, 173, 237, 0.28));
  box-shadow: inset 0 0 0 1px rgba(185, 215, 255, 0.9), 0 12px 22px rgba(49, 130, 246, 0.1);
}

#scene-jet {
  z-index: 2;
  right: 16px;
  top: 14px;
  width: 128px;
  height: 66px;
  background-image: url('../assets/ui/milestone-jet.svg');
  filter: drop-shadow(0 10px 12px rgba(71, 85, 105, 0.13));
  transform: rotate(-4deg);
}

#scene-jet::before {
  content: "";
  position: absolute;
  right: 82px;
  top: 38px;
  width: 56px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(49, 130, 246, 0.42));
}

#scene-penthouse {
  z-index: 2;
  left: 50%;
  top: 12px;
  width: 112px;
  height: 86px;
  transform: translateX(-50%);
  border-radius: 18px;
  background:
    url('../assets/ui/milestone-penthouse.svg') center 62% / 74px 74px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 255, 0.68));
  box-shadow: inset 0 0 0 1px rgba(185, 215, 255, 0.74), 0 12px 24px rgba(49, 130, 246, 0.1);
}

#wall-art {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: 18px;
  width: 76px;
  height: 56px;
  margin: 0;
  border: 5px solid #8b633c;
  border-radius: 10px;
  background:
    url('../assets/ui/milestone-art.svg') center / 64px 64px no-repeat,
    #fff7e6;
  box-shadow: 0 8px 18px rgba(97, 72, 42, 0.12);
}

#avatar-scene.has-jet #wall-art,
#avatar-scene.has-penthouse #wall-art {
  right: 152px;
}

#ant-avatar-wrap {
  z-index: 8;
  margin-top: 54px;
}

#ant-avatar {
  filter: drop-shadow(0 12px 14px rgba(39, 52, 70, 0.12));
}

#avatar-scene.has-watch #acc-watch {
  transform: scale(2.05);
  transform-box: view-box;
  transform-origin: 30px 110px;
  filter: drop-shadow(0 0 5px rgba(245, 181, 68, 0.76));
}

#avatar-scene.has-watch #acc-watch::after {
  content: none;
}

#avatar-scene.has-gold #gold-stack {
  left: 72px;
  bottom: -7px;
  width: 56px;
  height: 44px;
  filter: drop-shadow(0 10px 12px rgba(245, 181, 68, 0.28));
}

#avatar-scene.has-gold #gold-stack::before,
#avatar-scene.has-gold #gold-stack::after {
  width: 46px;
  height: 13px;
  border-width: 2px;
}

#avatar-scene.has-gold #gold-stack::after {
  left: 9px;
  bottom: 13px;
}

#scene-floor {
  display: none;
}

.item-row,
.item-row.owned,
.item-row.unaffordable,
.milestone-card,
.milestone-card.purchased,
.milestone-card.achievable,
.prestige-card,
.codex-card,
.achievement-chip,
.bank-card {
  background: #ffffff !important;
  border-color: #e2eaf5 !important;
  color: #191f28 !important;
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.06) !important;
}

.item-row.owned,
.milestone-card.purchased,
.achievement-chip.unlocked {
  border-color: #b7efd8 !important;
  background:
    linear-gradient(90deg, rgba(34, 197, 128, 0.075), transparent 42%),
    #ffffff !important;
}

.achievement-chip,
.achievement-chip.unlocked {
  opacity: 1 !important;
}

.achievement-chip.unlocked .achievement-emoji {
  border-color: #b7efd8 !important;
  background: #ecfff7 !important;
  color: #0ca678 !important;
}

.achievement-chip.unlocked .achievement-name {
  color: #191f28 !important;
}

.achievement-chip.unlocked .achievement-desc {
  color: #6b7684 !important;
}

.item-row.unaffordable {
  opacity: 1;
  background: #f7f9fc !important;
}

.item-row.unaffordable .item-info,
.item-row.unaffordable .item-icon {
  opacity: 0.62;
}

.item-icon.text-icon,
.item-icon[data-icon],
.milestone-emoji[data-icon] {
  border-color: #dbe7f5 !important;
  background: #f2f7ff !important;
  color: #3182f6 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.item-row.owned .item-icon[data-icon],
.item-row.owned .item-icon.text-icon,
.milestone-card.purchased .milestone-emoji[data-icon] {
  border-color: #b7efd8 !important;
  background: #ecfff7 !important;
  color: #0ca678 !important;
}

.item-name,
.milestone-name {
  color: #191f28 !important;
}

.item-sub,
.milestone-sub {
  color: #6b7684 !important;
}

.item-level {
  border-color: #dbe7ff !important;
  background: #edf4ff !important;
  color: #3182f6 !important;
}

.item-row.owned .item-level,
.milestone-card.purchased .item-level {
  border-color: #b7efd8 !important;
  background: #ecfff7 !important;
  color: #0ca678 !important;
}

#action-buttons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 16px 0;
}

#action-buttons button {
  min-height: 52px;
  padding: 7px 4px;
  font-size: 11px;
  line-height: 1.15;
  word-break: keep-all;
}

@media (max-width: 360px) {
  #action-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* v63: keep the day-trade minigame in the same light, readable visual system as the rest of the app. */
#daytrade-field {
  height: clamp(210px, 44dvh, 300px);
  border: 1px solid #d8e7f7;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 20%, rgba(49, 130, 246, 0.14), transparent 28%),
    radial-gradient(circle at 78% 24%, rgba(23, 185, 120, 0.12), transparent 24%),
    linear-gradient(rgba(157, 177, 208, 0.20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 177, 208, 0.20) 1px, transparent 1px),
    linear-gradient(180deg, #f9fbff 0%, #edf5ff 100%);
  background-size: auto, auto, 24px 24px, 24px 24px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 14px 32px rgba(37, 99, 235, 0.10);
}

#daytrade-field::before {
  content: '';
  position: absolute;
  inset: 18px 18px auto 18px;
  height: 54px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 4%, rgba(239, 68, 68, 0.46) 4% 6%, transparent 6% 12%,
      rgba(47, 143, 255, 0.42) 12% 14%, transparent 14% 24%, rgba(239, 68, 68, 0.44) 24% 27%,
      transparent 27% 36%, rgba(47, 143, 255, 0.42) 36% 38%, transparent 38% 50%,
      rgba(239, 68, 68, 0.48) 50% 53%, transparent 53% 64%, rgba(47, 143, 255, 0.42) 64% 66%,
      transparent 66% 78%, rgba(239, 68, 68, 0.42) 78% 81%, transparent 81% 100%);
  opacity: 0.62;
  pointer-events: none;
}

.daytrade-target {
  border: 1px solid rgba(9, 115, 75, 0.18);
  color: #063b28;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 12%, #c9ffe9 13% 42%, #28d79a 75%);
  box-shadow: 0 10px 22px rgba(23, 185, 120, 0.28), 0 0 0 6px rgba(23, 185, 120, 0.10);
}

.daytrade-target.gold {
  border-color: rgba(194, 121, 0, 0.18);
  background: radial-gradient(circle at 35% 30%, #ffffff 0 12%, #fff0bc 13% 42%, #ffc742 75%);
  box-shadow: 0 10px 24px rgba(245, 181, 68, 0.34), 0 0 0 6px rgba(245, 181, 68, 0.12);
}

@media (max-width: 520px) {
  #avatar-scene {
    min-height: 232px;
    padding-inline: 12px;
  }

  #avatar-scene.has-sportscar.has-yacht.has-gold,
  #avatar-scene.has-sportscar.has-yacht.has-jet,
  #avatar-scene.has-sportscar.has-yacht.has-penthouse {
    min-height: 262px;
  }

  #scene-window {
    left: 12px;
    top: 14px;
    width: 68px;
    height: 52px;
  }

  #scene-jet {
    right: 10px;
    top: 12px;
    width: 106px;
    height: 56px;
  }

  #scene-penthouse {
    top: 12px;
    width: 94px;
    height: 74px;
  }

  #wall-art {
    right: 12px;
    top: 18px;
    width: 64px;
    height: 48px;
  }

  #avatar-scene.has-jet #wall-art {
    right: 112px;
  }

  #avatar-scene.has-penthouse #wall-art {
    left: 88px;
    right: auto;
    width: 54px;
    height: 42px;
  }

  #ant-avatar-wrap {
    margin-top: 50px;
  }

  #scene-sportscar {
    left: 2px;
    bottom: 8px;
    width: 154px;
    height: 72px;
  }

  #scene-yacht {
    right: 8px;
    bottom: 10px;
    width: 104px;
    height: 66px;
    background-size: 92px 92px, auto, auto;
  }

  #avatar-scene.has-gold #gold-stack {
    left: 76px;
    bottom: -8px;
    width: 50px;
    height: 40px;
  }

  #avatar-scene.has-sportscar.has-yacht.has-gold #gold-stack {
    left: 154px;
    bottom: -8px;
  }

  #avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
    width: 148px;
    height: 70px;
  }
}

/* v56 final mobile action-button density: keep cooldown timers readable in 4-up layout. */
#action-buttons button,
#action-buttons button.action-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 60px;
  padding: 6px 4px;
  overflow: hidden;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
}

#action-buttons button::before,
#action-buttons button.action-primary::before,
#free-cash-btn.glow::before,
#boost-btn.glow::before {
  display: block;
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}

#action-buttons button::after {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 17px;
  height: 17px;
  transform: translateX(-50%);
}

@media (min-width: 620px) {
  #action-buttons button,
  #action-buttons button.action-primary {
    min-height: 64px;
    font-size: 13px;
  }
}

/* ============ 2026-07-07 character badge and final light UI audit ============ */

body {
  background: #f4f7fb !important;
  color: #191f28 !important;
}

#topbar,
#tip-ticker,
#action-buttons,
#bottom-nav,
#market-news-feed,
.portfolio-summary,
.stock-card,
.item-row,
.bank-card,
.milestone-card,
.prestige-card,
.codex-card,
.achievement-chip,
.modal-content,
.sheet,
#sell-sheet,
.sell-preview,
.daytrade-game,
.daytrade-result,
.help-slide-card,
.guide-card,
.daily-dot {
  background: #ffffff !important;
  color: #191f28 !important;
  border-color: #e2eaf5 !important;
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.06) !important;
  text-shadow: none !important;
}

#tip-ticker,
#action-buttons,
#bottom-nav {
  box-shadow: 0 -1px 0 rgba(219, 231, 245, 0.7), 0 8px 20px rgba(25, 31, 40, 0.04) !important;
}

.cash-chip,
#milestone-progress-wrap,
.market-news-feed-list,
.stock-chart,
.sell-summary,
.sell-preview,
.ranking-myrank,
#ranking-list,
#save-code-area,
.help-slide-copy,
.bank-breakdown,
.offline-breakdown {
  background: #f7f9fc !important;
  color: #4e5968 !important;
  border-color: #e2eaf5 !important;
}

#action-buttons button,
#action-buttons button.action-primary,
#mute-btn,
#ranking-btn,
#invite-btn,
#help-btn,
#nickname-btn,
.bank-btn,
.buy-btn,
.modal-actions button,
.sell-confirm-btn {
  background: #ffffff !important;
  color: #191f28 !important;
  border-color: #dbe7f5 !important;
  box-shadow: 0 6px 16px rgba(25, 31, 40, 0.06) !important;
  text-shadow: none !important;
}

#action-buttons button.glow,
#action-buttons button.action-primary.glow,
#invite-btn.glow {
  border-color: #f4b544 !important;
  background:
    linear-gradient(180deg, #ffffff, #fffaf0) !important;
}

.tier-ant-mark {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #dbe7f5 !important;
  border-radius: 12px !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 210, 92, 0.26), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #fff8e8 100%) !important;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.09) !important;
}

.tier-ant-mark::before,
.tier-ant-mark::after,
.tier-ant-mini,
.tier-ant-mini::before,
.tier-ant-mini::after,
.tier-ant-mini i,
.tier-ant-mini b {
  content: none !important;
  display: none !important;
}

.tier-ant-img {
  display: block;
  width: 54px;
  height: 54px;
  max-width: none;
  object-fit: contain;
  object-position: 42% bottom;
  transform: translate(-6px, 5px);
  filter: drop-shadow(0 4px 5px rgba(25, 31, 40, 0.14));
}

.tier-ant-mark[data-tier="8"],
.tier-ant-mark[data-tier="9"] {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 203, 71, 0.42), transparent 58%),
    linear-gradient(180deg, #ffffff 0%, #fff7dc 100%) !important;
}

.tier-ant-mark[data-tier="8"] .tier-ant-img,
.tier-ant-mark[data-tier="9"] .tier-ant-img {
  width: 58px;
  height: 58px;
  object-position: 41% bottom;
  transform: translate(-8px, 6px);
}

#scene-yacht {
  right: max(6px, calc(50% - 178px));
  bottom: 7px;
  width: 154px;
  height: 94px;
  border-radius: 0;
  background: url('../assets/ui/milestone-yacht.svg') center bottom / 146px 98px no-repeat !important;
  box-shadow: none;
  filter: drop-shadow(0 12px 10px rgba(49, 130, 246, 0.16));
}

#scene-yacht::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 6px;
  bottom: 0;
  height: 12px;
  border-radius: 50%;
  background: rgba(49, 130, 246, 0.14);
  z-index: -1;
}

#scene-jet {
  right: 8px;
  top: 16px;
  width: 158px;
  height: 72px;
  background-image: url('../assets/ui/milestone-jet.svg') !important;
  filter: drop-shadow(0 10px 12px rgba(49, 73, 101, 0.16));
  transform: rotate(-3deg);
}

#scene-jet::before {
  right: 112px;
  top: 42px;
  width: 72px;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(49, 130, 246, 0.38));
}

#scene-penthouse {
  left: 50%;
  top: 12px;
  width: 142px;
  height: 92px;
  border-radius: 12px 12px 4px 4px;
  background:
    linear-gradient(90deg, transparent 12px, rgba(125, 211, 252, 0.86) 12px 19px, transparent 19px 33px, rgba(125, 211, 252, 0.86) 33px 40px, transparent 40px) 14px 20px / 54px 54px repeat-y,
    linear-gradient(90deg, transparent 11px, rgba(125, 211, 252, 0.9) 11px 18px, transparent 18px 31px, rgba(125, 211, 252, 0.9) 31px 38px, transparent 38px) 78px 12px / 52px 58px repeat-y,
    linear-gradient(180deg, #243858 0%, #152541 100%) left bottom / 64px 76px no-repeat,
    linear-gradient(180deg, #31486e 0%, #172842 100%) right bottom / 72px 92px no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 12px 14px rgba(49, 73, 101, 0.14));
}

#scene-penthouse::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 8px;
  border-radius: 999px;
  background: rgba(49, 73, 101, 0.14);
  z-index: -1;
}

#scene-penthouse::after {
  content: "";
  position: absolute;
  left: 43px;
  bottom: 0;
  width: 12px;
  height: 18px;
  border-radius: 3px 3px 0 0;
  background: #f6b84b;
  box-shadow: 56px -6px 0 -1px rgba(246, 184, 75, 0.92);
}

#avatar-scene.has-gold #gold-stack {
  width: 66px;
  height: 50px;
}

#wall-art {
  border-width: 6px;
  border-radius: 9px;
  filter: drop-shadow(0 8px 10px rgba(97, 72, 42, 0.16));
}

@media (max-width: 520px) {
  #scene-yacht {
    right: 0;
    bottom: 8px;
    width: 122px;
    height: 78px;
    background-size: 118px 82px !important;
  }

  #scene-jet {
    right: 4px;
    top: 12px;
    width: 122px;
    height: 62px;
  }

  #scene-penthouse {
    top: 8px;
    width: 116px;
    height: 82px;
    background:
      linear-gradient(90deg, transparent 9px, rgba(125, 211, 252, 0.86) 9px 15px, transparent 15px 27px, rgba(125, 211, 252, 0.86) 27px 33px, transparent 33px) 10px 18px / 42px 48px repeat-y,
      linear-gradient(90deg, transparent 9px, rgba(125, 211, 252, 0.9) 9px 15px, transparent 15px 26px, rgba(125, 211, 252, 0.9) 26px 32px, transparent 32px) 62px 12px / 42px 50px repeat-y,
      linear-gradient(180deg, #243858 0%, #152541 100%) left bottom / 54px 68px no-repeat,
      linear-gradient(180deg, #31486e 0%, #172842 100%) right bottom / 58px 82px no-repeat;
  }

  #avatar-scene.has-gold #gold-stack {
    width: 58px;
    height: 44px;
  }
}

/* v59 balance pass: stronger ownership states and visible watch equipment. */
#scene-watch {
  z-index: 9;
  left: -18px;
  bottom: 32px;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 226, 143, 0.8), transparent 54%),
    url('../assets/ui/milestone-watch.svg') center / 48px 48px no-repeat,
    linear-gradient(180deg, #ffffff, #fff4d1);
  border: 1px solid #f3d58a;
  box-shadow: 0 10px 18px rgba(245, 181, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#scene-watch::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -6px;
  height: 8px;
  border-radius: 50%;
  background: rgba(97, 72, 42, 0.13);
  z-index: -1;
}

.item-row.locked,
.analyst-row.locked {
  background: #f7f9fc !important;
  border-color: #dbe4f0 !important;
  opacity: 1 !important;
}

.item-row.locked .item-icon,
.item-row.locked .item-info {
  opacity: 0.58;
}

.analyst-row.locked .buy-btn {
  color: #8b95a1 !important;
  background: #eef3f8 !important;
  border-color: #dbe4f0 !important;
}

.milestone-card {
  position: relative;
  overflow: hidden;
}

.milestone-card.locked {
  background: #f8fafc !important;
  border-color: #e2eaf5 !important;
}

.milestone-card.achievable {
  border-color: #f3c45d !important;
  background:
    linear-gradient(90deg, rgba(255, 203, 71, 0.16), transparent 46%),
    #ffffff !important;
  box-shadow: 0 10px 24px rgba(245, 181, 68, 0.12) !important;
}

.milestone-card.purchased {
  border-color: #8ce5bd !important;
  background:
    linear-gradient(90deg, rgba(34, 197, 128, 0.18), transparent 48%),
    linear-gradient(180deg, #ffffff, #f5fff9) !important;
  box-shadow: 0 12px 28px rgba(34, 197, 128, 0.1) !important;
}

.milestone-card.purchased::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #12b886, #63e6be);
}

.milestone-copy {
  flex: 1;
  min-width: 0;
}

.milestone-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.milestone-status {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 999px;
  border: 1px solid #dbe7f5;
  background: #f7f9fc;
  color: #6b7684;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.milestone-status.ready {
  border-color: #f3c45d;
  background: #fff8e3;
  color: #8a5b00;
}

.milestone-status.owned {
  border-color: #9ee8c6;
  background: #eafff5;
  color: #0ca678;
}

.milestone-owned-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.milestone-owned-summary span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #c9f2de;
  border-radius: 8px;
  background: #f2fff8;
  color: #087f5b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.milestone-resell-btn {
  border-color: #dbe7f5 !important;
  background: #ffffff !important;
  color: #4e5968 !important;
}

.milestone-buy-btn {
  background: linear-gradient(180deg, #ffd76a, #f3b846) !important;
  color: #2b1a00 !important;
  border: 1px solid #e8ad38 !important;
  box-shadow: 0 6px 14px rgba(245, 181, 68, 0.18) !important;
  min-height: 42px;
  line-height: 1.2;
  white-space: normal;
  word-break: keep-all;
}

.milestone-buy-btn:disabled {
  background: #eef3f8 !important;
  border-color: #dbe4f0 !important;
  color: #8b95a1 !important;
  box-shadow: none !important;
}

@media (max-width: 520px) {
  #scene-watch {
    left: -10px;
    bottom: 28px;
    width: 50px;
    height: 50px;
    background-size: auto, 42px 42px, auto;
  }

  .milestone-title-row {
    align-items: flex-start;
  }

  .milestone-owned-summary {
    grid-template-columns: 1fr;
  }
}

/* ============ 2026-07-07 section rhythm and large-number guards ============ */

#app {
  overflow-x: clip;
  background:
    linear-gradient(180deg, #ffffff 0 232px, #f5f8fc 232px 100%) !important;
}

#topbar {
  border-bottom-color: #dbe7f5 !important;
}

#tip-ticker {
  background: linear-gradient(180deg, #ffffff, #f7fbff) !important;
  border-top: 1px solid #edf3fb !important;
  border-bottom: 1px solid #dfeaf7 !important;
}

#action-buttons {
  margin: 0;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%) !important;
  border-top: 1px solid #edf3fb !important;
  border-bottom: 1px solid #dbe7f5 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(219, 231, 245, 0.7) !important;
}

#action-buttons button,
#action-buttons button.action-primary {
  background: linear-gradient(180deg, #ffffff, #fbfdff) !important;
}

#avatar-scene {
  margin-top: 14px;
  margin-bottom: 0;
}

#market-news-feed {
  margin-top: 12px;
  margin-bottom: 0;
  background:
    linear-gradient(90deg, rgba(49, 130, 246, 0.06), transparent 38%),
    #ffffff !important;
}

#main-screen {
  border-top: 1px solid #e8eff8;
  background: linear-gradient(180deg, #f7f9fc 0%, #ffffff 34px, #ffffff 100%);
}

.panel.active {
  display: grid;
  gap: 12px;
}

#stock-list {
  gap: 12px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 20px 0 8px;
  color: #4e5968;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: none;
}

.section-label:first-child {
  margin-top: 0;
}

.section-label::after {
  content: "";
  flex: 1 1 auto;
  min-width: 28px;
  height: 1px;
  background: linear-gradient(90deg, #dbe7f5, transparent);
}

.panel-desc {
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #f7f8fa;
  padding: 10px 12px;
}

.portfolio-summary {
  border: 1px solid #e5e8eb !important;
  background: #ffffff !important;
}

.stock-card.is-held {
  background: #ffffff !important;
}

.item-row.owned,
.milestone-card.purchased,
.achievement-chip.unlocked {
  background:
    linear-gradient(90deg, rgba(34, 197, 128, 0.11), transparent 42%),
    #ffffff !important;
}

.networth-block,
.cash-action-wrap,
.cash-chip,
.ps-head,
.ps-head > div,
.ps-right,
.stock-price-block,
.stock-price-line,
.holding-info,
.holding-metric,
.holding-pl,
.sheet,
.sheet-head,
.sheet-head > div,
.sheet-price-block,
.sell-preview,
.sell-preview-row,
.sell-preview-row > span,
.sell-confirm-btn {
  min-width: 0;
  max-width: 100%;
}

#networth-amount,
#cash-amount,
.ps-value,
.ps-pl,
.ps-sub,
.ps-sub b,
.stock-price,
.holding-metric.value,
.holding-pl,
.modal-highlight,
.bank-balance,
.ranking-worth,
.cost,
.sheet-title,
.sheet-sub,
.sheet-price,
.sheet-pl,
#sell-preview-qty,
#sell-preview-amount,
#sell-preview-pl,
.sell-preview-row span:last-child,
.sell-confirm-btn {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

#networth-amount {
  display: block;
  font-size: clamp(18px, 5.4vw, 24px);
  line-height: 1.22;
  overflow: visible;
}

.networth-line {
  flex-wrap: wrap;
}

#cash-amount {
  max-width: 100%;
  text-align: right;
  line-height: 1.22;
  overflow: visible;
}

.ps-head {
  gap: 12px;
}

.ps-right {
  flex: 0 1 44%;
}

.ps-value,
.ps-pl {
  font-size: clamp(17px, 5vw, 21px);
  line-height: 1.12;
}

.stock-price {
  line-height: 1.12;
}

.sheet-backdrop {
  align-items: flex-end;
  overflow-x: hidden;
  box-sizing: border-box;
}

#sell-sheet {
  width: min(100%, 480px);
  max-width: calc(100vw - 16px);
  overflow-x: hidden;
}

.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  align-items: start;
}

.sheet-price-block {
  justify-items: end;
}

.sheet-price,
.sheet-pl {
  max-width: 100%;
  line-height: 1.14;
  text-align: right;
}

.sell-portion-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.sell-portion-chips button {
  min-width: 0;
  padding-right: 4px;
  padding-left: 4px;
}

.sell-preview-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
}

.sell-preview-row span:last-child {
  justify-self: end;
  text-align: right;
  line-height: 1.16;
}

#sell-preview-leverage {
  max-width: 100%;
  white-space: normal;
}

.sell-confirm-btn {
  display: grid;
  place-items: center;
  padding-right: 12px;
  padding-left: 12px;
  line-height: 1.2;
}

@media (max-width: 380px) {
  #main-screen {
    padding-top: 14px;
  }

  #action-buttons {
    padding-right: 12px;
    padding-left: 12px;
  }

  .ps-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
    align-items: start;
  }

  .sell-preview-row {
    grid-template-columns: 1fr;
  }

  .sell-preview-row span:last-child {
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 360px) {
  #app {
    background:
      linear-gradient(180deg, #ffffff 0 214px, #f5f8fc 214px 100%) !important;
  }

  #sell-sheet {
    max-width: calc(100vw - 12px);
    padding-right: 10px;
    padding-left: 10px;
  }

  .sheet-head,
  .sell-preview-row {
    grid-template-columns: 1fr;
  }

  .sheet-price-block,
  .sheet-price,
  .sheet-pl,
  .sell-preview-row span:last-child {
    justify-items: start;
    justify-self: start;
    text-align: left;
  }

  .sheet-title {
    font-size: 16px;
  }

  .sheet-price {
    font-size: 15px;
  }

  .sell-preview-row {
    gap: 4px;
    padding: 8px;
  }

  .sell-preview-row span:last-child {
    font-size: 13px;
  }

  .sell-portion-chips {
    gap: 6px;
  }

  .sell-portion-chips button {
    min-height: 36px;
    font-size: 12px;
  }
}

/* v64 cross-check fixes: pinned tabs and clearer luxury-scene composition. */
#bottom-nav {
  position: fixed !important;
  right: auto !important;
  bottom: 0 !important;
  left: 50% !important;
  width: min(100vw, 480px) !important;
  max-width: 480px !important;
  transform: translateX(-50%) translateZ(0) !important;
}

#scene-window {
  left: 16px !important;
  top: 16px !important;
  width: 74px !important;
  height: 56px !important;
}

#wall-art {
  right: 16px !important;
  left: auto !important;
  top: 18px !important;
  width: 76px !important;
  height: 56px !important;
}

#avatar-scene.has-jet #wall-art,
#avatar-scene.has-penthouse #wall-art {
  right: 16px !important;
  left: auto !important;
}

#scene-watch {
  display: none !important;
}

#avatar-scene.has-watch #acc-watch {
  transform: translate(30px, 110px) rotate(11deg) scale(1.6) !important;
  transform-box: view-box;
  transform-origin: 0 0;
  filter: drop-shadow(0 1px 1px rgba(122, 79, 18, 0.35)) drop-shadow(0 0 5px rgba(245, 181, 68, 0.65));
}

#scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
  left: max(-4px, calc(50% - 198px)) !important;
  bottom: 2px !important;
  width: 216px !important;
  height: 100px !important;
  z-index: 7 !important;
  filter: drop-shadow(0 13px 13px rgba(240, 68, 82, 0.22));
}

#scene-yacht {
  right: max(0px, calc(50% - 194px)) !important;
  bottom: 4px !important;
  z-index: 5 !important;
}

#scene-jet {
  right: 8px !important;
  top: 98px !important;
  width: 188px !important;
  height: 88px !important;
  z-index: 6 !important;
  background-image: url('../assets/ui/milestone-jet.svg') !important;
  transform: rotate(-7deg) !important;
  filter: drop-shadow(0 12px 14px rgba(49, 73, 101, 0.22));
}

#scene-jet::before {
  right: 126px !important;
  top: 48px !important;
  width: 92px !important;
  height: 4px !important;
  background: linear-gradient(90deg, transparent, rgba(49, 130, 246, 0.48)) !important;
}

@media (max-width: 520px) {
  #scene-window {
    left: 14px !important;
    top: 14px !important;
    width: 70px !important;
    height: 52px !important;
  }

  #wall-art,
  #avatar-scene.has-jet #wall-art,
  #avatar-scene.has-penthouse #wall-art {
    right: 14px !important;
    left: auto !important;
    top: 16px !important;
    width: 66px !important;
    height: 50px !important;
  }

  #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
    left: -12px !important;
    bottom: 0 !important;
    width: 190px !important;
    height: 88px !important;
  }

  #scene-yacht {
    right: -2px !important;
    bottom: 2px !important;
    width: 126px !important;
    height: 80px !important;
  }

  #scene-jet {
    right: 2px !important;
    top: 76px !important;
    width: 166px !important;
    height: 78px !important;
  }

  #scene-jet::before {
    right: 112px !important;
    top: 42px !important;
    width: 78px !important;
  }

  #avatar-scene.has-watch #acc-watch {
    transform: translate(30px, 110px) rotate(11deg) scale(1.48) !important;
  }
}

/* v65 first-screen clarity pass: stronger hierarchy without losing the clean white UI. */
:root {
  --sticky-topbar-height: 156px;
}

#app {
  background:
    linear-gradient(180deg, #f4f9ff 0 170px, #ffffff 170px 284px, #f5f8fc 284px 100%) !important;
}

#topbar {
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 203, 71, 0.22), transparent 34%),
    linear-gradient(180deg, #f6fbff 0%, #ffffff 72%) !important;
  border-bottom: 1px solid #dbe9f8 !important;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08) !important;
}

.topbar-row1 {
  align-items: center;
  gap: 8px;
}

#asset-title {
  display: flex !important;
  align-items: center !important;
  min-width: 0;
  padding: 7px 9px !important;
  border: 1px solid #d8e9fb !important;
  border-radius: 10px !important;
  background:
    linear-gradient(90deg, rgba(255, 203, 71, 0.18), rgba(49, 130, 246, 0.08)),
    #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 14px rgba(37, 99, 235, 0.07) !important;
}

.tier-copy {
  min-width: 0;
}

.tier-name {
  color: #15233a !important;
  font-size: 13px !important;
  line-height: 1.15;
}

.tier-next-label {
  color: #5b6b7f !important;
  font-size: 10.5px !important;
  line-height: 1.2;
}

.tier-progress-row {
  gap: 6px;
}

.tier-progress-track {
  height: 6px !important;
  background: #e7eef8 !important;
}

.tier-progress-fill {
  background: linear-gradient(90deg, #f5b544, #3182f6) !important;
}

.tier-progress-pct {
  color: #315f9d !important;
  font-size: 10.5px !important;
}

.topbar-btns {
  flex: 0 0 auto;
}

#ranking-btn,
#invite-btn,
#mute-btn {
  min-height: 32px !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

#ranking-btn,
#invite-btn {
  padding: 0 9px !important;
  font-size: 11.5px !important;
}

.topbar-row2 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 34%) !important;
  align-items: stretch !important;
  gap: 10px !important;
  margin-bottom: 9px !important;
}

.networth-block,
.cash-chip {
  border: 1px solid #dfeaf7 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  padding: 0 10px !important;
  box-shadow: 0 5px 14px rgba(25, 31, 40, 0.04) !important;
}

.cash-action-wrap {
  min-width: 0 !important;
  display: block !important;
}

.cash-chip {
  min-height: 0 !important;
  height: 100%;
}

#cash-amount {
  font-size: clamp(12px, 3.5vw, 15px) !important;
}

#topbar-sellall-btn {
  display: none !important;
}

#tip-ticker {
  gap: 8px !important;
  min-height: 36px;
  padding: 8px 16px !important;
  background: #ffffff !important;
}

#action-buttons {
  position: relative;
  z-index: 5;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding: 10px 16px 8px !important;
  border-top: 1px solid #edf3fb !important;
  border-bottom: 1px solid #dfeaf7 !important;
  background: #ffffff !important;
  box-shadow: inset 0 -1px 0 rgba(219, 231, 245, 0.72) !important;
}

#work-btn {
  --button-accent: #3182f6;
}

#daytrade-btn {
  --button-accent: #f04452;
}

#free-cash-btn {
  --button-accent: #f5b544;
}

#boost-btn {
  --button-accent: #17b978;
}

#action-buttons button,
#action-buttons button.action-primary {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  min-height: 62px !important;
  padding: 6px 3px !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, var(--button-accent, #3182f6) 30%, #dbe7f5) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--button-accent, #3182f6) 13%, #ffffff), #ffffff 72%) !important;
  color: #191f28 !important;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--button-accent, #3182f6) 14%, transparent) !important;
  font-size: 11.5px !important;
  font-weight: 950 !important;
  line-height: 1.12 !important;
  text-align: center !important;
  word-break: keep-all !important;
}

#action-buttons button::before,
#action-buttons button.action-primary::before,
#free-cash-btn.glow::before,
#boost-btn.glow::before {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  flex-basis: 28px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--button-accent, #3182f6) 15%, #ffffff) !important;
}

#action-buttons button::after {
  top: 10px !important;
  width: 18px !important;
  height: 18px !important;
  background: var(--button-accent, #3182f6) !important;
}

#action-buttons button.glow,
#action-buttons button.action-primary.glow {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--button-accent, #3182f6) 20%, #ffffff), #ffffff 68%) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--button-accent, #3182f6) 14%, transparent),
    0 8px 18px color-mix(in srgb, var(--button-accent, #3182f6) 18%, transparent) !important;
}

#work-btn[data-busy="1"] {
  opacity: 1 !important;
  cursor: progress !important;
  border-color: #f5b544 !important;
  background:
    linear-gradient(180deg, #fff5dc, #ffffff 72%) !important;
  box-shadow:
    0 0 0 2px rgba(245, 181, 68, 0.16),
    0 8px 18px rgba(245, 181, 68, 0.18) !important;
}

#action-buttons .action-label,
#action-buttons .action-status {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: keep-all;
}

#action-buttons .action-label {
  color: #191f28;
  font-size: 11.5px;
  font-weight: 950;
  line-height: 1.12;
}

#action-buttons .action-status {
  color: color-mix(in srgb, var(--button-accent, #3182f6) 76%, #26384f);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.08;
}

#action-buttons button:disabled .action-status {
  color: #6b7684;
}

#action-buttons button:disabled {
  opacity: 0.88 !important;
  color: #4e5968 !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--button-accent, #3182f6) 7%, #ffffff), #ffffff) !important;
  filter: saturate(0.78);
}

#market-news-feed {
  margin: 0 0 12px !important;
  padding: 0 16px !important;
  border: 1px solid #e5e8eb !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.market-news-feed.collapsed {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

#market-news-toggle {
  grid-template-columns: minmax(0, 1fr) auto 24px !important;
}

.market-news-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: #315f9d !important;
  font-size: 12.5px !important;
}

.market-news-title em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef6ff;
  color: #3182f6 !important;
  padding: 3px 6px;
  font-size: 11.5px !important;
  font-style: normal;
}

#market-news-toggle small {
  max-width: 120px;
  font-size: 11.5px !important;
}

.market-news-feed-list {
  gap: 6px !important;
  margin-top: 8px;
}

.market-news-item {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  min-height: 25px !important;
  padding: 5px 7px !important;
  border-radius: 6px;
  background: #f7f9fc;
}

.portfolio-summary {
  position: sticky !important;
  top: calc(var(--sticky-topbar-height, 156px) + 8px) !important;
  z-index: 18 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 5px 10px !important;
  align-items: center !important;
  min-height: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid #dce9f8 !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.ps-head {
  grid-column: 1;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  align-items: start !important;
}

.ps-right {
  min-width: 76px;
}

.ps-label {
  font-size: 10.5px !important;
}

.ps-value,
.ps-pl {
  font-size: clamp(15px, 4.3vw, 19px) !important;
}

.ps-sub {
  grid-column: 1 / -1;
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.ps-sellall-btn {
  grid-column: 2;
  grid-row: 1;
  width: auto !important;
  min-width: 82px;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 1px solid #d6e7ff !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #3182f6, #206ad5) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 14px rgba(49, 130, 246, 0.16) !important;
  font-size: 12px !important;
}

.ps-sellall-btn:disabled {
  border-color: #dfe6ef !important;
  background: #eef3f8 !important;
  color: #8b95a1 !important;
  box-shadow: none !important;
}

#help-modal .help-content,
#guide-modal .modal-content {
  width: min(94vw, 440px) !important;
  max-width: 440px !important;
}

#help-modal .help-content {
  height: min(760px, calc(100dvh - 24px)) !important;
  padding: 14px !important;
  overflow: hidden !important;
}

#help-body.help-carousel {
  gap: 10px !important;
}

.help-slide-card {
  min-height: 0 !important;
  grid-template-rows: minmax(104px, 0.45fr) minmax(0, 1fr) !important;
  gap: 10px !important;
}

.help-visual-frame {
  min-height: 108px !important;
}

.help-slide-copy {
  padding: 12px !important;
}

.help-slide-copy h3 {
  font-size: 16px !important;
  line-height: 1.25 !important;
}

.help-slide-copy li,
.help-disclaimer,
#guide-text {
  font-size: 12.5px !important;
  line-height: 1.48 !important;
}

.help-carousel-controls {
  min-height: 36px;
}

.help-arrow {
  width: 36px !important;
  height: 36px !important;
}

#guide-modal .modal-content {
  padding: 18px 16px !important;
}

#guide-title {
  font-size: 18px !important;
}

@media (max-width: 380px) {
  #app {
    background:
      linear-gradient(180deg, #f4f9ff 0 156px, #ffffff 156px 270px, #f5f8fc 270px 100%) !important;
  }

  #topbar {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  #asset-title {
    padding: 6px 7px !important;
  }

  .tier-ant-mark {
    flex-basis: 40px !important;
    width: 40px !important;
    height: 40px !important;
  }

  .tier-ant-img {
    width: 50px;
    height: 50px;
  }

  #ranking-btn,
  #invite-btn {
    padding: 0 7px !important;
    font-size: 11px !important;
  }

  #tip-ticker,
  #action-buttons {
    margin-right: 12px !important;
    margin-left: 12px !important;
  }

  #action-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 9px 12px 8px !important;
  }

  #action-buttons button,
  #action-buttons button.action-primary {
    min-height: 52px !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    text-align: left !important;
  }

  #action-buttons button::before,
  #action-buttons button.action-primary::before,
  #free-cash-btn.glow::before,
  #boost-btn.glow::before {
    width: 28px !important;
    min-width: 28px !important;
  }

  #action-buttons button::after {
    top: 50% !important;
    left: 22px !important;
    transform: translate(-50%, -50%) !important;
  }

  #action-buttons .action-label,
  #action-buttons .action-status {
    text-align: left;
  }

  #action-buttons .action-label {
    font-size: 12px;
  }

  .portfolio-summary {
    top: calc(var(--sticky-topbar-height, 150px) + 6px) !important;
    padding: 9px 10px !important;
  }

  .ps-head {
    grid-template-columns: 1fr !important;
    gap: 2px !important;
  }

  .ps-right {
    min-width: 0;
    text-align: left;
  }

  .ps-sellall-btn {
    min-width: 76px;
    padding: 0 8px !important;
    font-size: 11px !important;
  }
}

@media (min-width: 700px) {
  #help-modal .help-content {
    width: min(820px, 94vw) !important;
    max-width: 820px !important;
    height: min(650px, calc(100dvh - 40px)) !important;
  }

  .help-slide-card {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr) !important;
    grid-template-rows: 1fr !important;
    min-height: 360px !important;
  }

  .help-visual-frame {
    min-height: 0 !important;
  }
}

@media (min-width: 700px) and (max-height: 560px) {
  #help-modal .help-content {
    height: calc(100dvh - 20px) !important;
    padding: 10px !important;
    overflow-y: auto !important;
  }

  .help-slide-card {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr) !important;
    gap: 8px !important;
  }

  .help-visual-frame {
    min-height: 92px !important;
  }

  .help-slide-copy {
    padding: 10px !important;
    overflow-y: auto !important;
  }

  .help-slide-copy h3 {
    font-size: 15px !important;
  }

  .help-slide-copy li,
  .help-disclaimer {
    font-size: 12px !important;
    line-height: 1.36 !important;
  }

  .help-carousel-controls {
    min-height: 32px !important;
  }

  .help-arrow {
    width: 32px !important;
    height: 32px !important;
  }
}

/* v66 concept pass: the ant grows from an empty field into an outdoor asset landscape. */
#avatar-scene {
  isolation: isolate;
  min-height: 258px !important;
  padding: 18px 16px 8px !important;
  border-color: #cfe1f7 !important;
  background:
    radial-gradient(circle at 78% 14%, rgba(255, 212, 92, 0.72) 0 13px, rgba(255, 212, 92, 0.22) 14px 32px, transparent 33px),
    linear-gradient(180deg, #eff9ff 0 44%, #d9f2ff 44% 58%, #e7f5e8 58% 72%, #d8e8d0 72% 100%) !important;
  box-shadow: 0 16px 36px rgba(43, 78, 116, 0.13) !important;
}

#avatar-scene::before {
  z-index: 0;
  height: 86px !important;
  background:
    radial-gradient(ellipse at 28% 100%, rgba(118, 93, 62, 0.18), transparent 56%),
    repeating-linear-gradient(90deg, rgba(122, 151, 103, 0.18) 0 2px, transparent 2px 42px),
    linear-gradient(180deg, rgba(218, 237, 198, 0.2), rgba(171, 196, 142, 0.56)) !important;
  border-top: 1px solid rgba(141, 171, 113, 0.35) !important;
}

#avatar-scene[data-tier="0"] {
  background:
    radial-gradient(circle at 78% 14%, rgba(255, 212, 92, 0.64) 0 12px, rgba(255, 212, 92, 0.18) 13px 29px, transparent 30px),
    linear-gradient(180deg, #f4fbff 0 44%, #e8f7ff 44% 58%, #ece5cf 58% 74%, #d6c6a2 74% 100%) !important;
}

#avatar-scene[data-tier="1"] {
  background:
    radial-gradient(circle at 78% 14%, rgba(255, 212, 92, 0.7) 0 13px, rgba(255, 212, 92, 0.22) 14px 32px, transparent 33px),
    linear-gradient(180deg, #eff9ff 0 44%, #d8f1ff 44% 58%, #e7f5e8 58% 72%, #cfe1c0 72% 100%) !important;
}

#avatar-scene[data-tier="2"],
#avatar-scene[data-tier="3"] {
  background:
    radial-gradient(circle at 78% 14%, rgba(255, 212, 92, 0.74) 0 14px, rgba(255, 212, 92, 0.23) 15px 34px, transparent 35px),
    linear-gradient(180deg, #edf9ff 0 43%, #d3eeff 43% 57%, #e2f6fb 57% 67%, #d7efd2 67% 100%) !important;
}

#scene-window,
#scene-window-view {
  display: none !important;
}

#scene-wall {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: block !important;
  overflow: hidden;
  pointer-events: none;
}

#scene-skyline,
#scene-sea,
#scene-runway,
#scene-road {
  position: absolute;
  display: none;
  pointer-events: none;
}

#scene-skyline {
  left: 15%;
  right: 16%;
  top: 54px;
  z-index: 1;
  height: 74px;
  opacity: 0.84;
  background:
    linear-gradient(180deg, #385575, #243a58) 5% 28px / 18% 46px no-repeat,
    linear-gradient(180deg, #496b91, #273d5f) 27% 6px / 20% 68px no-repeat,
    linear-gradient(180deg, #314b70, #1f3554) 50% 20px / 17% 54px no-repeat,
    linear-gradient(180deg, #5b7ba2, #2b4569) 73% 0 / 21% 74px no-repeat,
    linear-gradient(90deg, transparent 8px, rgba(144, 218, 255, 0.72) 8px 13px, transparent 13px 27px) 0 12px / 44px 58px repeat-x;
  filter: drop-shadow(0 10px 12px rgba(43, 78, 116, 0.16));
}

#avatar-scene.has-penthouse #scene-skyline,
#avatar-scene.has-jet #scene-runway,
#avatar-scene.has-sportscar #scene-road,
#avatar-scene.has-yacht #scene-sea {
  display: block;
}

#scene-sea {
  right: -8px;
  bottom: 0;
  z-index: 2;
  width: 52%;
  height: 66px;
  border-top-left-radius: 42px;
  background:
    radial-gradient(ellipse at 38% 10%, rgba(255, 255, 255, 0.72) 0 8px, transparent 9px),
    repeating-linear-gradient(175deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px 20px),
    linear-gradient(180deg, #8de2ff 0%, #55b7ed 62%, #3c98d8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

#scene-road {
  left: max(-10px, calc(50% - 228px));
  bottom: 0;
  z-index: 3;
  width: min(58%, 360px);
  height: 54px;
  border-top-right-radius: 34px;
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(255, 255, 255, 0.78) 38% 43%, transparent 43% 59%, rgba(255, 255, 255, 0.78) 59% 64%, transparent 64%),
    linear-gradient(180deg, #758391 0%, #4d5a67 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#scene-runway {
  right: -24px;
  bottom: 76px;
  z-index: 3;
  width: 246px;
  height: 36px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.88) 18px 30px, transparent 30px 48px),
    linear-gradient(180deg, #8793a2 0%, #596775 100%);
  box-shadow: 0 10px 16px rgba(71, 85, 105, 0.16);
  transform: rotate(-8deg);
  transform-origin: right center;
}

#ant-avatar-wrap {
  z-index: 8 !important;
  margin-top: 62px !important;
}

#scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
  left: max(-2px, calc(50% - 210px)) !important;
  bottom: 4px !important;
  z-index: 7 !important;
  width: 218px !important;
  height: 102px !important;
}

#scene-sportscar::after {
  bottom: 5px !important;
  background: rgba(24, 34, 46, 0.22) !important;
}

#scene-yacht {
  right: max(0px, calc(50% - 206px)) !important;
  bottom: 10px !important;
  z-index: 6 !important;
  width: 164px !important;
  height: 98px !important;
  background: url('../assets/ui/milestone-yacht.svg') center bottom / 156px 104px no-repeat !important;
}

#scene-yacht::after {
  bottom: 1px !important;
  background: rgba(255, 255, 255, 0.34) !important;
}

#scene-jet {
  right: 16px !important;
  top: auto !important;
  bottom: 82px !important;
  z-index: 6 !important;
  width: 190px !important;
  height: 90px !important;
  transform: rotate(-7deg) !important;
}

#scene-jet::before {
  display: none !important;
}

#scene-penthouse {
  left: 58% !important;
  top: 30px !important;
  z-index: 2 !important;
  width: 150px !important;
  height: 104px !important;
  transform: translateX(-50%) !important;
}

#wall-art {
  left: 18px !important;
  right: auto !important;
  top: 74px !important;
  z-index: 5 !important;
  width: 82px !important;
  height: 60px !important;
  border-width: 5px !important;
  border-color: #9b6b3d !important;
  background:
    url('../assets/ui/milestone-art.svg') center / 68px 68px no-repeat,
    linear-gradient(180deg, #fff8e8, #ffffff) !important;
  box-shadow: 0 8px 14px rgba(97, 72, 42, 0.16) !important;
}

#wall-art::before,
#wall-art::after {
  content: "";
  position: absolute;
  bottom: -25px;
  width: 4px;
  height: 25px;
  border-radius: 999px;
  background: #9b6b3d;
}

#wall-art::before {
  left: 15px;
  transform: rotate(8deg);
}

#wall-art::after {
  right: 15px;
  transform: rotate(-8deg);
}

#avatar-scene.has-jet #wall-art,
#avatar-scene.has-penthouse #wall-art {
  left: 18px !important;
  right: auto !important;
}

#avatar-scene.has-gold #gold-stack {
  z-index: 9 !important;
  left: 70px !important;
  bottom: -7px !important;
}

@media (max-width: 520px) {
  #avatar-scene {
    min-height: 266px !important;
    padding-inline: 12px !important;
  }

  #scene-skyline {
    left: 18%;
    right: 8%;
    top: 48px;
    height: 70px;
  }

  #scene-sea {
    width: 54%;
    height: 62px;
  }

  #scene-road {
    left: -10px;
    width: 50%;
    height: 52px;
  }

  #scene-runway {
    right: -32px;
    bottom: 82px;
    width: 210px;
    height: 32px;
  }

  #ant-avatar-wrap {
    margin-top: 66px !important;
  }

  #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
    left: -10px !important;
    bottom: 2px !important;
    width: 190px !important;
    height: 90px !important;
  }

  #scene-yacht {
    right: -2px !important;
    bottom: 8px !important;
    width: 134px !important;
    height: 84px !important;
    background-size: 128px 88px !important;
  }

  #scene-jet {
    right: -2px !important;
    bottom: 94px !important;
    width: 166px !important;
    height: 78px !important;
  }

  #scene-penthouse {
    left: 58% !important;
    top: 24px !important;
    width: 122px !important;
    height: 88px !important;
  }

  #wall-art,
  #avatar-scene.has-jet #wall-art,
  #avatar-scene.has-penthouse #wall-art {
    left: 12px !important;
    top: 74px !important;
    width: 64px !important;
    height: 48px !important;
  }
}

/* v67 visual QA: center help ants and give day-trade a deliberate mini-chart stage. */
.help-tier-ant-svg {
  transform: translateX(-4px);
  transform-origin: center;
}

.help-tier-card.featured .help-tier-ant-svg {
  transform: translateX(-5px);
}

#daytrade-field {
  height: clamp(220px, 44dvh, 306px) !important;
  border: 1px solid #cfe1f7 !important;
  border-radius: 10px !important;
  background:
    radial-gradient(circle at 80% 78%, rgba(23, 185, 120, 0.20), transparent 26%),
    radial-gradient(circle at 16% 22%, rgba(49, 130, 246, 0.16), transparent 27%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 248, 255, 0.56) 48%, rgba(235, 253, 246, 0.74)),
    linear-gradient(rgba(142, 169, 205, 0.20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 169, 205, 0.20) 1px, transparent 1px),
    linear-gradient(180deg, #f9fcff 0%, #edf6ff 100%) !important;
  background-size: auto, auto, auto, 24px 24px, 24px 24px, auto !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 14px 32px rgba(37, 99, 235, 0.10) !important;
}

#daytrade-field.done {
  height: 120px !important;
}

#daytrade-field::before {
  content: "" !important;
  position: absolute !important;
  inset: 18px 18px 68px 18px !important;
  z-index: 0;
  height: auto !important;
  border: 1px solid rgba(207, 225, 247, 0.86);
  border-radius: 10px !important;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 148'%3E%3Cpath d='M12 108 C42 98 58 116 86 88 S132 54 164 76 S222 105 254 54 S292 45 308 32' fill='none' stroke='%233182f6' stroke-width='7' stroke-linecap='round' stroke-linejoin='round' opacity='.28'/%3E%3Cpath d='M12 112 C42 102 58 120 86 92 S132 58 164 80 S222 109 254 58 S292 49 308 36' fill='none' stroke='%2317b978' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' opacity='.72'/%3E%3Cg opacity='.78'%3E%3Crect x='32' y='54' width='7' height='48' rx='3' fill='%23f04452'/%3E%3Crect x='58' y='34' width='7' height='76' rx='3' fill='%233182f6'/%3E%3Crect x='104' y='42' width='7' height='62' rx='3' fill='%23f04452'/%3E%3Crect x='138' y='26' width='7' height='82' rx='3' fill='%233182f6'/%3E%3Crect x='198' y='50' width='7' height='56' rx='3' fill='%23f04452'/%3E%3Crect x='240' y='24' width='7' height='84' rx='3' fill='%233182f6'/%3E%3Crect x='284' y='44' width='7' height='60' rx='3' fill='%23f04452'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.18)) !important;
  opacity: 1 !important;
  pointer-events: none;
}

#daytrade-field::after {
  content: "" !important;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: 88px;
  background:
    radial-gradient(ellipse at 78% 70%, rgba(23, 185, 120, 0.34), transparent 42%),
    linear-gradient(180deg, transparent, rgba(216, 236, 255, 0.66));
  pointer-events: none;
}

.daytrade-target,
.daytrade-pop {
  z-index: 2;
}

@media (max-width: 380px) {
  .help-tier-ant-svg {
    transform: translateX(-4px);
  }

  .help-tier-card.featured .help-tier-ant-svg {
    transform: translateX(-5px);
  }
}

/* v68 first-15-min flow: contextual all-sell and loss-cut tutorial. */
.portfolio-summary {
  position: relative !important;
  top: auto !important;
  z-index: 1 !important;
}

.ps-sellall-btn {
  border-color: #ffd5dc !important;
  background:
    linear-gradient(180deg, #fff7f8 0%, #ffffff 42%, #ffeef1 100%) !important;
  color: #c42035 !important;
  box-shadow: 0 6px 14px rgba(240, 68, 82, 0.12) !important;
}

.ps-sellall-btn:disabled {
  border-color: #dfe6ef !important;
  background: #eef3f8 !important;
  color: #8b95a1 !important;
  box-shadow: none !important;
}

.ps-sellall-btn.onboarding-focus {
  animation: lossCutPulse 1.08s ease-in-out infinite;
}

@keyframes lossCutPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(240, 68, 82, 0.18), 0 8px 18px rgba(240, 68, 82, 0.10);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(240, 68, 82, 0.12), 0 12px 24px rgba(240, 68, 82, 0.16);
  }
}

.loss-cut-content {
  border-top: 4px solid #f04452;
}

.loss-cut-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}

.loss-cut-next span {
  color: #6b7684;
  font-size: 11px;
  font-weight: 850;
}

.loss-cut-next strong {
  min-width: 0;
  color: #191f28;
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.modal-actions .danger {
  border-color: #ffd5dc !important;
  background: linear-gradient(180deg, #f04452, #d9364e) !important;
  color: #ffffff !important;
}

.loss-cut-next {
  grid-template-columns: 1fr;
  justify-items: start;
  margin: 14px 0 2px;
  background:
    linear-gradient(90deg, rgba(49, 130, 246, 0.08), rgba(255, 255, 255, 0)),
    #f8fafc;
}

.loss-cut-next strong {
  text-align: left;
}

/* v69 visual QA: clean late-game scene objects, optical logo centering, and one-line money labels. */
#stock-list,
.stock-card,
.portfolio-summary {
  overflow-anchor: none;
}

.sell-reward-content {
  overflow: hidden;
  border-top: 4px solid #22c580;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 197, 128, 0.16), transparent 45%),
    #ffffff !important;
}

.sell-reward-visual {
  position: relative;
  display: grid;
  width: 132px;
  height: 104px;
  place-items: center;
  margin: -4px auto 8px;
}

.sell-reward-visual::before {
  content: "";
  position: absolute;
  inset: 24px 5px 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 203, 71, 0.28), rgba(34, 197, 128, 0.10));
}

.sell-reward-visual img {
  position: relative;
  z-index: 1;
  width: 118px;
  height: 118px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 12px rgba(25, 31, 40, 0.16));
}

#sell-sheet {
  height: min(410px, calc(100dvh - 78px));
  max-height: calc(100dvh - 78px);
  overflow-y: auto !important;
  contain: layout paint;
  overscroll-behavior: contain;
}

#sell-sheet .sell-preview {
  min-height: 92px;
  justify-content: center;
}

.sheet-backdrop {
  overscroll-behavior: contain;
}

.tier-ant-img {
  transform: translate(-6px, 0) !important;
}

.tier-ant-mark[data-tier="8"] .tier-ant-img,
.tier-ant-mark[data-tier="9"] .tier-ant-img {
  transform: translate(-8px, -2px) !important;
}

#scene-skyline {
  left: 13% !important;
  right: 10% !important;
  top: 50px !important;
  height: 82px !important;
  opacity: 0.54 !important;
  background-image:
    linear-gradient(180deg, rgba(138, 198, 226, 0.30), rgba(96, 151, 185, 0.10)),
    linear-gradient(90deg,
      transparent 0 7%,
      rgba(56, 91, 126, 0.18) 7% 15%,
      transparent 15% 24%,
      rgba(78, 124, 162, 0.16) 24% 33%,
      transparent 33% 43%,
      rgba(46, 82, 118, 0.14) 43% 51%,
      transparent 51% 63%,
      rgba(88, 137, 171, 0.15) 63% 72%,
      transparent 72% 100%);
  background-position: center bottom, center bottom;
  background-size: 100% 20px, 100% 56px;
  background-repeat: no-repeat !important;
  border-radius: 18px 18px 4px 4px;
  filter: drop-shadow(0 10px 12px rgba(43, 78, 116, 0.08));
}

#scene-penthouse {
  left: 59% !important;
  top: 18px !important;
  width: 170px !important;
  height: 128px !important;
  overflow: visible !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 16px 18px rgba(31, 51, 77, 0.16));
}

#scene-penthouse .penthouse-wing {
  position: absolute;
  bottom: 0;
  border: 1px solid rgba(181, 217, 242, 0.78);
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.94) 0 42%, transparent 45%) 10px 18px / 20px 18px repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #dff4ff 0%, #87c3e8 52%, #4c7fae 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 10px 0 18px rgba(255, 255, 255, 0.14);
}

#scene-penthouse .penthouse-wing::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: -9px;
  height: 13px;
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(180deg, #ffffff 0%, #dcefff 100%);
  box-shadow: 0 6px 12px rgba(43, 78, 116, 0.12);
}

#scene-penthouse .penthouse-wing-left {
  left: 8px;
  width: 46px;
  height: 84px;
  border-radius: 13px 13px 5px 5px;
  background-position: 8px 18px, center, center;
  background-size: 18px 17px, 100% 100%, 100% 100%;
}

#scene-penthouse .penthouse-tower-main {
  left: 47px;
  z-index: 2;
  width: 78px;
  height: 118px;
  border-radius: 16px 16px 6px 6px;
  background-position: 13px 20px, center, center;
}

#scene-penthouse .penthouse-tower-main::before {
  left: 20%;
  right: 20%;
  top: -12px;
  height: 18px;
  border-radius: 14px 14px 6px 6px;
}

#scene-penthouse .penthouse-wing-right {
  right: 10px;
  width: 50px;
  height: 96px;
  border-radius: 13px 13px 5px 5px;
  background-position: 11px 18px, center, center;
  background-size: 19px 18px, 100% 100%, 100% 100%;
}

#scene-penthouse .penthouse-entrance {
  content: "";
  position: absolute;
  z-index: 3;
  left: 74px;
  bottom: 0;
  width: 24px;
  height: 34px;
  border-radius: 9px 9px 0 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 0 2px, transparent 2px),
    linear-gradient(180deg, #315a82, #213953);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 6px 8px rgba(31, 51, 77, 0.12);
}

#scene-penthouse::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 4px;
  bottom: -6px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.74), rgba(105, 151, 184, 0.72));
  box-shadow: 0 8px 12px rgba(31, 51, 77, 0.12);
}

#scene-collection {
  position: absolute;
  top: 14px;
  right: auto;
  left: 10px;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(4, 28px);
  gap: 5px;
  max-width: 132px;
  border: 1px solid rgba(196, 218, 241, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 20px rgba(31, 51, 77, 0.10);
  padding: 6px;
  pointer-events: none;
}

#scene-collection.hidden {
  display: none !important;
}

#scene-realestate {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

#scene-realestate.hidden {
  display: none !important;
}

.estate-object {
  position: absolute;
  display: none;
  filter: drop-shadow(0 12px 14px rgba(31, 51, 77, 0.16));
}

#avatar-scene.has-trading-office .estate-office,
#avatar-scene.has-supercar-garage .estate-garage,
#avatar-scene.has-private-villa .estate-villa,
#avatar-scene.has-bluechip-vault .estate-vault,
#avatar-scene.has-landmark-tower .estate-tower,
#avatar-scene.has-island-resort .estate-island {
  display: block;
}

.estate-office {
  left: 25%;
  top: 36px;
  width: 72px;
  height: 104px;
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82) 0 5px, transparent 5px 14px) 12px 20px / 44px 62px repeat,
    linear-gradient(180deg, #dcefff, #6ba6d5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.estate-garage {
  left: 13%;
  bottom: 45px;
  width: 82px;
  height: 50px;
  border-radius: 8px 8px 4px 4px;
  background:
    linear-gradient(180deg, #27364d 0 18px, #f04452 18px 22px, #42536d 22px),
    linear-gradient(90deg, transparent 0 12px, rgba(255, 255, 255, 0.78) 12px 18px, transparent 18px 30px);
}

.estate-villa {
  left: auto;
  right: 13%;
  top: 78px;
  width: 122px;
  height: 66px;
  border-radius: 8px 8px 5px 5px;
  background:
    linear-gradient(135deg, transparent 0 50%, #35597c 50%) 0 0 / 60px 30px no-repeat,
    linear-gradient(225deg, transparent 0 50%, #35597c 50%) 60px 0 / 62px 30px no-repeat,
    linear-gradient(90deg, #f8fbff 0 32%, #9fd0ef 32% 38%, #f8fbff 38% 62%, #9fd0ef 62% 68%, #f8fbff 68%) 0 28px / 100% 38px no-repeat;
  box-shadow: 0 10px 16px rgba(31, 51, 77, 0.12);
}

.estate-villa::before {
  content: "";
  position: absolute;
  left: 50px;
  bottom: 0;
  width: 22px;
  height: 28px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #365a7e, #243a58);
}

.estate-villa::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -8px;
  width: 44px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(142, 226, 255, 0.82), rgba(62, 164, 220, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.estate-vault {
  left: 7%;
  bottom: 88px;
  width: 54px;
  height: 46px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 50%, #f8fbff 0 5px, #4e6f91 6px 9px, transparent 10px),
    linear-gradient(180deg, #b9d4ee, #56799d);
  border: 3px solid rgba(36, 58, 88, 0.72);
}

.estate-tower {
  right: 15%;
  top: 8px;
  width: 74px;
  height: 142px;
  border-radius: 14px 14px 5px 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.84) 0 5px, transparent 5px 15px) 12px 24px / 44px 86px repeat,
    linear-gradient(180deg, #c9ecff, #2f6aa3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 14px 18px rgba(31, 51, 77, 0.16);
}

.estate-island {
  right: 6%;
  bottom: 60px;
  width: 96px;
  height: 48px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 52% 72%, #f5d98d 0 36px, transparent 37px),
    radial-gradient(ellipse at 48% 70%, #27b58c 0 54px, transparent 55px);
}

.estate-island::before {
  content: "";
  position: absolute;
  left: 42px;
  top: -22px;
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: #8b5b2f;
  transform: rotate(8deg);
}

.estate-island::after {
  content: "";
  position: absolute;
  left: 38px;
  top: -34px;
  width: 42px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 32% 55%, #1f9d74 0 14px, transparent 15px),
    radial-gradient(ellipse at 72% 42%, #28c08d 0 14px, transparent 15px);
}

.scene-collection-chip {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #d8e9ff;
  border-radius: 9px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.34) 44%, transparent 45%),
    linear-gradient(180deg, #ffffff, #eef6ff);
  color: #314b70;
}

.scene-collection-chip[data-icon]::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
}

.scene-collection-chip[data-item="tailored-suit"] {
  color: #17233a;
  border-color: #f7cf7b;
  background: linear-gradient(180deg, #fff8df, #ffffff);
}

.scene-collection-chip[data-item="trading-office"],
.scene-collection-chip[data-item="landmark-tower"] {
  color: #2f6aa3;
}

.scene-collection-chip[data-item="island-resort"] {
  color: #1c9a84;
}

.scene-collection-chip em {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stock-logo span {
  display: grid !important;
  place-items: center !important;
  line-height: 1 !important;
  transform: translateY(-1px);
  transform-origin: center;
}

#networth-amount,
#cash-amount,
#income-rate,
.ps-value,
.ps-pl,
.ps-sub b,
.stock-price,
.bank-balance,
#bank-earning,
.ranking-worth,
.cost,
#sell-sheet-price,
#sell-sheet-pl,
#sell-preview-qty,
#sell-preview-amount,
#sell-preview-pl,
.modal-highlight,
#daily-amount,
#offline-amount,
#offline-breakdown b,
#daytrade-earned,
#daytrade-total,
.sell-preview-row span:last-child {
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  white-space: nowrap !important;
  line-height: 1.05;
}

#networth-amount,
#cash-amount {
  line-height: 1.22 !important;
  overflow: visible !important;
}

.networth-line {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.networth-line .coin-glyph {
  flex: 0 0 22px !important;
}

#networth-amount {
  display: inline-block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: calc(100% - 28px) !important;
  transform-origin: left center;
}

@media (max-width: 520px) {
  #scene-skyline {
    left: 16% !important;
    right: 7% !important;
    top: 46px !important;
    height: 76px !important;
  }

  #scene-penthouse {
    left: 54% !important;
    top: 23px !important;
    width: 128px !important;
    height: 96px !important;
  }

  #scene-collection {
    top: 8px;
    right: auto;
    left: 7px;
    grid-template-columns: repeat(4, 24px);
    max-width: 116px;
    gap: 4px;
    padding: 5px;
  }

  .scene-collection-chip {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }

  .scene-collection-chip[data-icon]::before {
    width: 15px;
    height: 15px;
  }

  .estate-office {
    left: 22%;
    top: 42px;
    width: 58px;
    height: 82px;
  }

  .estate-villa {
    right: 6%;
    top: 84px;
    width: 104px;
    height: 56px;
  }

  .estate-tower {
    right: 10%;
    top: 12px;
    width: 58px;
    height: 116px;
  }

  .estate-garage {
    left: 8%;
    bottom: 43px;
    width: 68px;
    height: 42px;
  }

  .estate-vault {
    left: 4%;
    bottom: 86px;
    width: 46px;
    height: 40px;
  }

  .estate-island {
    right: 4%;
    bottom: 60px;
    width: 82px;
    height: 42px;
  }

  #sell-sheet {
    height: min(392px, calc(100dvh - 66px));
    max-height: calc(100dvh - 66px);
  }

  .sell-reward-visual {
    height: 94px;
    margin-top: -8px;
  }

  .sell-reward-visual img {
    width: 108px;
    height: 108px;
  }
}

/* ============ v73 desktop tab rail and visual reward lessons ============ */
@media (min-width: 900px) {
  #bottom-nav {
    width: min(calc(100vw - 40px), 1040px) !important;
    max-width: 1040px !important;
    min-height: calc(76px + env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
    border: 1px solid #dfe8f5;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -14px 34px rgba(25, 31, 40, 0.13);
  }

  body[data-review-safe-mode="toss"] #bottom-nav,
  body[data-review-safe-mode="play"] #bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #bottom-nav .nav-btn {
    min-height: 56px;
    display: grid;
    grid-template-columns: auto auto;
    place-content: center;
    align-items: center;
    gap: 9px;
    border: 1px solid #e2ebf6;
    border-radius: 10px;
    background: #f8fbff;
    color: #4e5968;
  }

  #bottom-nav .nav-btn.active {
    border-color: #b9d7ff;
    background: linear-gradient(180deg, #eef6ff, #ffffff);
    color: #1769d8;
    box-shadow: 0 8px 18px rgba(49, 130, 246, 0.11);
  }

  #bottom-nav .nav-icon {
    width: 24px;
    height: 24px;
  }

  #bottom-nav .nav-label {
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0;
  }
}

/* Keep the intermediate tablet rail compact enough to leave the first scene unobstructed. */
@media (min-width: 900px) and (max-width: 1279px) {
  #bottom-nav {
    min-height: calc(56px + env(safe-area-inset-bottom)) !important;
    padding: 5px 12px calc(5px + env(safe-area-inset-bottom));
  }

  #bottom-nav .nav-btn {
    min-height: 44px;
  }
}

.guide-visual,
.daily-reward-visual,
.offline-reward-visual,
.loss-cut-visual {
  position: relative;
  overflow: hidden;
  width: min(100%, 258px);
  min-height: 118px;
  margin: 0 auto 14px;
  border: 1px solid #dce8f7;
  border-radius: 12px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 210, 63, 0.22), transparent 30%),
    radial-gradient(circle at 18% 18%, rgba(49, 130, 246, 0.15), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: inset 0 -1px 0 rgba(49, 130, 246, 0.08), 0 10px 24px rgba(25, 31, 40, 0.06);
}

.guide-visual {
  display: grid;
  place-items: center;
}

.guide-visual::before {
  content: "";
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--ui-icon) center / 50px 50px no-repeat, #ffffff;
  box-shadow: 0 12px 24px rgba(49, 130, 246, 0.16);
}

.guide-visual::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 88px;
  height: 42px;
  border-left: 3px solid #17b978;
  border-bottom: 3px solid #17b978;
  border-radius: 0 0 0 10px;
  opacity: 0.46;
  transform: skewX(-16deg);
}

.daily-reward-visual {
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(245, 181, 68, 0.16) 0 14%, transparent 14%),
    linear-gradient(180deg, #fff9ec 0%, #ffffff 100%);
}

.daily-reward-visual::before {
  content: none;
  position: absolute;
  top: 14px;
  left: 16px;
  width: 72px;
  height: 76px;
  border: 1px solid #f1d089;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #ffd76a 0 24px, #ffffff 24px),
    linear-gradient(90deg, transparent 0 49%, #e7edf5 49% 51%, transparent 51%),
    linear-gradient(0deg, transparent 0 49%, #e7edf5 49% 51%, transparent 51%);
  background-size: auto, 100% 26px, 100% 26px;
  box-shadow: 0 8px 18px rgba(245, 181, 68, 0.15);
}

.daily-reward-visual img,
.offline-reward-visual img {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(25, 31, 40, 0.14));
}

.reward-card-art {
  width: min(100%, 220px) !important;
  height: auto !important;
  max-height: 124px;
  object-fit: contain !important;
  border-radius: 10px;
  filter: drop-shadow(0 10px 16px rgba(25, 31, 40, 0.10)) !important;
}

.sell-reward-visual {
  width: min(100%, 258px);
  height: auto;
  min-height: 0;
  aspect-ratio: 220 / 124;
  margin: 0 auto 14px;
}

.sell-reward-visual::before {
  inset: 6px;
}

.sell-reward-visual .reward-card-art {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
}

.offline-reward-visual {
  display: grid;
  place-items: center;
  width: min(100%, 314px);
  min-height: 0;
  aspect-ratio: 16 / 9;
  padding: 4px;
  background:
    radial-gradient(circle at 78% 20%, rgba(127, 93, 239, 0.18), transparent 30%),
    linear-gradient(180deg, #f8f6ff 0%, #ffffff 100%);
}

.offline-reward-visual .reward-card-art {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
}

.sleep-z {
  position: absolute;
  z-index: 3;
  color: #7f5def;
  font-size: 14px;
  font-weight: 950;
}

.sleep-z.z1 {
  top: 22px;
  right: 72px;
}

.sleep-z.z2 {
  top: 12px;
  right: 48px;
  font-size: 18px;
}

.reward-coin {
  position: absolute;
  z-index: 1;
  width: 24px;
  height: 24px;
  border: 2px solid #e8a41c;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe58a, #f5b544);
  box-shadow: 0 8px 14px rgba(245, 181, 68, 0.18);
}

.reward-coin.c1 {
  bottom: 24px;
  left: 28px;
}

.reward-coin.c2 {
  right: 34px;
  bottom: 30px;
  transform: scale(0.82);
}

.reward-coin.c3 {
  top: 24px;
  left: 58px;
  transform: scale(0.68);
}

.loss-cut-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  gap: 0;
  min-height: 122px;
  padding: 8px;
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
}

.loss-cut-visual .reward-card-art {
  width: min(100%, 232px) !important;
  max-height: 128px;
}

#daily-modal .modal-content,
#offline-modal .modal-content,
#sell-reward-modal .modal-content,
#loss-cut-modal .modal-content,
#guide-modal .modal-content {
  background: #ffffff !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

#offline-modal .modal-content {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

@media (max-width: 380px) {
  .guide-visual,
  .daily-reward-visual,
  .offline-reward-visual,
  .loss-cut-visual {
    min-height: 106px;
    margin-bottom: 10px;
  }

  .loss-cut-visual {
    gap: 6px;
    padding: 10px;
  }

}

/* v76 imagegen pass: keep the goofy ant, but let luxury objects carry the fantasy. */
#gold-stack {
  width: 94px !important;
  height: 70px !important;
  background: url('../assets/generated/luxury-gold-bars.png') center / contain no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 12px rgba(149, 106, 12, 0.18));
}

#gold-stack::before,
#gold-stack::after,
#scene-sportscar::after,
#scene-yacht::after,
#scene-jet::before,
#scene-penthouse .penthouse-wing,
#scene-penthouse .penthouse-entrance,
#scene-penthouse::before,
#scene-penthouse::after,
.estate-object::before,
.estate-object::after {
  content: none !important;
  display: none !important;
}

#scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
#avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
  width: 212px !important;
  height: 100px !important;
  background: url('../assets/generated/luxury-sportscar.png') center / contain no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 14px 14px rgba(31, 51, 77, 0.18));
}

#scene-yacht {
  width: 124px !important;
  height: 70px !important;
  background: url('../assets/generated/luxury-yacht.png') center / contain no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 12px rgba(31, 120, 170, 0.18));
}

#scene-jet {
  width: 176px !important;
  height: 86px !important;
  background: url('../assets/generated/luxury-jet.png') center / contain no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 14px rgba(37, 72, 115, 0.16));
}

#scene-penthouse {
  width: 176px !important;
  height: 132px !important;
  background: url('../assets/generated/luxury-apartment.png') center bottom / contain no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 16px 18px rgba(31, 51, 77, 0.16));
}

.estate-object {
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 14px rgba(31, 51, 77, 0.16));
}

.estate-office {
  width: 84px !important;
  height: 106px !important;
  background-image: url('../assets/generated/luxury-office.png') !important;
}

.estate-garage {
  width: 92px !important;
  height: 54px !important;
  background-image: url('../assets/generated/luxury-sportscar.png') !important;
}

.estate-villa {
  width: 126px !important;
  height: 74px !important;
  background-image: url('../assets/generated/luxury-villa.png') !important;
}

.estate-vault {
  width: 64px !important;
  height: 54px !important;
  background-image: url('../assets/generated/luxury-vault.png') !important;
}

.estate-tower {
  width: 86px !important;
  height: 144px !important;
  background-image: url('../assets/generated/luxury-tower.png') !important;
}

.estate-island {
  width: 104px !important;
  height: 62px !important;
  background-image: url('../assets/generated/luxury-island.png') !important;
}

@media (max-width: 520px) {
  #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-gold #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-jet #scene-sportscar,
  #avatar-scene.has-sportscar.has-yacht.has-penthouse #scene-sportscar {
    width: 186px !important;
    height: 88px !important;
  }

  #scene-yacht {
    width: 108px !important;
    height: 62px !important;
  }

  #scene-jet {
    width: 150px !important;
    height: 72px !important;
  }

  #scene-penthouse {
    width: 136px !important;
    height: 104px !important;
  }

  .estate-office {
    width: 64px !important;
    height: 84px !important;
  }

  .estate-garage {
    width: 72px !important;
    height: 44px !important;
  }

  .estate-villa {
    width: 104px !important;
    height: 62px !important;
  }

  .estate-vault {
    width: 48px !important;
    height: 42px !important;
  }

  .estate-tower {
    width: 68px !important;
    height: 112px !important;
  }

  .estate-island {
    width: 82px !important;
    height: 50px !important;
  }
}

/* ============ v85 UI 안정화: 금액/도감/설명서/저발열 ============ */

.stock-card.just-bought {
  animation: justBoughtGlow 1.05s ease-in-out 2 !important;
}

@keyframes justBoughtGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 203, 71, 0.20), 0 4px 16px rgba(31, 36, 55, 0.06); }
  50% { box-shadow: 0 0 0 4px rgba(255, 203, 71, 0.42), 0 8px 22px rgba(255, 159, 28, 0.20); }
}

#networth-amount {
  font-size: clamp(19px, 5.6vw, 24px) !important;
}

#cash-amount {
  font-size: clamp(14px, 4.1vw, 16px) !important;
}

#sell-sheet-sub,
#sell-sheet-price,
#sell-sheet-pl,
#sell-preview-qty,
#sell-preview-amount,
#sell-preview-pl {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}

.sell-preview-row {
  grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr) !important;
  gap: 8px !important;
}

.sell-preview-row span:last-child {
  min-width: 0;
  justify-self: end !important;
  text-align: right !important;
}

.codex-card {
  flex-basis: 104px;
  min-height: 128px;
}

.codex-emoji.codex-ant-slot {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 203, 71, 0.28), transparent 54%),
    linear-gradient(180deg, #fff8e8, #ffffff);
  overflow: visible;
}

.codex-ant-img,
.tier-modal-ant-img,
.help-tier-ant-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.codex-ant-img {
  transform: translateY(3px) scale(1.16);
}

.tier-modal-ant-img {
  width: 110px;
  height: 110px;
  transform: translateY(-12px);
  filter: drop-shadow(0 14px 14px rgba(25, 31, 40, 0.18));
}

.modal-emoji:has(.tier-modal-ant-img),
.flex-emoji:has(.tier-modal-ant-img) {
  width: 110px;
  height: 92px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.help-tier-card {
  overflow: visible;
}

.help-tier-ant-img {
  width: 54px;
  height: 46px;
  transform: translate(-6px, 2px) scale(1.18);
  filter: drop-shadow(0 8px 8px rgba(25, 31, 40, 0.10));
}

#sell-preview-qty {
  font-size: clamp(11px, 3.2vw, 13px) !important;
}

@media (max-width: 380px) {
  #sell-sheet {
    height: auto !important;
    max-height: calc(100dvh - 42px) !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
  }

  .sell-preview-row {
    grid-template-columns: 1fr !important;
    gap: 3px !important;
  }

  .sell-preview-row span:last-child {
    justify-self: start !important;
    text-align: left !important;
  }

  #sell-preview-qty {
    font-size: 11px !important;
    line-height: 1.18 !important;
  }

  #sell-sheet-confirm {
    min-height: 46px !important;
  }
}

.help-visual-frame {
  overflow: visible !important;
}

.help-rumor-panel {
  display: grid;
  width: min(100%, 260px);
  gap: 10px;
  justify-items: center;
}

.help-rumor-card {
  display: grid;
  position: relative;
  width: 100%;
  gap: 5px;
  border: 1px solid #b9d6ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f1f7ff);
  padding: 14px 14px 16px;
  box-shadow: 0 12px 22px rgba(49, 130, 246, 0.12);
}

.help-rumor-card span {
  width: max-content;
  border-radius: 999px;
  background: #3182f6;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  padding: 4px 7px;
}

.help-rumor-card strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.help-rumor-card em {
  color: var(--text-dim);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.help-rumor-card i {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3182f6 54%, #d8e6f8 54%);
}

.help-rumor-outcome {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.help-rumor-outcome b {
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  padding: 9px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce), (max-width: 520px) {
  .particle {
    animation-duration: 520ms;
  }

  .stock-card.just-bought,
  .price.flash-up,
  .price.flash-down {
    animation-duration: 0.55s !important;
  }
}

/* v97 interaction hardening: reachable controls and a desktop rail that never covers gameplay. */
#ranking-btn,
#invite-btn,
#mute-btn {
  min-height: 44px !important;
}

#ranking-btn,
#mute-btn {
  min-width: 44px !important;
}

.sell-portion-chips button,
.help-arrow {
  min-width: 44px !important;
  min-height: 44px !important;
}

.help-arrow {
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
}

#sell-slider {
  height: 44px !important;
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}

@media (min-width: 1280px) {
  #bottom-nav {
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: calc(50% + 528px) !important;
    width: 104px !important;
    max-width: 104px !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 40px);
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
    overflow-y: auto;
    border: 1px solid #dfe8f5 !important;
    border-radius: 14px !important;
    transform: translateY(-50%) translateZ(0) !important;
  }

  #bottom-nav .nav-btn {
    width: 100%;
    min-height: 56px;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
    gap: 3px !important;
  }
}

@media (min-width: 700px) and (max-height: 560px) {
  .help-visual-frame {
    overflow: hidden !important;
  }

  .help-evolution-route {
    gap: 4px !important;
    padding: 6px !important;
  }

  .help-tier-route {
    gap: 4px !important;
  }

  .help-tier-card.featured {
    min-height: 64px !important;
    gap: 1px !important;
    padding: 3px 3px 2px !important;
  }

  .help-tier-card.featured .help-tier-ant-img {
    width: 42px !important;
    height: 34px !important;
    transform: translate(-4px, 1px) scale(1.06) !important;
  }

  .help-evolution-route .help-journey-path {
    gap: 4px !important;
  }

  .help-evolution-route .help-journey-path span {
    gap: 0 !important;
    padding: 3px 4px !important;
  }
}
