/* Traffic Control: road-sign menus over a live crossroads (shared bits in ../shared/game-ui.css). */
.hud-level {
  padding: 4px 8px 2px;
  border-radius: 5px;
  background: rgba(14, 16, 20, 0.7);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.plate.guide b { font-size: 26px; }

.strikes { display: flex; gap: 5px; }
.strikes.bump { animation: bump 0.35s ease; }
.strike {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--asphalt-2);
  color: #5b616b;
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px #5b616b, 0 2px 0 rgba(0, 0, 0, 0.35);
}
.strike.on { background: var(--sign-red); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--sign-white), 0 2px 0 rgba(0, 0, 0, 0.35); }

.hud-b {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 20px);
}
.swap-btn, .power-btn {
  pointer-events: auto;
  position: relative;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-family: var(--font-sign);
  transition: transform 0.1s ease;
}
.swap-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 16px 7px;
  background: var(--sign-yellow);
  color: var(--ink);
  box-shadow: inset 0 0 0 2.5px var(--sign-yellow), inset 0 0 0 4px var(--ink), 0 4px 0 var(--sign-yellow-deep);
}
.swap-btn b { font-size: 16px; font-weight: 900; letter-spacing: 0.05em; white-space: nowrap; }
.swap-btn:active, .power-btn:active { transform: translateY(3px); }
.powers { display: flex; gap: 6px; }
.power-btn {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 6px;
  padding: 6px 10px 5px 8px;
  background: var(--asphalt-2);
  color: var(--sign-white);
  box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px var(--sign-white), 0 4px 0 rgba(0, 0, 0, 0.4);
}
.power-btn .power-ico { grid-row: span 2; font-size: 20px; line-height: 1; }
.power-btn b { font-size: 12px; font-weight: 900; letter-spacing: 0.04em; text-align: left; }
.power-btn em { font-style: normal; font-size: 15px; font-weight: 900; text-align: left; font-variant-numeric: tabular-nums; }
.power-btn:disabled { opacity: 0.45; cursor: default; }
.power-btn:not(:disabled) { box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px var(--sign-yellow), 0 4px 0 rgba(0, 0, 0, 0.4); }
.key-hint {
  position: absolute;
  top: -7px;
  right: -5px;
  padding: 2px 4px 0;
  border-radius: 3px;
  background: var(--sign-white);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--ink);
}
@media (hover: none) { .key-hint { display: none; } .swap-btn.alt { display: none; } }
.swap-btn.alt {
  background: var(--asphalt-2);
  color: var(--sign-white);
  box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px var(--sign-yellow), 0 4px 0 rgba(0, 0, 0, 0.4);
}
.wave-ico { color: #7be07b; }
@media (max-width: 520px) {
  .power-btn b { display: none; }
  .power-btn { grid-template-columns: auto; padding: 6px 9px 4px; }
  .power-btn .power-ico { grid-row: auto; }
  .power-btn em { text-align: center; }
  .swap-btn { padding: 8px 12px 6px; }
  .swap-btn b { font-size: 14px; }
}


.signal-ico { flex: none; width: clamp(30px, 8vw, 46px); height: auto; }

.goal { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
.tip { margin: 0; padding: 10px 12px 8px; border-radius: 7px; background: #fff4cc; font-size: 15px; font-weight: 700; line-height: 1.35; box-shadow: inset 0 0 0 1.5px #e8cf7a; }

.level-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.level-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 10px 6px 8px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: var(--sign-green);
  color: var(--sign-white);
  font-family: var(--font-sign);
  box-shadow: inset 0 0 0 2px var(--sign-green), inset 0 0 0 3.5px var(--sign-white), 0 4px 0 var(--sign-green-deep);
  transition: transform 0.1s ease;
}
.level-btn:hover { transform: translateY(-2px); }
.level-btn.locked { background: #c3c7ce; color: #6b717a; box-shadow: 0 4px 0 #9aa0a8; cursor: default; transform: none; }
.lv-no { font-size: 24px; font-weight: 900; line-height: 1; }
.lv-name { max-width: 100%; font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-stars { font-size: 13px; letter-spacing: 1px; }
.lv-stars i { font-style: normal; color: rgba(255, 255, 255, 0.3); }
.lv-stars i.on { color: #ffd23f; }
.map-sec + .map-sec { margin-top: 6px; }

.stars-big { display: flex; gap: 6px; font-size: 44px; line-height: 1; }
.stars-big span { color: #d9dce1; }
.stars-big span.on { color: #ffc619; text-shadow: 0 2px 0 #a87800; animation: star-pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.stars-big span.on:nth-child(2) { animation-delay: 0.15s; }
.stars-big span.on:nth-child(3) { animation-delay: 0.3s; }
@keyframes star-pop { from { transform: scale(0.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }


/* Custom shift */
.mode-btn.custom { background: var(--sign-green); box-shadow: inset 0 0 0 3px var(--sign-green), inset 0 0 0 5px var(--sign-white), 0 5px 0 var(--sign-green-deep); }
.mode-btn.locked { background: #5b616b; box-shadow: inset 0 0 0 3px #5b616b, inset 0 0 0 5px #c3c7ce, 0 5px 0 #3a3e45; cursor: default; }
.mode-btn.locked:hover, .mode-btn.locked:active { transform: none; }
#custom-body { gap: 16px; }
.opt-sec { display: flex; flex-direction: column; gap: 8px; }
.opt-sec h3 { margin: 0 0 2px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; min-height: 34px; }
.opt-lbl { font-weight: 800; font-size: 15px; }
.opt-lbl em { display: block; font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button {
  min-width: 42px;
  padding: 7px 10px 5px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: #e3e6ea;
  color: var(--ink);
  font: 800 13px var(--font-sign);
  box-shadow: inset 0 0 0 1.5px #c3c7ce;
}
.seg button[aria-pressed="true"] { background: var(--sign-green); color: var(--sign-white); box-shadow: inset 0 0 0 1.5px var(--sign-green), inset 0 0 0 3px var(--sign-white); }
.seg button:disabled { opacity: 0.4; cursor: default; }
.opt-range { display: flex; align-items: center; gap: 10px; }
.opt-range input { width: min(220px, 46vw); accent-color: var(--sign-green); }
.opt-range output { min-width: 58px; font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 18px; }
.opt-grid .toggle-row { min-height: 34px; }
/* the tabs (four to a row on a phone) */
.opt-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 9px; background: #e3e6ea; }
@media (max-width: 560px) { .opt-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.opt-tabs button {
  min-width: 0;
  padding: 8px 10px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font: 900 13px var(--font-sign);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.opt-tabs button[aria-selected="true"] { background: var(--ink); color: var(--sign-white); }
.opt-panel { display: flex; flex-direction: column; gap: 16px; }
/* the crossing editor: a little map you tap, and the chosen crossing's settings */
.xed { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; }
.xmap { display: grid; grid-template-columns: repeat(var(--cols), 56px); padding: 6px; border-radius: 8px; background: #7fbf63; box-shadow: inset 0 0 0 2px #5f9e47; }
.xcell { position: relative; width: 56px; height: 56px; padding: 0; border: 0; background: none; cursor: pointer; }
.xcell svg { display: block; width: 100%; height: 100%; }
.xcell .rd { fill: #3a3d44; }
.xcell .ln { fill: rgba(247, 247, 242, 0.55); }
.xcell .lt { fill: #2ee66b; stroke: #16181c; stroke-width: 2; }
.xcell.auto .lt { fill: #47a6ff; }
.xcell span { position: absolute; left: 3px; top: 2px; font: 900 11px var(--font-sign); color: #16381a; }
.xcell em { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); padding: 1px 4px 0; border-radius: 3px; background: #47a6ff; color: #fff; font: 900 8px var(--font-sign); font-style: normal; letter-spacing: 0.06em; }
.xcell[aria-pressed="true"] { z-index: 1; border-radius: 6px; box-shadow: 0 0 0 3px var(--sign-yellow, #ffc619), 0 0 0 5px var(--ink); }
.xside { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.xtitle { font-size: 15px; font-weight: 900; }
/* ideas */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.idea {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px 7px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px #d4d8df;
  font-family: var(--font-sign);
}
.idea b { font-size: 14px; font-weight: 900; }
.idea em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.idea:hover { box-shadow: inset 0 0 0 2.5px var(--sign-green); }
/* the time limit in the HUD */
.hud-time.low { background: var(--sign-red); color: var(--sign-white); animation: bump 0.5s ease infinite; }
#hud.no-powers .powers { display: none; }
.pay-line { margin: 0; padding: 10px 12px 8px; border-radius: 7px; background: #e5f4ea; font-weight: 800; box-shadow: inset 0 0 0 1.5px #9fd3b0; }
.pay-line.none { background: #fde8e8; box-shadow: inset 0 0 0 1.5px #f0aaaa; }
.strike-count { display: grid; place-items: center; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--asphalt-2); color: var(--sign-white); font-weight: 900; box-shadow: inset 0 0 0 2px #5b616b; }

/* share codes */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-code {
  flex: 1 1 250px;
  min-width: 0;
  padding: 10px 12px 8px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: 800 17px var(--font-mono);
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 0 1.5px #c3c7ce;
}
.share-code[readonly] { background: #e5f4ea; box-shadow: inset 0 0 0 1.5px #9fd3b0; }
.share-code:focus { outline: none; box-shadow: inset 0 0 0 2.5px var(--sign-green); }
.share-msg { margin: 0; font-size: 14px; font-weight: 800; color: #1d6b3a; }
.share-msg:empty { display: none; }
.share-msg.bad { color: var(--sign-red); }
