/* AUREA Simulation Games — shared page styles (trading-sim,
   mining-sim, stable-sim). Neon gold/purple frames
   on the portal's dark navy shell; readability floor per the
   AUREA visual standard (--muted #A7ACC2, border #39415F). */

.sim-card {
  background: linear-gradient(180deg, rgba(24, 30, 58, .92), rgba(13, 18, 38, .96));
  border: 1px solid #39415F;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 0 0 1px rgba(255, 215, 0, .06), 0 0 22px rgba(124, 58, 237, .12), 0 10px 30px rgba(0, 0, 0, .35);
}
.sim-card h3 { margin-top: 0; }
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .sim-grid { grid-template-columns: 1fr; } }

.sim-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .sim-stats { grid-template-columns: repeat(2, 1fr); } }
.sim-stat { background: rgba(10, 15, 30, .55); border: 1px solid #39415F; border-radius: 12px; padding: 12px 14px; }
.sim-stat .k { color: var(--muted, #A7ACC2); font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sim-stat .v { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.sim-stat .v small { font-size: .8rem; color: var(--muted, #A7ACC2); font-weight: 600; }
.sim-pos { color: #3DDC84; } .sim-neg { color: #FF6B81; }

.sim-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sim-table th, .sim-table td { padding: 9px 10px; border-bottom: 1px solid rgba(57, 65, 95, .55); text-align: right; vertical-align: middle; }
.sim-table th { color: var(--muted, #A7ACC2); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; }
.sim-table th:first-child, .sim-table td:first-child { text-align: left; }
.sim-table tr.me td { background: rgba(255, 215, 0, .07); }
.sim-table tr:last-child td { border-bottom: none; }
.sim-scroll { overflow-x: auto; }

.sim-coin { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.sim-coin img { width: 22px; height: 22px; border-radius: 50%; }
.sim-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.sim-badge.long { background: rgba(61, 220, 132, .14); color: #3DDC84; border: 1px solid rgba(61, 220, 132, .45); }
.sim-badge.short { background: rgba(255, 107, 129, .12); color: #FF6B81; border: 1px solid rgba(255, 107, 129, .45); }
.sim-badge.stale { background: rgba(255, 180, 0, .12); color: #FFB400; border: 1px solid rgba(255, 180, 0, .45); }
.sim-badge.cpu { background: rgba(124, 58, 237, .16); color: #C4B5FD; border: 1px solid rgba(124, 58, 237, .5); }
.sim-badge.live { background: rgba(61, 220, 132, .12); color: #3DDC84; border: 1px solid rgba(61, 220, 132, .4); }

.sim-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .sim-form { grid-template-columns: 1fr; } }
.sim-field label { display: block; color: var(--muted, #A7ACC2); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.sim-field select, .sim-field input {
  width: 100%; box-sizing: border-box; background: #0A0F1E; color: #EDF0FA;
  border: 1px solid #39415F; border-radius: 10px; padding: 10px 12px; font: inherit;
}
.sim-field select:focus, .sim-field input:focus { outline: 2px solid rgba(255, 215, 0, .55); outline-offset: 1px; }
.sim-seg { display: flex; gap: 8px; }
.sim-seg button {
  flex: 1; padding: 10px 0; border-radius: 10px; border: 1px solid #39415F;
  background: #0A0F1E; color: var(--muted, #A7ACC2); font: inherit; font-weight: 800; cursor: pointer;
}
.sim-seg button.on-long { background: rgba(61, 220, 132, .16); color: #3DDC84; border-color: #3DDC84; }
.sim-seg button.on-short { background: rgba(255, 107, 129, .14); color: #FF6B81; border-color: #FF6B81; }
.sim-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sim-note { color: var(--muted, #A7ACC2); font-size: .85rem; }
.sim-err { color: #FF6B81; font-weight: 600; }
.sim-ok { color: #3DDC84; font-weight: 700; }
.sim-hidden { display: none !important; }

/* Coming Soon teaser state (2026-12-01): an enhancement section whose
   backend RPC is not live yet stays visible as a labelled teaser —
   badge + note on top, the section's own content dimmed and inert so
   nothing can be operated. Cleared automatically once the RPC answers
   (SimCommon.soonOff on the normal render path). */
.sim-soon-box {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  margin: 0 0 14px; padding: 18px 20px; border-radius: 16px;
  border: 2px solid transparent;
  background:
    linear-gradient(#101736, #101736) padding-box,
    linear-gradient(90deg, #FFD700, #8A2BE2) border-box;
  box-shadow: 0 0 22px rgba(138, 43, 226, .26), 0 0 12px rgba(255, 215, 0, .13), 0 10px 26px rgba(0, 0, 0, .38);
}
.sim-soon-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px; flex: none;
  font-size: 1.3rem; font-weight: 800; letter-spacing: .06em;
  color: #0A0F1E; background: linear-gradient(90deg, #FFD700, #F5C542);
  border: 1px solid rgba(255, 215, 0, .85); box-shadow: 0 0 16px rgba(255, 215, 0, .4);
  white-space: nowrap; line-height: 1.25;
}
.sim-soon-note { color: #C6CADB; font-size: .95rem; margin: 0; line-height: 1.55; }
.sim-soon > :not(.sim-soon-box):not(h3) { opacity: .38; pointer-events: none; filter: saturate(.55); }
.sim-progress { height: 8px; background: rgba(57, 65, 95, .5); border-radius: 999px; overflow: hidden; }
.sim-progress > div { height: 100%; background: linear-gradient(90deg, #FFD700, #7C3AED); border-radius: 999px; }
.sim-prize-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed rgba(57, 65, 95, .6); }
.sim-prize-row:last-child { border-bottom: none; }
button.sim-mini {
  padding: 6px 12px; border-radius: 8px; border: 1px solid #39415F; cursor: pointer;
  background: rgba(255, 215, 0, .1); color: #FFD700; font: inherit; font-weight: 700; font-size: .85rem;
}
button.sim-mini:disabled { opacity: .45; cursor: default; }
.sim-hero-img { width: 100%; border-radius: 16px; border: 1px solid #39415F; box-shadow: 0 0 24px rgba(124, 58, 237, .25); }

/* Poster-style hero (four.meme-style, user order 2026-11-30 20:03):
   mascot hero image + huge bold gradient headline over a readable
   scrim. Neon frame + readability baseline preserved. */
.poster-hero { position: relative; border: 1px solid rgba(245,197,66,.6); border-radius: 20px; overflow: hidden; margin: 0 0 22px; min-height: 360px; display: flex; align-items: flex-end; box-shadow: 0 0 34px rgba(168,85,247,.35), 0 0 14px rgba(245,197,66,.25); background: #0A0F1E; }
.poster-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center right; }
.poster-hero-body { position: relative; z-index: 2; padding: 30px 30px 26px; max-width: 660px; background: linear-gradient(92deg, rgba(5,7,16,.92) 0%, rgba(5,7,16,.72) 62%, rgba(5,7,16,0) 100%); }
.poster-title { margin: 6px 0 10px; font-size: clamp(2.5rem, 6.2vw, 4.3rem); font-weight: 900; line-height: 1.0; letter-spacing: .01em; text-transform: uppercase; background: linear-gradient(180deg, #FFF3C4 0%, #F5C542 52%, #D9940D 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 12px rgba(0,0,0,.65)); }
.poster-hero .page-sub { color: #EDEFF7; font-size: 1.02rem; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
@media (max-width: 640px) { .poster-hero { min-height: 300px; } .poster-hero-body { padding: 20px; background: linear-gradient(180deg, rgba(5,7,16,.25) 0%, rgba(5,7,16,.88) 55%); max-width: none; } }

/* Enhancement pack (2026-11-30): achievements, titles, collection */
.sim-achv { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid #39415F; color: #A7ACC2; background: rgba(10, 15, 30, .5); }
.sim-achv.on { color: #FFD700; border-color: rgba(255, 215, 0, .65); background: rgba(255, 215, 0, .08); }
.sim-achv .sub { font-weight: 600; opacity: .75; font-size: .72rem; }
.sim-dev-off { opacity: .38; filter: grayscale(1); }
.sim-rank-arrow { font-size: .85rem; font-weight: 700; }

/* =====================================================================
   Stable Sim game layer (2026-11-30): WorkMarket-style readable cards,
   horse portraits, gauges, race replay. Scoped to body.ss-page /
   .ss- classes so the other sim pages are untouched.
   ===================================================================== */
body.ss-page .card { background: linear-gradient(180deg, rgba(24,30,58,.92), rgba(13,18,38,.96)); border: 1px solid #39415F; border-radius: 16px; padding: 20px; margin: 0 0 18px; box-shadow: 0 0 0 1px rgba(255,215,0,.06), 0 0 22px rgba(124,58,237,.12), 0 10px 30px rgba(0,0,0,.35); }
body.ss-page .card h3 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; }
body.ss-page .card h4 { margin: 16px 0 6px; font-size: .98rem; font-weight: 800; color: #E7EAF6; }
body.ss-page .stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 18px; }
@media (max-width: 860px) { body.ss-page .stat-grid { grid-template-columns: repeat(2, 1fr); } }
body.ss-page .stat-card { background: rgba(10,15,30,.55); border: 1px solid #39415F; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
body.ss-page .stat-label { color: var(--muted, #A7ACC2); font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
body.ss-page .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.15; color: #FFD700; }
body.ss-page .stat-sub { color: var(--muted, #A7ACC2); font-size: .8rem; font-weight: 600; }
body.ss-page .mini-btn { padding: 7px 12px; border-radius: 9px; border: 1px solid #39415F; cursor: pointer; background: rgba(255,215,0,.1); color: #FFD700; font: inherit; font-weight: 700; font-size: .85rem; }
body.ss-page .mini-btn:hover { background: rgba(255,215,0,.2); }
body.ss-page .chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
body.ss-page .chip-open { background: rgba(124,58,237,.16); color: #C4B5FD; border: 1px solid rgba(124,58,237,.5); }
body.ss-page .chip-cpu { background: rgba(124,58,237,.16); color: #C4B5FD; border: 1px solid rgba(124,58,237,.5); }
body.ss-page .chip-me { background: rgba(255,215,0,.14); color: #FFD700; border: 1px solid rgba(255,215,0,.55); }
body.ss-page .sim-table-wrap { overflow-x: auto; }
body.ss-page .sim-table tr.sim-me td { background: rgba(255,215,0,.07); }
body.ss-page .race-block { border: 1px solid rgba(57,65,95,.7); border-radius: 12px; padding: 14px; margin: 0 0 12px; background: rgba(10,15,30,.4); }
body.ss-page .race-head { font-size: .95rem; margin-bottom: 8px; line-height: 1.55; }
body.ss-page .prize-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 640px) { body.ss-page .prize-grid { grid-template-columns: repeat(3, 1fr); } }
body.ss-page .prize-cell { background: rgba(10,15,30,.55); border: 1px solid #39415F; border-radius: 10px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; }
body.ss-page .prize-cell span { color: var(--muted, #A7ACC2); font-weight: 700; }
body.ss-page .prize-cell strong { color: #FFD700; }
body.ss-page .winner-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed rgba(57,65,95,.6); }
body.ss-page .winner-row:last-child { border-bottom: none; }
body.ss-page .how-list { margin: 0; padding-left: 20px; line-height: 1.65; color: #C9CEDE; }
body.ss-page .how-list li { margin-bottom: 8px; }

/* Horse portraits + stable cards */
.ss-thumb { width: 58px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255,215,0,.35); vertical-align: middle; }
.ss-yard { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(255,215,0,.35); margin: 0 0 14px; box-shadow: 0 0 18px rgba(124,58,237,.25); }
.ss-horses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ss-horse { background: rgba(10,15,30,.55); border: 1px solid #39415F; border-radius: 14px; overflow: hidden; }
.ss-horse-media { position: relative; height: 128px; }
.ss-horse-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ss-horse-media .ss-media-tag { position: absolute; left: 10px; bottom: 8px; background: rgba(5,7,16,.78); border: 1px solid rgba(255,215,0,.45); color: #FFD700; border-radius: 999px; padding: 2px 10px; font-size: .74rem; font-weight: 800; }
.ss-horse-body { padding: 12px 14px 14px; }
.ss-horse-name { font-size: 1.05rem; font-weight: 800; line-height: 1.3; }
.ss-ped { color: var(--muted, #A7ACC2); font-size: .8rem; margin: 2px 0 10px; }
.ss-stats { display: grid; gap: 6px; margin-bottom: 10px; }
.ss-stat-row { display: grid; grid-template-columns: 38px 1fr 30px; align-items: center; gap: 8px; font-size: .8rem; position: relative; }
.ss-stat-row .k { color: var(--muted, #A7ACC2); font-weight: 700; letter-spacing: .03em; }
.ss-stat-row .v { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.ss-bar { height: 8px; background: rgba(57,65,95,.5); border-radius: 999px; overflow: hidden; }
.ss-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7C3AED, #FFD700); transition: width .8s ease; }
.ss-bar.cond > div { background: linear-gradient(90deg, #1F9D63, #3DDC84); }
.ss-bar.fat > div { background: linear-gradient(90deg, #B03A4B, #FF6B81); }
.ss-bar.energy > div { background: linear-gradient(90deg, #0EA5E9, #67E8F9); }
.ss-light-btn { opacity: .88; }
.ss-lighttag { opacity: .75; font-size: .86em; }
body.ss-page .mini-btn:disabled { opacity: .4; cursor: not-allowed; }
.ss-daily-cd { font-weight: 800; color: #FFD700; margin: 4px 0 10px; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.ss-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.ss-gauge .k { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted, #A7ACC2); font-weight: 700; margin-bottom: 4px; }
.ss-gauge .k b { color: #E7EAF6; font-variant-numeric: tabular-nums; }
.ss-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: #C9CEDE; margin-bottom: 10px; }
.ss-pips { display: inline-flex; gap: 4px; vertical-align: middle; }
.ss-pips i { width: 9px; height: 9px; border-radius: 50%; background: rgba(57,65,95,.8); display: inline-block; }
.ss-pips i.on { background: #FFD700; box-shadow: 0 0 6px rgba(255,215,0,.7); }
.ss-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-fx { position: absolute; right: 0; top: -14px; color: #3DDC84; font-size: .74rem; font-weight: 800; animation: ssFloatUp 1.6s ease forwards; }
@keyframes ssFloatUp { 0% { opacity: 0; transform: translateY(6px); } 18% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.ss-flash .v { color: #3DDC84; }

/* Training menu + jockeys */
.ss-train-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .ss-train-grid { grid-template-columns: 1fr; } }
.ss-train { background: rgba(10,15,30,.55); border: 1px solid #39415F; border-radius: 12px; overflow: hidden; }
.ss-train img { width: 100%; height: 104px; object-fit: cover; display: block; }
.ss-train .b { padding: 10px 12px 12px; }
.ss-train .b strong { display: block; font-size: .95rem; margin-bottom: 3px; }
.ss-train .b span { color: var(--muted, #A7ACC2); font-size: .82rem; line-height: 1.45; display: block; }
.ss-jockeys { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ss-jockey { background: rgba(10,15,30,.55); border: 1px solid #39415F; border-radius: 12px; overflow: hidden; text-align: center; }
.ss-jockey img { width: 100%; height: 128px; object-fit: cover; object-position: top; display: block; }
.ss-jockey .b { padding: 9px 10px 11px; }
.ss-jockey .b strong { display: block; font-size: .92rem; }
.ss-jockey .stars { color: #FFD700; font-size: .8rem; letter-spacing: 1px; }
.ss-jockey .fee { color: var(--muted, #A7ACC2); font-size: .8rem; font-weight: 700; }

/* Race feed + countdown */
.ss-feed { display: grid; gap: 8px; margin-bottom: 12px; }
.ss-feed-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; background: rgba(10,15,30,.45); border: 1px solid rgba(57,65,95,.6); border-radius: 10px; padding: 9px 12px; font-size: .88rem; }
.ss-feed-row .g { font-weight: 800; color: #FFD700; }
.ss-cd { display: inline-block; background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.45); color: #3DDC84; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Race replay */
.ss-replay { margin-top: 10px; border: 1px solid rgba(255,215,0,.4); border-radius: 12px; background: linear-gradient(180deg, rgba(16,22,44,.95), rgba(8,11,24,.97)); padding: 12px; }
.ss-replay-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.ss-replay-bar .ss-prog { flex: 1 1 120px; }
.ss-lane { display: grid; grid-template-columns: 118px 1fr; gap: 10px; align-items: center; padding: 4px 0; }
@media (max-width: 560px) { .ss-lane { grid-template-columns: 86px 1fr; } }
.ss-lane-name { font-size: .8rem; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.ss-lane-name .pl { display: inline-block; min-width: 20px; text-align: center; background: rgba(255,215,0,.16); border: 1px solid rgba(255,215,0,.55); color: #FFD700; border-radius: 6px; font-size: .72rem; font-weight: 800; margin-right: 4px; padding: 0 3px; }
.ss-track { position: relative; height: 34px; border-radius: 8px; background: repeating-linear-gradient(90deg, rgba(124,58,237,.10) 0 46px, rgba(124,58,237,.02) 46px 92px), linear-gradient(180deg, rgba(57,65,95,.35), rgba(57,65,95,.15)); border: 1px solid rgba(57,65,95,.55); overflow: hidden; }
.ss-track::after { content: ""; position: absolute; right: 6px; top: 0; bottom: 0; width: 3px; background: repeating-linear-gradient(180deg, #E7EAF6 0 5px, #0A0F1E 5px 10px); opacity: .8; }
.ss-runner { position: absolute; top: 50%; left: 0; width: 62px; height: 30px; transform: translate(0, -50%); will-change: transform; }
.ss-runner img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid rgba(255,215,0,.4); animation: ssGallop .34s ease-in-out infinite alternate; }
.ss-runner.done img { animation: none; }
.ss-runner.me img { border-color: #FFD700; box-shadow: 0 0 10px rgba(255,215,0,.65); }
@keyframes ssGallop { from { transform: translateY(-1.6px) rotate(-1.2deg); } to { transform: translateY(1.6px) rotate(1.2deg); } }
.ss-comm { margin-top: 10px; background: rgba(5,7,16,.6); border: 1px solid rgba(57,65,95,.55); border-radius: 10px; padding: 10px 12px; max-height: 132px; overflow-y: auto; font-size: .88rem; line-height: 1.5; }
.ss-comm p { margin: 0 0 4px; color: #C9CEDE; }
.ss-comm p.win { color: #FFD700; font-weight: 800; }
.ss-comm p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .ss-runner img, .ss-fx { animation: none !important; }
  .ss-bar > div { transition: none; }
}

/* Mining-sim liveness FX (2026-11-30): animated rig visuals, live
   counters, sparklines, region map/cards, cost breakdown, hero coins.
   Animations use transform/opacity only; .msfx-paused (set by an
   IntersectionObserver) freezes them off-screen, and
   prefers-reduced-motion turns them off entirely. */
.msfx-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; padding: 10px 14px; border: 1px solid rgba(255, 215, 0, .35); border-radius: 12px; background: rgba(255, 215, 0, .05); font-size: .9rem; }
.msfx-live[hidden] { display: none; }
.msfx-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 10px #3DDC84; animation: msfxPulseDot 1.8s ease-in-out infinite; }
.msfx-live .k { color: var(--muted, #A7ACC2); font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-right: 6px; }
.msfx-live strong { font-size: 1.02rem; }
.msfx-hashpulse { display: inline-block; animation: msfxHashPulse 2.8s ease-in-out infinite; }
@keyframes msfxPulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.78); } }
@keyframes msfxHashPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.msfx-rigcell { display: flex; gap: 12px; align-items: center; min-width: 230px; }
.msfx-rig { position: relative; width: 118px; aspect-ratio: 3 / 2; flex: none; border-radius: 10px; overflow: hidden; border: 1px solid #39415F; background: #0A0F1E; }
.msfx-rig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msfx-rig .msfx-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 85%, rgba(255, 215, 0, .35), transparent 65%); opacity: .25; pointer-events: none; }
.msfx-rig.mining .msfx-glow { animation: msfxGlowPulse 2.8s ease-in-out infinite; }
@keyframes msfxGlowPulse { 0%, 100% { opacity: .18; } 50% { opacity: .55; } }
.msfx-rig .msfx-shimmer { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 32%, rgba(255, 233, 138, .16) 48%, rgba(168, 85, 247, .13) 56%, transparent 72%); background-size: 260% 100%; background-position: 120% 0; pointer-events: none; }
.msfx-rig.mining .msfx-shimmer { animation: msfxShimmer 3.4s linear infinite; }
@keyframes msfxShimmer { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.msfx-led { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 9px #3DDC84; }
.msfx-rig.mining .msfx-led { animation: msfxBlink 1.7s steps(1, end) infinite; }
.msfx-rig.failed .msfx-led { background: #FF3B5C; box-shadow: 0 0 9px #FF3B5C; animation: msfxBlink .65s steps(1, end) infinite; }
@keyframes msfxBlink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }
.msfx-fan { position: absolute; left: 7px; bottom: 7px; width: 22px; height: 22px; border-radius: 50%; background: rgba(5, 7, 16, .72); border: 1px solid rgba(255, 215, 0, .5); color: #FFD700; display: flex; align-items: center; justify-content: center; }
.msfx-fan svg { width: 15px; height: 15px; }
.msfx-rig.mining .msfx-fan svg { animation: msfxSpin 1.15s linear infinite; }
@keyframes msfxSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.msfx-rig.failed img { filter: grayscale(.55) brightness(.72); }
.msfx-smoke { position: absolute; left: 50%; top: 34%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle, rgba(200, 205, 220, .55), transparent 70%); opacity: 0; pointer-events: none; }
.msfx-rig.failed .msfx-smoke { animation: msfxSmoke 2.6s ease-out infinite; }
.msfx-rig.failed .msfx-smoke.s2 { animation-delay: .85s; }
.msfx-rig.failed .msfx-smoke.s3 { animation-delay: 1.7s; }
@keyframes msfxSmoke { 0% { transform: translateY(6px) scale(.6); opacity: 0; } 25% { opacity: .8; } 100% { transform: translateY(-30px) scale(1.5); opacity: 0; } }

.msfx-dev-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; border: 1px solid #39415F; display: block; margin-bottom: 10px; background: #0A0F1E; }
.msfx-thumb { width: 54px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; border: 1px solid #39415F; vertical-align: middle; margin-right: 10px; background: #0A0F1E; }

.msfx-map { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid #39415F; margin: 4px 0 12px; }
.msfx-map img { width: 100%; display: block; }
.msfx-pin { position: absolute; width: 16px; height: 16px; margin: -15px 0 0 -8px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: linear-gradient(135deg, #FFE98A, #D9940D); border: 1px solid rgba(0, 0, 0, .45); box-shadow: 0 0 10px rgba(245, 197, 66, .8); z-index: 2; }
.msfx-pin::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(255, 215, 0, .55); animation: msfxPinRing 2.4s ease-out infinite; }
@keyframes msfxPinRing { 0% { transform: scale(.45) rotate(45deg); opacity: 1; } 100% { transform: scale(1.25) rotate(45deg); opacity: 0; } }
.msfx-pin-label { position: absolute; left: 0; top: 0; transform: rotate(45deg) translate(13px, -19px); transform-origin: left center; white-space: nowrap; background: rgba(5, 7, 16, .85); border: 1px solid rgba(255, 215, 0, .5); color: #EDF0FA; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.msfx-pin.on { width: 21px; height: 21px; margin: -20px 0 0 -10px; background: linear-gradient(135deg, #FFF3C4, #F5C542); box-shadow: 0 0 16px rgba(245, 197, 66, 1); }

.msfx-regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px; }
@media (max-width: 700px) { .msfx-regions { grid-template-columns: 1fr; } }
.msfx-region { border: 1px solid #39415F; border-radius: 12px; overflow: hidden; cursor: pointer; background: rgba(10, 15, 30, .55); text-align: left; padding: 0; color: inherit; font: inherit; width: 100%; }
.msfx-region img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.msfx-region .msfx-region-body { padding: 10px 12px 12px; }
.msfx-region .msfx-region-name { font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.msfx-region .msfx-region-stats { color: var(--muted, #A7ACC2); font-size: .8rem; margin-top: 5px; line-height: 1.5; }
.msfx-region.on { border-color: #FFD700; box-shadow: 0 0 0 1px rgba(255, 215, 0, .5), 0 0 18px rgba(255, 215, 0, .18); }
.msfx-cur { font-size: .68rem; font-weight: 800; letter-spacing: .04em; color: #0A0F1E; background: #FFD700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

.msfx-cost-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.msfx-cost-head img { width: 92px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; border: 1px solid #39415F; flex: none; }
.msfx-staff { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.msfx-staff img { width: 58px; height: 58px; object-fit: cover; object-position: top; border-radius: 12px; border: 1px solid #39415F; flex: none; }

.msfx-spark { display: block; margin-top: 4px; }
.msfx-up { color: #3DDC84 !important; }
.msfx-dn { color: #FF6B81 !important; }
.msfx-rate { color: #3DDC84; font-weight: 700; white-space: nowrap; }
.msfx-new { animation: msfxNewRow 2.4s ease-out 1; }
@keyframes msfxNewRow { 0% { background: rgba(255, 180, 0, .22); } 100% { background: transparent; } }

.msfx-hero-coins { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.msfx-coin { position: absolute; bottom: -34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFEF9E, #F5C542 55%, #B97E0C); box-shadow: 0 0 14px rgba(245, 197, 66, .5), inset 0 0 0 3px rgba(185, 126, 12, .6), inset 0 0 0 7px rgba(255, 239, 158, .45); opacity: 0; animation: msfxFloat linear infinite; }
@keyframes msfxFloat { 0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; } 8% { opacity: .95; } 88% { opacity: .9; } 100% { transform: translate3d(14px, -430px, 0) rotate(160deg); opacity: 0; } }

.msfx-paused .msfx-rig.mining .msfx-shimmer, .msfx-paused .msfx-rig.mining .msfx-fan svg,
.msfx-paused .msfx-rig .msfx-led, .msfx-paused .msfx-rig.failed .msfx-smoke,
.msfx-paused .msfx-live-dot, .msfx-paused .msfx-hashpulse, .msfx-paused .msfx-pin::after,
.msfx-paused .msfx-coin, .msfx-paused .msfx-rig.mining .msfx-glow { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .msfx-rig .msfx-shimmer, .msfx-rig .msfx-fan svg, .msfx-rig .msfx-led, .msfx-rig .msfx-smoke,
  .msfx-live-dot, .msfx-hashpulse, .msfx-pin::after, .msfx-coin, .msfx-rig .msfx-glow, .msfx-new {
    animation: none !important;
  }
  .msfx-coin { display: none; }
}

/* Official character in sim empty states (display only, 2026-11-30) */
.sim-char { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; vertical-align: middle; margin-right: 10px; border: 1px solid #39415F; box-shadow: 0 0 12px rgba(245,197,66,.2); }

/* ---------- MOBILE OVERFLOW FIX v1 (2026-11-30) — see styles.css note. */
.sim-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sim-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sim-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.ss-page .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.ss-page .prize-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ss-gauges { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ss-train-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.msfx-regions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ss-stat-row { grid-template-columns: 38px minmax(0, 1fr) 30px; }
.ss-lane { grid-template-columns: 118px minmax(0, 1fr); }
.ss-horses { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.ss-jockeys { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
@media (max-width: 860px) {
  .sim-grid { grid-template-columns: minmax(0, 1fr); }
  .sim-stats, body.ss-page .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) { .ss-train-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .msfx-regions { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { body.ss-page .prize-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .sim-form { grid-template-columns: minmax(0, 1fr); }
  .ss-lane { grid-template-columns: 86px minmax(0, 1fr); }
}
.sim-grid > *, .sim-stats > *, .sim-form > *, .stat-grid > *,
.prize-grid > *, .ss-gauges > *, .ss-train-grid > *, .msfx-regions > *,
.ss-horses > *, .ss-jockeys > * { min-width: 0; }
.msfx-rigcell { min-width: 0; }

/* --- AUREA Derby raising layer (#99) ------------------------------------ */
body.ss-page .ss-raisemeta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  margin: 8px 0 2px; font-size: 13px;
}
body.ss-page .ss-moodrow { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
body.ss-page .ss-moodrow .k { color: var(--muted, #A7ACC2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
body.ss-page .ss-mood { display: inline-flex; gap: 3px; }
body.ss-page .ss-mood i { width: 10px; height: 10px; border-radius: 50%; background: #39415F; display: inline-block; }
body.ss-page .ss-mood i.on.m0 { background: #e5484d; }
body.ss-page .ss-mood i.on.m1 { background: #f76b15; }
body.ss-page .ss-mood i.on.m2 { background: #ffd60a; }
body.ss-page .ss-mood i.on.m3 { background: #46a758; }
body.ss-page .ss-mood i.on.m4 { background: #f5c542; box-shadow: 0 0 6px rgba(245,197,66,.8); }
body.ss-page .ss-failrisk { color: #f76b15; font-size: 11px; font-weight: 700; }
body.ss-page .ss-skills { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
body.ss-page .ss-uniq {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  color: #1a1405; background: linear-gradient(90deg, #f5c542, #e8a33d);
  box-shadow: 0 0 8px rgba(245,197,66,.45);
}
body.ss-page .ss-skill {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid rgba(167,139,250,.55); color: #cdbffb; background: rgba(124,93,250,.12);
}
body.ss-page .ss-skill.hint { border-style: dashed; opacity: .85; }
body.ss-page .ss-goals { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 8px 0 2px; }
body.ss-page .ss-goals-label { font-size: 11px; color: var(--muted, #A7ACC2); text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
body.ss-page .ss-goal {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid #39415F; color: var(--muted, #A7ACC2); background: none;
}
body.ss-page .ss-goal.done { border-color: rgba(70,167,88,.6); color: #8fce9b; }
body.ss-page button.ss-goal.claim {
  border-color: #f5c542; color: #f5c542; cursor: pointer; font-weight: 700;
  box-shadow: 0 0 8px rgba(245,197,66,.35);
}
body.ss-page .ss-event-banner {
  display: block; width: 100%; margin-top: 8px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid #a78bfa; background: linear-gradient(90deg, rgba(124,93,250,.25), rgba(245,197,66,.18));
  color: #fff; font-weight: 700; cursor: pointer; text-align: left;
}
body.ss-page .ss-factors { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
body.ss-page .ss-factor {
  font-size: 12px; padding: 3px 9px; border-radius: 8px;
  border: 1px solid #39415F; background: rgba(255,255,255,.04);
}
body.ss-page .ss-factor b { color: #f5c542; }
body.ss-page .ss-factor.f-stat { border-color: rgba(245,197,66,.5); }
body.ss-page .ss-factor.f-apt { border-color: rgba(70,167,88,.5); }
body.ss-page .ss-factor.f-special { border-color: rgba(167,139,250,.6); }
body.ss-page .ss-retired { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
body.ss-page .ss-rank {
  font-size: 30px; font-weight: 900; line-height: 1; padding: 8px 12px; border-radius: 12px;
  border: 2px solid #39415F; color: #cdbffb; min-width: 64px; text-align: center;
}
body.ss-page .ss-rank.r-SS, body.ss-page .ss-rank.r-S {
  color: #1a1405; background: linear-gradient(135deg, #f5c542, #ffe9a8); border-color: #f5c542;
  box-shadow: 0 0 14px rgba(245,197,66,.5);
}
body.ss-page .ss-rank.r-A, body.ss-page .ss-rank.r-B { border-color: #a78bfa; color: #e4dcff; }
body.ss-page .ss-is-retired { opacity: .92; }
body.ss-page .ss-retire-btn { border-color: rgba(245,197,66,.6); color: #f5c542; }
body.ss-page .ss-evmodal {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center;
  background: rgba(5, 8, 18, .72); padding: 18px;
}
body.ss-page .ss-evmodal.open { display: flex; }
body.ss-page .ss-evbox {
  max-width: 440px; width: 100%; border-radius: 16px; padding: 20px;
  background: #10172e; border: 1px solid rgba(167,139,250,.6);
  box-shadow: 0 0 24px rgba(124,93,250,.35), 0 0 10px rgba(245,197,66,.25);
}
body.ss-page .ss-evbox h4 { margin: 0 0 8px; font-size: 18px; }
body.ss-page .ss-evbox p { margin: 0 0 14px; line-height: 1.55; }
body.ss-page .ss-evbtns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Points -> SG exchange panel (patch #99 section 16) */
body.ss-page .ss-fund-bal { font-size: 15px; font-weight: 700; margin: 10px 0 4px; }
body.ss-page .ss-fund-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
body.ss-page .ss-fund-rate { color: #f5c542; font-weight: 700; font-size: 13px; }
body.ss-page .ss-fund-presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
body.ss-page .ss-fund-presets .mini-btn.on { background: linear-gradient(135deg, #f5c542, #ffe9a8); color: #1a1405; border-color: #f5c542; }
body.ss-page .ss-fund-presets .mini-btn:disabled { opacity: .4; cursor: default; }
body.ss-page .ss-fund-choices { margin-top: 14px; border-top: 1px solid #39415F; padding-top: 10px; }
body.ss-page .ss-fund-choices a.mini-btn { display: inline-block; text-decoration: none; }
