*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:     #090e18;
  --bg2:    #111828;
  --bg3:    #1a2440;
  --border: #253458;
  --text:   #ddeeff;
  --text2:  #7090c0;
  --text3:  #3a5078;
  --green:  #1D9E75;
  --red:    #D85A30;
  --blue:   #378ADD;
  --yellow: #EF9F27;
}

[data-theme="neon"] {
  --bg:     #07080f;
  --bg2:    #0d0f1c;
  --bg3:    #13152a;
  --border: #242660;
  --text:   #ddeeff;
  --text2:  #7080c8;
  --text3:  #383e70;
  --green:  #00e87a;
  --red:    #ff2d6b;
  --blue:   #00c8ff;
  --yellow: #ffe600;
}

[data-theme="amber"] {
  --bg:     #100d00;
  --bg2:    #1c1800;
  --bg3:    #282000;
  --border: #3d3000;
  --text:   #ffd06a;
  --text2:  #a87e38;
  --text3:  #5e4418;
  --green:  #aacc00;
  --red:    #ff6520;
  --blue:   #e09800;
  --yellow: #ffec40;
}

[data-theme="sakura"] {
  --bg:     #fff5f8;
  --bg2:    #fce6ef;
  --bg3:    #f8d6e6;
  --border: #f0b0c8;
  --text:   #3a1020;
  --text2:  #8a3858;
  --text3:  #c08898;
  --green:  #2a9e68;
  --red:    #e83068;
  --blue:   #6858c8;
  --yellow: #d88820;
}

[data-theme="mint"] {
  --bg:     #f0fdf5;
  --bg2:    #dff5e8;
  --bg3:    #c6ebd5;
  --border: #96d4b0;
  --text:   #1a3828;
  --text2:  #3a7058;
  --text3:  #7aaa90;
  --green:  #1a9e58;
  --red:    #e03068;
  --blue:   #2870c8;
  --yellow: #c88820;
}

[data-theme="cny"] {
  --bg:     #0e0304;
  --bg2:    #1c0708;
  --bg3:    #2a0e0e;
  --border: #5c1a1a;
  --text:   #ffd060;
  --text2:  #cc8830;
  --text3:  #7a4a18;
  --green:  #f0c020;
  --red:    #ff4428;
  --blue:   #ff8020;
  --yellow: #ffd700;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

#game {
  width: 100%;
  max-width: 480px;
}

/* ---- Screens ---- */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; animation: fadeIn .22s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-inner {
  margin: auto;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  text-align: center;
}

#screen-trade {
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 3rem;
}

/* ---- Welcome ---- */
#screen-welcome h1 {
  font-size: 38px;
  letter-spacing: -.02em;
  margin-bottom: 0;
}

.tagline {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  width: 100%;
}

.rule-item {
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .55rem .85rem;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.tier-active {
  background: var(--bg2);
  border: .5px solid var(--border);
  color: var(--text);
}

.tier-locked {
  background: var(--bg2);
  border: .5px solid var(--bg3);
  color: var(--text3);
}

.tier-row span { font-size: 11px; color: var(--text3); }
.tier-active span { color: var(--green); }

.cta-btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: .75rem 2.5rem;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}

.cta-btn:hover { opacity: .85; }
.cta-btn .key-hint { background: rgba(0,0,0,.12); color: inherit; }

/* ---- Result screen ---- */
#screen-result h2 {
  font-size: 26px;
  font-weight: 700;
}

#result-pnl {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}

#result-pnl.up   { color: var(--green); }
#result-pnl.down { color: var(--red); }

#result-networth {
  font-size: 14px;
  color: var(--text2);
}

#share-btn {
  background: var(--bg3);
  color: var(--text2);
  border: .5px solid var(--border);
  padding: .6rem 2rem;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  width: 100%;
}

#share-btn:hover { background: var(--bg2); color: var(--text); }

#result-forced {
  font-size: 12px;
  color: var(--yellow);
}

h1 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.25rem;
  letter-spacing: .04em;
}

/* ---- HUD ---- */
#hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 1rem;
}

.metric {
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 10px;
  padding: .6rem .75rem;
}

.metric-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.metric-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.metric-value.up   { color: var(--green); }
.metric-value.down { color: var(--red); }

/* ---- Level bar ---- */
#level-bar {
  margin-bottom: 1rem;
}

#level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

#level-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

#level-next-label {
  font-size: 11px;
  color: var(--text3);
}

#level-progress-wrap {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

#level-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--blue);
  width: 0%;
  transition: width .4s ease, background .3s;
}

.level-up-badge {
  background: var(--yellow);
  color: #1a1200;
  font-weight: 700;
  font-size: 13px;
  padding: .4rem 1.2rem;
  border-radius: 20px;
  letter-spacing: .03em;
}

/* ---- Chart ---- */
#chart-wrap {
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

#asset-name {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 1px;
  font-weight: 500;
}

#asset-desc {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 6px;
  font-style: italic;
}

#current-price {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

#price-change {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text3);
}

#price-change.up   { color: var(--green); }
#price-change.down { color: var(--red); }

#timer-bar-wrap {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}

#timer-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
  width: 100%;
  transition: background .3s;
}

#chartCanvas {
  display: block;
  width: 100%;
  border-radius: 6px;
}

/* ---- Overlay ---- */
#overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 20, .82);
  backdrop-filter: blur(4px);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#overlay h2 {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
}

#overlay p {
  color: var(--text2);
  font-size: 13px;
  text-align: center;
  padding: 0 1.5rem;
  line-height: 1.5;
}

#overlay button {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: .65rem 2.2rem;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity .15s;
}

#overlay button:hover { opacity: .85; }

/* ---- Controls ---- */
.key-hint {
  display: inline-block;
  background: rgba(0, 0, 0, .15);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: monospace;
  margin-left: 6px;
}

#qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: .75rem;
}

#qty-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  flex-shrink: 0;
  white-space: nowrap;
}

#qty-display {
  font-weight: 700;
  color: var(--text);
}

#qty-slider {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.qty-dot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
}

.qty-dot::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  transition: background .12s, transform .15s, border-color .12s, opacity .12s;
}

.qty-dot.qs-filled::after {
  background: var(--blue);
  border-color: var(--blue);
  opacity: .45;
  transform: scale(.85);
}

.qty-dot.qs-active::after {
  background: var(--blue);
  border-color: var(--blue);
  transform: scale(1.55);
  opacity: 1;
}

.qty-dot.qs-empty::after {
  background: transparent;
  border-color: var(--border);
  opacity: .5;
}

#max-hint {
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}

/* ---- Action buttons ---- */
#actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1rem;
}

.abtn {
  padding: .9rem 1rem;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  letter-spacing: .02em;
}

.abtn:hover   { opacity: .88; }
.abtn:active  { transform: scale(.96); }
.abtn:disabled { opacity: .25; cursor: default; transform: none; }
.abtn .key-hint { background: rgba(0,0,0,.2); color: inherit; }
.abtn.flash-press { transform: scale(.95) !important; filter: brightness(1.2); }

.buy  { background: var(--green); color: #d0f5e8; }
.sell { background: var(--red);   color: #fae0d5; }

.hold {
  background: var(--bg3);
  color: var(--text2);
  border: .5px solid var(--border);
  grid-column: span 2;
  padding: .55rem;
  font-size: 13px;
}

/* ---- Log ---- */
#log {
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.log-entry {
  font-size: 12px;
  color: var(--text3);
  padding: 4px 0;
  border-bottom: .5px solid var(--bg3);
}

.log-entry.profit { color: var(--green); }
.log-entry.loss   { color: var(--red); }

/* ---- Floating numbers ---- */
.float-num {
  position: absolute;
  font-size: 16px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
  animation: floatUp 1.1s ease-out forwards;
  z-index: 20;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0)     scale(1); }
  15%  { opacity: 1; transform: translateY(-6px)  scale(1.2); }
  100% { opacity: 0; transform: translateY(-56px) scale(.85); }
}

/* ---- Juice ---- */
#timer-bar.urgent {
  animation: timerPulse .45s ease infinite;
}

@keyframes timerPulse {
  0%, 100% { filter: brightness(1); }
  50%       { filter: brightness(2); }
}

.confetti-piece {
  position: fixed;
  width: 9px;
  height: 9px;
  top: -12px;
  pointer-events: none;
  z-index: 1000;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(600deg); opacity: 0; }
}

@keyframes screenFlash {
  0%   { opacity: .5; }
  100% { opacity: 0; }
}

@keyframes pnlBounce {
  0%   { transform: scale(.2); opacity: 0; }
  65%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#result-pnl { transform-origin: center; }

/* ---- Game header ---- */
#game-header {
  position: relative;
  text-align: center;
  margin-bottom: 1.25rem;
}

#game-header h1 { margin-bottom: 0; }

#menu-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

#menu-btn:hover { color: var(--text2); background: var(--bg3); }

/* ---- Settings ---- */
#settings-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  line-height: 1;
}

#settings-btn:hover { background: var(--bg3); }

#settings-panel {
  position: fixed;
  top: 3.5rem;
  right: 1rem;
  z-index: 99;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 12px;
  padding: .5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 148px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  transform-origin: top right;
  animation: panelIn .18s ease;
}

#settings-panel.hidden { display: none; }

@keyframes panelIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

.settings-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  padding: .2rem .75rem .3rem;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: .45rem .75rem;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .12s, color .12s;
}

.theme-btn:hover  { background: var(--bg3); color: var(--text); }
.theme-btn.active  { background: var(--bg3); color: var(--text); font-weight: 600; }
.theme-btn.locked  { opacity: .38; cursor: default; }

/* ---- Game modes ---- */
.mode-buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.cta-btn:disabled { opacity: .38; cursor: default; }

.cta-outline {
  background: transparent;
  color: var(--text2);
  border: 1.5px solid var(--border);
  padding: .75rem 2.5rem;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.cta-outline:hover { background: var(--bg3); color: var(--text); border-color: var(--text3); }

#daily-status {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  margin: -2px 0;
}

#daily-status.played-pos { color: var(--green); font-weight: 500; }
#daily-status.played-neg { color: var(--red);   font-weight: 500; }

#result-level-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.daily-badge {
  display: inline-block;
  background: var(--blue);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  padding: .4rem 1.2rem;
  border-radius: 20px;
  letter-spacing: .03em;
}

/* ---- Achievements screen ---- */
.ach-open-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  cursor: pointer;
  padding: .3rem 0;
  transition: color .15s;
}

.ach-open-btn:hover { color: var(--text2); }

.ach-screen-header {
  position: relative;
  width: 100%;
  text-align: center;
}

.ach-screen-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

.back-btn:hover { color: var(--text2); background: var(--bg3); }

.ach-count {
  font-size: 13px;
  color: var(--text3);
  margin-top: -.5rem;
}

.ach-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ach-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  text-align: left;
  transition: opacity .2s;
}

.ach-row.locked { opacity: .38; }

.ach-row-emoji {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
}

.ach-row.locked .ach-row-emoji { filter: grayscale(1); }

.ach-row-info { flex: 1; }

.ach-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.ach-row.locked .ach-row-name { color: var(--text3); }

.ach-row-desc {
  font-size: 12px;
  color: var(--text3);
}

.ach-row-check {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

/* ---- Achievements toast ---- */
.achievement-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1rem;
  z-index: 200;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: 14px;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  transform: translateX(calc(100% + 1.5rem));
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}

.achievement-toast.show { transform: translateX(0); }

.ach-emoji {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.ach-header {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--yellow);
  margin-bottom: 2px;
}

.ach-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.ach-desc {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.ach-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg3);
  color: var(--text2);
  border: .5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  padding: .3rem .85rem;
  border-radius: 20px;
}

/* ---- Shop screen ---- */
.shop-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  text-align: left;
}

.shop-row.owned { opacity: .55; }

.shop-row-emoji {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
}

.shop-row-info { flex: 1; }

.shop-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.shop-row-desc {
  font-size: 12px;
  color: var(--text3);
}

.shop-row-check {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
  background: var(--bg3);
  padding: .3rem .8rem;
  border-radius: 20px;
  white-space: nowrap;
}

.shop-buy-btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: .4rem .9rem;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
  white-space: nowrap;
}

.shop-buy-btn:hover { opacity: .85; }

.shop-buy-btn.cant-afford {
  background: var(--bg3);
  color: var(--text3);
  cursor: default;
}

.shop-level-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  background: var(--bg3);
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---- Office card ---- */
#office-card { width: 100%; }

.office-card {
  width: 100%;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.office-emoji { font-size: 52px; line-height: 1; margin-bottom: 6px; }

.office-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.office-tier {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 2px;
}

.office-flavour {
  font-size: 12px;
  color: var(--text3);
  font-style: italic;
  margin-bottom: 6px;
}

.office-upgrade-locked { width: 100%; margin-top: 8px; }

.office-next-hint {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 7px;
}

.office-progress-track {
  width: 100%;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}

.office-progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  transition: width .4s ease;
}

.office-progress-label {
  font-size: 11px;
  color: var(--text3);
}

.office-upgrade-ready {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.office-hold-btn {
  width: 100%;
  background: var(--yellow);
  color: #1a1200;
  border: none;
  padding: .75rem 1.5rem;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: opacity .15s;
}

.office-hold-btn:hover { opacity: .9; }

.office-hold-sub {
  font-size: 12px;
  color: var(--text3);
}

.office-hold-track {
  width: 100%;
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}

.office-hold-bar {
  height: 100%;
  width: 0%;
  background: var(--yellow);
  border-radius: 3px;
}

.office-maxed {
  font-size: 13px;
  color: var(--yellow);
  font-weight: 600;
  margin-top: 8px;
}

/* ---- Office card balance ---- */
.office-balance { text-align: center; width: 100%; }

.office-balance-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -.02em;
  line-height: 1;
}

.office-balance-label {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.office-card-divider {
  width: 100%;
  height: .5px;
  background: var(--border);
  margin: .75rem 0 .5rem;
}

/* ---- Day badge ---- */
.day-badge {
  display: inline-block;
  background: var(--bg3);
  color: var(--text2);
  border: .5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  padding: .3rem .85rem;
  border-radius: 20px;
}

/* ---- Weekly summary screen ---- */
#weekly-title { text-align: center; }
#weekly-title h2 { font-size: 26px; font-weight: 700; }

.weekly-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
}

.weekly-days-table,
.weekly-costs-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weekly-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem .75rem;
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg2);
}

.weekly-row-total {
  border-top: .5px solid var(--border);
  font-weight: 700;
  margin-top: 4px;
  background: var(--bg3);
}

.weekly-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text3);
  font-weight: 600;
  padding: .4rem .25rem .1rem;
}

.weekly-row-net {
  font-size: 16px;
  font-weight: 800;
  background: var(--bg3);
  border: .5px solid var(--border);
  border-radius: 10px;
  padding: .65rem .75rem;
}

.weekly-day-label { color: var(--text3); font-size: 13px; }

.weekly-downgrade {
  background: rgba(216,90,48,.12);
  border: .5px solid var(--red);
  border-radius: 10px;
  padding: .75rem 1rem;
  font-size: 13px;
  color: var(--red);
  text-align: center;
  line-height: 1.6;
  width: 100%;
}

/* ---- Dollar particles ---- */
.dollar-particle {
  position: fixed;
  font-size: 17px;
  font-weight: 800;
  color: var(--green);
  pointer-events: none;
  z-index: 300;
  line-height: 1;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  animation: dollarFloat var(--dur, .8s) ease-out forwards;
}

@keyframes dollarFloat {
  0%   { opacity: 1;   transform: translate(0, 0)                                    scale(1);   }
  55%  { opacity: 1;   transform: translate(var(--dx), var(--dy))                    scale(1.3); }
  100% { opacity: 0;   transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) * 1.5)) scale(.7);  }
}

/* ---- Achievement claim ---- */
.ach-claim-hint {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  margin-top: -.5rem;
}

.ach-claim-btn {
  background: var(--green);
  color: #d0f5e8;
  border: none;
  padding: .35rem .8rem;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: opacity .15s;
}

.ach-claim-btn:hover { opacity: .85; }

/* ---- Team earnings ---- */
#result-team-earnings {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  min-height: 1.2em;
}

/* ---- List screens: top-anchored, not vertically centered ---- */
#screen-shop,
#screen-hire,
#screen-achievements,
#screen-leaderboard,
#screen-weekly {
  align-items: flex-start;
}

#screen-shop .screen-inner,
#screen-hire .screen-inner,
#screen-achievements .screen-inner,
#screen-leaderboard .screen-inner,
#screen-weekly .screen-inner {
  margin: 0 auto;
  min-height: 100vh;
  justify-content: flex-start;
}

/* ---- Shop tabs ---- */
.shop-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: 10px;
  padding: 4px;
  width: 100%;
}

.shop-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  padding: .4rem .5rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.shop-tab:hover { color: var(--text2); }
.shop-tab.active { background: var(--bg2); color: var(--text); }

.shop-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 2rem 1rem;
  color: var(--text3);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

.shop-empty-emoji { font-size: 36px; }

/* ---- Shop section label ---- */
.shop-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text3);
  padding: .5rem .25rem .15rem;
  font-weight: 600;
}

/* ---- Shop fire / hire row ---- */
.shop-fire-btn {
  background: var(--bg3);
  color: var(--red);
  border: .5px solid var(--border);
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.shop-fire-btn:hover { background: var(--red); color: #fae0d5; }

.shop-hire-row { cursor: pointer; transition: background .15s; }
.shop-hire-row:hover { background: var(--bg3); }

.shop-row-arrow {
  font-size: 16px;
  color: var(--text3);
  flex-shrink: 0;
}

/* ---- Hire screen ---- */
.hire-candidates {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hire-card {
  display: flex;
  align-items: stretch;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
}

.hire-card-emoji {
  font-size: 38px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem .85rem;
  background: var(--bg3);
  flex-shrink: 0;
  min-width: 68px;
}

.hire-card-info {
  flex: 1;
  padding: .75rem .85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.hire-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.hire-card-stats {
  font-size: 12px;
  color: var(--text3);
}

.hire-card-quote {
  font-size: 11px;
  color: var(--text2);
  font-style: italic;
  margin-top: 2px;
}

.hire-btn {
  background: var(--green);
  color: #d0f5e8;
  border: none;
  padding: .5rem .9rem;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  margin-right: .85rem;
  border-radius: 20px;
  transition: opacity .15s;
  white-space: nowrap;
}

.hire-btn:hover { opacity: .85; }

.hire-btn.cant-afford {
  background: var(--bg3);
  color: var(--text3);
  cursor: default;
  opacity: 1;
}

.cant-afford-btn {
  opacity: .38;
  cursor: default;
}

/* ---- Leaderboard ---- */
.leaderboard-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: .5px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
}

.lb-row.lb-top {
  border-color: var(--yellow);
  background: var(--bg3);
}

.lb-rank {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.lb-rank-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
}

.lb-initials {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .06em;
  flex-shrink: 0;
  width: 56px;
}

.lb-info { flex: 1; text-align: right; }

.lb-score {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

.lb-week {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.lb-loading,
.lb-empty {
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  padding: 2rem 1rem;
}

/* ---- Weekly submit ---- */
.weekly-submit-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weekly-submit-label {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

.weekly-submit-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.initials-input {
  flex: 1;
  background: var(--bg3);
  border: .5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  padding: .5rem .75rem;
  outline: none;
  transition: border-color .15s;
}

.initials-input:focus { border-color: var(--blue); }
.initials-input::placeholder { color: var(--text3); font-weight: 400; letter-spacing: .04em; }
.initials-hint { font-size: 11px; color: var(--red); min-height: 14px; margin: 0; }