/* ================= Page layout ================= */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* 👑 Logo: header bar, loading screen, welcome screen */
:root { --brandH: 0px; }   /* the logo sits inside the tab bar, so it takes no extra height */
#brand { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: flex; cursor: pointer; }
#brand img { height: 48px; width: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)); }
#brand img.icon { height: 40px; border-radius: 22%; }
#loading {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 50% 45%, #3c0a57 0%, #14151f 75%);
  transition: opacity 0.45s ease;
}
#loading.fade { opacity: 0; pointer-events: none; }
#loading img { width: min(240px, 55vw); border-radius: 22%; box-shadow: 0 0 60px rgba(255, 200, 60, 0.35); animation: loadPulse 1.6s ease-in-out infinite; }
#loading .bar { width: min(240px, 55vw); height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
#loading .bar::after { content: ""; display: block; width: 40%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ffb300, #ffe27a); animation: loadBar 1.1s ease-in-out infinite; }
#loading .txt { color: #ffd34d; font: 600 16px system-ui, sans-serif; letter-spacing: 0.5px; }
@keyframes loadPulse { 50% { transform: scale(1.04); } }
@keyframes loadBar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 🏠 Main menu (start page): background picture + separate logo and buttons */
#mainMenu { position: fixed; inset: 0; z-index: 90; overflow: hidden;
  background: #1b1140 url("../assets/logo/menu-bg-blur.webp") center / cover; }
#mainMenu::before { content: ""; position: absolute; inset: -40px; background: inherit; filter: blur(24px) brightness(0.55); }
#menuStage { position: absolute; left: 0; top: 0; width: 1672px; height: 941px; transform-origin: 0 0;
  background: url("../assets/logo/menu-bg.webp") 0 0 / 100% 100%; box-shadow: 0 0 80px rgba(0, 0, 0, 0.6); }
/* Logo and buttons are separate pictures on top of the background; button text is real text.
   A button element covers only the frame; its picture (crown, ornaments) overhangs it. */
#menuLogo { position: absolute; left: 900px; top: 92px; width: 420px; pointer-events: none; user-select: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45)); }
.menuBtn { position: absolute; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer;
  overflow: visible; transition: transform 0.12s ease; -webkit-tap-highlight-color: transparent; }
.menuBtn img { position: absolute; left: -2.63%; top: -53.7%; width: 105.26%; pointer-events: none; user-select: none; }
.menuLabel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0.32em;
  font-family: "Lilita One", "Arial Black", system-ui, sans-serif; font-size: 30px; letter-spacing: 0.5px; color: #fff;
  -webkit-text-stroke: 1.5px rgba(40, 20, 0, 0.55); paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 10px rgba(0, 0, 0, 0.35); pointer-events: none; padding-top: 2px; }
.menuBtn.mGreen .menuLabel { font-size: 36px; }
.menuLabel svg { width: 0.95em; height: 0.95em; fill: url(#menuGold); filter: drop-shadow(0 1.5px 0 rgba(60, 30, 0, 0.7)); }
/* effects go on the picture (not the button box), so the glow follows the real outline */
.menuBtn img { transition: filter 0.15s ease; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.menuBtn:hover, .menuBtn:focus-visible { transform: scale(1.045); outline: none; }
.menuBtn:hover img, .menuBtn:focus-visible img { filter: brightness(1.13) drop-shadow(0 0 14px rgba(255, 214, 90, 0.9)); }
.menuBtn:active { transform: scale(0.97) translateY(2px); transition-duration: 0.05s; }
.menuBtn:active img { filter: brightness(0.95) drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5)); }
.menuBtn.mGreen:not(:hover) img { animation: playGlow 2.4s ease-in-out infinite; }
@keyframes playGlow { 50% { filter: brightness(1.08) drop-shadow(0 0 14px rgba(130, 255, 150, 0.6)); } }
.menuBtn.soon { cursor: default; }
.menuBtn.soon:hover { transform: none; }
.menuBtn.soon:hover img { filter: brightness(1.04) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
body.menuOpen #tipCard, body.menuOpen #tutBubble, body.menuOpen #alerts { display: none !important; }
/* ⚙️ Ornate settings panel (9-slice gold frame + crown ribbon + gold buttons) */
#modalBox.ornate { background: none; border: 0; box-shadow: none; padding: 0; max-width: 470px; width: min(470px, 94vw); overflow: visible; }
.orPanel { position: relative; border-style: solid; border-width: 58px 52px 52px;
  border-image: url("../assets/ui/panel.webp") 150 fill / 58px 52px 52px stretch;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6)); margin-top: 52px; padding-top: 26px; text-align: left; color: #fff; }
.orRibbon { position: absolute; left: 50%; top: -112px; width: 112%; transform: translateX(-50%); aspect-ratio: 1100 / 346;
  background: url("../assets/ui/ribbon.webp") 0 0 / 100% 100%; pointer-events: none; }
.orRibbon span { position: absolute; left: 0; right: 0; top: 60.6%; transform: translateY(-50%); text-align: center;
  font-family: "Lilita One", "Arial Black", system-ui, sans-serif; font-size: 30px; color: #fff3c4; letter-spacing: 1px;
  -webkit-text-stroke: 1.5px rgba(70, 0, 0, 0.6); paint-order: stroke fill; text-shadow: 0 2px 0 rgba(0,0,0,0.45); }
.orClose { position: absolute; right: -40px; top: -46px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 2px solid #ffd34d; background: radial-gradient(circle at 35% 30%, #5b3fa8, #1d1050); color: #ffe7a0;
  font-size: 18px; font-weight: 900; line-height: 1; box-shadow: 0 3px 8px rgba(0,0,0,0.5); }
.orClose:hover { filter: brightness(1.2); transform: scale(1.06); }
.orSec { font-family: "Lilita One", "Arial Black", system-ui, sans-serif; color: #ffd34d; font-size: 15px; letter-spacing: 1.5px;
  text-transform: uppercase; margin: 8px 4px 6px; display: flex; align-items: center; gap: 8px; }
.orSec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 211, 77, 0.6), transparent); }
.orSec:first-of-type { margin-top: 0; }
.orRow { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 6px; padding: 9px 12px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(255, 211, 77, 0.22);
  color: #fff; font: 600 15px system-ui, sans-serif; text-align: left; cursor: pointer; transition: background 0.12s, border-color 0.12s, transform 0.08s; }
.orRow:hover { background: linear-gradient(180deg, rgba(255, 211, 77, 0.18), rgba(255, 211, 77, 0.06)); border-color: rgba(255, 211, 77, 0.7); }
.orRow:active { transform: scale(0.985); }
.orRow svg { width: 22px; height: 22px; flex: 0 0 22px; fill: url(#menuGold); filter: drop-shadow(0 1px 0 rgba(60, 30, 0, 0.7)); }
.orRow .grow { flex: 1; }
.orRow.off { cursor: default; opacity: 0.55; }
.orRow.off:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border-color: rgba(255, 211, 77, 0.22); }
.orSoon { font-size: 11px; font-weight: 800; color: #2b2100; background: #ffd34d; border-radius: 999px; padding: 2px 8px; }
.orSwitch { width: 46px; height: 24px; border-radius: 999px; background: #3a3355; border: 2px solid #8a7a40; position: relative; transition: background 0.15s; flex: 0 0 46px; }
.orSwitch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #d9a400); transition: left 0.15s; }
.orSwitch.on { background: #2e8b3a; border-color: #ffd34d; }
.orSwitch.on::after { left: 24px; }
/* 🌗 background brightness: a dark layer between the background art and the game */
#bgDim { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: #05040c; opacity: 0; }
.orRow.slider { cursor: default; flex-wrap: wrap; }
.orRow.slider:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border-color: rgba(255, 211, 77, 0.22); }
.orVal { font-weight: 800; color: #ffd34d; min-width: 44px; text-align: right; }
.orRange { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; margin: 6px 0 2px; cursor: pointer;
  background: linear-gradient(90deg, #ffd34d var(--p, 100%), #3a3355 var(--p, 100%)); border: 1px solid #8a7a40; }
.orRange::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #8a5a00;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #d9a400); box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.orRange::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #8a5a00; background: radial-gradient(circle at 35% 30%, #fff6c8, #d9a400); }
.orNote { color: #c6bfe8; font-size: 13px; text-align: center; min-height: 18px; margin: 4px 0 8px; }
.orBtns { display: flex; gap: 10px; }
.orBtn { position: relative; flex: 1; border: 0; padding: 0; background: 0 / 100% 100% no-repeat; cursor: pointer;
  transition: transform 0.12s, filter 0.15s; }
.orBtn.orBlue { aspect-ratio: 1000 / 256; background-image: url("../assets/ui/btn-blue.webp"); }
.orBtn.orRed { aspect-ratio: 1000 / 268; background-image: url("../assets/ui/btn-red.webp"); }
.orBtn span { position: absolute; left: 0; right: 0; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: "Lilita One", "Arial Black", system-ui, sans-serif; font-size: 18px; color: #fff; letter-spacing: 0.3px;
  -webkit-text-stroke: 1px rgba(30, 10, 0, 0.55); paint-order: stroke fill; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.orBtn.orBlue span { top: 47%; } .orBtn.orRed span { top: 43.5%; }
.orBtn span svg { width: 17px; height: 17px; fill: url(#menuGold); }
.orBtn:hover { transform: scale(1.04); filter: brightness(1.12) drop-shadow(0 0 10px rgba(255, 214, 90, 0.7)); }
.orBtn:active { transform: scale(0.97) translateY(1px); }
@media (max-width: 520px) { .orPanel { padding-top: 14px; border-width: 50px 34px 44px; border-image-width: 50px 34px 44px; } .orClose { right: -22px; } .orBtn span { font-size: 15px; } }

.secretCard { border-color: rgba(170, 120, 255, 0.55); box-shadow: 0 0 18px rgba(150, 100, 255, 0.18); }
.secretTag { font-size: 12px; font-weight: 800; color: #d7b8ff; background: rgba(140, 90, 255, 0.22); border: 1px solid rgba(170, 120, 255, 0.5); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.recruitCols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: left; max-height: 58vh; overflow-y: auto; margin: 10px 0 14px; }
@media (max-width: 640px) { .recruitCols { grid-template-columns: 1fr; } }
.recruitCol h3 { margin: 0 0 8px; color: #ffd34d; }
.recruitCol label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
.recruitCol select { flex: 0 0 60%; padding: 5px 6px; border-radius: 8px; border: 1px solid #555566; background: #1c1d2b; color: #fff; font: inherit; font-size: 13px; }
.recruitErr { color: #ff8a8a; min-height: 18px; font-weight: 700; }
#modalBox.about { text-align: left; max-height: 86vh; overflow-y: auto; }
#modalBox.about h2, #modalBox.about .aboutLogo { text-align: center; }
#modalBox.about h3 { color: #ffd34d; margin: 18px 0 6px; font-size: 18px; }
#modalBox.about ul { margin: 4px 0; padding-left: 22px; line-height: 1.5; }
#modalBox.about p { line-height: 1.5; margin: 6px 0; }
#modalBox.about details { margin-top: 10px; }
#modalBox.about summary { cursor: pointer; color: #ffd34d; font-weight: 600; }
#modalBox .aboutLogo img { width: min(260px, 60vw); }
#modalBox.about .closeRow { text-align: center; margin-top: 16px; }
.menuSettings { display: flex; flex-direction: column; gap: 8px; margin: 12px auto 4px; max-width: 320px; }
.menuSettings button { width: 100%; }
#modalBox .awayLogo { width: min(260px, 70vw); display: block; margin: -4px auto 4px; }   /* hidden elements always stay hidden */

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 30% 50%, #2b2d42 0%, #14151f 100%);
  color: #fff;
  user-select: none;
}

#game {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  min-height: calc(100vh - 56px - var(--brandH));
}

#incomeView { display: flex; }
#incomeView[hidden], #casinoView[hidden], #investView[hidden], #shopView[hidden], #logisticsView[hidden], #wikiView[hidden], #artView[hidden] { display: none; }
#artView { max-width: 1100px; margin: 0 auto; padding: 20px; }
#artStudio[hidden], #artCollection[hidden], #artOpen[hidden], #artLocked[hidden] { display: none; }
.artBoards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.artBoards canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.15); display: block; }
#artDraw { cursor: crosshair; touch-action: none; }
.artLabel { margin-bottom: 4px; font-weight: 700; }
.artTools { margin-top: 12px; }
.artPalette { display: flex; flex-wrap: wrap; gap: 6px; }
.artColor { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); cursor: pointer; }
.artColor.on { outline: 3px solid #ffd34d; outline-offset: 2px; }
.artToolRow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.artAngle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 8px; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; }
.artAngle[hidden] { display: none; }
.artAngle input { width: 110px; accent-color: #ffd34d; }
.artAngle b { min-width: 34px; display: inline-block; }
.sizeDot { display: inline-block; border-radius: 50%; background: currentColor; vertical-align: middle; }
.artResult { display: flex; gap: 18px; align-items: center; margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(255, 211, 77, 0.08); border: 1px solid rgba(255, 211, 77, 0.4); }
.artScore { font-size: 40px; font-weight: 900; color: #ffd34d; text-align: center; line-height: 1; }
.artScore small { display: block; font-size: 12px; color: #9a9ab0; }
.artGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.artCard { padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); display: grid; gap: 8px; }
.artPair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.artPair img, .artCopy { width: 100%; border-radius: 6px; display: block; }
@media (max-width: 700px) { .artBoards { grid-template-columns: 1fr; } .artResult { flex-direction: column; text-align: center; } }
#wikiView { max-width: 1100px; margin: 0 auto; padding: 20px; }
.wikiBody h2 { margin: 0 0 10px; }
.wikiBody h3 { margin: 22px 0 8px; color: #ffd34d; }
.wikiBody p, .wikiBody li { line-height: 1.55; }
.wikiTable { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.wikiTable th { text-align: left; color: #9a9ab0; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.wikiTable td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
.wikiTable tr:hover td { background: rgba(255,255,255,0.03); }
.wikiCols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .wikiCols { grid-template-columns: 1fr; } .wikiTable { font-size: 12px; } }
#logisticsView { max-width: 900px; margin: 0 auto; padding: 20px; }
.tankerGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 12px; }
@media (max-width: 860px) { .tankerGrid { grid-template-columns: 1fr; } }
.tanker { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 12px; }
.tanker.sailing { border-color: rgba(127, 209, 255, 0.5); }
.tanker.emptySlot { border-style: dashed; text-align: center; color: #8d8da3; padding: 22px 12px; }
.offers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.offer { text-align: left; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
         padding: 9px; color: #fff; cursor: pointer; font: inherit; font-size: 13px; line-height: 1.45; }
.agentToggle { margin-left: auto; margin-right: 8px; }
.btn.ghost.agentToggle.on { background: #2e9e5b; border-color: #5fd68e; color: #fff; }
.agentNote { margin-top: 6px; font-size: 13px; color: #8fd3ff; }
.offer:hover { border-color: #ffd34d; background: rgba(255, 211, 77, 0.08); }
.offer b.route { display: block; font-size: 13px; margin-bottom: 2px; }
.offer .long { color: #ffd34d; font-weight: 800; font-size: 11px; }
.sea { position: relative; height: 34px; margin: 10px 0 4px; border-radius: 999px; overflow: hidden;
       background: linear-gradient(90deg, #0d3b66, #1565a6, #0d3b66); }
.sea .wake { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,0.15); }
.sea .ship { position: absolute; top: 50%; transform: translate(-50%, -50%) scaleX(-1); font-size: 22px; transition: left 1s linear; }
.sea.road { background: linear-gradient(180deg, #3a3a44 0 44%, #f5f5f5 44% 56%, #3a3a44 56% 100%); }
.sea.road .wake { background: rgba(255, 211, 77, 0.18); }
.sea.sky { background: linear-gradient(180deg, #4fa3e0, #9fd3f7); }
.sea.sky .wake { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.75) 0 10px, transparent 10px 16px); height: 3px; top: 50%; bottom: auto; }
.sea.sky .ship { transform: translate(-50%, -50%) rotate(45deg); }
.offer.express { border-color: #ffb300; background: rgba(255, 179, 0, 0.12); }
.offer .exp { color: #ffb300; font-weight: 900; font-size: 11px; }
.sea .port { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; }
#shopView { max-width: 900px; margin: 0 auto; padding: 20px; }
.cosmetics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.cosmetic { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; overflow: hidden; }
.cosmetic.on { border-color: #ffd34d; box-shadow: 0 0 16px rgba(255, 211, 77, 0.35); }
.cosmetic .preview { height: 170px; display: flex; align-items: center; justify-content: center; background: #15162a center / cover no-repeat; }
.cosmetic .preview img { height: 150px; width: 150px; }
.cosmetic .info { padding: 12px 14px; }
.cosmetic .info .row { margin-top: 10px; }
.switch { position: relative; width: 52px; height: 28px; border-radius: 999px; border: none; cursor: pointer; background: #555566; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.switch.on { background: #1fbf5a; }
.switch.on::after { left: 27px; }

/* Wow So Rich cosmetics */
body.emperorBg {
  background: linear-gradient(rgba(12, 12, 22, 0.8), rgba(12, 12, 22, 0.88)), url("../assets/emperor-background.jpg") center / cover fixed;
}
#coin.emperorCoin { background: url("../assets/emperor-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
body.royalBg {
  background: linear-gradient(rgba(12, 12, 22, 0.8), rgba(12, 12, 22, 0.88)), url("../assets/royal-background.jpg") center / cover fixed;
}
body.wowBg {
  background: linear-gradient(rgba(12, 12, 22, 0.78), rgba(12, 12, 22, 0.86)), url("../assets/wow-background.jpg") center / cover fixed;
}
#coin.wowCoin { background: url("../assets/wow-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.wowCoin::after { content: none; }
#coin.royalCoin { background: url("../assets/royal-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.royalCoin::after { content: none; }
body.rainBg {
  background: linear-gradient(rgba(12, 12, 22, 0.76), rgba(12, 12, 22, 0.86)), url("../assets/rain-background.jpg") center / cover fixed;
}
#coin.rainCoin { background: url("../assets/rain-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.rainCoin::after { content: none; }
body.aheadBg {
  background: linear-gradient(rgba(12, 12, 22, 0.76), rgba(12, 12, 22, 0.86)), url("../assets/ahead-background.jpg") center / cover fixed;
}
#coin.aheadCoin { background: url("../assets/ahead-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
body.artistBg {
  background: linear-gradient(rgba(12, 12, 22, 0.74), rgba(12, 12, 22, 0.86)), url("../assets/artist-background.jpg") center / cover fixed;
}
#coin.artistCoin { background: url("../assets/artist-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.artistCoin::after { content: none; }
body.bullBg {
  background: linear-gradient(rgba(12, 12, 22, 0.74), rgba(12, 12, 22, 0.86)), url("../assets/bull-background.jpg") center / cover fixed;
}
#coin.bullCoin { background: url("../assets/bull-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.bullCoin::after { content: none; }
body.sharkBg {   /* already a dark, moody picture: lighter overlay */
  background: linear-gradient(rgba(12, 12, 22, 0.58), rgba(12, 12, 22, 0.76)), url("../assets/shark-background.jpg") center / cover fixed;
}
#coin.sharkCoin { background: url("../assets/shark-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.sharkCoin::after { content: none; }
body.spaceBg {
  background: linear-gradient(rgba(12, 12, 22, 0.74), rgba(12, 12, 22, 0.86)), url("../assets/space-background.jpg") center / cover fixed;
}
#coin.spaceCoin { background: url("../assets/space-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.spaceCoin::after { content: none; }
body.globalBg {
  background: linear-gradient(rgba(12, 12, 22, 0.74), rgba(12, 12, 22, 0.86)), url("../assets/global-background.jpg") center / cover fixed;
}
#coin.globalCoin { background: url("../assets/global-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.globalCoin::after { content: none; }
body.jackpotBg {
  background: linear-gradient(rgba(12, 12, 22, 0.76), rgba(12, 12, 22, 0.87)), url("../assets/jackpot-background.jpg") center / cover fixed;
}
#coin.jackpotCoin { background: url("../assets/jackpot-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.jackpotCoin::after { content: none; }
body.goldrushBg {   /* already a dark picture: lighter overlay */
  background: linear-gradient(rgba(12, 12, 22, 0.55), rgba(12, 12, 22, 0.75)), url("../assets/goldrush-background.jpg") center / cover fixed;
}
#coin.goldrushCoin { background: url("../assets/goldrush-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.goldrushCoin::after { content: none; }
/* 🏅 Level 99 master coins (rewards) */
#coin.gambler99Coin { background: url("../assets/gambler99-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.gambler99Coin::after { content: none; }
#coin.investor99Coin { background: url("../assets/investor99-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.investor99Coin::after { content: none; }
#coin.logistics99Coin { background: url("../assets/logistics99-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.logistics99Coin::after { content: none; }
body.strongmanBg {   /* muted, grey picture: medium overlay */
  background: linear-gradient(rgba(12, 12, 22, 0.66), rgba(12, 12, 22, 0.8)), url("../assets/strongman-background.jpg") center / cover fixed;
}
#coin.strongmanCoin { background: url("../assets/strongman-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.strongmanCoin::after { content: none; }
#coin.aheadCoin::after { content: none; }

#shop {
  width: 420px;
  max-height: calc(100vh - 56px - var(--brandH));
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
}

/* On phones: coin on top, shop underneath */
@media (max-width: 800px) {
  #incomeView { flex-direction: column; }
  #game { min-height: 70vh; }
  #shop { width: 100%; max-height: none; border-left: none; overflow: visible; }   /* the page scrolls, so the sub-tabs can stick */
}

/* ================= Tabs ================= */
#settingsWrap { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
#settingsBtn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #555566; background: transparent;
  font-size: 18px; cursor: pointer;
}
#settingsBtn:hover { border-color: #ffd34d; background: rgba(255, 211, 77, 0.1); }
#settingsMenu {
  position: absolute; right: 0; top: 46px; width: 250px; z-index: 50;
  background: #2b2d42; border: 1px solid #555566; border-radius: 12px; padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
#settingsMenu button {
  display: block; width: 100%; text-align: left; background: transparent; color: #fff; border: none;
  font: inherit; font-size: 14px; padding: 10px; border-radius: 8px; cursor: pointer;
}
#settingsMenu button:hover { background: rgba(255, 255, 255, 0.08); }
#settingsMenu button.danger { color: #ff8a8a; }
#settingsMenu .muted { padding: 6px 10px 2px; font-size: 12px; }
#modalBox .row { justify-content: center; gap: 10px; }
button.btn.dangerBtn { background: #d62828; color: #fff; }
button.btn.dangerBtn:hover:not(:disabled) { background: #e63939; }

#tabs {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* frosted, almost solid bar: content scrolling underneath can't show through */
  background: rgba(14, 12, 30, 0.96);
  /* (no backdrop blur: it was recalculated on the graphics card every frame and slowed other browser tabs) */
  border-bottom: 1px solid rgba(255, 211, 77, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  background: transparent;
  color: #c9c9d6;
  border: 1px solid #555566;
  border-radius: 999px;
  padding: 8px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tab.active { background: #ffd34d; color: #2b2100; border-color: #ffd34d; }
@media (max-width: 1500px) { .tab { padding: 8px 14px; } }   /* leaves room for the logo on the left */

/* ================= Casino ================= */
#casinoView { max-width: 900px; margin: 0 auto; padding: 20px; }
.wallet { display: flex; gap: 14px; flex-wrap: wrap; }
.wallet .stat { flex: 1; min-width: 160px; }
.stat .label { color: #9a9ab0; font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 800; color: #ffd34d; }
.stat .value.chips { color: #7fd1ff; }
.moneyRow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.moneyRow input {
  width: 190px; padding: 8px; border-radius: 8px; border: 1px solid #555566;
  background: #1c1d2b; color: #fff; font: inherit;
}
.debtBanner {
  display: block; width: 100%; margin-bottom: 14px; padding: 10px;
  background: #d62828; color: #fff; border: 2px solid #ff8a8a; border-radius: 10px;
  font: inherit; font-weight: 800; cursor: pointer; animation: pulse 1s ease-in-out infinite;
}
.debtBanner[hidden] { display: none; }
#casinoLevel .levelNum {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #2b2100;
  background: radial-gradient(circle at 35% 30%, #fff6c2, #ffd34d 55%, #c98a00);
  box-shadow: 0 0 16px rgba(255, 211, 77, 0.45);
}
#casinoLevel .xpBar { height: 16px; background: #1c1d2b; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
#casinoLevel .xpFill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #7fd1ff, #b388ff);
  transition: width 0.6s ease;
}
.allTime { margin-top: 6px; font-size: 14px; }
#investAllTime { display: flex; flex-wrap: wrap; gap: 4px 16px; }
#investAllTime .total { font-weight: 800; }
#casinoLevel.levelUp { animation: levelGlow 1.2s ease; }
@keyframes levelGlow { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 30px #ffd34d; } }
.gameGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.gameGrid .gameCard { margin-bottom: 0; height: 100%; }
.gameCard { cursor: pointer; text-align: left; width: 100%; font: inherit; color: #fff; }
.gameCard:hover { border-color: #ffd34d; }

/* ================= Investing ================= */
#investView { max-width: 1100px; margin: 0 auto; padding: 20px; }
.subLayout { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; }
.subNav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 8px; }
.subTab { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12);
          background: rgba(22, 18, 44, 0.92);
          color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.subTab:hover { background: rgba(48, 40, 84, 0.9); }
.subTab.active { background: #ffd34d; color: #2b2200; border-color: #ffd34d; }
.subMain > div > .card:first-child { margin-top: 0; }
#investPane[hidden], #livePane[hidden] { display: none; }
.cardMsg { margin-top: 8px; min-height: 0; font-weight: 700; }
@media (max-width: 760px) {
  .subLayout { grid-template-columns: 1fr; }
  .subNav { position: static; flex-direction: row; }
  .subTab { flex: 1; text-align: center; }
}
.levelCard { gap: 16px; justify-content: flex-start; }
.levelCard .levelNum {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #0b2a1a;
  background: radial-gradient(circle at 35% 30%, #d9ffe8, #5be08f 55%, #1f8a4c);
  box-shadow: 0 0 16px rgba(91, 224, 143, 0.45);
}
.levelCard .xpBar { height: 16px; background: #1c1d2b; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.levelCard .xpFill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #5be08f, #7fd1ff); transition: width 0.6s ease; }
.levelCard.levelUp { animation: levelGlow 1.2s ease; }
.bigValue { font-size: 28px; font-weight: 800; }
.up { color: #5be08f; }
.down { color: #ff6b6b; }
.property {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); margin-bottom: 6px; font-size: 14px;
}
.property .grow { flex: 1; }
#etfHistory, .etfHist { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
#etfHistory span, .etfHist span { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,0.06); }
#investMsg { min-height: 18px; }
.chartBox { position: relative; margin-top: 10px; background: #15161f; border-radius: 10px; padding: 8px 8px 4px; }
.chartBox svg { display: block; width: 100%; height: 190px; }
.chartHead { display: flex; justify-content: space-between; font-size: 13px; color: #9a9ab0; padding: 0 4px 4px; }
.chartTip {
  position: absolute; pointer-events: none; background: #2b2d42; border: 1px solid #555566;
  border-radius: 6px; padding: 4px 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%);
}
.infoBox { margin-top: 6px; padding: 8px 10px; border-left: 3px solid #7fd1ff; background: rgba(127, 209, 255, 0.06); border-radius: 6px; }
.infoBox[hidden] { display: none; }
[data-info].open { color: #7fd1ff; border-color: #7fd1ff; }

/* Roulette wheel */
.rouletteTop { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; justify-content: center; }
#wheelWrap { position: relative; width: 280px; height: 280px; }
#wheel {   /* the wheel picture (assets/roulette-wheel.webp) turns; the ball is drawn on top */
  width: 280px; height: 280px; border-radius: 50%; position: relative;
  background: url("../assets/roulette-wheel.webp") center / contain no-repeat;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.6));
}
#ball {
  position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; z-index: 5;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e6e6e6 45%, #9a9a9a 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

#result { text-align: center; min-width: 180px; }
#resultNum {
  width: 90px; height: 90px; margin: 0 auto 8px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 900; background: #333344;
}
#history { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin-top: 8px; max-width: 220px; }
#history span {
  width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.red { background: #c62828 !important; }
.black { background: #1b1b1b !important; }
.green { background: #2e7d32 !important; }

/* ================= Blackjack ================= */
.bjFelt {
  background: radial-gradient(ellipse at 50% 0%, #2a7a4a 0%, #1e5631 60%, #164226 100%);
  border-radius: 16px; padding: 16px; margin-top: 12px; border: 6px solid #5a3a14;
}
.bjDealer { text-align: center; min-height: 150px; }
.bjLabel { font-size: 13px; color: #d7f5df; opacity: 0.8; margin-bottom: 6px; }
.bjTotal { display: inline-block; margin-top: 6px; background: rgba(0,0,0,0.35); padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.cardsRow { display: flex; justify-content: center; gap: 6px; min-height: 104px; flex-wrap: wrap; }
.pcard {
  width: 62px; height: 100px; border-radius: 8px; background: #fff; color: #1b1b1b;
  box-shadow: 0 3px 8px rgba(0,0,0,0.45); position: relative; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.pcard.redSuit { color: #c62828; }
.pcard .corner { position: absolute; top: 4px; left: 6px; font-size: 15px; line-height: 1; text-align: center; }
.pcard .corner.br { top: auto; left: auto; bottom: 4px; right: 6px; transform: rotate(180deg); }
.pcard.face, .pcard.back { background: center / 100% 100% no-repeat; }
.pcard.back { background-image: var(--card-back, url("../assets/cards/back.webp")); }
.cardsPreview { display: flex; align-items: center; justify-content: center; gap: 0; background: radial-gradient(circle, #1f5a3a, #0f2e1e) !important; }
.cardsPreview img { width: 30% !important; height: auto !important; border-radius: 6px; box-shadow: 0 3px 8px rgba(0,0,0,0.5); margin: 0 -4%; }
.cardsPreview img:nth-child(1) { transform: rotate(-10deg) translateY(6%); }
.cardsPreview img:nth-child(3) { transform: rotate(10deg) translateY(6%); }
.pcard.deal { animation: dealIn 0.35s ease-out; }
@keyframes dealIn { from { opacity: 0; transform: translate(0, -60px) rotate(-8deg) scale(0.8); } to { opacity: 1; transform: none; } }
/* Achievements */
#achievementsView { max-width: 900px; margin: 0 auto; padding: 20px; }
.achHead { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.achGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }
.ach .ico { font-size: 28px; width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,0.3); filter: grayscale(1); opacity: 0.5; }
.ach.done { border-color: #ffd34d; background: rgba(255, 211, 77, 0.09); }
.ach.done .ico { filter: none; opacity: 1; background: radial-gradient(circle, #ffe680, #c98a00); }
.ach .nm { font-weight: 800; }
.ach .bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.1); margin-top: 6px; overflow: hidden; }
.ach .bar div { height: 100%; background: linear-gradient(90deg, #6ec6ff, #b388ff); }
#modalBox.wide { max-width: 760px; width: 92vw; border-color: #6ec6ff; box-shadow: 0 0 40px rgba(110, 198, 255, 0.35); }
.freeGrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 12px; }
.freeSlot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 74px; cursor: help; }
.freeSlot .chipMark { width: 54px; height: 54px; font-size: 13px; }
.freeSlot .ftime { font-size: 12px; color: #8fd3ff; font-variant-numeric: tabular-nums; }
.freeSlot .fcount { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.freeSlot.full .ftime { color: #7dffa8; }
.freeSlot.locked .chipMark { filter: grayscale(1); opacity: 0.35; }
.freeSlot.locked .ftime, .freeSlot.locked .fcount { color: #6b7088; }
.freeSlot .lock { position: absolute; top: -6px; left: 4px; font-size: 14px; }
.freeSlot.vip .chipMark { box-shadow: 0 0 0 3px #ffd34d; }
.freeSlot .vipTag { position: absolute; top: -6px; right: 2px; font-size: 14px; }
.freeSlot:nth-child(-n+2):hover::after { left: 0; transform: none; }
.freeSlot:nth-last-child(-n+2):hover::after { left: auto; right: 0; transform: none; }
.freeSlot:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: 210px; padding: 8px 10px; border-radius: 10px; background: #111327; border: 1px solid #b388ff;
  color: #fff; font-size: 12px; line-height: 1.35; text-align: center; z-index: 20; white-space: normal; pointer-events: none;
}
.chip.free { position: relative; box-shadow: 0 0 0 3px #b388ff; }
.chip.free i { position: absolute; bottom: -6px; right: -8px; font-style: normal; font-size: 10px; background: #b388ff; color: #1a1030; border-radius: 999px; padding: 0 4px; }
.freeRow { margin-top: 0; }
.cryptoRow { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 10px; }
.cryptoName { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.cryptoIcon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
              font-size: 22px; font-weight: 900; background: linear-gradient(160deg, #ffb300, #f57c00); color: #fff; }
.chartBox svg.cryptoSvg { display: block; width: 100%; height: 440px; }
#livePane .chartHead { font-size: 14px; }
#livePane .chartTip { font-size: 13px; }
.maLegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; font-weight: 700; padding: 0 4px 4px; }
#worldMap { position: relative; margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
#worldMap svg { display: block; width: 100%; height: auto; }
#worldMapWrap[hidden] { display: none; }
.mapLand polygon { fill: #2f4a3a; stroke: #4f7a5f; stroke-width: 0.8; stroke-linejoin: round; }
.mapGrid line { stroke: #ffffff; stroke-opacity: 0.05; stroke-width: 1; }
#mapRoutes polyline { fill: none; stroke-width: 1.3; stroke-dasharray: 4 4; opacity: 0.55; }
.mapIcon { cursor: pointer; }
.mapCity { cursor: help; }
.mapCity:hover circle:last-child { stroke: #fff; stroke-width: 1.5; }
.destRing { fill: none; stroke: #ffd34d; stroke-width: 1.5; animation: destPulse 1.6s ease-in-out infinite; }
@keyframes destPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.mapIcon:hover circle { stroke-width: 3; }
.mapIcon.idle { opacity: 0.85; }
.mapTip { position: absolute; width: 210px; padding: 8px 10px; border-radius: 10px; background: #111327; border: 1px solid #6ec6ff;
          font-size: 12px; line-height: 1.45; pointer-events: none; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
#mapCard .seg.on { background: #29b6f6; color: #06243a; }
.tradePanel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.tradePanel input { max-width: 180px; }
.seg.long.on { background: #26a69a; color: #fff; }
.seg.short.on { background: #ef5350; color: #fff; }
.btn.longBtn { background: #26a69a; color: #fff; }
.btn.shortBtn { background: #ef5350; color: #fff; }
.sideTag { font-weight: 900; font-size: 12px; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.sideTag.long { background: rgba(38,166,154,0.2); color: #4dd0c0; }
.sideTag.short { background: rgba(239,83,80,0.2); color: #ff8a80; }
.tradeExtra { margin-top: 6px; }
.tpslBox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #c9c9d9; font-weight: 700; }
.tpslBox input { width: 90px; }
.tpslCell { white-space: nowrap; }
.tpslCell .btn { padding: 1px 6px; margin-left: 2px; }
.orderTable th:first-child { color: #ffd34d; }
.posTable { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.posTable th { text-align: left; color: #9a9ab0; font-weight: 700; padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.posTable td { padding: 6px; border-bottom: 1px solid rgba(255,255,255,0.06); font-variant-numeric: tabular-nums; }
.posTable td.up { color: #5be08f; } .posTable td.down { color: #ff6b6b; }
.tradeLog { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; }
.tradeLog .up b { color: #5be08f; } .tradeLog .down b { color: #ff6b6b; }
@media (max-width: 640px) { .posTable { font-size: 11px; } .posTable th:nth-child(4), .posTable td:nth-child(4) { display: none; } }
.chartTools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.segGroup { display: inline-flex; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; overflow: hidden; }
.seg { background: #1b1c28; color: #c9c9da; border: none; border-right: 1px solid rgba(255,255,255,0.1);
       padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.seg:last-child { border-right: none; }
.seg:hover { background: #262838; }
.seg.on { background: #ffd34d; color: #2b2200; }
.seg.ma { color: var(--ma); }
.seg.ma.on { background: var(--ma); color: #15161f; }
.maGroup { margin-left: auto; }
.chartTools + .chartBox { margin-top: 6px; }
.cryptoStatus { font-size: 13px; font-weight: 800; color: #ffb347; margin-right: 8px; }
.cryptoStatus.on { color: #5be08f; }
.levelTableWrap { max-height: 55vh; overflow-y: auto; margin: 12px 0; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); }
.levelTable { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.levelTable th { position: sticky; top: 0; background: #23253a; padding: 6px 10px; }
.levelTable td { padding: 4px 10px; border-top: 1px solid rgba(255,255,255,0.06); font-variant-numeric: tabular-nums; }
.levelTable td:nth-child(2), .levelTable td:nth-child(3) { text-align: right; }
.levelTable tr.done td { color: #8a8fa8; }
.levelTable tr.now td { background: rgba(255, 211, 77, 0.18); color: #ffd34d; font-weight: 800; }
.alertPop.good { background: #7a5a00; border-color: #ffd34d; }
/* Red alert pop-ups (top right, don't pause the game) */
#alerts { position: fixed; top: 70px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.alertPop {
  background: #b71c1c; color: #fff; border: 2px solid #ff8a8a; border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5); cursor: pointer; animation: alertIn 0.3s ease-out;
}
.alertPop b { display: block; font-size: 16px; margin-bottom: 2px; }
.alertPop small { opacity: 0.8; }
@keyframes alertIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
/* Broken-down truck */
.tanker.broken { background: rgba(198, 40, 40, 0.22); border-color: #ff5252; box-shadow: 0 0 12px rgba(255, 82, 82, 0.35); }
.tanker.broken .brokeIcon { font-size: 34px; text-align: center; margin: 6px 0; }
/* Ultimate Texas Hold'em */
.uthRow { text-align: center; }
.uthRow .pcard, .uthSeat .pcard { width: 54px; height: 87px; font-size: 24px; }
.uthRow .pcard .corner, .uthSeat .pcard .corner { font-size: 13px; }
.uthRow .cardsRow, .uthSeat .cardsRow { min-height: 78px; gap: 5px; }
.uthBoard { margin: 14px 0; padding: 10px 0; border-top: 1px dashed rgba(255,255,255,0.2); border-bottom: 1px dashed rgba(255,255,255,0.2); }
.pcard.slot { background: rgba(0,0,0,0.18); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18); }
.uthSeats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.uthSeat { border: 2px dashed rgba(255,255,255,0.3); border-radius: 14px; padding: 10px; text-align: center; }
.uthSeat.active { border-style: solid; border-color: #ffd34d; background: rgba(255, 211, 77, 0.08); box-shadow: 0 0 14px rgba(255, 211, 77, 0.3); }
.uthSeat.folded .cardsRow { opacity: 0.4; }
.uthSpots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.uthSpot {
  width: 66px; height: 66px; border-radius: 50%; border: 2px dashed rgba(255,255,255,0.6); background: rgba(10, 20, 50, 0.3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; font-size: 10px; line-height: 1.1;
}
.uthSpot.click { cursor: pointer; }
.uthSpot.click:hover { border-color: #ffd34d; background: rgba(255, 211, 77, 0.12); }
.uthSpot.has { border-style: solid; }
.uthSpot .chipMark { width: 30px; height: 30px; font-size: 9px; }
.uthSpot.win { border-color: #5fd68e; box-shadow: 0 0 10px rgba(95, 214, 142, 0.6); }
.uthSpot.lose { opacity: 0.45; }
.uthHandName { font-weight: 800; font-size: 13px; color: #d7f5df; min-height: 18px; margin-top: 4px; }
.uthResult { font-weight: 900; margin-top: 4px; }
.uthResult.win { color: #7dffa8; } .uthResult.lose { color: #ff8a8a; } .uthResult.push { color: #ffd34d; }
.uthPayInfo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; }
.uthPayInfo table { width: 100%; border-collapse: collapse; }
.uthPayInfo td { padding: 2px 6px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.uthPayInfo td:last-child { text-align: right; }
@media (max-width: 640px) { .uthSeats, .uthPayInfo { grid-template-columns: 1fr; } }
/* Video poker */
.vpJackpot {
  text-align: center; margin: 12px 0 0; padding: 10px; border-radius: 12px;
  background: linear-gradient(90deg, #7a4b00, #c98a00, #7a4b00); border: 2px solid #ffd34d;
  box-shadow: 0 0 18px rgba(255, 211, 77, 0.35);
}
.vpJackpot .amt { font-size: 30px; font-weight: 900; color: #fff6c9; text-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.vpJackpot .sub { font-size: 13px; color: #ffefb0; }
.vpJackpot.won { animation: pulse 0.6s ease-in-out 6; }
.vpPay { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14px; }
.vpPayHead { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.vpTable { margin-top: 10px; }
.vpPay td { padding: 3px 10px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.vpPay td:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.vpPay tr.hit td { background: rgba(255, 211, 77, 0.25); color: #ffd34d; font-weight: 800; }
.vpPay tr.now td { color: #8fd3ff; }
.vpPay .jp { color: #ffd34d; }
.vpCards { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 140px; }
.vpSlot { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: default; }
.vpSlot.canHold { cursor: pointer; }
.vpSlot.canHold:hover .pcard { transform: translateY(-4px); }
.vpSlot .pcard { width: 78px; height: 126px; font-size: 34px; transition: transform 0.12s; }
.vpSlot .pcard .corner { font-size: 17px; }
.vpSlot.held .pcard { box-shadow: 0 0 0 3px #ffd34d, 0 3px 8px rgba(0,0,0,0.45); transform: translateY(-6px); }
.vpSlot .holdTag { font-size: 12px; font-weight: 900; letter-spacing: 1px; height: 18px; padding: 0 8px; border-radius: 6px; }
.vpSlot.held .holdTag { background: #ffd34d; color: #3a2a00; }
.vpCards .pcard.deal { animation-fill-mode: backwards; }
.vpHandName { text-align: center; margin-top: 10px; font-weight: 800; min-height: 22px; color: #d7f5df; }
@media (max-width: 640px) { .vpSlot .pcard { width: 56px; height: 90px; font-size: 24px; } .vpCards { gap: 5px; } }
.bjSeats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.bjSeat {
  border: 2px dashed rgba(255,255,255,0.35); border-radius: 14px; padding: 10px 6px; text-align: center;
  min-height: 190px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
}
.bjSeat.locked { cursor: default; }
.bjSeat:not(.locked):hover { border-color: #ffd34d; background: rgba(255, 211, 77, 0.06); }
.bjSeat .seatName { font-size: 12px; color: #d7f5df; opacity: 0.8; }
.bjHand { border-radius: 10px; padding: 6px; width: 100%; }
.bjHand.active { background: rgba(255, 211, 77, 0.15); box-shadow: 0 0 0 2px #ffd34d; }
.bjHand .pcard { width: 48px; height: 77px; font-size: 22px; }
.bjHand .pcard .corner { font-size: 12px; }
.bjHand .cardsRow { min-height: 70px; gap: 4px; }
.bjResult { font-weight: 800; font-size: 13px; margin-top: 4px; }
.bjResult.win { color: #9fe39f; } .bjResult.lose { color: #ff8a8a; } .bjResult.push { color: #ffd34d; }
.bjSeat .chipMark { width: 40px; height: 40px; font-size: 12px; }
.bjActions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.bjActions .btn { min-width: 92px; }
@media (max-width: 640px) { .bjSeats { gap: 4px; } .bjHand .pcard { width: 38px; height: 61px; font-size: 18px; } }

/* ================= Plinko ================= */
#plinkoCanvas { display: block; width: 100%; max-width: 680px; margin: 10px auto 0; border-radius: 14px;
                background: radial-gradient(ellipse at 50% 0%, #2b2d52 0%, #15162a 80%); }
.plinkoControls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; margin-top: 12px; }
.ballCount { display: flex; align-items: center; gap: 6px; }
.ballCount input[type=range] { width: 160px; accent-color: #ffd34d; }
.ballCount b { min-width: 28px; text-align: center; font-size: 18px; }
#plinkoHistory { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin-top: 8px; min-height: 24px; }
#plinkoHistory span { font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #1b1b1b; }

/* ================= Sky Climb ================= */
.climbWrap { display: grid; grid-template-columns: 1fr 230px; gap: 16px; margin-top: 12px; }
@media (max-width: 760px) { .climbWrap { grid-template-columns: 1fr; } }
.climbSky {
  position: relative; border-radius: 14px; padding: 16px; min-height: 360px; overflow: hidden;
  background: linear-gradient(180deg, #1b2a5a 0%, #3a5ba0 60%, #7fb3e6 100%);
}
.climbSky.crash { animation: crashShake 0.5s; background: linear-gradient(180deg, #4a1010 0%, #8e2a2a 100%); }
@keyframes crashShake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.machine {
  width: 240px; height: 240px; margin: 0 auto; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0.06) 60%);
  border: 3px solid rgba(255,255,255,0.5); box-shadow: inset 0 -10px 30px rgba(0,0,0,0.25);
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px; padding: 34px 30px;
}
.machine.mixing .ball { animation: mix 0.25s infinite alternate; }
.machine.mixing .ball:nth-child(2n) { animation-delay: 0.1s; }
@keyframes mix { from { transform: translate(-3px, 2px); } to { transform: translate(3px, -3px); } }
.ball { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset -3px -3px 6px rgba(0,0,0,0.35); }
.ball.g { background: radial-gradient(circle at 35% 30%, #b9f6ca, #1fbf5a 60%, #0b6b2f); }
.ball.r { background: radial-gradient(circle at 35% 30%, #ffcdd2, #e53935 60%, #7a1010); }
.ball.d { background: radial-gradient(circle at 35% 30%, #fff6c2, #ffd34d 55%, #b07a00); box-shadow: 0 0 10px #ffd34d; }
.drawnRow { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 14px; min-height: 30px; }
.drawnRow .ball { width: 26px; height: 26px; }
.drawnRow .ball.new { animation: popIn 0.5s ease-out; }
@keyframes popIn { from { transform: translateY(-80px) scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
.drawnRow .ball.absorbed { opacity: 0.45; outline: 2px solid #ffd34d; }
.climbInfo { text-align: center; margin-top: 12px; color: #fff; }
.climbInfo .big { font-size: 30px; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.odds { display: flex; justify-content: center; gap: 12px; margin-top: 8px; font-size: 13px; font-weight: 700; }
.odds span { background: rgba(0,0,0,0.35); padding: 3px 10px; border-radius: 999px; }
.shield { display: inline-block; background: #ffd34d; color: #3e2b00; border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 13px; }
.ladder { display: flex; flex-direction: column-reverse; gap: 3px; }
/* drawn balls shown as balloons */
.balloonRow { display: flex; flex-wrap: wrap; gap: 8px 6px; justify-content: center; margin-top: 14px; min-height: 52px; }
.balloon {
  position: relative; width: 26px; height: 32px; margin-bottom: 14px;
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  box-shadow: inset -4px -5px 8px rgba(0, 0, 0, 0.25);
}
.balloon::before {   /* knot */
  content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid currentColor;
}
.balloon::after {    /* string */
  content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 14px; background: rgba(255, 255, 255, 0.6);
  margin-top: 3px;
}
.balloon.g { color: #0b6b2f; background: radial-gradient(circle at 32% 28%, #e3ffe9 0%, #3ddc76 30%, #1fbf5a 60%, #0b6b2f 100%); }
.balloon.r { color: #7a1010; background: radial-gradient(circle at 32% 28%, #ffe3e3 0%, #ff6b6b 30%, #e53935 60%, #7a1010 100%); }
.balloon.d { color: #b07a00; background: radial-gradient(circle at 32% 28%, #fffbe0 0%, #ffe066 30%, #ffd34d 60%, #b07a00 100%);
             box-shadow: 0 0 12px #ffd34d, inset -4px -5px 8px rgba(0, 0, 0, 0.2); }
.balloon.new { animation: floatIn 0.6s ease-out; }
@keyframes floatIn { from { transform: translateY(40px) scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.balloon.absorbed { opacity: 0.45; filter: grayscale(0.6); }
.balloon.absorbed::before { content: "🛡️"; border: none; font-size: 12px; bottom: auto; top: 6px; }
.balloon.popped { background: none; box-shadow: none; }
.balloon.popped::before { content: "💥"; border: none; font-size: 24px; bottom: auto; top: 2px; }
.balloon.popped::after { display: none; }

/* betting circle with decision buttons around it */
.climbTable { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-top: 16px; }
.betCircle {
  width: 112px; height: 112px; border-radius: 50%; margin: 0 auto;
  border: 3px dashed rgba(255, 255, 255, 0.75); background: rgba(10, 20, 50, 0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #fff; font-size: 12px; text-align: center; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.3);
}
.betCircle.live { border-style: solid; border-color: #ffd34d; box-shadow: 0 0 18px rgba(255, 211, 77, 0.5); }
.betCircle .chipMark { width: 46px; height: 46px; font-size: 12px; }
.betCircle b { font-size: 13px; }
.decision {
  width: 96px; height: 96px; border-radius: 50%; border: none; cursor: pointer; justify-self: center;
  font: inherit; font-weight: 800; font-size: 13px; line-height: 1.2; color: #2b2100; padding: 6px;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #ffd34d 60%, #c99600); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.decision small { display: block; font-size: 11px; font-weight: 700; }
.decision:hover:not(:disabled) { transform: scale(1.05); }
.decision:disabled { filter: grayscale(1); opacity: 0.45; cursor: not-allowed; }
.decision.main { grid-column: 2; width: 120px; height: 52px; border-radius: 999px; margin-top: 2px; }
.climbTable .spacer { grid-column: 1; }
@media (max-width: 760px) { .decision { width: 80px; height: 80px; font-size: 12px; } }

.rung {
  display: flex; justify-content: space-between; padding: 3px 10px; border-radius: 6px; font-size: 13px;
  background: rgba(255,255,255,0.05); color: #c9c9d6;
}
.rung.passed { color: #9fe39f; }
.rung.current { background: #ffd34d; color: #2b2100; font-weight: 800; box-shadow: 0 0 12px rgba(255,211,77,0.6); }
.rung.top { border: 1px solid #ffd34d; }

/* Roulette betting table */
.chipsRow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 10px; }
.chip, .chipMark {
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.85);
  font: inherit; font-weight: 800; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 0 0 3px rgba(0, 0, 0, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.chip { width: 48px; height: 48px; font-size: 12px; cursor: pointer; }
.chip.selected { outline: 3px solid #ffd34d; outline-offset: 3px; transform: translateY(-3px); }
.chipMark { width: 30px; height: 30px; font-size: 10px; pointer-events: none; border-width: 2px; }
.spot .chipMark { width: 26px; height: 26px; font-size: 9px; }

#tableWrap { overflow-x: auto; padding-bottom: 4px; }
#table {
  display: grid;
  grid-template-columns: 50px repeat(12, 1fr) 50px;
  grid-auto-rows: 46px;
  gap: 3px;
  background: #1e5631;
  padding: 10px;
  border-radius: 10px;
  min-width: 680px;
}
.cell {
  position: relative; border: 1px solid rgba(255,255,255,0.35); border-radius: 4px;
  color: #fff; font-weight: 800; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cell:hover, .cell.covered { box-shadow: inset 0 0 0 3px #ffd34d; }
.cell.winner { box-shadow: inset 0 0 0 3px #ffd34d, 0 0 14px #ffd34d; }

/* invisible hot-spots on the lines between numbers: split, corner, street, six line */
.spot {
  position: absolute; z-index: 3; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.spot:hover::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: #ffd34d; box-shadow: 0 0 8px #ffd34d;
}
.spot:has(.chipMark):hover::before { display: none; }
.spot.winner .chipMark { outline: 3px solid #ffd34d; }
.spot.right  { right: -10px; top: 18%;  width: 17px; height: 64%; }    /* split with the number to the right */
.spot.bottom { bottom: -10px; left: 18%; width: 64%; height: 17px; }   /* split with the number below / street */
.spot.zsplit { height: 20%; }   /* the three splits on the zero */
.spot.corner { right: -11px; bottom: -11px; width: 19px; height: 19px; z-index: 4; } /* corner / six line */

/* ================= Currency info ================= */
#currencyInfo { position: absolute; top: 16px; right: 16px; z-index: 6; }
#currencyBtn {
  background: rgba(255, 255, 255, 0.06); color: #c9c9d6; border: 1px solid #555566; border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: help;
}
#currencyBtn:hover, #currencyBtn:focus-visible { border-color: #ffd34d; color: #ffd34d; }
#currencyTip {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 290px;
  background: #2b2d42; border: 1px solid #555566; border-radius: 10px; padding: 12px 14px;
  font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#currencyInfo:hover #currencyTip, #currencyBtn:focus-visible + #currencyTip { display: block; }
#currencyTip table { width: 100%; border-collapse: collapse; margin: 8px 0; }
#currencyTip td { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
#currencyTip td:first-child { white-space: nowrap; padding-right: 10px; color: #ffd34d; }

/* ================= Energy drink ================= */
#boosters { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); z-index: 5;
            display: flex; flex-direction: column; gap: 22px; }
.booster { position: relative; }
#energyBtn, #pillBtn, #influenceBtn {
  position: relative; background: rgba(255, 255, 255, 0.05); border: 1px solid #555566; border-radius: 14px;
  padding: 8px 12px; cursor: pointer; transition: transform 0.1s;
}
/* booster pictures (energy drink, magical pill, political influence) */
.boostImg { display: block; width: 58px; height: 58px; object-fit: contain; pointer-events: none; user-select: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); transition: filter 0.2s; }
#energyBtn.cantAfford .boostImg, #pillBtn.cantAfford .boostImg, #influenceBtn.cantAfford .boostImg { filter: grayscale(1) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
#energyBtn, #pillBtn, #influenceBtn { padding: 6px 8px; }
#energyBtn:hover:not(.cantAfford) { border-color: #1fbf5a; transform: scale(1.06); }
#pillBtn:hover:not(.cantAfford) { border-color: #64b5f6; transform: scale(1.06); }
#energyBtn.cantAfford, #pillBtn.cantAfford, #influenceBtn.cantAfford { opacity: 0.45; cursor: not-allowed; }
#influenceBtn:hover:not(.cantAfford) { border-color: #ffd34d; transform: scale(1.06); }
#influenceBtn.active { border-color: #ffd34d; box-shadow: 0 0 18px rgba(255, 211, 77, 0.6); animation: hatPulse 1s ease-in-out infinite; }
@keyframes hatPulse { 50% { box-shadow: 0 0 30px rgba(255, 211, 77, 0.95); } }
#influenceTimer {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: #ffd34d; color: #2b2100; font-weight: 800; font-size: 12px; padding: 1px 8px; border-radius: 999px;
}
#influenceTimer.cooldown { background: #555566; color: #e0e0ea; }
#pillBtn.active { border-color: #64b5f6; box-shadow: 0 0 18px rgba(100, 181, 246, 0.6); animation: pillPulse 1s ease-in-out infinite; }
@keyframes pillPulse { 50% { box-shadow: 0 0 28px rgba(160, 120, 255, 0.9); } }
#pillTimer {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  background: #64b5f6; color: #0b1a2e; font-weight: 800; font-size: 12px; padding: 1px 8px; border-radius: 999px;
}
#energyBtn.active { border-color: #1fbf5a; box-shadow: 0 0 18px rgba(31, 191, 90, 0.6); animation: energyPulse 1s ease-in-out infinite; }
@keyframes energyPulse { 50% { box-shadow: 0 0 28px rgba(31, 191, 90, 0.9); } }
#energyTimer {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  background: #1fbf5a; color: #0b2a14; font-weight: 800; font-size: 12px; padding: 1px 8px; border-radius: 999px;
}
#energyTimer.cooldown, #pillTimer.cooldown { background: #555566; color: #e0e0ea; }
#energyTimer, #pillTimer { white-space: nowrap; }
#energyTip, #pillTip, #influenceTip {
  display: none; position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  width: 230px; background: #2b2d42; border: 1px solid #555566; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#energyWrap:hover #energyTip, #energyBtn:focus-visible + #energyTip,
#pillWrap:hover #pillTip, #pillBtn:focus-visible + #pillTip,
#influenceWrap:hover #influenceTip, #influenceBtn:focus-visible + #influenceTip { display: block; }
@media (max-width: 800px) { #boosters { top: 20px; transform: none; left: 16px; } #energyTip, #pillTip, #influenceTip { top: 0; transform: none; } }

/* ================= Money counter ================= */
#counter {
  font-size: 56px;
  font-weight: 800;
  color: #ffd34d;
  text-shadow: 0 4px 16px rgba(255, 196, 0, 0.35);
  text-align: center;
}
#counter span { font-size: 24px; color: #c9c9d6; font-weight: 500; }
#perSecond { font-size: 18px; color: #9fe39f; font-weight: 600; }

/* ================= Tax debt button ================= */
#debt {
  background: #d62828;
  color: #fff;
  border: 3px solid #ff8a8a;
  border-radius: 14px;
  padding: 14px 22px;
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 40, 40, 0.7);
  animation: pulse 1s ease-in-out infinite;
}
#debt[hidden] { display: none; }
#debt small { display: block; font-size: 14px; font-weight: 600; opacity: 0.9; margin-top: 4px; }
#debt:hover { background: #e63939; }
#debt.urgent { animation-duration: 0.4s; }   /* pulses faster in the last minute */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ================= Pop-up window ================= */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#modal[hidden] { display: none; }
#modalBox {
  background: #2b2d42;
  border: 3px solid #d62828;
  border-radius: 16px;
  padding: 28px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 40px rgba(214, 40, 40, 0.6);
}
#modalBox h2 { font-size: 26px; }
#modalBox.gold {
  max-width: 760px; border-color: #ffd34d; box-shadow: 0 0 60px rgba(255, 211, 77, 0.6);
  background: radial-gradient(ellipse at 50% 0%, #4a3a10 0%, #2b2d42 70%);
}
#modalBox.gold h2 { color: #ffd34d; }
.prestigeChoices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 6px; }
.prestigeChoice {
  text-align: left; padding: 14px; border-radius: 14px; cursor: pointer; font: inherit; color: #fff;
  background: rgba(255,255,255,0.05); border: 2px solid rgba(255, 211, 77, 0.35);
}
.prestigeChoice:hover { border-color: #ffd34d; background: rgba(255, 211, 77, 0.12); transform: translateY(-2px); }
.prestigeChoice .big { font-size: 34px; }
.prestigeChoice b { display: block; font-size: 16px; margin: 4px 0; color: #ffd34d; }
.prestigeChoice small { display: block; margin-top: 6px; color: #b9f6ca; }
@media (max-width: 700px) { .prestigeChoices { grid-template-columns: 1fr; } }
#prestigeBtn {
  position: fixed; left: 16px; bottom: 16px; z-index: 50; font-size: 16px; box-shadow: 0 4px 18px rgba(255, 211, 77, 0.5);
  background: linear-gradient(180deg, #ffe680, #c98a00); color: #3a2a00; border: none; border-radius: 999px;
  padding: 8px 14px; font: inherit; font-weight: 900; cursor: pointer; animation: pulse 1.4s ease-in-out infinite;
}
#prestigeBtn[hidden] { display: none; }
button.btn.big { font-size: 18px; padding: 12px 24px; margin-top: 10px; }

/* ================= The golden coin ================= */
#coin {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  background: url("../assets/coin.webp") center / contain no-repeat;   /* 👑 the Empire of Coins coin */
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
  transition: transform 0.08s ease;
  will-change: transform;   /* own layer: hover/press only scale it, nothing is redrawn */
}
/* The picture and its shadow are drawn by ::before, inside the coin's own layer, so the shadow is painted ONCE.
   (A filter on the layer itself made the graphics card re-blur the shadow on every frame while +numbers float.) */
#coin { filter: none !important; background-size: 0 0 !important; }
#coin::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: inherit; background-position: center; background-size: contain; background-repeat: no-repeat;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin:hover  { transform: scale(1.04); }
#coin:active { transform: scale(0.94); }
#coin:focus-visible { outline: 4px solid #fff; outline-offset: 6px; }
#coin::after {
  content: none;   /* the old "$" sign (the coin picture has its own design) */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 110px;
  font-weight: 900;
  color: #c98a00;
  text-shadow: 2px 2px 0 #fff1a8, -1px -1px 0 #8a5a00;
}
#coin.blocked { animation: shake 0.2s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.plus {
  position: fixed;
  pointer-events: none;
  font-size: 28px;
  font-weight: 800;
  color: #ffd34d;
  animation: floatUp 0.8s ease-out forwards;
}
@keyframes floatUp {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, -80px); }
}
#hint { color: #8d8da3; font-size: 14px; height: 18px; }

/* ================= Shop ================= */
h2 { margin: 0 0 14px; font-size: 22px; }
h3 { margin: 0; font-size: 18px; }
h4 { margin: 14px 0 8px; font-size: 14px; color: #c9c9d6; text-transform: uppercase; letter-spacing: 0.05em; }

.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: #9a9ab0; font-size: 13px; }
.income { color: #9fe39f; font-weight: 700; }
.income.neg, #perSecond.neg { color: #ff7b7b; }   /* 🔴 negative income per second */
.flash { color: #ff8a8a; font-weight: 700; font-size: 13px; height: 16px; }

button.btn {
  background: #ffd34d;
  color: #2b2100;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
button.btn:hover:not(:disabled) { background: #ffe07a; }
button.btn:disabled { background: #555566; color: #9a9ab0; cursor: not-allowed; }
button.btn.ghost { background: transparent; color: #c9c9d6; border: 1px solid #555566; }
button.btn.small { padding: 4px 8px; font-size: 12px; }

/* choice cards for accountant / HR / candidates */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px;
  color: #fff;
  cursor: pointer;
  font: inherit;
}
.choice:hover:not(:disabled) { border-color: #ffd34d; background: rgba(255, 211, 77, 0.08); }
.choice:disabled { opacity: 0.45; cursor: not-allowed; }
.choice b { display: block; margin-bottom: 4px; }
.choice small { color: #b5b5c8; }

.staff { font-size: 14px; margin: 4px 0; }
.specialHead { margin: 22px 0 12px; }
.specialCard { border-color: rgba(127, 209, 255, 0.4); background: rgba(127, 209, 255, 0.06); }
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 8px; }
.agent { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.agent b { color: #9fe39f; }
.lawSlots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.lawSlot { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 7px 9px; font-size: 13px; }
.lawSlot .live { color: #9fe39f; font-weight: 700; }
.lawSlot.empty { border: 1px dashed rgba(255,255,255,0.2); color: #8d8da3; text-align: center; }
#logisticsView.locked > :not(#logiLocked):not(.debtBanner) { display: none !important; }
#liveLocked[hidden], #logiLocked[hidden] { display: none; }
#tipCard { position: fixed; left: 16px; bottom: 16px; z-index: 9000; width: 340px; max-width: calc(100vw - 32px); padding: 12px 14px;
           border-radius: 14px; background: #23233a; border: 1px solid rgba(255,211,77,0.55); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
           animation: tipIn 0.35s ease-out; font-size: 14px; }
#tipCard[hidden], #tutBubble[hidden] { display: none; }
@keyframes tipIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.tipHead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #ffd34d; }
.tipHead b { flex: 1; } .tipIcon { font-size: 20px; }
.tipX { background: none; border: none; color: #9a9ab0; cursor: pointer; font-size: 14px; }
.tipText { color: #d6d6e6; line-height: 1.4; }
.tipBtns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tipOff { margin-left: auto; opacity: 0.7; }
#tutBubble { position: fixed; z-index: 9500; width: 300px; max-width: calc(100vw - 16px); padding: 12px 14px; border-radius: 14px;
             background: #ffd34d; color: #2b2000; box-shadow: 0 10px 30px rgba(0,0,0,0.55); font-size: 14px; line-height: 1.4; transition: top 0.2s, left 0.2s; }
#tutBubble.free { left: 50% !important; bottom: 20px; top: auto !important; transform: translateX(-50%); }
#tutBubble .muted { color: #5a4600; }
.tutStep { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; margin-bottom: 4px; }
.tutProg { font-weight: 900; margin-top: 4px; }
.tutBtns { display: flex; gap: 6px; margin-top: 8px; }
#tutBubble .btn.ghost { color: #2b2000; border-color: rgba(43,32,0,0.35); }
#tutBubble .btn:not(.ghost) { background: #2b2000; color: #ffd34d; }
.tutGlow { outline: 3px solid #ffd34d !important; outline-offset: 4px; border-radius: 12px; animation: tutPulse 1.2s ease-in-out infinite; position: relative; z-index: 5; }
#coin.tutGlow { border-radius: 50%; }
@keyframes tutPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,211,77,0.55); } 50% { box-shadow: 0 0 0 10px rgba(255,211,77,0); } }
#achList[hidden], #rewardList[hidden] { display: none; }
.achFilter { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.achCats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.achCat { background: transparent; color: #c9c9d6; border: 1px solid #555566; border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.achCat span { color: #9a9ab0; font-weight: 600; font-size: 12px; margin-left: 4px; }
.achCat.active { background: #ffd34d; color: #2b2100; border-color: #ffd34d; }
.achCat.active span { color: #5a4500; }
.rewardCard .bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); margin: 8px 0; overflow: hidden; }
.rewardCard .bar > div { height: 100%; background: linear-gradient(90deg, #ffd34d, #ff9800); }
.rewardCard:not(.got) .cosmetic { filter: grayscale(0.7); opacity: 0.75; }
.rewardCard.got { border-color: rgba(255,211,77,0.6); }
.rewardNeeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 13px; }
.rewardNeeds span { padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }
.rewardNeeds span.ok { border-color: rgba(129,199,132,0.6); color: #a5d6a7; }
#saveWarn { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9999; max-width: 560px;
             background: #b71c1c; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,0.5); font-size: 14px; }
#saveWarn[hidden] { display: none; }
#saveWarn .btn { margin-left: 8px; }
/* Businesses / Special / Science: a frosted strip across the whole panel that stays on top while scrolling */
.incomeTabs { display: flex; gap: 6px; position: sticky; top: -20px; z-index: 3; margin: -20px -20px 14px; padding: 14px 20px 10px;
  background: rgba(16, 14, 34, 0.97);
  border-bottom: 1px solid rgba(255, 211, 77, 0.25); }
.incomeTabs::after { content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; pointer-events: none;
  background: linear-gradient(rgba(16, 14, 34, 0.75), rgba(16, 14, 34, 0)); }   /* soft fade instead of a hard cut */
@media (max-width: 800px) { .incomeTabs { top: var(--tabsH, 56px); } }   /* phones: the page scrolls, so stick below the top bar */
.incomeTab { flex: 1; padding: 9px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: #24203c; color: inherit; font-weight: 700; cursor: pointer; font-size: 14px; }
.incomeTab:hover { background: rgba(255,255,255,0.09); }
.incomeTab.active { background: #4a3d16; border-color: #ffd34d; color: #ffd34d; }
#incBiz[hidden], #incSpecial[hidden], #incScience[hidden] { display: none; }
.vialCount { font-size: 18px; font-weight: 900; color: #ffd34d; background: rgba(255,211,77,0.12); border: 1px solid rgba(255,211,77,0.5); padding: 2px 10px; border-radius: 999px; }
.nobel { text-align: center; }
.nobelMedal { font-size: 64px; line-height: 1; animation: rushPulse 0.9s ease-in-out infinite alternate; }
.nobelReward { font-size: 30px; font-weight: 900; color: #ffd34d; margin: 6px 0 14px; }
.satPerks { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: #c9c9da; }
.wikiSearch { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wikiSearch input { flex: 1; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); color: inherit; font-size: 15px; outline: none; }
.wikiSearch input:focus { border-color: #ffd34d; box-shadow: 0 0 0 3px rgba(255,211,77,0.2); }
.wikiHitRow { display: block; width: 100%; text-align: left; padding: 10px 12px; margin: 6px 0; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); color: inherit; cursor: pointer; font: inherit; }
.wikiHitRow:hover { background: rgba(255,211,77,0.08); border-color: rgba(255,211,77,0.5); }
.wikiHitWhere { display: block; font-size: 12px; font-weight: 700; color: #ffd34d; margin-bottom: 3px; }
.wikiHitText { font-size: 14px; color: #d6d6e6; }
.wikiBody mark, .wikiHitRow mark { background: #ffd34d; color: #2b2000; border-radius: 3px; padding: 0 2px; }
.wikiFlash { animation: wikiFlash 2s ease-out; }
@keyframes wikiFlash { 0%, 40% { background: rgba(255,211,77,0.25); } 100% { background: transparent; } }
.hotCard.on { border-color: rgba(255, 138, 0, 0.7); background: linear-gradient(90deg, rgba(255,87,34,0.22), rgba(255,193,7,0.12)); }
.hotCard.on b { color: #ffb74d; }
.hotCard.off { opacity: 0.85; }
.hotTime { font-weight: 800; font-variant-numeric: tabular-nums; }
.hotBar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); margin: 8px 0 6px; overflow: hidden; }
.hotBar > div { height: 100%; background: linear-gradient(90deg, #ff5722, #ffc107); transition: width 0.9s linear; }
.hotCard.off .hotBar > div { background: linear-gradient(90deg, #4fc3f7, #b3e5fc); }
.hotTag { font-size: 11px; font-weight: 900; color: #2b1600; background: linear-gradient(90deg, #ffb300, #ff7043); padding: 1px 6px; border-radius: 999px; }
.rushBadge { white-space: nowrap; display: inline-block; font-size: 12px; font-weight: 900; color: #2b1600; background: linear-gradient(90deg, #ffb300, #ff7043); padding: 2px 8px; border-radius: 999px; margin-left: 6px; animation: rushPulse 0.8s ease-in-out infinite alternate; }
.rushBadge[hidden] { display: none; }
.income.rushOn { color: #ffb300; text-shadow: 0 0 8px rgba(255, 179, 0, 0.6); }
@keyframes rushPulse { from { transform: scale(1); } to { transform: scale(1.08); } }
.mineBar { height: 12px; background: #1c1d2b; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.mineFill { height: 100%; background: linear-gradient(90deg, #b07a00, #ffd34d); border-radius: 999px; }
.agent.zero b { color: #9a9ab0; }
.groupHead { background: rgba(255, 211, 77, 0.07); border-color: rgba(255, 211, 77, 0.35); padding: 10px 14px; }

.worker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 4px;
  font-size: 14px;
}
.worker .name { flex: 1; }
.worker .status { width: 90px; text-align: right; font-size: 12px; }
.worker .earn { width: 52px; text-align: right; color: #9fe39f; font-weight: 600; }

/* ================= 🎮 Mini-games ================= */
#gamesView { max-width: 1100px; margin: 0 auto; padding: 20px; }
.gamesTitle { margin: 0 0 4px; }
.gamesGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.gameCard { display: flex; flex-direction: column; gap: 8px; text-align: center; align-items: center; padding: 22px 18px; }
.gameCard h3 { margin: 0; font-size: 20px; }
.gameCard p { margin: 0; flex: 1; }
.gameCard .gameIcon { font-size: 54px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.gameCard .gameStatus { font-size: 13px; color: #ffd34d; min-height: 18px; }
.gameCard .btn { min-width: 140px; }
.gameCard.locked .gameIcon, .gameCard.soon .gameIcon { filter: grayscale(1) opacity(0.6); }
.gameCard.soon { opacity: 0.6; }
.gameStatus .off, .mineEnergy .off { filter: grayscale(1) opacity(0.35); }
.gamesBack { margin-bottom: 12px; }
#artView .gamesBack { display: block; margin: 0 auto 12px 0; }

/* ⛏️ Gold Mine Dig */
.mineIntro { max-width: 640px; margin: 0 auto; text-align: center; }
.mineIntro h2 { margin-top: 0; }
.mineOreRow { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin: 8px 0; font-size: 14px; }
.mineEnergy { font-size: 26px; margin: 10px 0; display: flex; justify-content: center; align-items: center; gap: 4px; }
.mineEnergy .muted { font-size: 13px; margin-left: 10px; }
.mineLayout { display: grid; grid-template-columns: minmax(0, 480px) 260px; gap: 16px; justify-content: center; align-items: start; }
.mineStage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#mineCanvas { width: 100%; max-width: 480px; border-radius: 12px; border: 2px solid rgba(255, 211, 77, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); image-rendering: pixelated; touch-action: none; background: #120e1c; }
.minePad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: 50px 50px; gap: 6px; user-select: none; }
.minePad [data-dir="up"] { grid-column: 2; }
.minePad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.minePad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.minePad [data-dir="right"] { grid-column: 3; grid-row: 2; }
.minePad button { border-radius: 12px; border: 1px solid rgba(255, 211, 77, 0.5); background: #2a2346; color: #ffd34d; font-size: 20px;
  cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.minePad button:active { background: #4a3d16; transform: scale(0.95); }
.mineSide { display: flex; flex-direction: column; gap: 6px; }
.mineStat { display: flex; justify-content: space-between; font-size: 14px; }
.mineBar { height: 10px; border-radius: 999px; background: #2b2640; overflow: hidden; }
.mineBar div { height: 100%; transition: width 0.15s; }
.mineWarn { color: #ff8a8a; font-weight: 800; font-size: 13px; }
.mineRush { color: #ffb347; font-weight: 800; }
.mineHeat { color: #ff9a4d; font-weight: 800; font-size: 13px; }
/* ore art as an inline icon */
.oreIcon { width: 1.45em; height: 1.45em; object-fit: contain; vertical-align: -0.4em; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.mineVault span { display: inline-flex; align-items: center; gap: 5px; }
.mineVault .oreIcon { width: 24px; height: 24px; vertical-align: 0; }
.mineVault.small .oreIcon { width: 18px; height: 18px; }
/* 🛗 mine lift: its own box at the top of the upgrades */
.mineLiftBox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 211, 77, 0.14), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(255, 211, 77, 0.45); }
.mineLiftIcon { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.mineLiftText { flex: 1 1 220px; font-size: 15px; }
.mineLiftText b { font-size: 18px; }
.mineLiftHave { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); font-weight: 800; color: #ffd34d; }
.mineLiftBox .btn { font-size: 16px; padding: 10px 18px; }
/* 📦 treasure chest opening */
.chestStage { position: relative; display: flex; flex-direction: column; align-items: center; margin: 22px 0 12px; }
.chestArt { width: 190px; height: auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55)); }
.chestArt.open, .chestArt.jackpot { animation: chestPop 0.45s cubic-bezier(.3, 1.6, .5, 1); }
.chestStage.big .chestArt { filter: drop-shadow(0 0 18px rgba(255, 211, 77, 0.65)); }
.chestStage.jackpot .chestArt { width: 220px; filter: drop-shadow(0 0 26px rgba(120, 240, 255, 0.85)); }
.chestStage.shake .chestArt { animation: chestShake 0.18s ease-in-out 6; }
@keyframes chestShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
.chestPrize { margin-top: 8px; font-size: 28px; font-weight: 900; color: #ffd34d; text-shadow: 0 2px 0 #6b4400, 0 0 18px rgba(255, 211, 77, 0.6);
  animation: chestPop 0.5s cubic-bezier(.3, 1.6, .5, 1); }
.chestStage.big .chestPrize { font-size: 34px; }
.chestStage.jackpot .chestPrize { font-size: 40px; color: #8ff3ff; text-shadow: 0 2px 0 #08515c, 0 0 26px rgba(120, 240, 255, 0.9); }
@keyframes chestPop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mineOres { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; min-height: 20px; }
.mineMsg { min-height: 36px; font-size: 13px; color: #ffe7a0; }
@media (max-width: 800px) {
  .mineLayout { grid-template-columns: 1fr; gap: 10px; }
  #mineCanvas { max-height: 52vh; width: auto; max-width: 100%; }   /* mine + buttons fit on one phone screen */
  .minePad { grid-template-columns: repeat(3, 64px); grid-template-rows: 52px 52px; }
}

/* ⛏️ Gold Mine Dig: vault line and upgrades */
.mineVault { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.mineVault span { background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 211, 77, 0.3); border-radius: 999px; padding: 4px 12px; font-size: 15px; }
.mineVault.small { margin: 0; gap: 4px; }
.mineVault.small span { padding: 2px 8px; font-size: 12px; }
.mineUps { max-width: 900px; margin: 16px auto 0; }
.mineUps h3 { margin: 0 0 4px; }
.mineUpGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 10px; }
.mineUp { display: flex; flex-direction: column; gap: 5px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 211, 77, 0.22); }
.mineUp.maxed { border-color: rgba(120, 220, 120, 0.45); }
.mineUpHead { display: flex; align-items: center; gap: 8px; }
.mineUpIcon { font-size: 22px; }
.mineUpLv { margin-left: auto; font-size: 12px; color: #ffd34d; font-weight: 800; }
.mineUpEff { font-size: 13px; color: #c9c9d6; }
.mineUpEff.next { color: #9fe39f; }
.mineUpCost { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 700; }
.mineUpCost span { background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 2px 8px; }
.mineUpCost .short { color: #ff8a8a; }
.mineUp .btn { align-self: flex-start; margin-top: 2px; }
.vaultSell { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; text-align: left; }
.vsRow { padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 211, 77, 0.2); }
.vsHead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; }
.vsHead .oreIcon { width: 26px; height: 26px; vertical-align: 0; }
.vsNeed { font-size: 12px; font-weight: 700; color: #ffb347; background: rgba(255, 179, 71, 0.12); border-radius: 999px; padding: 1px 8px; }
.vsCtrl { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.vsCtrl input[type=range] { flex: 1 1 140px; accent-color: #ffd34d; }
.vsCtrl .btn.small { min-width: 34px; padding: 4px 10px; }
.vsCount { min-width: 120px; text-align: right; font-size: 14px; color: #ffd34d; }

/* ⭐ Legacy badge (top-left of the coin area) */
#legacyBadge { position: absolute; left: 24px; top: 16px; z-index: 4; display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 211, 77, 0.22), rgba(255, 211, 77, 0.08)); color: #ffe7a0;
  border: 1px solid rgba(255, 211, 77, 0.6); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 800; }
#legacyBadge:hover { background: rgba(255, 211, 77, 0.3); }
#legacyBadge .lgIcons { letter-spacing: 1px; }
.legacyList { text-align: left; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.legacyRow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 211, 77, 0.25); }
.legacyRow.off { opacity: 0.45; }
.legacyRow .big { font-size: 26px; line-height: 1; }
.legacyRow b { color: #ffd34d; }
.legacySteps { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.legacySteps span { padding: 4px 10px; border-radius: 999px; border: 1px solid #555566; font-size: 13px; font-weight: 700; }
.legacySteps span.done { background: #ffd34d; color: #2b2100; border-color: #ffd34d; }
@media (max-width: 800px) { #legacyBadge { left: 50%; transform: translateX(-50%); top: 14px; } }

/* 🔬 Science building requirements (✅ / ❌, live) */
.sciNeed { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 700; }
.sciNeed span { padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid #555566; }
.sciNeed span.ok { border-color: rgba(120, 220, 120, 0.6); color: #9fe39f; }
.sciNeed span.ok::after { content: " ✅"; }
.sciNeed span.short { border-color: rgba(255, 120, 120, 0.6); color: #ff9a9a; }
.sciNeed span.short::after { content: " ❌"; }

/* =====================================================================
   📱 PHONE MODE (body.phone: screens up to 760 px wide, see js/00-phone.js)
   ===================================================================== */
#bgLayer { position: fixed; inset: 0; z-index: -2; pointer-events: none; background-position: center; background-size: cover; background-repeat: no-repeat; }
/* the background picture is drawn once on #bgLayer (its own still layer) instead of as a "fixed" page background,
   which made the browser repaint it on scrolling and animations (all screen sizes) */
body:not(.bgProbe) { background: #14151f !important; }

/* Tab bar at the bottom, one scrollable row (thumb-friendly) */
body.phone { --navH: 64px; padding-bottom: calc(var(--navH) + env(safe-area-inset-bottom)); }
body.phone #tabs {
  position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 70;
  justify-content: flex-start; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding: 0 10px;
  border-bottom: 0; border-top: 1px solid rgba(255, 211, 77, 0.35); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
  background: #120f24; -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.phone #tabs::-webkit-scrollbar { display: none; }
body.phone .tab { flex: 0 0 auto; padding: 9px 13px; font-size: 13px; white-space: nowrap; }
body.phone #brand { display: none; }
body.phone #settingsWrap { position: static; transform: none; order: -1; flex: 0 0 auto; }   /* ⚙️ first in the row */
body.phone #settingsBtn { width: 40px; height: 40px; }
/* pages fill the screen above the bottom bar */
body.phone #incomeView, body.phone #game { min-height: 0; }
body.phone #shop { max-height: none; }
body.phone .incomeTabs { top: 0 !important; margin: -20px -20px 14px; }
/* floating things move up, above the bottom bar */
body.phone #prestigeBtn { bottom: calc(var(--navH) + 12px + env(safe-area-inset-bottom)); left: 12px; }
body.phone #tipCard { bottom: calc(var(--navH) + 12px + env(safe-area-inset-bottom)); left: 8px; }
body.phone #saveWarn { bottom: calc(var(--navH) + 12px); }
body.phone #alerts { top: 10px; right: 8px; left: 8px; max-width: none; }
/* pop-ups fit the screen */
body.phone #modalBox { max-width: calc(100vw - 20px); max-height: calc(100vh - 40px); overflow-y: auto; padding: 20px 16px; box-sizing: border-box; }
body.phone #modalBox.ornate { overflow: visible; max-height: none; }
/* side menus become a scrollable row of buttons */
body.phone .subLayout { grid-template-columns: 1fr; }
body.phone .subNav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
body.phone .subNav::-webkit-scrollbar { display: none; }
body.phone .subTab { flex: 0 0 auto; white-space: nowrap; padding: 9px 12px; }
/* wide tables scroll sideways inside their card instead of stretching the page */
body.phone .wikiTable { display: block; overflow-x: auto; max-width: 100%; }
body.phone #investView, body.phone #gamesView, body.phone #wikiView, body.phone #achievementsView, body.phone #shopView, body.phone #logisticsView { padding: 12px; }

/* Performance: no blur, no endless glow animations (they repaint the screen 60 times a second) */
body.phone *, body.phone *::before, body.phone *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
body.phone .incomeTabs { background-color: #1b1735; }
body.phone .subTab:not(.active) { background-color: #1b1735; }
body.phone #prestigeBtn, body.phone .menuBtn.mGreen img, body.phone #energyBtn.active, body.phone #pillBtn.active, body.phone #influenceBtn.active,
body.phone .rushBadge, body.phone .nobelMedal, body.phone .destRing, body.phone #debt { animation: none !important; }

/* 💰 Income on phones: money → coin → boosters in a row (no overlap), tips open above the boosters */
body.phone #game { gap: 16px; padding: 56px 16px 20px; justify-content: flex-start; }
body.phone #debt { order: 0; } body.phone #counter { order: 1; } body.phone #coin { order: 2; }
body.phone #boosters { order: 3; position: static; transform: none; flex-direction: row; justify-content: center; gap: 16px; }
body.phone #hint { order: 4; }
body.phone #energyTip, body.phone #pillTip, body.phone #influenceTip { left: 50%; top: auto; bottom: calc(100% + 10px); transform: translateX(-50%); }
body.phone #pillTip { left: 50%; } body.phone #energyTip { left: 0; transform: none; } body.phone #influenceTip { left: auto; right: 0; transform: none; }

/* ✨ Floating "+1" click numbers: drawn in an isolated layer (#fx); a small pool of elements is reused */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; contain: strict; }
#fx .plus { position: absolute; left: 0; top: 0; animation: none; will-change: transform, opacity; opacity: 0; white-space: nowrap; }
/* the money counter's size changes never move the rest of the page */
#counter { contain: layout paint; font-variant-numeric: tabular-nums; }

/* Booster glows: the glow is drawn once (::after) and only its opacity pulses (no repaint every frame) */
#energyBtn.active, #pillBtn.active, #influenceBtn.active { animation: none; }
#energyBtn.active::after, #pillBtn.active::after, #influenceBtn.active::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
  will-change: opacity; animation: glowFade 1s ease-in-out infinite; }
#energyBtn.active::after { box-shadow: 0 0 28px rgba(31, 191, 90, 0.9); }
#pillBtn.active::after { box-shadow: 0 0 28px rgba(160, 120, 255, 0.9); }
#influenceBtn.active::after { box-shadow: 0 0 30px rgba(255, 211, 77, 0.95); }
@keyframes glowFade { 50% { opacity: 1; } }
#prestigeBtn { will-change: transform; }   /* its pulse only scales: keep it on its own layer */

/* ⚠️ red warning badge on a tab (e.g. a broken-down truck in Logistics) */
.tabWarn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; vertical-align: 1px;
  border-radius: 50%; background: #e53935; color: #fff; font-size: 12px; font-weight: 900; line-height: 1; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }

.gameIconImg { width: 60px; height: 60px; object-fit: contain; display: block; margin: -3px auto 0; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
/* tall pop-ups (e.g. 🏦 sell vault ore) scroll instead of running off the screen; the ornate settings panel keeps its own layout */
#modalBox:not(.ornate) { max-height: calc(100vh - 40px); overflow-y: auto; box-sizing: border-box; }

/* ===== 🧬 Gene Splicer ===== */
#geneView { max-width: 980px; margin: 0 auto; }
.geneTop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.geneTop h2 { margin: 0; flex: 1 1 auto; }
.geneProg { min-width: 200px; text-align: right; font-size: 14px; }
.geneProg .xpBar { margin-top: 4px; width: 100%; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.geneProg .xpFill { height: 100%; background: linear-gradient(90deg, #2fc4b2, #6fe3ff); }
.geneLab { text-align: center; }
.geneSplicer { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.genePlus { font-size: 32px; font-weight: 900; color: #ffd34d; }
.geneSlot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 132px; height: 132px; border-radius: 18px;
  border: 2px dashed rgba(120, 220, 255, 0.45); background: radial-gradient(circle at 50% 35%, rgba(120, 220, 255, 0.14), rgba(0, 0, 0, 0.3)); color: inherit; cursor: pointer; font: inherit; }
.geneSlot.full { border-style: solid; }
.geneSlot .geneEmoji { font-size: 48px; }
.geneSplicer .btn.big { margin-left: 8px; }
.geneNote { margin-top: 10px; font-size: 13px; }
.geneResult { display: flex; align-items: center; gap: 14px; justify-content: center; text-align: left; margin: 12px auto 0; max-width: 560px; padding: 10px 16px;
  border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 2px solid rgba(255, 255, 255, 0.15); animation: chestPop 0.4s cubic-bezier(.3, 1.6, .5, 1); }
.geneResult.fail { display: block; text-align: center; border-color: rgba(255, 107, 107, 0.5); }
.geneResult.new { box-shadow: 0 0 22px rgba(255, 211, 77, 0.35); }
.geneResEmoji { font-size: 56px; line-height: 1; }
.geneResName { font-size: 18px; margin-bottom: 2px; }
.geneRar { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; vertical-align: 2px; background: rgba(255, 255, 255, 0.12); }
.geneBar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 2px; font-size: 14px; }
.geneHints { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 2px 10px; }
.geneHints span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 211, 77, 0.14); border: 1px solid rgba(255, 211, 77, 0.4); font-size: 13px; }
.geneTabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.geneTabs input { margin-left: auto; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.3); color: inherit; min-width: 160px; }
.geneGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 10px; }
.geneCard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.12); color: inherit; font: inherit; cursor: pointer; text-align: center; }
.geneCard.codex, .geneCard.unknown { cursor: default; }
.geneCard.unknown { opacity: 0.5; }
.geneCard.sel { outline: 3px solid #ffd34d; }
.geneCard[data-empty] { opacity: 0.45; }
.geneCard .geneEmoji { font-size: 30px; line-height: 1.1; }
.geneName { font-size: 12px; font-weight: 700; line-height: 1.2; }
.geneHow { font-size: 11px; color: #a9b0c8; }
.genePips { display: flex; gap: 3px; margin-top: 2px; }
.genePips i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.genePips i.on { background: #6fe3ff; box-shadow: 0 0 4px #6fe3ff; }
/* rarity colours: common grey, uncommon green, rare blue, extinct purple, mythical gold, starting samples teal */
.r-c { border-color: rgba(200, 200, 210, 0.35); } .r-u { border-color: #4caf6a; } .r-r { border-color: #3d8bff; }
.r-e { border-color: #a46bff; } .r-l { border-color: #ffc93d; } .r-s { border-color: #2fc4b2; }
.geneRar.r-u { background: rgba(76, 175, 106, 0.3); } .geneRar.r-r { background: rgba(61, 139, 255, 0.3); }
.geneRar.r-e { background: rgba(164, 107, 255, 0.3); } .geneRar.r-l { background: rgba(255, 201, 61, 0.3); }
.geneCard.r-l { box-shadow: inset 0 0 12px rgba(255, 201, 61, 0.18); }
body.phone .geneSlot { width: 104px; height: 104px; }
body.phone .geneSlot .geneEmoji { font-size: 38px; }
body.phone .geneSplicer .btn.big { margin: 8px 0 0; flex-basis: 100%; }
body.phone .geneTabs input { margin-left: 0; flex: 1 1 100%; }
#geneView .achCat { font-size: 13px; padding: 4px 10px; }
#geneView .geneTabs .subTab { font-size: 14px; padding: 6px 14px; }
body.phone #geneView .achCats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
body.phone #geneView .achCat { flex: 0 0 auto; }

/* painted tab icons (assets/icons/tab-*.webp) */
.tabIco { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; margin: -4px 6px -4px 0; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }
@media (max-width: 1500px) { .tabIco { width: 21px; height: 21px; margin-right: 4px; } }
body.phone .tabIco { width: 22px; height: 22px; margin-right: 4px; }

/* painted icons inline (ico() in js/01-core.js) */
.ico { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.32em; margin-right: 0.3em; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }
.ico.h { width: 1.25em; height: 1.25em; vertical-align: -0.22em; }
.ico.lockS { width: 1.1em; height: 1.1em; margin-right: 0.15em; vertical-align: -0.2em; }
.ico.setIco { width: 26px; height: 26px; margin: 0; vertical-align: middle; }
.ico.biz { width: 1.7em; height: 1.7em; vertical-align: -0.5em; margin-right: 0.35em; }

/* casino game pictures: the 💎 high-roller badges sit on the bottom-right corner */
.casIco { position: relative; display: inline-block; vertical-align: -0.5em; margin-right: 0.35em; }
.casIco > .ico { margin: 0; vertical-align: 0; }
.casTier { position: absolute; right: -0.45em; bottom: -0.2em; display: flex; }
.casTier .ico { width: 0.95em; height: 0.95em; margin: 0 0 0 -0.35em; vertical-align: 0; }
#casinoGame .gameCard h3 .casIco { display: block; width: fit-content; margin: 0 auto 6px; }
#casinoGame .gameCard h3 .casIco > .ico.biz { width: 56px; height: 56px; }
#casinoGame .gameCard h3 .casTier .ico { width: 22px; height: 22px; margin-left: -8px; }
#casinoGame .gameCard h3 .casTier { right: -10px; bottom: -2px; }

/* 🧮 staff pictures: accountants and HR managers */
.ico.staffI { width: 1.7em; height: 1.7em; vertical-align: -0.55em; margin-right: 0.3em; }
.choice .ico.staffI.pick { display: block; width: 52px; height: 52px; margin: 0 auto 4px; }

/* 🏅 painted achievement badges: the badge is the whole icon (no circle behind it); greyed out until unlocked */
.ach .ico.pic { background: none !important; width: 52px; height: 52px; }
.ach .ico.pic .achPic { width: 52px; height: 52px; object-fit: contain; }
.ach.done .ico.pic { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.achPic.inl { width: 1.6em; height: 1.6em; vertical-align: -0.45em; }

.ach .ico.pic { position: relative; }
.achDiff { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #1b1c2a; }
.achDiff.easy { background: #43c463; } .achDiff.medium { background: #f2c531; } .achDiff.hard { background: #e5484d; }

/* 🛡️ collection emblems on Shop and Rewards headers */
.colEmblem { width: 56px; height: 56px; object-fit: contain; vertical-align: middle; margin: -8px 10px -8px 0; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5)); }
body.phone .colEmblem { width: 44px; height: 44px; margin-right: 8px; }

.ico.reIco { width: 2em; height: 2em; vertical-align: -0.6em; margin-right: 0.4em; }

/* 🧪 Gene Splicer: mutants and the unfound-partners tag */
.r-m { border-color: #7ddf3a; } .geneRar.r-m { background: rgba(125, 223, 58, 0.25); }
.geneCard.r-m { background: radial-gradient(circle at 50% 30%, rgba(125, 223, 58, 0.18), rgba(0, 0, 0, 0.3)); }
.geneResult.mutant { border-color: #7ddf3a; box-shadow: 0 0 18px rgba(125, 223, 58, 0.25); }
.geneResult.mutant .geneResEmoji { font-size: 40px; filter: hue-rotate(60deg) saturate(1.4); }
.geneCard.r-m .geneEmoji { filter: hue-rotate(60deg) saturate(1.4); font-size: 22px; }
.geneUnf { margin-top: 3px; font-size: 11px; font-weight: 800; color: #ffd34d; background: rgba(255, 211, 77, 0.14); border-radius: 999px; padding: 1px 7px; }
.geneUnf.later { color: #a9b0c8; background: rgba(255, 255, 255, 0.07); }
.geneUnf.done { color: #6fdc8c; background: rgba(111, 220, 140, 0.12); }

.genePerks { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 2px 10px; font-size: 13px; }
.genePerks span { padding: 3px 10px; border-radius: 999px; background: rgba(47, 196, 178, 0.12); border: 1px solid rgba(47, 196, 178, 0.35); }
.genePerks b { color: #6fe3ff; }

.genePerkTitle { text-align: center; font-size: 17px; font-weight: 800; color: #ffd34d; margin: 14px 0 8px; }
.genePerkTitle .muted { display: block; font-size: 12px; font-weight: 500; margin-top: 2px; }
.genePerks { justify-content: center; }

/* 🎴 Baccarat */
.bacHands { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.bacHand { text-align: center; padding: 8px 14px; border-radius: 14px; border: 2px solid transparent; min-width: 200px; }
.bacHand.won { border-color: #ffd34d; box-shadow: 0 0 18px rgba(255, 211, 77, 0.35); }
.bacPts { font-size: 30px; font-weight: 900; color: #fff; min-height: 38px; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); }
.bacSpots { display: flex; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.bacSpot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 120px; height: 86px;
  border-radius: 16px; border: 2px dashed rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.18); color: #fff; font-size: 13px; }
.bacSpot.side { width: 96px; height: 70px; font-size: 12px; }
.bacSpot.click { cursor: pointer; } .bacSpot.click:hover { border-color: #ffd34d; }
.bacSpot.has { border-style: solid; }
.bacSpot.player { border-color: rgba(90, 160, 255, 0.8); } .bacSpot.banker { border-color: rgba(255, 90, 90, 0.8); } .bacSpot.tie { border-color: rgba(80, 210, 120, 0.8); }
.bacSpot.win { box-shadow: 0 0 16px rgba(80, 230, 120, 0.7); } .bacSpot.lose { opacity: 0.55; } .bacSpot.push { box-shadow: 0 0 12px rgba(255, 211, 77, 0.5); }
.bacSpot span { font-size: 11px; color: #cfd6ea; }
.bacRoad { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 8px 0; font-size: 13px; }
.bead { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; font-style: normal; color: #fff; }
.bead.P { background: #3d7bff; } .bead.B { background: #e5484d; } .bead.T { background: #2fb25c; }
.gameCard.locked { opacity: 0.6; cursor: not-allowed; }
body.phone .bacHands { gap: 10px; } body.phone .bacHand { min-width: 0; }
body.phone .bacSpot { width: 92px; height: 74px; } body.phone .bacSpot.side { width: 80px; height: 62px; }

/* 🧬 Mad Lab Collection (secret, after the 2nd prestige) */
body.mutantBg {   /* bright, busy picture: stronger overlay */
  background: linear-gradient(rgba(12, 12, 22, 0.7), rgba(12, 12, 22, 0.84)), url("../assets/mutant-background.jpg") center / cover fixed;
}
#coin.mutantCoin { background: url("../assets/mutant-coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
#coin.mutantCoin::after { content: none; }

/* 🧬 painted species icons */
.geneImg { width: 1.5em; height: 1.5em; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
.geneImg.half { width: 1.1em; height: 1.1em; }
.geneImg.sm { width: 1.35em; height: 1.35em; margin: -3px 0; filter: none; }
.geneEmoji .geneImg { display: inline-block; }
.geneImg.empty { opacity: 0.55; filter: grayscale(0.4); }
.geneImg.title { width: 1.3em; height: 1.3em; margin: -6px 6px 0 0; }
.geneCard.unknown .geneImg { opacity: 0.85; }

/* 🧬 Gene Cascade slot */
.gcTop { display: flex; justify-content: space-between; align-items: center; margin: 8px 2px; min-height: 26px; }
.gcLabel { font-weight: 800; color: #b9f6ca; }
.gcWin { font-size: 18px; } .gcWin b { color: #ffd34d; font-size: 22px; }
.gcBoard { position: relative; max-width: 560px; margin: 0 auto; }
.gcGrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px; border-radius: 18px;
  background: radial-gradient(circle at 50% 30%, #1d3b4a, #0d1a26 75%); border: 2px solid #2f6f7f; box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.4); }
.gcGrid.bonus { border-color: #b26bff; background: radial-gradient(circle at 50% 30%, #3a1d4a, #160d26 75%); }
.gcCell { position: relative; aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.03); }
.gcCell img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); transition: transform 0.25s, opacity 0.25s; }
.gcCell.marked { background: rgba(80, 230, 140, 0.16); box-shadow: inset 0 0 0 2px rgba(80, 230, 140, 0.45); }
.gcCell.spot { background: rgba(255, 196, 64, 0.2); box-shadow: inset 0 0 0 2px rgba(255, 196, 64, 0.8), 0 0 10px rgba(255, 196, 64, 0.35); }
.gcCell.drop img { animation: gcDrop 0.32s ease-out both; animation-delay: calc(var(--row) * 0.025s + var(--col) * 0.01s); }
@keyframes gcDrop { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
.gcCell.win img { animation: gcPulse 0.5s ease-in-out infinite alternate; }
.gcCell.win { background: rgba(255, 255, 255, 0.16); }
@keyframes gcPulse { from { transform: scale(1); filter: drop-shadow(0 0 2px #fff); } to { transform: scale(1.14); filter: drop-shadow(0 0 10px #ffe680); } }
.gcCell.pop img { transform: scale(0.1) rotate(25deg); opacity: 0; }
.gcCell.scat img { filter: drop-shadow(0 0 8px rgba(120, 255, 140, 0.9)); }
.gcMult { position: absolute; z-index: 2; bottom: 1px; right: 2px; font-size: 11px; font-weight: 900; padding: 0 4px; border-radius: 6px; background: #ffb300; color: #2a1600; }
.gcMult.m4, .gcMult.m5 { background: #ff6d00; color: #fff; } .gcMult.m6, .gcMult.m7 { background: #d500f9; color: #fff; }
.gcBanner { position: absolute; inset: 40% 4% auto; text-align: center; font-size: 26px; font-weight: 900; color: #ffd34d; padding: 12px; border-radius: 16px;
  background: rgba(10, 6, 24, 0.85); border: 2px solid #ffd34d; text-shadow: 0 2px 6px #000; animation: gcBan 0.35s ease-out; }
@keyframes gcBan { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.gcLines { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; min-height: 26px; margin: 8px 0; font-size: 13px; }
.gcLines img { width: 22px; height: 22px; vertical-align: middle; }
.gcMultTxt { color: #ffb300; }
.gcFast { align-self: center; font-size: 13px; color: #cfd6ea; }
.gcRules { margin-top: 10px; } .gcRules summary { cursor: pointer; font-weight: 700; }
.gcPayImg { width: 24px; height: 24px; vertical-align: middle; margin-right: 4px; }
.gcPay td, .gcPay th { text-align: center; } .gcPay td:first-child { text-align: left; white-space: nowrap; }
body.phone .gcGrid { gap: 2px; padding: 5px; } body.phone .gcMult { font-size: 9px; } body.phone .gcBanner { font-size: 18px; }
.gcCell.win { background: rgba(255, 230, 120, 0.28); box-shadow: inset 0 0 0 2px #ffe680, 0 0 12px rgba(255, 230, 120, 0.6); z-index: 1; }
.gcBanner { z-index: 5; }

/* 🧬 Gene Cascade buttons: Spin in the middle, Buy free spins beside it, chips below */
.gcActions { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 6px 0 10px; flex-wrap: wrap; }
.gcBtn { display: flex; flex-direction: column; align-items: center; justify-content: center; border: none; cursor: pointer; color: #fff; font-family: inherit;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); transition: transform 0.12s, filter 0.12s; }
.gcBtn:hover:not(:disabled) { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }
.gcBtn:active:not(:disabled) { transform: scale(0.97); }
.gcBtn:disabled { filter: grayscale(0.7) brightness(0.7); cursor: not-allowed; }
.gcBtn small { font-size: 12px; font-weight: 700; opacity: 0.95; }
.gcSpinBtn { width: 118px; height: 118px; border-radius: 50%; font-size: 26px; font-weight: 900; letter-spacing: 1px;
  background: radial-gradient(circle at 35% 30%, #b9ffb0, #2fd36b 40%, #0b8f4a 75%); box-shadow: 0 0 0 5px #e9b949, 0 0 0 8px #7a4f12, 0 8px 22px rgba(47, 211, 107, 0.45), inset 0 -6px 12px rgba(0, 0, 0, 0.3); }
.gcBuyBtn { min-width: 150px; height: 74px; padding: 0 18px; border-radius: 18px; font-size: 15px; font-weight: 900;
  background: linear-gradient(180deg, #d58bff, #8b2fd3 55%, #5a148f); box-shadow: 0 0 0 3px #e9b949, 0 6px 16px rgba(160, 60, 230, 0.45), inset 0 -4px 10px rgba(0, 0, 0, 0.3); }
.gcBuyBtn.armed { background: linear-gradient(180deg, #ffd27a, #ff8a00 55%, #c25400); animation: gcPulseBtn 0.6s ease-in-out infinite alternate; }
@keyframes gcPulseBtn { to { box-shadow: 0 0 0 3px #fff3, 0 0 22px rgba(255, 160, 0, 0.8); } }
.gcSkipBtn { padding: 14px 26px; border-radius: 16px; border: none; font-weight: 800; font-size: 16px; cursor: pointer; background: #ffd34d; color: #2a1600; }
.gcChips { justify-content: center; }
body.phone .gcSpinBtn { width: 96px; height: 96px; font-size: 21px; } body.phone .gcBuyBtn { min-width: 120px; height: 62px; font-size: 13px; }
.gcActions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.gcSide.left { justify-self: end; } .gcSide.right { justify-self: start; }
body.phone .gcActions { gap: 8px; }
/* 🎨 painted Gene Cascade buttons (assets/icons/gc-spin.webp, gc-buy.webp) */
.gcSpinBtn { width: 128px; height: 128px; background: url("../assets/icons/gc-spin.webp") center / contain no-repeat; box-shadow: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55)); text-shadow: 0 2px 0 #0b5a2a, 0 0 8px rgba(0, 0, 0, 0.8), 0 3px 6px rgba(0, 0, 0, 0.7); }
.gcSpinBtn b { font-size: 27px; } .gcSpinBtn small { font-size: 12px; }
.gcSpinBtn:hover:not(:disabled) { transform: rotate(-8deg) scale(1.05); filter: drop-shadow(0 6px 16px rgba(80, 255, 120, 0.55)) brightness(1.08); }
.gcSpinBtn:active:not(:disabled) { transform: rotate(-20deg) scale(0.96); }
.gcBuyBtn { width: 240px; min-width: 0; height: 63px; padding: 0 30px 0 62px; border-radius: 0; background: url("../assets/icons/gc-buy.webp") center / 100% 100% no-repeat;
  box-shadow: none; filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5)); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); line-height: 1.15; }
.gcBuyBtn b { font-size: 15px; } .gcBuyBtn small { font-size: 11px; color: #ffe58a; }
.gcBuyBtn:hover:not(:disabled) { filter: drop-shadow(0 5px 14px rgba(190, 90, 255, 0.6)) brightness(1.1); }
.gcBuyBtn.armed { background: url("../assets/icons/gc-buy.webp") center / 100% 100% no-repeat; animation: gcArm 0.55s ease-in-out infinite alternate; }
@keyframes gcArm { from { filter: drop-shadow(0 0 4px rgba(255, 190, 60, 0.6)) brightness(1.05); } to { filter: drop-shadow(0 0 16px rgba(255, 190, 60, 1)) brightness(1.3) hue-rotate(-25deg); } }
.gcBtn:disabled { filter: grayscale(0.85) brightness(0.65); }
body.phone .gcSpinBtn { width: 100px; height: 100px; } body.phone .gcSpinBtn b { font-size: 21px; }
body.phone .gcBuyBtn { width: 150px; height: 40px; padding: 0 16px 0 38px; } body.phone .gcBuyBtn b { font-size: 11px; } body.phone .gcBuyBtn small { font-size: 9px; }

/* 🎨 painted logistics icons */
.sea .ship.lgShip { transform: translate(-50%, -50%); font-size: inherit; line-height: 0; }
.sea.sky .ship.lgShip { transform: translate(-50%, -50%) rotate(-8deg); }
.ico.lgVeh { width: 34px; height: 34px; margin: 0; vertical-align: middle; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.ico.lgPort { width: 24px; height: 24px; margin: 0; vertical-align: middle; }
.ico.lgBroke { width: 76px; height: 76px; margin: 0; }
.ico.lgSlot { width: 52px; height: 52px; margin: 0; }
.agentToggle .ico { width: 1.25em; height: 1.25em; }

/* 🎞️ Gene Cascade: falling specimens. --fall = rows fallen; the bottom row lands first, then row by row upwards */
.gcGrid { --spd: 1; overflow: hidden; }
.gcGrid.fast { --spd: 0.5; }
.gcGrid.skip .gcCell img { animation: none !important; }
.gcCell.drop img { animation: none; }
.gcCell.fall img { animation: gcFall calc(0.42s * var(--spd)) cubic-bezier(0.35, 0, 0.6, 1.25) both;
  animation-delay: calc(((6 - var(--row)) * 0.075s + var(--col) * 0.02s) * var(--spd)); }
@keyframes gcFall { from { transform: translateY(calc(var(--fall) * -108%)); } to { transform: none; } }
.gcCell.out img { animation: gcOut calc(0.3s * var(--spd)) ease-in both; animation-delay: calc(((6 - var(--row)) * 0.02s + var(--col) * 0.008s) * var(--spd)); }
@keyframes gcOut { to { transform: translateY(160%); opacity: 0; } }

/* 🚀 mission lists */
.spLog .ico { width: 1.6em; height: 1.6em; vertical-align: -0.45em; }
.spFail { color: #ff8a8a; }

/* 🧾 tax debt banner: stays in view under the top menu while scrolling, pays when clicked */
.debtBanner { position: sticky; top: 64px; z-index: 9; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }
body.phone .debtBanner { top: 56px; }
/* 🎁 reward cards: the collection emblem sits inside the title row instead of hanging over the text below */
.rewardCard h2 { display: flex; align-items: center; gap: 4px; }
.rewardCard .colEmblem { margin: 0 8px 0 0; flex-shrink: 0; }
.rewardCard > .muted { margin-top: 6px; }
.spot.trio { right: -11px; width: 19px; height: 19px; z-index: 4; }   /* 0-2-3 and 0-1-2 on the zero's edge */

/* 🎨 painted mine icons */
.mineEnergy .ico.mnE { width: 30px; height: 30px; margin: 0; }
.gameStatus .ico.mnE { width: 1.2em; height: 1.2em; margin: 0; }
.ico.mnUp { width: 34px; height: 34px; margin: 0; }

/* 🌐 language switch */
.langRow { display: flex; align-items: center; gap: 6px; padding: 6px 10px; }
#settingsMenu .langRow button { flex: 1; padding: 6px 8px; text-align: center; border-radius: 8px; }
#menuCorner { position: absolute; right: 12px; top: 12px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#menuLang { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(10, 8, 24, 0.75); border: 1px solid rgba(255, 211, 77, 0.5); }
#menuLang button { font: 700 15px/1 inherit; font-family: inherit; color: #d9d6ea; background: transparent; border: none; padding: 8px 12px; border-radius: 9px; cursor: pointer; }
#menuLang button:hover { color: #fff; }
html[lang="en"] [data-lang="en"], html[lang="es"] [data-lang="es"] { background: linear-gradient(180deg, #ffe27a, #f0a81c) !important; color: #2a1800 !important; }
.orLang { display: flex; gap: 4px; }
.orLang button { font: 700 13px system-ui, sans-serif; padding: 5px 12px; border-radius: 8px; border: 1px solid rgba(255, 211, 77, 0.5); background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer; }
/* 🌐 longer Spanish labels: keep amounts on one line */
#shop .income, #shop .card > .row > .muted, #shop .row > span.muted:last-child { white-space: nowrap; }

/* ☁️ Cloud save: main menu badge, Google letter, the "which progress to keep" choice */
#menuAccount { font: 700 15px/1 inherit; font-family: inherit; color: #fff; cursor: pointer;
  padding: 9px 14px; border-radius: 12px; background: rgba(10, 8, 24, 0.75); border: 1px solid rgba(255, 211, 77, 0.5); display: flex; align-items: center; gap: 6px; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#menuAccount:hover { border-color: #ffd34d; }
#menuAccount[hidden] { display: none; }
/* ⚙️ the ornate settings panel: scroll the page of the pop-up when it is taller than the screen */
#modal:has(#modalBox.ornate) { overflow-y: auto; align-items: flex-start; padding: 70px 0 20px; box-sizing: border-box; }
#modalBox.ornate { margin: auto; }
.cloudBtns { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 0 6px; }
.cloudBtns button { flex: 1; font: 700 13px/1.2 inherit; font-family: inherit; color: #fff; cursor: pointer; padding: 8px 6px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255, 211, 77, 0.35); }
.cloudBtns button:hover { border-color: #ffd34d; background: rgba(255,255,255,0.1); }
.cloudBtns button.danger { color: #ff9a9a; border-color: rgba(255, 107, 107, 0.4); }
.gIcon { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 900; font-family: Arial, sans-serif; margin-right: 6px; flex: none; }
.cloudInfo .grow { display: flex; flex-direction: column; gap: 2px; }
.cloudInfo small { color: #b9b4d6; font-weight: 600; }
.cloudPick { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 12px 0; }
.cloudPick .btn { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.cloudPick small { font-weight: 600; opacity: 0.85; }
/* ⚙️ settings on short screens: tighter rows so most of the panel fits without scrolling */
@media (max-height: 820px) {
  .orRow { padding: 6px 12px; margin-bottom: 4px; }
  .orSec { margin: 4px 4px 3px; }
  .orPanel { padding-top: 14px; }
  #modal:has(#modalBox.ornate) { padding-top: 56px; }
}

/* 🗂️ the game is open in another tab */
#tabBlock { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 6, 20, 0.92); display: grid; place-items: center; padding: 20px; }
#tabBlock[hidden] { display: none; }
#tabBlock .tabCard { max-width: 420px; text-align: center; background: #2b2d42; border: 2px solid #ffd34d; border-radius: 18px; padding: 26px 24px; color: #fff; }
#tabBlock .tabIcon { font-size: 44px; }
#tabBlock h2 { margin: 8px 0; }
#tabBlock p { color: #c9c6e0; }
.guestWarn { color: #ffcf7a; font-size: 13px; line-height: 1.35; margin: 2px 4px 8px; }
p.guestWarn { font-size: 14px; background: rgba(255, 170, 0, 0.1); border: 1px solid rgba(255, 170, 0, 0.35); border-radius: 10px; padding: 8px 10px; }
.guestAgain { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: #b9b4d6; cursor: pointer; }
.cloudPick #guestSignIn, .cloudPick #guestPlay { flex-direction: row; justify-content: center; align-items: center; }
.geneNote.geneKnownWarn { color: #ffcf7a; background: rgba(255, 170, 0, 0.1); border: 1px solid rgba(255, 170, 0, 0.35); border-radius: 10px; padding: 6px 10px; display: inline-block; }
.geneKnownWarn .sm, .geneKnownWarn img { vertical-align: middle; }

/* 🚀 Nebula Strike (🎮 Mini-games) */
.shGameIcon { width: 110px; }
.shIntro { max-width: 760px; margin: 0 auto 14px; text-align: center; }
.shIntro h2 { margin-top: 0; }
.shKeys { font-size: 13px; line-height: 1.6; margin: 8px 0; }
.shAuto { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 4px 0 8px; }
.shDustBig { font-size: 20px; color: #ffe66b; }
.shDustIco { filter: drop-shadow(0 0 4px rgba(255, 230, 107, 0.7)); }
.shLevels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.shLevel { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; margin: 0; }
.shLevel h3 { margin: 2px 0 0; }
.shLevel.locked { opacity: 0.55; }
.shLevel.locked .shBossPic img { filter: brightness(0.25) saturate(0); }
.shLevel.done { border-color: rgba(120, 230, 140, 0.55); }
.shBossPic { height: 120px; width: 100%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(120, 70, 255, 0.35), rgba(0, 0, 0, 0) 70%); border-radius: 12px; }
.shBossPic img { max-height: 112px; max-width: 92%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.shLvReward { font-size: 14px; line-height: 1.5; min-height: 42px; }
.shLevel .btn { margin-top: auto; }
.shHangar h3 { margin-top: 0; }
.shShips { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.shShip { display: flex; flex-direction: column; gap: 5px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 211, 77, 0.22); align-items: stretch; text-align: center; }
.shShip.sel { border: 2px solid #ffd34d; background: rgba(255, 211, 77, 0.08); box-shadow: 0 0 18px rgba(255, 211, 77, 0.25); }
.shShip.notOwned .shShipPic img { filter: brightness(0.55) saturate(0.6) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.shShipPic { height: 72px; display: flex; align-items: center; justify-content: center; }
.shShipPic img { max-height: 66px; max-width: 90%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.shShipDesc { font-size: 12.5px; min-height: 34px; }
.shBar { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 6px; font-size: 12px; text-align: left; }
.shBar i { display: block; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.shBar i b { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ffb300, #ffe27a); }
.shShip .btn { margin-top: 4px; }
.shUpTitle { margin: 18px 0 2px; }
.shStatsLine { text-align: center; }
.shPlay { display: flex; justify-content: center; }
.shStage { position: relative; width: 100%; max-width: min(960px, calc((100vh - 150px) * 16 / 9)); aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden; border: 2px solid rgba(255, 211, 77, 0.45); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  touch-action: none; user-select: none; -webkit-user-select: none; }
#shCanvas { width: 100%; height: 100%; display: block; touch-action: none; }
.shPauseBtn { position: absolute; top: 4px; right: 6px; width: 34px; height: 32px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 16px; }
.shTouch { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 12px; }
.shTouch.off { display: none; }
.shTBtn { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); font-size: 26px; cursor: pointer;
  background: rgba(20, 10, 50, 0.45); color: #fff; touch-action: none; }
.shTBtn.sh { border-color: rgba(120, 240, 255, 0.8); }
.shTBtn:active { transform: scale(0.94); background: rgba(120, 240, 255, 0.3); }
.shOverlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 4, 24, 0.62); padding: 12px; }
.shOverlay[hidden] { display: none; }
.shPanel { background: linear-gradient(180deg, #2a1a4f, #171030); border: 2px solid rgba(255, 211, 77, 0.6); border-radius: 16px;
  padding: 16px 22px; text-align: center; max-width: 520px; max-height: 100%; overflow: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.shPanel h2 { margin: 0 0 6px; }
.shPanel.win h2 { color: #ffd34d; }
.shPanel.lose h2 { color: #ff7a7a; }
.shEndStats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 14px; margin: 6px 0; }
.shEndReward { display: flex; justify-content: center; gap: 18px; font-size: 20px; color: #ffe66b; margin: 8px 0; }
.shFirst { color: #9dff9d; font-weight: 700; }
@media (max-width: 700px) {
  .shPanel { padding: 10px 12px; font-size: 13px; }
  .shPanel h2 { font-size: 18px; }
  .shEndReward { font-size: 16px; }
  .shTBtn { width: 54px; height: 54px; font-size: 22px; }
}
.shRotate { display: none; text-align: center; margin-top: 8px; }
@media (orientation: portrait) and (max-width: 700px) { .shPlay { flex-direction: column; align-items: center; } .shRotate { display: block; } }
@media (max-height: 520px) { .shStage { max-width: min(960px, calc((100dvh - 70px) * 16 / 9)); } }
.shPauseKeys { display: grid; grid-template-columns: 1fr; gap: 5px; max-width: 340px; margin-left: auto !important; margin-right: auto !important; text-align: left; font-size: 14px; margin: 10px 0 4px;
  padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.shPauseKeys b { display: inline-block; min-width: 150px; color: #ffd34d; }
@media (max-width: 700px) { .shPauseKeys { grid-template-columns: 1fr; font-size: 12px; gap: 3px; } .shPauseKeys b { min-width: 90px; } }
.shBinds { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; margin: 6px 0 8px; }
.shBind { display: flex; align-items: center; gap: 8px; }
.shBind .btn { min-width: 110px; }
.shBind .btn.waiting { animation: shBlink 0.8s ease-in-out infinite; }
@keyframes shBlink { 50% { opacity: 0.5; } }
.shOreNote .oreIcon, .shHangar .mineUpCost .oreIcon { width: 18px; height: 18px; vertical-align: -4px; }
.shScore { font-size: 18px; margin: 4px 0; }
.shScore b { color: #ffd34d; }
.shNewBest { color: #9dff9d; font-weight: 700; font-size: 15px; }
.shLoot { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0; }
.shChest { width: 170px; height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6)); }
.shLoot:not(.open) .shChest { animation: shChestBob 1.6s ease-in-out infinite; }
.shChest.shake { animation: shChestShake 0.15s linear infinite !important; filter: drop-shadow(0 0 18px rgba(120, 240, 255, 0.9)); }
.shLoot.open .shChest { animation: shChestPop 0.45s ease-out; filter: drop-shadow(0 0 26px rgba(255, 210, 80, 0.8)); }
@keyframes shChestBob { 50% { transform: translateY(-5px); } }
@keyframes shChestShake { 0% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) scale(1.04); } 100% { transform: rotate(-4deg); } }
@keyframes shChestPop { 0% { transform: scale(0.7); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.shLootTier { font-size: 22px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; text-shadow: 0 0 12px currentColor; }
.shLootTier.common { color: #8be38b; } .shLootTier.rare { color: #5ab8ff; } .shLootTier.epic { color: #c77dff; }
.shLootTier.legendary { color: #ffcc33; } .shLootTier.pet { color: #ff8ad8; }
.shPetWin { display: flex; align-items: center; gap: 12px; text-align: left; max-width: 360px; }
.shPetWin img { width: 86px; height: 86px; border-radius: 50%; border: 3px solid #ff8ad8; box-shadow: 0 0 18px rgba(255, 138, 216, 0.7); }
.shEndReward.small { font-size: 15px; }
@media (max-width: 700px) { .shChest { width: 110px; } .shLootTier { font-size: 17px; } .shPetWin img { width: 60px; height: 60px; } }

/* 🐾 Pet on the Income page */
#petLayer { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: visible; }
#petLayer[hidden] { display: none; }
#pet { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; will-change: transform; -webkit-tap-highlight-color: transparent; }
#pet img { width: 100%; height: 100%; display: block; transform-origin: 50% 100%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); user-select: none; }
#pet:focus-visible { outline: 2px dashed #ffd34d; outline-offset: 2px; border-radius: 12px; }
.petFloat { position: absolute; pointer-events: none; font-size: 22px; font-weight: 900; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.petFloat.z { color: #cfe4ff; font-size: 18px; font-style: italic; }
.petSetPic { width: 34px; height: 34px; border-radius: 50%; margin-right: 8px; border: 2px solid #ff8ad8; }
.petNameInput { width: 140px; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(255, 211, 77, 0.5); background: rgba(0, 0, 0, 0.35); color: #fff; font: inherit; }
/* 🏴‍☠️ loot reel */
.shReel { position: relative; width: min(480px, 100%); margin: 10px auto 8px; overflow: hidden; border-radius: 12px; padding: 10px 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(30, 10, 50, 0.6)); border: 2px solid rgba(255, 211, 77, 0.5);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.shReelStrip { display: flex; gap: 8px; padding-left: 0; will-change: transform; }
.shReelPointer { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); background: #ffd34d; box-shadow: 0 0 10px #ffd34d; }
.shReelPointer::before, .shReelPointer::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border: 9px solid transparent; }
.shReelPointer::before { top: 0; border-top-color: #ffd34d; }
.shReelPointer::after { bottom: 0; border-bottom-color: #ffd34d; }
.shCard { --c: #8be38b; flex: 0 0 104px; height: 124px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--c) 35%, transparent), rgba(10, 5, 25, 0.9) 75%);
  border: 2px solid var(--c); border-bottom-width: 5px; box-shadow: inset 0 0 14px color-mix(in srgb, var(--c) 40%, transparent); }
.shCard img { width: 78%; height: auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.shCard span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--c); }
.shCard.rare { --c: #5ab8ff; } .shCard.epic { --c: #c77dff; } .shCard.legendary { --c: #ffcc33; } .shCard.pet { --c: #ff8ad8; }
.shCard.won { animation: shCardWin 0.9s ease-out forwards; }
@keyframes shCardWin { 0% { transform: scale(1); } 40% { transform: scale(1.12); box-shadow: 0 0 30px var(--c), inset 0 0 20px var(--c); } 100% { transform: scale(1.06); box-shadow: 0 0 22px var(--c), inset 0 0 16px var(--c); } }
.shWinCard { display: flex; justify-content: center; }
.shWinCard .shCard { flex: 0 0 auto; width: 140px; height: 160px; animation: shCardWin 0.9s ease-out forwards; }
@media (max-width: 700px) { .shCard { flex-basis: 78px; height: 96px; } .shCard span { font-size: 9px; } .shWinCard .shCard { width: 96px; height: 112px; } }
.shChestShop { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.shChestShop h3 { margin: 0 0 4px; }
.shChestShop.locked { opacity: 0.6; }
.shChestShopImg { width: 90px; height: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.shChestShop.locked .shChestShopImg { filter: grayscale(1) brightness(0.6); }
.shChestModal { text-align: center; width: min(520px, 86vw); margin: 0 auto; }
.shChestModal h2 { margin: 0 0 6px; color: #ffd34d; }
/* 🚀 Nebula Strike painted icons: stardust keeps its ✨ text (for translations) but shows the picture */
.shDustIco { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; color: transparent; overflow: hidden;
  background: url("../assets/icons/ico-sh-dust.webp") center / contain no-repeat; filter: none; }
.ico.shAutoIco { width: 26px; height: 26px; margin: 0; }
.shTBtn .ico { width: 40px; height: 40px; margin: 0; pointer-events: none; }
@media (max-width: 700px) { .shTBtn .ico { width: 32px; height: 32px; } }
/* 🔞 age and entertainment notice */
.ageGate { text-align: left; max-width: 640px; margin: 0 auto; line-height: 1.5; }
.ageGate h2 { text-align: center; margin-top: 0; }
.ageGate ul { margin: 6px 0 10px; padding-left: 22px; }
.ageGate li { margin: 5px 0; }
.ageCheck { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-weight: 700; cursor: pointer; }
.ageCheck input { width: 18px; height: 18px; }
.ageGate .cloudPick { justify-content: center; }
.ageNoMsg { text-align: center; color: #ff8a8a; font-weight: 700; }
.ageLinks, .orLegal { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 6px; }
.ageLinks a, .orLegal a { color: #8fd0ff; font-weight: 700; text-decoration: none; padding: 5px 12px; border-radius: 8px; border: 1px solid rgba(143, 208, 255, 0.4); background: rgba(143, 208, 255, 0.08); }
.ageLinks a:hover, .orLegal a:hover { background: rgba(143, 208, 255, 0.2); }
