
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #7ec850;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#btn-rotate-cam:active,
.hud-gear-btn:active {
  background: rgba(255, 255, 255, 0.7);
}



#hud-gear {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hud-gear-btn {
  cursor: pointer;
  pointer-events: auto;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: #3a3a1e;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
  padding: 0;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}
.hud-gear-btn:active {
  background: rgba(255, 255, 255, 0.98);
}

#hud-gear-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 8px 4px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

#hud-gear-menu .hud-pill {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  border: none;
  color: #3a3a1e;
  text-decoration: none;
}

#hud-gear-menu .hud-pill:active {
  background: rgba(0, 0, 0, 0.08);
}

#hud-gear-menu .hud-pill:disabled {
  opacity: 0.28;
  cursor: default;
}

.hud-exit-btn {
  color: #c0392b;
}

.hud-help-btn {
  text-decoration: none;
  color: inherit;
}

/* Non-interactive pills always faded */
#hud-day {
  cursor: pointer;
  user-select: none;
}

.hud-pill-on {
  cursor: pointer;
}
.hud-pill-off {
  opacity: 0.6;
  pointer-events: none;
}

/* Mid-day recipe edit: hide bottom row entirely + Insumos/Mejoras in top row */
#recipe-panel.mid-day .tab-row:last-child { display: none; }
#recipe-panel.mid-day .tab-btn:not([data-tab="tab-receta"]) { display: none; }

#hud-speed {
  position: fixed;
  bottom: max(calc(env(safe-area-inset-bottom, 0px) + 20px), 56px);
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  align-items: flex-end;
}

#speed-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.hud-speed-btn {
  pointer-events: auto;
  cursor: pointer;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(147, 213, 255, 0.93);
  color: #0a4a72;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
  padding: 0;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}

.hud-speed-btn:active {
  background: rgba(100, 185, 255, 0.98);
}

#hud-speed .hud-speed-active {
  display: flex;
}

#hud-speed.hud-speed-expanded .hud-speed-btn {
  display: flex;
  opacity: 0.45;
}

#hud-speed.hud-speed-expanded .hud-speed-active {
  opacity: 1;
}

#btn-close-shop {
  display: none;
  pointer-events: auto;
  cursor: pointer;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 160, 80, 0.93);
  color: #7a2a00;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
  padding: 0;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}

#btn-close-shop:active {
  background: rgba(255, 135, 50, 0.98);
}

#btn-close-shop.visible {
  display: flex;
}

.btn-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #7aaac0;
  cursor: pointer;
  padding: 2px 6px;
  z-index: 1;
}

.btn-close:active { color: #c0392b; }

#hud-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: auto;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

.hud-pill {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 14px;
  color: #3a3a1e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

/* ---------- Panels ---------- */
.panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(420px, 100%);
  z-index: 200;
  background: linear-gradient(170deg, #c4e4f7 0%, #eef6fd 40%);
  border-radius: 22px 22px 0 0;
  padding: 20px 22px calc(env(safe-area-inset-bottom, 0px) + 18px);
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.25);
  text-align: center;
  max-height: 88vh;
  overflow-y: auto;
  touch-action: pan-y;
}

.panel h1 {
  font-size: 22px;
  color: #1a3a5c;
  margin-bottom: 6px;
}

#welcome-panel,
#franchise-panel {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
  width: min(380px, 92vw);
  padding: 16px 28px 24px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(160deg, #bddff7 0%, #eef6fd 45%);
}

.game-logo-title {
  text-align: center;
  line-height: 1;
  letter-spacing: 0.01em;
}
.game-logo-title--stack {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 12px;
}
.glt-cup {
  font-size: clamp(65px, 18vw, 85px);
  line-height: 1;
  flex-shrink: 0;
  margin-right: -18px;
  transform: scaleX(-1);
  text-shadow:
    -1px -1px 0 #3d1800,  1px -1px 0 #3d1800,
    -1px  1px 0 #3d1800,  1px  1px 0 #3d1800,
     0    3px 0 #1a0800;
}
.glt-cup--right {
  margin-right: 0;
  margin-left: -18px;
  transform: none;
}
.glt-words {
  display: flex;
  flex-direction: column;
  line-height: 0.95;
}
.game-logo-title--inline {
  display: block;
  white-space: nowrap;
  margin: 16px 0 20px;
}
.glt-mike {
  font-family: 'Titan One', sans-serif;
  color: #f5c200;
  text-shadow:
    -2px -2px 0 #3d1800,  2px -2px 0 #3d1800,
    -2px  2px 0 #3d1800,  2px  2px 0 #3d1800,
     0    5px 0 #1a0800;
}
.glt-chichero {
  font-family: 'Titan One', sans-serif;
  color: #f8ecd4;
  text-shadow:
    -2px -2px 0 #3d1800,  2px -2px 0 #3d1800,
    -2px  2px 0 #3d1800,  2px  2px 0 #3d1800,
     0    5px 0 #1a0800;
}
.game-logo-title--stack .glt-mike {
  display: block;
  font-size: clamp(53px, 15vw, 73px);
}
.game-logo-title--stack .glt-chichero {
  display: block;
  font-size: clamp(27px, 7.5vw, 37px);
}
.game-logo-title--inline .glt-mike,
.game-logo-title--inline .glt-chichero {
  display: inline;
  font-size: clamp(22px, 6.5vw, 30px);
}
.game-logo-title--inline .glt-cup {
  font-size: clamp(28px, 8vw, 36px);
  margin-right: -4px;
}
.game-logo-title--inline .glt-cup--right {
  margin-left: -4px;
  margin-right: 0;
}

.franchise-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -12px 0 14px;
}
.recipe-franchise-name {
  font-size: 13px;
  font-weight: 600;
  color: #2a5070;
  letter-spacing: 0.02em;
}
.edit-name-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: #7aaac0;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.edit-name-btn:hover { color: #2a5070; }

.panel h1 {
  font-family: 'Titan One', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 5vw, 22px);
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #fff;
  text-shadow:
    -1px -1px 0 #3d1800,  1px -1px 0 #3d1800,
    -1px  1px 0 #3d1800,  1px  1px 0 #3d1800,
     0    3px 0 #1a0800;
  margin-bottom: 30px;
}

#welcome-panel .lang-toggle {
  position: static;
  justify-content: center;
  margin-top: 20px;
}

.about-link {
  margin-top: 12px;
  font-size: 12px;
  color: #7aaac0;
  text-align: center;
}

.about-link a {
  color: #2a5070;
  text-decoration: underline;
}

.version-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #7aaac055;
  text-align: center;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
}
.version-label:hover { text-decoration: underline; }

.day-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #2a5070;
  margin-bottom: 2px;
}

.hint {
  font-size: 13px;
  color: #5a7a90;
  margin-bottom: 12px;
}

.summary-rent-warning {
  color: #b05a00;
  background: rgba(255, 180, 50, 0.15);
  border: 1px solid rgba(255, 180, 50, 0.5);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
}

.crash-ticker {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 400;
  pointer-events: none;
}
.crash-ticker.visible { pointer-events: auto; }

.crash-ticker-inner {
  background: #f0e6c4;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 22px,
      rgba(160,120,60,0.07) 22px,
      rgba(160,120,60,0.07) 23px
    );
  border-top: 4px solid #6b1a00;
  border-bottom: 3px double #3a2010;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  padding: 10px 32px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transform: translateY(-110%);
  transition: transform 0.38s cubic-bezier(0.3, 0, 0.2, 1);
  position: relative;
}
.crash-ticker.visible .crash-ticker-inner {
  transform: translateY(0);
}
.crash-ticker-masthead {
  font-family: 'Titan One', Georgia, serif;
  font-size: 17px;
  color: #1a0800;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.1;
  padding-bottom: 3px;
}
.crash-ticker-dateline {
  font-family: Georgia, serif;
  font-size: 9px;
  color: #6b4a20;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 5px;
}
.crash-ticker-rule {
  border: none;
  border-top: 1px solid #3a2010;
  box-shadow: 0 1.5px 0 #f0e6c4, 0 2.5px 0 #3a2010;
  margin-bottom: 7px;
}
.crash-ticker-headline {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  color: #1a0800;
  line-height: 1.35;
  text-align: center;
}
.crash-ticker-byline {
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  color: #7a0000;
  text-align: center;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px solid #c09060;
  letter-spacing: 0.02em;
}
.crash-ticker-close {
  position: absolute;
  top: 7px; right: 10px;
  background: none;
  border: none;
  color: #6b3010;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
}

#price-index-hint {
  background: rgba(255, 255, 255, 0.92);
  border-color: #b0d4ec;
}

#price-index-hint.index-high { color: #1a6fa0; border-color: #1a6fa0; }
#price-index-hint.index-low  { color: #27ae60; border-color: #27ae60; }

#tutorial-skip-btn {
  position: fixed;
  left: 12px;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  z-index: 20;
  pointer-events: auto;
  background: rgba(0, 60, 100, 0.72);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

#supply-inflation-badge { color: #b05a00; font-weight: 600; }

.price-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.price-meta-row .hint {
  margin-bottom: 0;
}

.price-cup-btn {
  border: 1.5px solid #7fc4e8;
  border-radius: 999px;
  background: rgba(91, 179, 232, 0.18);
  color: #1a3a5c;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.price-cup-btn:active {
  background: rgba(91, 179, 232, 0.45);
}

.price-cup-btn.profit-loss {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
  color: #c0392b;
}

.price-cup-btn.profit-low {
  border-color: #f1c40f;
  background: rgba(241, 196, 15, 0.25);
  color: #7d6608;
}

.price-cup-btn.profit-good {
  border-color: #27ae60;
  background: rgba(39, 174, 96, 0.15);
  color: #1e8449;
}

#price-slider-wrap {
  background: #ddeefb;
  border-radius: 10px;
  padding: 10px 12px 2px;
  margin-bottom: 10px;
}

.chicha-drawer {
  text-align: left;
  margin: 8px 0 4px;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
  overflow: hidden;
}
.chicha-drawer summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1a3a5c;
  list-style: none;
  user-select: none;
  text-align: center;
}
.chicha-drawer summary::-webkit-details-marker { display: none; }
.chicha-drawer[open] summary { border-bottom: 1px solid rgba(0,0,0,0.08); }
.chicha-drawer-body {
  font-size: 12px;
  color: #555;
  padding: 10px 12px;
  margin: 0;
}
.welcomeText {
  font-size: 12px;
  color: #666666;
  margin: 12px 6px 20px;
}

.wiki-link {
  color: #3aada8;
  text-decoration: underline;
  pointer-events: auto;
}
/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  background: #b8d9f0;
  border-radius: 12px;
  padding: 4px;
}

.tab-row {
  display: flex;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #2a5070;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 4px;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: #fff;
  color: #1a3a5c;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), inset 0 -3px 0 #5bb3e8;
}

.recipe-weather-toggle {
  cursor: pointer;
  user-select: none;
}

.recipe-weather-toggle::after, #hud-day::after {
  content: ' ▾';
  font-size: 10px;
  opacity: 0.55;
}

#forecast-wrap {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  width: min(340px, 92vw);
  background: #ddeefb;
  border-radius: 14px;
  padding: 10px 12px 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}

.forecast-close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  color: #5a7a90;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.forecast-title {
  font-size: 13px;
  font-weight: 700;
  color: #5a7a90;
  text-align: center;
  margin-bottom: 4px;
}

/* ---------- Forecast ---------- */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}

.forecast-card {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 10px 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.fc-period {
  font-size: 10px;
  font-weight: 700;
  color: #5a7a90;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fc-weather {
  font-size: 13px;
  font-weight: 700;
  color: #1a3a5c;
  margin: 6px 0 4px;
  line-height: 1.2;
}

.fc-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.fc-bar-fill {
  height: 100%;
  background: #2575b5;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.fc-pct {
  font-size: 12px;
  font-weight: 700;
  color: #2575b5;
  margin-top: 2px;
}

/* ---------- Sound settings ---------- */
#sound-settings-wrap {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  width: min(320px, 92vw);
  background: #ddeefb;
  border-radius: 14px;
  padding: 14px 16px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}

.sound-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.sound-row-all {
  border-bottom: 1px solid rgba(90, 122, 144, 0.25);
  margin-bottom: 4px;
}

.sound-mute-btn {
  background: none;
  border: none;
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  flex: 0 0 auto;
  opacity: 0.9;
}

.sound-mute-btn.channel-muted {
  opacity: 0.4;
}

.sound-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a3a5c;
  flex: 0 0 72px;
}

.sound-slider {
  flex: 1 1 auto;
  accent-color: #2575b5;
}

/* ---------- Recipe controls ---------- */
.control {
  margin-bottom: 12px;
  text-align: left;
}

.control label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
  color: #1a3a5c;
  margin-bottom: 4px;
}

.control .value {
  color: #2980b9;
}

.slider-wrap {
  position: relative;
  padding-bottom: 10px;
}

.recipe-dot {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid #2ecc71;
  transform: translateX(-50%);
  pointer-events: none;
  transition: left 0.12s;
}

input[type="range"] {
  width: 100%;
  height: 34px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: #b8d9f0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #5bb3e8;
  border: 3px solid #2980b9;
  margin-top: -9px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  background: #b8d9f0;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #5bb3e8;
  border: 3px solid #2980b9;
}

/* ---------- Supplies shop ---------- */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  color: #1a3a5c;
  margin: 4px 0 8px;
  border-top: 2px solid #5bb3e8;
  padding-top: 10px;
}

.section-note {
  font-size: 11px;
  font-weight: 500;
  color: #5a7a90;
}

.shop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.shop-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ddeefb;
  border-radius: 10px;
  padding: 6px 9px 7px;
}

.shop-label {
  font-size: 8px;
  font-weight: 600;
  color: #5a7a90;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.shop-stock {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #1a3a5c;
}

.stock-line1 {
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.stock-line2 {
  font-weight: 500;
  font-size: 9px;
  color: #5a7a90;
}

.stock-held {
  font-weight: 600;
  font-size: 9px;
  color: #7a4a00;
  background: #fff3cd;
  border-radius: 3px;
  padding: 0 3px;
  white-space: nowrap;
  align-self: flex-start;
}

.shop-stock.expiry-warn   { color: #1a6fa0; }
.shop-stock.expiry-warn .stock-line2 { color: #1a6fa0; }
.shop-stock.expiry-danger { color: #c0392b; }
.shop-stock.expiry-danger .stock-line2 { color: #c0392b; }

.buy-btn {
  border: none;
  border-radius: 8px;
  background: #e87c18;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 8px;
  cursor: pointer;
  box-shadow: 0 2px 0 #b85c08;
  white-space: nowrap;
}

.buy-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.buy-btn:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.buy-btn.layoff-btn {
  background: #ff6b6b;
  color: #fff;
  box-shadow: 0 2px 0 #c0392b;
}

.buy-btn.layoff-btn:active {
  box-shadow: none;
}

/* ---------- Upgrades ---------- */
.upgrades {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.upgrade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ddeefb;
  border-radius: 10px;
  padding: 8px 10px;
  border-left: 3px solid #5bb3e8;
}

.upgrade-row.owned {
  background: #e8f5d8;
  border-left-color: #4caf50;
}

.check-icon {
  font-size: 0.7em;
  margin-right: 3px;
  vertical-align: middle;
}

.upgrade-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.upgrade-name {
  font-weight: 700;
  font-size: 14px;
  color: #1a3a5c;
}

.upgrade-desc {
  font-size: 11px;
  color: #5a7a90;
}

/* ---------- Fixed costs tab ---------- */
.fixed-costs { display: flex; flex-direction: column; gap: 8px; }

.fixed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fdf5e0;
  border-radius: 10px;
  padding: 8px 10px;
  border-left: 3px solid #e8a930;
}
.fixed-row.due-today  { background: #fde8e8; border-left-color: #d64040; }
.fixed-row.inactive   { background: #f0f0f0; border-left-color: #aaaaaa; }

.fixed-info { display: flex; flex-direction: column; text-align: left; }
.fixed-name { font-weight: 700; font-size: 14px; color: #1a3a5c; }
.fixed-rule { font-size: 11px; color: #5a7a90; }

.fixed-next { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.fixed-next-label  { font-size: 11px; color: #5a7a90; }
.fixed-next-amount { font-size: 14px; font-weight: 700; color: #1a3a5c; }
.fixed-next-amount.due-today { color: #cc2020; }

/* ---------- Taxes tab ---------- */
.tax-panel { display: flex; flex-direction: column; gap: 8px; }

.tax-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e0d8c0;
  border-radius: 12px;
  padding: 10px;
}

.tax-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0;
}

.tax-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #eef6fb;
  border-radius: 10px;
  padding: 8px 10px;
}
.tax-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #2a5070;
}
.tax-line-sub {
  padding-left: 12px;
  font-size: 11px;
  color: #5a7a90;
}
.tax-line-total {
  font-weight: 700;
  color: #1a3a5c;
  border-top: 1px solid #c5dcea;
  padding-top: 4px;
  margin-top: 2px;
}

.tax-line-penalty {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #cc2020;
  padding: 4px 10px;
}

.tax-lock-note {
  color: #cc2020;
  font-weight: 700;
  font-size: 12px;
  margin: 0;
}

.tax-lock-warning {
  color: #cc2020;
  font-weight: 700;
  text-align: center;
}

.tax-pay-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #38b8f0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 #0a4e90;
}
.tax-pay-btn:active   { transform: translateY(2px); box-shadow: none; }
.tax-pay-btn:disabled { filter: grayscale(0.7); opacity: 0.6; cursor: default; }

.tax-bracket-toggle {
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: #dcedf7;
  color: #1a3a5c;
  font-size: 12px;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
}
.tax-bracket-toggle:active { transform: translateY(1px); }

.tax-bracket-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 6px;
  background: #eef6fb;
  border-radius: 10px;
  padding: 8px 10px;
  overflow: hidden;
}
.tax-bracket-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #2a5070;
  padding: 4px 6px;
  margin: 0 -10px;
}
.tax-bracket-row:nth-child(even):not(.tax-bracket-header) {
  background: #dcedf7;
}
.tax-bracket-header {
  font-weight: 700;
  color: #1a3a5c;
  border-bottom: 1px solid #c5dcea;
  padding-bottom: 4px;
  margin-bottom: 2px;
}

.wage-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.wage-btn {
  width: 26px; height: 26px;
  border: 1px solid #b0c8d8;
  border-radius: 6px;
  background: #e8f4fb;
  color: #1a3a5c;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.wage-btn:disabled { opacity: 0.35; cursor: default; }
.wage-value  { font-size: 13px; font-weight: 700; color: #1a3a5c; }
.wage-market { font-size: 11px; color: #5a7a90; }
.wage-pending {
  display: block;
  font-size: 11px;
  color: #c07800;
  margin-top: 2px;
}
.wage-accept-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #4caf50;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.wage-accept-btn:active { background: #388e3c; }

/* ---------- Language toggle ---------- */
.lang-toggle {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 4px;
}

.lang-btn {
  border: 2px solid #7fc4e8;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #5a7a90;
}

.lang-btn.lang-active {
  background: #5bb3e8;
  border-color: #2980b9;
  color: #fff;
  box-shadow: 0 2px 0 #1a6fa0;
}

/* ---------- Welcome screen ---------- */
.welcome-tagline { font-size: 15px; margin-bottom: 20px; }
#btn-new-game { margin-top: 20px; }

.save-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-weight: 700;
  font-size: 15px;
  color: #2a5070;
  margin-bottom: 10px;
}

.big-btn.btn-muted {
  background: transparent;
  border: 2px solid #7fc4e8;
  color: #5a7a90;
  font-size: 15px;
  box-shadow: none;
  margin-top: 4px;
}

/* ---------- Cart purchase ---------- */
.franchise-intro {
  font-size: 13px;
  color: #1a3a5c;
  line-height: 1.5;
  margin: 0 0 4px;
  text-align: center;
}

.franchise-name-input {
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 4px;
  padding: 12px 14px;
  border: 2px solid #5bb3e8;
  border-radius: 12px;
  background: rgba(91, 179, 232, 0.08);
  font-size: 15px;
  font-family: inherit;
  color: #1a3a5c;
  outline: none;
  text-align: center;
}
.franchise-name-input::placeholder { color: #5a90b5; }
.franchise-name-input:focus { border-color: #2980b9; background: rgba(91, 179, 232, 0.18); }

.cart-option {
  background: rgba(91, 179, 232, 0.15);
  border: 2px solid #5bb3e8;
  border-radius: 16px;
  padding: 16px 12px;
  margin: 14px 0 8px;
  text-align: center;
}

.cart-emoji     { font-size: 36px; margin-bottom: 6px; }
.cart-name      { font-weight: 700; font-size: 18px; color: #1a3a5c; margin-bottom: 4px; }
.cart-desc      { font-size: 12px; margin-bottom: 8px; }
.cart-price-tag { font-size: 26px; font-weight: 800; color: #2980b9; }

/* ---------- Franchise breakdown ---------- */
.franchise-breakdown {
  background: rgba(91, 179, 232, 0.12);
  border: 2px solid #5bb3e8;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 14px 0 8px;
}
.fb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #1a3a5c;
  padding: 5px 0;
}
.fb-row span:last-child { font-weight: 600; }
.fb-divider {
  border-top: 1px solid #2980b966;
  margin: 6px 0;
}
.fb-total {
  font-size: 16px;
  font-weight: 800;
  color: #2060a0;
}
.fb-total span:last-child { font-size: 20px; color: #2980b9; }
.fb-mike-note { font-size: 12px; color: #888; margin: 8px 0 4px; text-align: center; }

/* ---------- Consent checkbox ---------- */
.consent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  cursor: pointer;
}
.consent-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2980b9;
  cursor: pointer;
  flex-shrink: 0;
}
.consent-text {
  font-size: 13px;
  color: #1a3a5c;
  user-select: none;
}
.name-error {
  font-size: 12px;
  color: #c0392b;
  min-height: 16px;
  margin-top: 4px;
  text-align: center;
}

.consent-disclosure {
  font-size: 11px;
  color: #7aaac0;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* ---------- Buttons ---------- */

.big-btn {
  width: 100%;
  padding: 15px;
  margin-top: 6px;
  border: none;
  border-radius: 14px;
  background: #38b8f0;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #0a4e90;
}

.big-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1a6fa0;
}

.big-btn:disabled {
  filter: grayscale(0.7);
  opacity: 0.7;
}

/* ---------- Summary ---------- */
.stars {
  font-size: 38px;
  color: #f5a623;
  letter-spacing: 4px;
  margin: 6px 0 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.rating-label {
  font-size: 14px;
  font-weight: 600;
  color: #5a7a90;
  margin-bottom: 14px;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
}

.stat-num.red {
  color: #c0392b;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #4a8a2a;
}

.stat-label {
  font-size: 12px;
  color: #5a7a90;
}

/* ---------- NPC name tooltip ---------- */
/* ---------- Finance Chart Modal ---------- */
#finance-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
}
#finance-modal {
  background: linear-gradient(160deg, #bddff7 0%, #eef6fd 40%);
  border: 2px solid #5bb3e8;
  border-radius: 18px;
  padding: 14px 16px 16px;
  width: min(380px, 94vw);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
#finance-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 15px; color: #0a2040;
  margin-bottom: 8px;
}
#finance-close {
  background: none; border: none; font-size: 20px;
  color: #5a7a90; cursor: pointer; line-height: 1; padding: 0;
}
#finance-legend, #price-legend {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: #5a7a90; margin-bottom: 8px;
}
.fi-dot {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 2px; flex-shrink: 0;
}
#finance-tabs {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.fi-tab {
  flex: 1; padding: 6px 0; border: 1.5px solid #5bb3e8;
  border-radius: 10px; background: none; cursor: pointer;
  font-size: 12px; font-weight: 700; color: #5a7a90;
}
.fi-tab-active {
  background: #5bb3e8; color: #fff;
}
.chart-area { display: flex; align-items: flex-start; }
.chart-yaxis { flex-shrink: 0; width: 44px; display: block; }
.npc-month-select {
  display: block;
  margin: 8px auto 4px;
  padding: 4px 8px;
  border: 1.5px solid #ffd23f;
  border-radius: 8px;
  background: #fffde8;
  font-size: 13px;
  font-weight: 600;
  color: #5b4a12;
  text-align: center;
}
.npc-pie { display: block; margin: 4px auto 0; }
.npc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.npc-table th { background: #5bb3e8; color: #fff; padding: 5px 8px; text-align: center; white-space: nowrap; }
.npc-table td { padding: 4px 8px; text-align: center; border-bottom: 1px solid #e0eaf2; }
.npc-table tr:nth-child(even) td { background: #f0f7ff; }
.npc-pct { color: #7a9ab0; font-size: 10px; margin-left: 2px; }
.chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: #e4f2fc;
  direction: rtl;
}
#finance-canvas, #price-canvas {
  display: block; height: 200px;
  direction: ltr;
}
#finance-empty {
  text-align: center; color: #5a7a90; font-size: 13px; padding: 32px 0;
}

/* ---------- NPC Pill ---------- */
#npc-profile {
  position: fixed;
  bottom: 20px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #c8e8f8 0%, #eef6fd 50%);
  border: 2px solid #5bb3e8;
  border-left: 4px solid #2980b9;
  border-radius: 999px 20px 20px 999px;
  padding: 3px 16px 3px 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  width: 290px;
  transition: opacity 0.3s, transform 0.3s;
}

#npc-profile.npc-pill-hidden {
  opacity: 0;
  transform: translateX(-24px) scale(0.92);
  pointer-events: none;
}

#portrait-canvas {
  display: block;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 3px;
  background: linear-gradient(160deg, #c8e89a 0%, #7ec850 100%);
}

#npc-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#npc-profile-name {
  font-weight: 900;
  font-size: 20px;
  color: #0a2040;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  text-align: center;
}

#npc-profile-ratings { min-height: 36px; }

.pr-avg {
  font-weight: 900;
  font-size: 13px;
  color: #d4a629;
  letter-spacing: 1px;
  margin-bottom: 2px;
  text-align: center;
}

.pr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 1px 0;
}

.pr-label { color: #5a7a90; font-weight: 600; }
.pr-stars { color: #d4a629; letter-spacing: 1px; }

#npc-profile-comment {
  font-size: 14px;
  color: #1a3a5c;
  font-style: italic;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
  min-height: 18px;
}

#npc-comment-inner {
  display: inline-block;
  white-space: nowrap;
}

#npc-comment-inner.marquee {
  animation: npc-marquee 7s ease-in-out infinite alternate;
}

#npc-comment-inner.marquee-once {
  animation: npc-marquee 7s ease-in-out 1 forwards;
}

@keyframes npc-marquee {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(0); }
  80%  { transform: translateX(var(--marquee-dx, 0px)); }
  100% { transform: translateX(var(--marquee-dx, 0px)); }
}

#npc-profile-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #5bb3e8;
  border: 2px solid #eef6fd;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 13px;
  color: #0a2040;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ---------- Rating list panel ---------- */
#rating-list-panel {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 12px;
  width: min(260px, 88vw);
  max-height: 60vh;
  background: linear-gradient(170deg, #bddff7 0%, #eef6fd 35%);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 300;
}

#rating-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 6px;
  font-weight: 700;
  font-size: 14px;
  color: #1a3a5c;
  border-bottom: 2px solid #5bb3e8;
  flex-shrink: 0;
}

#rating-list-header button {
  background: none;
  border: none;
  font-size: 18px;
  color: #7aaac0;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

#rating-list-legend {
  padding: 4px 14px;
  font-size: 10px;
  color: #5a7a90;
  background: #deeefb;
  flex-shrink: 0;
}

#rating-list-body {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}

.rating-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 4px;
  align-items: center;
  padding: 5px 14px;
  font-size: 12px;
  border-bottom: 1px solid #cce0f0;
}

.rating-row:last-child { border-bottom: none; }

.rating-name {
  font-weight: 700;
  color: #1a3a5c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rating-sub {
  color: #2a5070;
  white-space: nowrap;
}

.rating-avg {
  font-weight: 700;
  color: #c98a00;
  white-space: nowrap;
}

.rating-list-empty {
  padding: 14px;
  color: #5a7a90;
  font-size: 13px;
  text-align: center;
}

/* ---------- Game Over ---------- */
.gameover-sub { margin-bottom: 16px; font-size: 14px; }

.go-section { margin: 18px 0 0; text-align: left; }
.go-section-title { font-family: 'Titan One', sans-serif; font-size: 13px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; text-shadow: -1px -1px 0 #3d1800, 1px -1px 0 #3d1800, -1px 1px 0 #3d1800, 1px 1px 0 #3d1800, 0 2px 0 #1a0800; }

.go-record-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.go-record-row:last-child { border-bottom: none; }
.go-record-top { font-weight: 700; color: #2060a0; }
.go-rec-rank   { width: 24px; flex-shrink: 0; color: #999; font-size: 11px; }
.go-rec-date   { color: #888; font-size: 11px; flex-shrink: 0; }
.go-rec-stat   { flex: 1; }
.go-rec-rating { font-weight: 700; flex-shrink: 0; }

.go-day-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.go-day-tab {
  padding: 4px 10px; border: none; border-radius: 20px;
  background: rgba(0,0,0,0.08); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.go-day-tab.active { background: #2980b9; color: #fff; font-weight: 700; }
.go-tab-avg { font-size: 11px; opacity: 0.85; }

.go-day-body { max-height: 220px; overflow-y: auto; }
.go-empty { font-size: 13px; color: #999; text-align: center; padding: 8px 0; }

/* ---------- NPC tooltip sub-ratings ---------- */

/* ── Retro Radio Modal ──────────────────────────────────────────── */
.radio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radio-overlay.hidden { display: none; }

/* ---------- Network overlay ---------- */
.network-modal {
  background: linear-gradient(160deg, #bddff7 0%, #eef6fd 40%);
  border: 2px solid #5bb3e8;
  border-radius: 20px;
  width: min(360px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.network-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  font-weight: 700;
  font-size: 15px;
  color: #1a3a5c;
  border-bottom: 1px solid #5bb3e855;
  flex-shrink: 0;
}
.network-body {
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.network-loading {
  text-align: center;
  color: #7aaac0;
  font-size: 13px;
  padding: 20px 0;
}
.network-card {
  background: rgba(91, 179, 232, 0.12);
  border: 1.5px solid #5bb3e877;
  border-radius: 14px;
  padding: 12px 14px;
}
.network-card-name {
  font-weight: 700;
  font-size: 14px;
  color: #1a3a5c;
  margin-bottom: 8px;
}
.network-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.network-stat {
  text-align: center;
}
.network-stat-num {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #e07818;
}
.network-stat-label {
  font-size: 9px;
  color: #5a7a90;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.network-rank {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: #e07818;
  border-radius: 6px;
  padding: 1px 5px;
  margin-right: 4px;
}
.network-card:first-child .network-rank { background: #c8880a; font-size: 12px; }
.network-all-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #2a5070;
  text-decoration: underline;
  padding: 6px 0 2px;
}

.radio-modal {
  background: linear-gradient(160deg, #5c3820 0%, #3d2210 55%, #271608 100%);
  border-radius: 18px;
  width: 300px;
  overflow: hidden;
  border: 2px solid #7a4a28;
  box-shadow: 0 16px 48px rgba(0,0,0,0.8),
              inset 0 1px 0 rgba(255,200,100,0.12);
}

.radio-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255,180,80,0.12);
}

.radio-brand {
  font-family: monospace;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #d09a34;
  text-shadow: 0 0 10px rgba(210,154,52,0.6);
}

.radio-close-btn {
  background: none;
  border: 1px solid rgba(200,140,60,0.35);
  color: #c8902a;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.radio-close-btn:hover { background: rgba(200,140,60,0.15); }

/* Main section: grille + display */
.radio-mid {
  display: flex;
  gap: 10px;
  padding: 10px 14px 10px;
  align-items: stretch;
}

/* Speaker grille */
.radio-grille {
  width: 80px;
  flex-shrink: 0;
  background: #120a04;
  border-radius: 8px;
  border: 2px solid #0a0600;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.9);
  overflow: hidden;
  min-height: 72px;
}

.radio-grille-inner {
  width: 100%;
  height: 100%;
  min-height: 72px;
  background:
    /* horizontal bars */
    repeating-linear-gradient(
      to bottom,
      rgba(255,160,60,0.04) 0px,
      rgba(255,160,60,0.04) 3px,
      transparent 3px,
      transparent 9px
    ),
    /* vertical columns */
    repeating-linear-gradient(
      to right,
      rgba(255,160,60,0.03) 0px,
      rgba(255,160,60,0.03) 2px,
      transparent 2px,
      transparent 8px
    );
}

/* LCD display */
.radio-display {
  flex: 1;
  background: linear-gradient(145deg, #0f1f0a, #0a160a);
  border-radius: 8px;
  padding: 8px 10px;
  border: 2px solid #080e06;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8),
              0 0 16px rgba(60,200,30,0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.radio-leds {
  display: flex;
  gap: 4px;
}
.radio-leds span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #50e020;
  box-shadow: 0 0 6px #50e020;
  opacity: 0.85;
}

.radio-station-text {
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  color: #60ee30;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(80,230,40,0.7);
  line-height: 1.2;
}

.radio-freq-text {
  font-family: monospace;
  font-size: 10px;
  color: #3ab818;
  opacity: 0.85;
  text-shadow: 0 0 4px rgba(60,185,24,0.5);
}

/* Knobs row */
.radio-knobs-row {
  display: flex;
  justify-content: space-around;
  padding: 12px 14px 18px;
  border-top: 1px solid rgba(255,180,80,0.08);
}

.radio-knob-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.radio-knob {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #f0d878 5%, #c49030 40%, #7a5012 80%);
  position: relative;
  cursor: pointer;
  box-shadow:
    0 5px 12px rgba(0,0,0,0.65),
    inset 0 1px 3px rgba(255,235,120,0.35),
    0 0 0 3px #3d2210,
    0 0 0 5px rgba(200,150,60,0.18);
  transition: box-shadow 0.1s, transform 0.08s;
  user-select: none;
}
.radio-knob:hover {
  box-shadow:
    0 6px 14px rgba(0,0,0,0.7),
    inset 0 1px 3px rgba(255,235,120,0.45),
    0 0 0 3px #3d2210,
    0 0 0 5px rgba(200,150,60,0.35);
}
.radio-knob:active { transform: scale(0.94); }

/* Indicator line — rotates around its own bottom edge which sits at knob center */
.knob-indicator {
  position: absolute;
  width: 4px;
  height: 40%;
  background: #1a0800;
  border-radius: 3px 3px 0 0;
  top: 10%;
  left: calc(50% - 2px);
  transform-origin: bottom center;
  transform: rotate(0deg);
  transition: transform 0.35s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.knob-label {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  color: rgba(210,158,70,0.75);
  font-family: monospace;
}

.knob-value-label {
  font-size: 11px;
  color: #e8c060;
  font-family: monospace;
  min-width: 90px;
  text-align: center;
  min-height: 16px;
}

/* ── Upgrade break toast ────────────────────────────────────────── */
#upgrade-break-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #c0392b;
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  z-index: 700;
  max-width: 88%;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  animation: toast-slide-in 0.3s ease;
}
#upgrade-break-toast.hidden { display: none; }

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Live price index drawer ────────────────────────────────────── */
#index-change-drawer {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 12px;
  transform: translateY(-140%);
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid #5bb3e8;
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #1a3a5c;
  z-index: 450;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s ease;
}
#index-change-drawer.shown {
  transform: translateY(0);
  opacity: 1;
}
#index-change-drawer.index-up   { border-color: #27ae60; color: #1e8449; }
#index-change-drawer.index-down { border-color: #e74c3c; color: #c0392b; }

/* ── Tutorial skip button ───────────────────────────────────────── */

/* ── Congratulations day-7 overlay ─────────────────────────────── */
#congrat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
}
#congrat-overlay.hidden { display: none; }

#congrat-modal {
  background: #eef6fd;
  border-radius: 24px;
  padding: 36px 28px 28px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  animation: congrat-pop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes congrat-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

#congrat-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}

#congrat-title {
  font-family: 'Titan One', sans-serif;
  font-size: 20px;
  color: #fff;
  text-shadow:
    -1px -1px 0 #3d1800,  1px -1px 0 #3d1800,
    -1px  1px 0 #3d1800,  1px  1px 0 #3d1800,
     0    3px 0 #1a0800;
  margin-bottom: 12px;
}

#congrat-body {
  font-size: 15px;
  line-height: 1.65;
  color: #444;
  margin-bottom: 24px;
}

#congrat-close {
  background: #4a7fc1;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#congrat-close:hover { background: #3a6aaa; }

#rank-up-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
}
#rank-up-overlay.hidden { display: none; }

#rank-up-modal {
  position: relative;
  z-index: 2;
  background: linear-gradient(160deg, #232f3f, #131a24);
  border: 1px solid rgba(245,194,0,0.25);
  border-radius: 24px;
  padding: 36px 28px 28px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 40px rgba(245,194,0,0.12);
  animation: congrat-pop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

#rank-up-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
  animation: rank-up-bounce 0.9s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
}

@keyframes rank-up-bounce {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  55%  { transform: scale(1.25) rotate(8deg); opacity: 1; }
  75%  { transform: scale(0.95) rotate(-4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

#rank-up-title {
  font-family: 'Titan One', sans-serif;
  font-size: 20px;
  color: #fff;
  text-shadow:
    -1px -1px 0 #3d1800,  1px -1px 0 #3d1800,
    -1px  1px 0 #3d1800,  1px  1px 0 #3d1800,
     0    3px 0 #1a0800;
  margin-bottom: 12px;
}

#rank-up-body {
  font-size: 15px;
  line-height: 1.65;
  color: #d7e0ea;
  margin-bottom: 24px;
}

#rank-up-body strong { color: #f5c200; }

#rank-up-view-btn {
  background: #f5c200;
  color: #2a1800;
  border: none;
  border-radius: 20px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#rank-up-view-btn:hover { background: #e0b000; }

#rank-up-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  opacity: 0.95;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.35, 0, 0.65, 1);
  animation-fill-mode: forwards;
}
.confetti-piece:nth-child(3n)  { border-radius: 50%; }
.confetti-piece:nth-child(4n)  { width: 10px; height: 10px; }
.confetti-piece:nth-child(5n)  { width: 6px; height: 16px; }

@keyframes confetti-fall {
  0%   { transform: translateY(0)      rotate(0deg);   opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(100vh)  rotate(600deg); opacity: 0; }
}

/* ── Mike Salary Migration Modal ───────────────────────────────── */
#mike-salary-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 601;
}
#mike-salary-modal-overlay.hidden { display: none; }

#mike-salary-modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 36px rgba(0,0,0,0.30);
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}

#mike-salary-modal-title {
  font-family: 'Titan One', sans-serif;
  font-size: 19px;
  color: #2c6e35;
  margin: 0 0 16px;
}

#mike-salary-modal-body {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin-bottom: 22px;
}

.mig-formula {
  display: inline-block;
  background: #f0faf2;
  border: 1px solid #b2dfbd;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: monospace;
  font-size: 13px;
  color: #1a5c24;
  margin: 6px 0;
}

#mike-salary-modal-close {
  background: #2c8a3c;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#mike-salary-modal-close:hover { background: #1e6628; }

#edit-name-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 601;
}
#edit-name-overlay.hidden { display: none; }

#edit-name-modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 36px rgba(0,0,0,0.30);
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}

#edit-name-modal-title {
  font-family: 'Titan One', sans-serif;
  font-size: 19px;
  color: #2c6e35;
  margin: 0 0 16px;
}

#edit-name-modal .franchise-name-input {
  width: 100%;
  box-sizing: border-box;
}

.edit-name-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}
.edit-name-actions .big-btn {
  padding: 12px 32px;
  font-size: 16px;
}

#iva-announcement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 601;
}
#iva-announcement-overlay.hidden { display: none; }

#iva-announcement-modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 36px rgba(0,0,0,0.30);
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}

#iva-announcement-title {
  font-family: 'Titan One', sans-serif;
  font-size: 19px;
  color: #a03030;
  margin: 0 0 16px;
}

#iva-announcement-body {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin-bottom: 22px;
}

#iva-announcement-close {
  background: #a03030;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#iva-announcement-close:hover { background: #7a2424; }

#tip-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 625;
}
#tip-overlay.hidden { display: none; }
#tip-modal {
  background: #fffbef;
  border-radius: 24px;
  padding: 28px 32px;
  max-width: 320px;
  width: 88%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  text-align: center;
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
#tip-jar {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
}
#tip-body {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: #2c8a3c;
  margin-bottom: 22px;
}
#tip-confirm {
  background: #f5c842;
  color: #3a2c1a;
  border: none;
  border-radius: 20px;
  padding: 11px 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
#tip-confirm:hover { background: #e0b030; }

#spec-req-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 620;
}
#spec-req-overlay.hidden { display: none; }
#spec-req-modal {
  background: #fffbef;
  border-radius: 20px;
  padding: 24px 28px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  text-align: center;
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
#spec-req-msg {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 16px;
  color: #3a2c1a;
}
#spec-req-ing-label {
  font-size: 14px;
  font-weight: 700;
  color: #5a7a90;
  margin-bottom: 10px;
}
.spec-req-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}
.spec-req-slider-row input[type=range] { flex: 1; }
.spec-req-bound { font-size: 11px; color: #888; min-width: 14px; }
#spec-req-val-wrap {
  font-size: 22px;
  font-weight: 700;
  color: #2c8a3c;
  margin: 4px 0 18px;
}
#spec-req-confirm {
  background: #2c8a3c;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 11px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
#spec-req-confirm:hover { background: #1e6628; }

#bulk-order-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 610;
}
#bulk-order-overlay.hidden { display: none; }
#bulk-order-modal {
  background: #fffbef;
  border-radius: 20px;
  padding: 24px 28px;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  text-align: center;
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
#bulk-order-body {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 20px;
  color: #3a2c1a;
}
#bulk-order-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}
#bulk-order-accept {
  background: #2c8a3c;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}
#bulk-order-accept:hover { background: #1e6628; }
#bulk-order-decline {
  background: #888;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}
#bulk-order-decline:hover { background: #555; }

/* ---------- Bulk pickup modal ---------- */
#bulk-pickup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 610;
}
#bulk-pickup-overlay.hidden { display: none; }
#bulk-pickup-modal {
  background: #fffbef;
  border-radius: 20px;
  padding: 24px 28px;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  text-align: center;
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
#bulk-pickup-body {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 8px;
  color: #3a2c1a;
}
#bulk-pickup-total {
  font-size: 18px;
  font-weight: 700;
  color: #1a5c2a;
  margin: 0 0 16px;
  text-align: center;
}
#bulk-pickup-confirm {
  background: #2c8a3c;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 11px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
#bulk-pickup-confirm:hover { background: #1e6628; }

/* ---------- Bulk orders tab ---------- */
#tab-bulk-orders { display: flex; flex-direction: column; gap: 6px; min-height: 264px; }

.bulk-orders-empty {
  text-align: center;
  color: #5a7a90;
  padding: 24px 0;
  font-size: 0.88rem;
}

.bulk-order-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  padding: 9px 10px;
  border-left: 3px solid #4a90d9;
  text-align: left;
}

.bulk-order-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.10);
  object-fit: cover;
  background: rgba(255,255,255,0.4);
}

.bulk-order-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.bulk-order-name { font-size: 13px; font-weight: 700; color: #1a3a5c; }
.bulk-order-type { font-size: 11px; color: #5a7a90; font-weight: 400; margin-left: 5px; }
.bulk-order-meta { font-size: 11px; color: #5a7a90; }

.bulk-order-due {
  font-size: 11px;
  font-weight: 700;
  color: #1a3a5c;
  white-space: nowrap;
  flex-shrink: 0;
}
.bulk-order-due.due-today { color: #cc2020; }

.bulk-order-hold { margin-top: 5px; }

.bulk-hold-btn {
  font-size: 11px;
  font-weight: 700;
  background: #2c7a40;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  white-space: nowrap;
}
.bulk-hold-btn:active { opacity: 0.8; }
.bulk-hold-btn:disabled {
  background: #b0b0b0;
  cursor: not-allowed;
}

.bulk-hold-done {
  font-size: 11px;
  font-weight: 700;
  color: #2c7a40;
}

.bulk-hold-no-space {
  font-size: 11px;
  color: #c0392b;
  margin: 4px 0 0;
}

#update-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 602;
}
#update-overlay.hidden { display: none; }

#update-modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 36px rgba(0,0,0,0.30);
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#update-modal-title {
  font-family: 'Titan One', sans-serif;
  font-size: 19px;
  color: #2c6e35;
  margin: 0;
}

#update-modal-body {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin: 0;
}

#update-modal-btn {
  display: block;
  text-decoration: none;
}

.btn-link {
  background: none;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

#changelog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 602;
}
#changelog-overlay.hidden { display: none; }

#changelog-modal {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  text-align: center;
  box-shadow: 0 8px 36px rgba(0,0,0,0.30);
  animation: congrat-pop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#changelog-modal-title {
  font-family: 'Titan One', sans-serif;
  font-size: 19px;
  color: #2c6e35;
  margin: 0;
}

#changelog-modal-body {
  font-size: 13px;
  line-height: 1.6;
  color: #444;
  text-align: left;
  overflow-y: auto;
  padding-right: 4px;
}

#changelog-modal-body h3 {
  font-size: 14px;
  color: #2c6e35;
  margin: 16px 0 2px;
}
#changelog-modal-body h3:first-child { margin-top: 0; }

#changelog-modal-body h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin: 8px 0 2px;
}

#changelog-modal-body ul {
  margin: 0 0 4px;
  padding-left: 18px;
}

#changelog-modal-body li {
  margin-bottom: 3px;
}

#changelog-modal-body hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 12px 0;
}
