:root {
  --text: #12172a;
  --muted: #667085;
  --line: rgba(30, 38, 70, 0.13);
  --glass: rgba(255, 255, 255, 0.72);
  --soft: rgba(255, 255, 255, 0.58);
  --shadow: 0 22px 65px rgba(23, 31, 74, 0.18), 0 4px 18px rgba(23, 31, 74, 0.08);
  --purple: #6856ff;
  --pink: #ee5b8c;
  --green: #1db76b;
  --amber: #e18413;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Keep the 3D build/move gizmo below the editor UI and visually compact. */
.gizmo-overlay {
  z-index: 5;
}

.gizmo-axis {
  width: 58px;
  height: 8px;
}

.gizmo-axis::before {
  height: 8px;
}

.gizmo-axis::after {
  border-width: 8px 0 8px 12px;
}

.tool-ribbon,
.panel-switcher,
.topbar,
.creator-start,
.dock,
.inspector,
.mechanics,
.ai-panel,
.kart-setup,
.architect-panel,
.scene-tree,
.look-panel,
.playtest-card,
.voxel-harvest-editor {
  z-index: 14;
}

.simple-mode-panel {
  left: 22px;
  top: 104px;
  width: 332px;
  max-height: calc(100vh - 142px);
  border-radius: 18px;
  padding: 12px;
  overflow: auto;
  z-index: 16;
}

.light-studio {
  position: fixed;
  inset: 0;
  z-index: 17;
  display: none;
  pointer-events: none;
}

.light-studio.open {
  display: block;
}

.light-studio > * {
  pointer-events: auto;
}

.light-studio-header {
  position: absolute;
  left: 128px;
  right: 360px;
  top: 82px;
  min-height: 0;
  border-radius: 20px;
  padding: 11px 16px;
  display: grid;
  align-content: center;
  text-align: left;
}

.light-studio-header small {
  color: #e18413;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.light-studio-header h1 {
  margin: 2px 0 4px;
  color: #11182b;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1;
  letter-spacing: 0;
}

.light-studio-header p {
  margin: 0;
  max-width: 720px;
  color: #556176;
  font-size: 12px;
  font-weight: 850;
}

.light-tool-dock,
.light-inspector,
.light-test-bar {
  border-radius: 20px;
}

.light-tool-dock {
  position: absolute;
  left: 18px;
  top: 82px;
  width: 92px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  align-content: start;
}

.light-tool-dock button,
.light-test-bar button,
.light-swatch-row button,
.light-toggle-row button {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(25, 34, 62, 0.1);
  color: #22304a;
  font-weight: 950;
}

.light-tool-dock button {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 7px 5px;
  text-align: center;
}

.light-tool-dock i {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  font-style: normal;
  font-size: 16px;
  background: linear-gradient(135deg, #ffd15c, #4aa8ff);
}

.light-tool-dock span {
  min-width: 0;
  font-size: 10px;
  line-height: 1.05;
}

.light-inspector {
  position: absolute;
  right: 18px;
  top: 82px;
  width: 320px;
  max-height: calc(100vh - 164px);
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 9px;
  align-content: start;
}

.light-inspector h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
}

.light-inspector label,
.light-swatch-row,
.light-toggle-row {
  min-height: 58px;
  border-radius: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  gap: 8px;
  color: #34405a;
  font-size: 12px;
  font-weight: 950;
}

.light-inspector input[type="range"] {
  width: 100%;
}

.light-swatch-row,
.light-toggle-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}

.light-swatch-row span {
  grid-column: 1 / -1;
}

.light-swatch-row button,
.light-toggle-row button {
  min-height: 38px;
  padding: 0 8px;
}

.light-toggle-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.light-tool-dock button:hover,
.light-tool-dock button.active,
.light-test-bar button:hover,
.light-swatch-row button:hover,
.light-toggle-row button:hover,
.light-toggle-row button.active {
  color: white;
  background: linear-gradient(135deg, #f0aa26, #4aa8ff);
}

.light-test-bar {
  position: absolute;
  left: 128px;
  right: 360px;
  bottom: 18px;
  min-height: 50px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.light-test-bar button {
  min-height: 36px;
  font-size: 12px;
}

.physics-lab {
  z-index: 15;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #bfe7ff;
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: linear-gradient(#a9dcff, #fff6eb);
  transition: filter 120ms ease;
}

body.duel-hit-pulse #gameCanvas {
  filter: saturate(1.45) brightness(1.18) contrast(1.06);
}

body.duel-hurt-pulse #gameCanvas {
  filter: saturate(1.35) brightness(1.05) sepia(0.18) hue-rotate(-18deg);
}

body.duel-break-pulse #gameCanvas {
  filter: saturate(1.7) brightness(1.28) contrast(1.14);
}

.game-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  pointer-events: none;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(12, 17, 28, 0.46), rgba(12, 17, 28, 0.12) 48%, rgba(12, 17, 28, 0.5)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(12, 17, 28, 0.18));
}

.game-shell-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 18px;
  padding: 24px;
  pointer-events: auto;
  color: #172033;
}

.game-kicker {
  margin: 0 0 8px;
  color: #7a4d14;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.game-shell-card h1 {
  margin: 0 0 18px;
  color: #151d2c;
  font-size: 40px;
  line-height: 0.98;
  letter-spacing: 0;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.game-stats p {
  margin: 0;
  min-height: 58px;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 3px;
  align-content: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(30, 38, 70, 0.1);
}

.game-stats span,
.public-name,
.score-save label {
  color: #667085;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.game-stats b {
  color: #182134;
  font-size: 20px;
  font-weight: 950;
}

.public-name {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.public-name input,
.score-save input {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(30, 38, 70, 0.16);
  background: rgba(255, 255, 255, 0.78);
  outline: 0;
  padding: 0 12px;
  color: #172033;
  font-size: 15px;
  font-weight: 900;
  text-transform: none;
}

.game-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-bottom: 12px;
}

.game-actions button,
.score-save button {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 18px;
  color: white;
  background: linear-gradient(135deg, #287a4f, #d68c24);
  font-size: 14px;
  font-weight: 950;
}

.game-actions button:last-child {
  color: #172033;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(30, 38, 70, 0.12);
}

.public-login-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(246, 232, 197, 0.72);
  border: 1px solid rgba(122, 77, 20, 0.16);
  color: #6f4c18;
  font-size: 12px;
  font-weight: 850;
}

.public-login-note b {
  color: #523610;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.public-leaderboard h2 {
  margin: 0 0 8px;
  color: #182134;
  font-size: 15px;
  letter-spacing: 0;
}

.public-leaderboard ol,
.end-leaderboard {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-leaderboard li,
.end-leaderboard li {
  min-height: 34px;
  border-radius: 11px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(30, 38, 70, 0.09);
  color: #172033;
  font-size: 12px;
  font-weight: 900;
}

.public-leaderboard li span:first-child,
.end-leaderboard li span:first-child {
  color: #8d601b;
  font-weight: 950;
}

body.public-game .game-shell {
  display: grid;
}

body.public-game.public-playing .game-shell {
  display: none;
}

body.public-game.public-result .game-shell {
  display: none;
}

body.public-game:not(.public-playing) .runtime-hud,
body.public-game:not(.public-playing) .shooter-hud,
body.public-game:not(.public-playing) .win-overlay {
  display: none !important;
}

body.public-game.public-result .win-overlay.show {
  display: block !important;
}

body.public-game.public-result .runtime-hud {
  display: none !important;
}

body.public-game.public-playing .toast {
  display: none !important;
}

body.public-game .topbar,
body.public-game .dock,
body.public-game .ai-panel,
body.public-game .kart-setup,
body.public-game .architect-panel,
body.public-game .tool-ribbon,
body.public-game .panel-switcher,
body.public-game .creator-start,
body.public-game .gizmo-overlay,
body.public-game .inspector,
body.public-game .minimap-card,
body.public-game .scene-tree,
body.public-game .look-panel,
body.public-game .mechanics,
body.public-game .physics-lab,
body.public-game .texture-designer-window,
body.public-game .playtest-card,
body.public-game .voxel-harvest-editor {
  display: none !important;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  user-select: none;
}

.hud * {
  pointer-events: auto;
}

.floating {
  position: absolute;
}

.glass {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.glass-soft {
  background: var(--soft);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(22, 32, 72, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar {
  left: 20px;
  right: 20px;
  top: 18px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(260px, 420px) minmax(190px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 0 10px 0 16px;
  overflow: visible;
  z-index: 16;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand b {
  display: block;
  font-size: 16px;
  white-space: nowrap;
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 650;
  font-size: 11px;
}

.project-pill {
  height: 40px;
  min-width: 0;
  width: min(420px, 34vw);
  max-width: 460px;
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  white-space: nowrap;
}

.project-pill select {
  min-width: 0;
  width: 100%;
  max-width: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-help {
  position: relative;
  height: 40px;
  min-width: 76px;
  border-radius: 14px;
  padding: 0;
  z-index: 30;
}

.header-help summary {
  height: 40px;
  cursor: pointer;
  list-style: none;
  display: grid;
  place-items: center;
  color: #1d2740;
  font-size: 13px;
  font-weight: 900;
}

.header-help summary::-webkit-details-marker {
  display: none;
}

.header-help[open] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.header-help[open]::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 39px;
  width: 210px;
  height: auto;
}

.header-help p,
.header-help hr {
  position: relative;
  z-index: 31;
}

.header-help p {
  width: 210px;
  margin: 0;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.9);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: #465066;
  font-size: 12px;
}

.header-help p:first-of-type {
  border-top: 1px solid var(--line);
}

.header-help p:last-child {
  border-bottom: 1px solid var(--line);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

.header-help hr {
  width: 210px;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.header-help kbd {
  background: rgba(31, 40, 65, 0.07);
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 10px;
  color: #667085;
  font-weight: 900;
}

.project-pill #saveState,
#saveState {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(29, 183, 107, 0.12);
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

#saveState::before,
.project-pill #saveState::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}

#saveState.dirty,
.project-pill #saveState.dirty {
  color: var(--amber);
  background: rgba(225, 132, 19, 0.16);
}

#saveState {
  color: var(--green);
  background: rgba(29, 183, 107, 0.12);
}

.green {
  color: var(--green);
  font-weight: 800;
}

.tabs {
  justify-self: center;
  height: 48px;
  min-width: 330px;
  max-width: min(760px, 52vw);
  border-radius: 16px;
  display: flex;
  gap: 4px;
  padding: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-width: 76px;
  padding: 0 10px;
  border-radius: 13px;
  font-weight: 850;
  white-space: nowrap;
  scroll-snap-align: center;
}

.tab.active {
  background: rgba(111, 86, 255, 0.16);
  color: #604cff;
}

.chips-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.chips-top > button {
  height: 48px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  font-size: 18px;
}

.chips-top b {
  display: block;
  font-size: 12px;
  line-height: 1;
}

.chips-top small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.chips-top .publish {
  display: block;
  color: white;
  font-size: 14px;
  font-weight: 900;
  background: linear-gradient(135deg, #6555ff, #7d55ff, #ef5a87);
  padding: 0 22px;
  border: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #27b9ff, #ff7c48);
}

.ai-op-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.ai-op-grid button {
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(104, 86, 255, 0.18);
  background: rgba(255, 255, 255, 0.64);
  color: #2f3851;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(31, 40, 65, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ai-op-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(104, 86, 255, 0.45);
  background: rgba(255, 255, 255, 0.9);
}

.texture-studio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.texture-studio button {
  min-height: 70px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  place-items: center;
  gap: 6px;
  color: #2f3851;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(31, 40, 65, 0.06);
}

.texture-studio button:hover {
  border-color: rgba(104, 86, 255, 0.45);
  background: rgba(255, 255, 255, 0.92);
}

.texture-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(31, 40, 65, 0.14);
  box-shadow: inset 0 5px 12px rgba(255, 255, 255, 0.35), 0 8px 20px rgba(31, 40, 65, 0.12);
}

.texture-dot.mossy {
  background:
    radial-gradient(circle at 25% 25%, #72b85b 0 16%, transparent 17%),
    linear-gradient(135deg, #3b3d45 0 48%, #66a14b 49% 64%, #2f333b 65%);
}

.texture-dot.cracked {
  background:
    linear-gradient(45deg, transparent 0 43%, #ff5a1f 44% 49%, transparent 50%),
    linear-gradient(120deg, #32333a, #1d2028 48%, #ff7a24 49% 55%, #2c2e35 56%);
}

.texture-dot.deep-water {
  background:
    radial-gradient(circle at 70% 25%, rgba(255,255,255,.65) 0 9%, transparent 10%),
    linear-gradient(135deg, #1477df, #23d4d1);
}

.texture-dot.runes {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 24%, #ffd65a 25% 31%, transparent 32%),
    linear-gradient(90deg, transparent 0 42%, #ffc02c 43% 50%, transparent 51%),
    linear-gradient(0deg, transparent 0 42%, #ffe27a 43% 50%, transparent 51%),
    linear-gradient(135deg, #17120c, #32220d 48%, #0b0a0a);
}

.texture-dot.royal-gold {
  background:
    radial-gradient(circle at 24% 22%, rgba(255,255,255,.78) 0 12%, transparent 13%),
    radial-gradient(circle at 70% 68%, rgba(96,47,0,.24) 0 18%, transparent 19%),
    linear-gradient(135deg, #ffe278, #c87f0a 48%, #fff0a8);
}

.texture-dot.marble {
  background:
    linear-gradient(120deg, transparent 0 30%, rgba(50,43,38,.42) 31% 35%, transparent 36% 58%, rgba(98,77,56,.24) 59% 62%, transparent 63%),
    linear-gradient(135deg, #fff6df, #c9c3b5);
}

.texture-dot.obsidian {
  background:
    linear-gradient(45deg, transparent 0 42%, #8126ff 43% 47%, transparent 48%),
    radial-gradient(circle at 70% 25%, rgba(181,83,255,.55) 0 12%, transparent 13%),
    linear-gradient(135deg, #05050a, #20122d);
}

.texture-dot.neon {
  background:
    linear-gradient(90deg, transparent 0 42%, #00eaff 43% 48%, transparent 49%),
    linear-gradient(0deg, transparent 0 55%, #c72cff 56% 61%, transparent 62%),
    radial-gradient(circle at 65% 35%, #00eaff 0 10%, transparent 11%),
    linear-gradient(135deg, #061820, #0a0620);
}

.texture-dot.ice-glow {
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.9) 0 13%, transparent 14%),
    linear-gradient(135deg, #8ee8ff, #3ca5f6);
}

.texture-dot.planks {
  background:
    linear-gradient(90deg, transparent 0 30%, rgba(0,0,0,.18) 31% 34%, transparent 35% 63%, rgba(0,0,0,.18) 64% 67%, transparent 68%),
    linear-gradient(135deg, #8a5634, #5a321f);
}

.texture-editor {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 8px;
}

.texture-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #2f3851;
  font-size: 11px;
  font-weight: 850;
}

.texture-editor-head span {
  color: #67718a;
  font-size: 10px;
  font-weight: 750;
}

.texture-editor label {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #46516a;
  font-size: 10px;
  font-weight: 850;
}

.texture-editor input {
  width: 100%;
}

.texture-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.texture-colors button {
  height: 28px;
  border: 1px solid rgba(31, 40, 65, 0.15);
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 30%, rgba(255,255,255,.32) 0 16%, transparent 17%),
    linear-gradient(135deg, var(--swatch), color-mix(in srgb, var(--swatch) 58%, #111827));
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, 0.22), 0 8px 18px rgba(31, 40, 65, 0.1);
}

.texture-designer-open {
  background: linear-gradient(135deg, rgba(104, 86, 255, 0.18), rgba(0, 210, 255, 0.16)) !important;
  color: #4537d6 !important;
}

.texture-designer-window {
  right: 392px;
  top: 104px;
  width: min(760px, calc(100vw - 430px));
  max-height: min(650px, calc(100vh - 132px));
  overflow: auto;
  border-radius: 24px;
  padding: 16px;
  z-index: 20;
}

.texture-designer-window .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.texture-designer-window .panel-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.texture-designer-window .panel-head small {
  color: #667085;
  font-size: 10px;
  margin-left: 6px;
}

#textureDesignerClose {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(31, 40, 65, 0.08);
  font-weight: 950;
}

.texture-designer-body {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(250px, 310px);
  gap: 14px;
}

#textureDesignerPreview {
  width: 100%;
  height: auto;
  aspect-ratio: 18 / 11;
  border-radius: 18px;
  border: 1px solid rgba(31, 40, 65, 0.13);
  background: #161821;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.22), 0 18px 40px rgba(22, 32, 72, 0.12);
}

.texture-designer-controls {
  display: grid;
  gap: 10px;
}

.texture-designer-controls label {
  display: grid;
  gap: 5px;
  color: #384158;
  font-size: 11px;
  font-weight: 900;
}

.texture-designer-controls input,
.texture-designer-controls select,
.texture-designer-controls textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 10px;
  outline: 0;
  color: #20283b;
  font-weight: 750;
}

.texture-designer-controls textarea {
  min-height: 84px;
  resize: vertical;
}

.texture-designer-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.texture-designer-swatches button {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(31, 40, 65, 0.15);
  background:
    radial-gradient(circle at 28% 30%, rgba(255,255,255,.36) 0 16%, transparent 17%),
    linear-gradient(135deg, var(--swatch), color-mix(in srgb, var(--swatch) 52%, #111827));
}

.texture-designer-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
}

.texture-designer-actions button {
  min-height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: #303a52;
  font-size: 12px;
  font-weight: 900;
}

#textureDesignerApply {
  background: linear-gradient(135deg, #6b5bff, #00b8ff);
  color: white;
}

/* Compact header pass: keep level, mode tabs and menu visible without overlap. */
.topbar {
  left: 20px;
  right: 20px;
  top: 14px;
  height: 50px;
  grid-template-columns: minmax(118px, 158px) minmax(180px, 1fr) minmax(300px, 360px) 42px;
  gap: 8px;
  padding: 0 8px 0 14px;
}

.brand b {
  font-size: 14px;
}

.brand small {
  font-size: 10px;
}

.project-pill {
  width: 100%;
  max-width: none;
  height: 36px;
  gap: 8px;
  padding: 0 10px;
}

.project-pill select {
  font-size: 14px;
}

.project-pill #saveState,
#saveState {
  min-width: 70px;
  height: 26px;
  font-size: 11px;
}

.tabs {
  height: 40px;
  min-width: 300px;
  max-width: min(640px, 52vw);
  padding: 4px;
}

.tab {
  font-size: 14px;
}

.header-help {
  width: 38px;
  min-width: 38px;
  height: 36px;
  border-radius: 13px;
  justify-self: end;
}

.header-help summary {
  height: 36px;
  font-size: 18px;
}

.header-help[open]::after {
  top: 35px;
  width: 186px;
}

.header-help p {
  width: 186px;
  padding: 7px 10px;
  gap: 10px;
  font-size: 11px;
}

.header-help hr {
  width: 186px;
}

.header-help kbd {
  padding: 2px 5px;
  font-size: 9px;
}

.header-help .help-menu {
  position: absolute;
  top: 42px;
  right: 0;
  width: 186px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 60px rgba(23, 31, 74, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-help .help-menu p,
.header-help .help-menu hr {
  width: auto;
  border-left: 0;
  border-right: 0;
  background: transparent;
}

.header-help .help-menu p:first-of-type {
  border-top: 0;
}

.header-help .help-menu p:last-child {
  border-bottom: 0;
  border-radius: 0;
}

@media (max-width: 900px) {
  .topbar {
    left: 10px;
    right: 10px;
    top: 10px;
    height: 46px;
    grid-template-columns: minmax(0, 1fr) 136px 38px;
    gap: 6px;
    padding: 0 6px 0 10px;
  }

  .brand {
    display: none;
  }

  .project-pill {
    height: 34px;
  }

  .project-pill #saveState,
  #saveState {
    display: none;
  }

  .tabs {
    min-width: 240px;
    max-width: 240px;
    height: 36px;
  }

  .tab {
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) 168px 36px;
  }

  .project-pill select {
    font-size: 12px;
  }

  .tabs {
    min-width: 168px;
    max-width: 168px;
  }
}

.dock {
  left: 20px;
  top: 104px;
  height: 84px;
  width: 112px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  z-index: 7;
}

.dock button:not(.new):not(.topup) {
  height: 44px;
  border-radius: 13px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  text-align: left;
  font-weight: 650;
  color: #2f3850;
  font-size: 13px;
}

.dock button:hover {
  background: rgba(101, 85, 255, 0.09);
}

.dock .new {
  height: 48px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #6b58ff, #6754e7);
  font-weight: 900;
}

.spacer {
  flex: 1;
}

.credit {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.credit b {
  color: var(--text);
  font-size: 16px;
}

.topup {
  height: 38px;
  border-radius: 12px;
  color: #6754ff;
  border: 1px solid rgba(101, 85, 255, 0.25);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.56);
}

.ai-panel {
  left: 146px;
  top: 104px;
  width: 430px;
  max-height: 390px;
  overflow: auto;
  border-radius: 22px;
  padding: 18px;
  z-index: 6;
}

.physics-lab {
  left: 50%;
  top: 94px;
  width: 460px;
  max-height: 520px;
  overflow: auto;
  border-radius: 22px;
  padding: 18px;
  transform: translateX(-50%);
}

.physics-lab textarea {
  min-height: 96px;
  max-height: 96px;
}

.physics-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.physics-grid label {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  color: #43506a;
  font-size: 12px;
  font-weight: 900;
}

.physics-grid input {
  width: 100%;
}

.physics-grid b {
  text-align: right;
  color: #202940;
  font-size: 12px;
}

.physics-report {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.physics-report p {
  margin: 0;
  min-height: 48px;
  border-radius: 13px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(30, 38, 70, 0.09);
}

.physics-report span {
  color: #667085;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.physics-report b {
  color: #263149;
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.physics-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.physics-actions button {
  min-height: 38px;
  border-radius: 12px;
  background: rgba(22, 28, 54, 0.07);
  color: #263149;
  font-size: 12px;
  font-weight: 900;
}

.physics-actions button:nth-child(1),
.physics-actions button:nth-child(3) {
  color: white;
  background: linear-gradient(135deg, #1d9c72, #2d7df0);
}

.kart-setup {
  right: 24px;
  top: 104px;
  width: 356px;
  max-height: calc(100vh - 138px);
  overflow: auto;
  border-radius: 22px;
  padding: 16px;
  z-index: 15;
}

.kart-setup > p {
  margin: 6px 0 12px;
  color: #576174;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.kart-setup h3 {
  margin: 14px 0 8px;
  color: #253049;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kart-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kart-choice-grid button {
  min-height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 8px 6px;
  color: #2b354d;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(32, 42, 64, 0.1);
  box-shadow: 0 10px 24px rgba(31, 40, 65, 0.06);
  font-size: 11px;
  font-weight: 900;
}

.kart-choice-grid button.active,
.kart-choice-grid button:hover {
  color: #172033;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(18, 140, 104, 0.35);
  box-shadow: 0 12px 26px rgba(18, 140, 104, 0.12);
}

.kart-chip {
  width: 28px;
  height: 18px;
  border-radius: 7px;
  border: 1px solid rgba(31, 40, 65, 0.15);
  box-shadow: inset 0 5px 10px rgba(255, 255, 255, 0.42), 0 7px 14px rgba(31, 40, 65, 0.12);
}

.kart-chip.blue { background: linear-gradient(135deg, #4fa8ff, #365bd9); }
.kart-chip.gold { background: linear-gradient(135deg, #ffe17b, #dd8d1e); }
.kart-chip.violet { background: linear-gradient(135deg, #a587ff, #2ed3d0); }
.kart-chip.metal { background: linear-gradient(135deg, #d5dde8, #68758a); }
.kart-chip.green { background: linear-gradient(135deg, #62d989, #16805b); }
.kart-chip.grass { background: linear-gradient(135deg, #86d96c, #236c46); }
.kart-chip.lava { background: linear-gradient(135deg, #ffce60, #e0472e); }
.kart-chip.ice { background: linear-gradient(135deg, #d7fbff, #3ba4e8); }

.kart-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.kart-stats p {
  margin: 0;
  min-height: 46px;
  border-radius: 13px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(30, 38, 70, 0.09);
}

.kart-stats span {
  color: #667085;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.kart-stats b {
  color: #1d2740;
  font-size: 14px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kart-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.kart-actions button {
  min-height: 40px;
  border-radius: 12px;
  background: rgba(22, 28, 54, 0.07);
  color: #263149;
  font-size: 12px;
  font-weight: 900;
}

.kart-actions button:last-child,
.kart-setup .panel-head button {
  color: white;
  background: linear-gradient(135deg, #15946c, #2879d4);
}

.architect-panel {
  left: 24px;
  top: 314px;
  width: 392px;
  max-height: 520px;
  overflow: auto;
  border-radius: 22px;
  padding: 16px;
  z-index: 7;
}

.architect-panel .panel-head button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-weight: 950;
}

.architect-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.architect-kpis p {
  margin: 0;
  min-height: 48px;
  border-radius: 13px;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  align-content: center;
  background: rgba(255, 255, 255, 0.63);
  border: 1px solid rgba(30, 38, 70, 0.09);
}

.architect-kpis span,
.architect-slots span {
  color: #667085;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.architect-kpis b {
  color: #263149;
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.architect-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.architect-actions button {
  min-height: 38px;
  border-radius: 12px;
  background: rgba(22, 28, 54, 0.07);
  color: #263149;
  font-size: 12px;
  font-weight: 900;
  min-width: 0;
}

.architect-actions button:nth-child(1),
.architect-actions button:nth-child(2) {
  color: white;
  background: linear-gradient(135deg, #2d7df0, #1d9c72);
}

.architect-slots {
  display: grid;
  gap: 7px;
  max-height: 132px;
  overflow: auto;
  margin-top: 11px;
}

.architect-slot {
  min-height: 34px;
  border-radius: 12px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(30, 38, 70, 0.09);
}

.architect-slot b {
  color: #263149;
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.architect-panel textarea {
  width: 100%;
  min-height: 74px;
  max-height: 118px;
  resize: vertical;
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 11px;
  outline: 0;
  color: #202940;
  font-size: 13px;
  font-weight: 760;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
}

.panel-head small {
  color: var(--muted);
}

.panel-head .ai-backend {
  margin-left: 7px;
  color: #8a93a7;
}

.panel-head .ai-backend.is-cli {
  color: var(--green);
}

.panel-head .ai-backend.is-fallback {
  color: var(--amber);
}

.panel-head button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #6754ff;
  background: rgba(101, 85, 255, 0.09);
}

textarea {
  width: 100%;
  min-height: 132px;
  max-height: 132px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  outline: 0;
  padding: 14px;
  color: #3c465c;
  font-size: 13px;
  line-height: 1.45;
}

.ai-panel .gradient {
  margin-top: 12px;
}

.ai-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.ai-flow p {
  margin: 0;
  min-height: 44px;
  border-radius: 13px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(30, 38, 70, 0.09);
}

.ai-flow span {
  color: #667085;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-flow b {
  color: #263149;
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-tabs button,
.tray-tabs button {
  border-radius: 999px;
  background: rgba(22, 28, 54, 0.06);
  padding: 7px 10px;
  font-weight: 750;
  font-size: 12px;
  color: #39445b;
}

.gradient {
  height: 46px;
  width: 100%;
  border-radius: 14px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(100deg, #6655ff, #aa50e2, #ff6d54);
  box-shadow: 0 14px 30px rgba(100, 80, 255, 0.23);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 950;
}

.asset-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.asset-tabs .active {
  background: rgba(101, 85, 255, 0.13);
  color: #5c4af2;
}

.asset-filtered {
  display: none !important;
}

.tool-options {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.tool-options label {
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  display: grid;
  grid-template-columns: auto 1fr 28px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: #39445b;
  font-size: 12px;
  font-weight: 900;
}

.tool-options input {
  min-width: 0;
  accent-color: #6754ff;
}

.tool-options button {
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  padding: 0 12px;
  color: #354057;
  font-size: 12px;
  font-weight: 900;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 8px;
  margin-top: 10px;
}

.asset-grid button {
  height: 58px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: #4b5368;
}

.cube {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 5px 10px rgba(20, 30, 50, 0.12);
}

.grass {
  background: linear-gradient(145deg, #66bd38 0 45%, #805337 46%);
}

.stone {
  background: linear-gradient(145deg, #8d9098, #3e424b);
}

.stone-light {
  background: linear-gradient(145deg, #ddd, #8c929e);
}

.lava {
  background: linear-gradient(145deg, #ffd45c, #ff692b, #c41112);
}

.water {
  background: linear-gradient(145deg, #76d6ff, #176bff);
}

.sand {
  background: linear-gradient(145deg, #ead490, #bd9550);
}

.wood {
  background: linear-gradient(145deg, #a06838, #56311f);
}

.ice {
  background: linear-gradient(145deg, #bff5ff, #59b0ff);
}

.crystal {
  background: linear-gradient(145deg, #df9cff, #7e3eff);
}

.metal {
  background: linear-gradient(145deg, #d5d8de, #7b8494);
}

.coin-icon {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: block;
  background: radial-gradient(circle at 35% 30%, #fff3a5, #ffc120 48%, #e09000);
}

.tool-ribbon {
  top: 112px;
  left: 50%;
  transform: translateX(-50%);
  height: 56px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  z-index: 14;
}

.panel-switcher {
  top: 176px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 40px);
  min-height: 48px;
  border-radius: 17px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 14;
}

.panel-switcher::-webkit-scrollbar {
  display: none;
}

.panel-switcher button {
  height: 36px;
  min-width: 58px;
  border-radius: 12px;
  padding: 0 12px;
  color: #39445b;
  font-size: 12px;
  font-weight: 900;
}

.panel-switcher button:hover,
.panel-switcher button.active {
  color: white;
  background: linear-gradient(135deg, #6555ff, #7d55ff);
}

.simple-mode-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.simple-mode-head b {
  display: block;
  font-size: 20px;
  line-height: 1.05;
}

.simple-mode-head span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.simple-mode-head button,
.simple-mode-actions button,
.simple-mode-tools button,
.simple-mode-controls button {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(25, 34, 62, 0.1);
  color: #24304a;
  font-weight: 900;
}

.simple-mode-head button {
  min-width: 88px;
  height: 40px;
  color: white;
  background: linear-gradient(135deg, #1db76b, #11a0a8);
}

.simple-mode-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.simple-mode-tools button {
  min-height: 74px;
  display: grid;
  gap: 5px;
  place-items: center;
  padding: 8px;
  text-align: center;
}

.simple-mode-tools i {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-style: normal;
  font-size: 17px;
  background: linear-gradient(135deg, #6856ff, #22b6c8);
  box-shadow: inset 0 -7px 12px rgba(0, 0, 0, 0.13);
}

.simple-mode-tools span {
  font-size: 12px;
  line-height: 1.15;
}

.simple-mode-tools button:hover,
.simple-mode-tools button.active,
.simple-mode-controls button:hover,
.simple-mode-controls button.active {
  color: white;
  background: linear-gradient(135deg, #6856ff, #22b6c8);
}

.simple-mode-controls {
  position: fixed;
  right: 22px;
  top: 104px;
  width: 332px;
  max-height: calc(100vh - 142px);
  overflow: auto;
  border-radius: 18px;
  padding: 54px 12px 12px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 16;
  display: grid;
  gap: 9px;
}

.simple-mode-controls::before {
  content: "Einstellungen";
  position: absolute;
  left: 14px;
  top: 14px;
  color: #12172a;
  font-size: 18px;
  font-weight: 950;
}

.simple-mode-controls label,
.simple-mode-controls .simple-row {
  min-height: 48px;
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(25, 34, 62, 0.08);
  display: grid;
  gap: 6px;
  color: #36425c;
  font-size: 12px;
  font-weight: 900;
}

.simple-mode-controls input[type="range"] {
  width: 100%;
}

.simple-mode-controls .simple-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.simple-mode-controls .simple-grid button {
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
}

.simple-mode-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.simple-mode-actions button {
  min-height: 40px;
  padding: 0 8px;
  font-size: 12px;
}

.voxel-harvest-editor {
  position: fixed;
  left: 18px;
  top: 150px;
  width: min(440px, calc(100vw - 36px));
  max-height: calc(100vh - 172px);
  overflow: auto;
  padding: 12px;
  border-radius: 18px;
}

.voxel-harvest-editor .panel-head {
  margin-bottom: 10px;
}

.harvest-editor-status {
  min-height: 34px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(29, 183, 107, 0.14);
  color: #165c3d;
  font-size: 12px;
  font-weight: 900;
}

.harvest-editor-status.is-warning {
  background: rgba(225, 132, 19, 0.15);
  color: #7a3e04;
}

.harvest-editor-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.harvest-editor-tabs button,
.harvest-editor-actions button,
.voxel-harvest-editor .panel-head button {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(25, 34, 62, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #26334d;
  font-size: 11px;
  font-weight: 950;
}

.harvest-editor-tabs button.active,
.harvest-editor-actions button:first-child {
  color: #fff;
  background: #1d6fd6;
}

.harvest-editor-body {
  border: 1px solid rgba(25, 34, 62, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.48);
}

.harvest-editor-page {
  display: none;
}

.harvest-editor-page.active {
  display: grid;
  gap: 9px;
}

.voxel-harvest-editor label {
  display: grid;
  gap: 5px;
  color: #33405b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.voxel-harvest-editor input,
.voxel-harvest-editor select {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(25, 34, 62, 0.14);
  border-radius: 9px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.88);
  color: #12172a;
  font: 850 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.harvest-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.harvest-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.harvest-editor-actions button:nth-child(2) {
  background: rgba(255, 255, 255, 0.82);
}

.harvest-editor-actions button:nth-child(3) {
  color: #8a1f14;
  background: rgba(228, 71, 54, 0.12);
}

.harvest-editor-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.harvest-editor-summary p {
  min-width: 0;
  margin: 0;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
}

.harvest-editor-summary span,
.harvest-editor-summary b {
  display: block;
}

.harvest-editor-summary span {
  color: #6a7284;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.harvest-editor-summary b {
  margin-top: 2px;
  color: #11182b;
  font-size: 17px;
  line-height: 1;
}

[data-panel] {
  display: none;
}

[data-panel].open {
  display: block;
}

.tool-ribbon button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 19px;
  color: #3d465a;
}

.tool-ribbon button:hover,
.tool-ribbon .active {
  background: rgba(104, 83, 255, 0.14);
  color: #6251ff;
}

.tool-ribbon button[data-tool="move"].active {
  background: rgba(46, 167, 255, 0.16);
  color: #1476d4;
}

body.is-moving #gameCanvas {
  cursor: grab;
}

body.is-moving.dragging #gameCanvas,
body.object-grab-active #gameCanvas {
  cursor: grabbing;
}

.paint-context-menu {
  z-index: 18;
  width: 188px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.paint-context-menu[hidden] {
  display: none;
}

.paint-context-menu button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  color: #303b52;
  font-size: 11px;
  font-weight: 820;
  text-align: left;
}

.paint-context-menu button:hover,
.paint-context-menu button.active {
  border-color: rgba(104, 86, 255, 0.45);
  background: rgba(104, 83, 255, 0.12);
  color: #5f50ff;
}

.paint-context-menu .cube {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.gizmo-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 220px;
  height: 220px;
  transform: translate(-110px, -110px);
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(18, 28, 58, 0.22));
  z-index: 5;
}

.gizmo-overlay.show {
  display: block;
}

.gizmo-dot {
  position: absolute;
  left: 101px;
  top: 101px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #f7fbff;
  border: 2px solid rgba(47, 55, 80, 0.18);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.38);
  z-index: 2;
}

.gizmo-axis {
  position: absolute;
  left: 110px;
  top: 108px;
  width: 62px;
  height: 6px;
  border-radius: 999px;
  transform-origin: left center;
  pointer-events: auto;
  cursor: grab;
  opacity: 0.98;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
  z-index: 1;
}

.gizmo-axis:active {
  cursor: grabbing;
}

.gizmo-axis::before {
  content: "";
  position: absolute;
  left: -10px;
  right: -18px;
  top: -12px;
  bottom: -12px;
}

.gizmo-axis::after {
  content: "";
  position: absolute;
  right: -6px;
  top: -5px;
  border-left: 12px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.gizmo-x {
  color: #ff4a58;
  background: currentColor;
}

.gizmo-y {
  color: #18c76f;
  background: currentColor;
}

.gizmo-z {
  color: #2f91ff;
  background: currentColor;
}

.inspector {
  right: 24px;
  top: 104px;
  width: 354px;
  max-height: 520px;
  overflow: auto;
  border-radius: 24px;
  padding: 18px;
  z-index: 6;
}

.inspector label {
  display: block;
  margin: 15px 0 8px;
  font-size: 11px;
  font-weight: 950;
  color: #333b50;
}

.wide {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.63);
  padding: 0 12px;
  outline: 0;
  font-weight: 700;
}

.transform-grid {
  display: grid;
  grid-template-columns: 44px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.transform-grid span {
  color: #667085;
  font-size: 11px;
  font-weight: 950;
}

.transform-grid input {
  min-width: 0;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  padding: 0 7px;
  outline: 0;
  color: #263149;
  font-size: 12px;
  font-weight: 850;
}

.toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.toggle-row label {
  margin: 0;
  min-height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12px;
}

.cards4,
.materials {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cards4 button,
.materials button {
  min-height: 64px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 750;
  color: #4b5366;
  min-width: 0;
}

.cards4 .active {
  background: linear-gradient(135deg, #6b55ff, #7d5cff);
  color: white;
  box-shadow: 0 10px 20px rgba(107, 85, 255, 0.24);
}

.materials .active {
  border-color: rgba(104, 83, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(104, 83, 255, 0.12);
}

.material-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.material-meta p {
  margin: 0;
  min-height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(30, 38, 70, 0.09);
  background: rgba(255, 255, 255, 0.55);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px 8px;
}

.material-meta span {
  color: #667085;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.material-meta b {
  color: #30394d;
  font-size: 11px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slider {
  display: grid;
  grid-template-columns: 70px 44px 1fr 35px;
  align-items: center;
  gap: 8px;
  margin: 13px 0;
  font-size: 12px;
}

.slider span {
  font-weight: 800;
}

.slider small {
  color: #7d8696;
  font-size: 11px;
}

.slider input {
  accent-color: #6754ff;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  font-size: 13px;
  font-weight: 800;
}

.toggle input {
  width: 36px;
  height: 20px;
  accent-color: #6754ff;
}

.minimap-card {
  left: 600px;
  bottom: 315px;
  width: 316px;
  border-radius: 22px;
  padding: 13px;
  z-index: 6;
}

.minimap-card canvas {
  width: 100%;
  height: 139px;
  display: block;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.minimap-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px 42px;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.minimap-controls button {
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  font-weight: 900;
}

.minimap-controls span {
  text-align: center;
  font-weight: 900;
}

.scene-tree {
  left: 24px;
  top: 420px;
  width: 316px;
  max-height: 360px;
  overflow: hidden;
  border-radius: 22px;
  padding: 14px;
  z-index: 6;
}

.scene-tree .panel-head,
.look-panel .panel-head {
  cursor: move;
}

.scene-tree .panel-head h2,
.look-panel .panel-head h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.scene-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  margin-bottom: 9px;
}

.scene-search input,
.scene-search select {
  min-width: 0;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  color: #354057;
  padding: 0 9px;
  outline: 0;
  font-size: 12px;
  font-weight: 800;
}

.scene-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.scene-actions button {
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  color: #354057;
  font-size: 12px;
  font-weight: 900;
}

.scene-actions button:hover {
  border-color: rgba(104, 83, 255, 0.38);
  background: rgba(104, 83, 255, 0.09);
}

.selection-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0 0 10px;
}

.selection-tools button {
  min-height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(47, 145, 255, 0.18);
  background: rgba(47, 145, 255, 0.08);
  color: #265b97;
  font-size: 11px;
  font-weight: 950;
}

.selection-tools button[data-mode="material"],
.selection-tools button[data-mode="touching"] {
  color: #2c4fc7;
  background: rgba(104, 83, 255, 0.12);
  border-color: rgba(104, 83, 255, 0.28);
}

.selection-tools button:hover {
  border-color: rgba(47, 145, 255, 0.42);
  background: rgba(47, 145, 255, 0.14);
}

.scene-tree-list {
  max-height: 224px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 3px;
}

.scene-tree-list button {
  min-height: 42px;
  border-radius: 13px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 6px;
  border: 1px solid rgba(30, 38, 70, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: #30394d;
  text-align: left;
}

.scene-tree-list button:hover,
.scene-tree-list button.active {
  border-color: rgba(104, 83, 255, 0.42);
  background: rgba(104, 83, 255, 0.1);
}

.scene-tree-list button.hidden {
  opacity: 0.58;
}

.scene-tree-list button.locked i {
  color: #b06112;
  background: rgba(225, 132, 19, 0.14);
}

.scene-tree-list i {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(31, 40, 65, 0.08);
  color: #6754ff;
  font-style: normal;
  font-size: 12px;
  font-weight: 950;
}

.scene-tree-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.scene-tree-list small {
  color: #7a8498;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-empty {
  margin: 0;
  padding: 18px 10px;
  text-align: center;
  color: #7a8498;
  font-size: 12px;
  font-weight: 800;
}

.look-panel {
  right: 24px;
  bottom: 34px;
  width: 316px;
  border-radius: 22px;
  padding: 14px;
  z-index: 6;
}

.look-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.look-grid button {
  min-height: 78px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  place-items: center;
  gap: 6px;
  color: #354057;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(31, 40, 65, 0.06);
}

.look-grid button:hover,
.look-grid button.active {
  border-color: rgba(104, 83, 255, 0.45);
  background: rgba(104, 83, 255, 0.1);
}

.look-swatch {
  width: 44px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(31, 40, 65, 0.12);
  box-shadow: inset 0 9px 16px rgba(255, 255, 255, 0.34), 0 10px 22px rgba(31, 40, 65, 0.13);
}

.look-swatch.cinematic {
  background: linear-gradient(145deg, #70baff 0 45%, #ffc980 46% 100%);
}

.look-swatch.crystal-look {
  background: linear-gradient(145deg, #3b95e6 0 42%, #9bf5ff 43% 100%);
}

.look-swatch.dusk {
  background: linear-gradient(145deg, #2c245c 0 42%, #ff7650 43% 100%);
}

.look-swatch.seus {
  background: linear-gradient(145deg, #327de8 0 34%, #ffb75a 35% 58%, #0c7d9d 59% 100%);
}

.look-swatch.clean {
  background: linear-gradient(145deg, #a9dcff 0 45%, #fff7d6 46% 100%);
}

.look-stats {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.look-stats p {
  margin: 0;
  min-height: 32px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(30, 38, 70, 0.09);
  font-size: 12px;
}

.look-stats span {
  color: #667085;
  font-weight: 850;
}

.look-stats b {
  color: #30394d;
  font-weight: 950;
}

.camera-lab {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(30, 38, 70, 0.1);
}

.camera-lab label {
  display: block;
  margin-bottom: 8px;
  color: #667085;
  font-size: 10px;
  font-weight: 950;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.visibility-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.camera-lab label.visibility-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 8px;
}

.visibility-label small {
  color: #30394d;
  font-size: 10px;
  font-weight: 950;
}

.camera-grid button,
.camera-wide,
.visibility-grid button {
  min-height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: #354057;
  font-size: 11px;
  font-weight: 900;
}

.camera-grid button:hover,
.camera-grid button.active,
.camera-wide:hover,
.camera-wide.active,
.visibility-grid button:hover,
.visibility-grid button.active {
  color: #5c4af2;
  border-color: rgba(104, 83, 255, 0.38);
  background: rgba(104, 83, 255, 0.1);
}

.camera-wide {
  width: 100%;
  margin-top: 7px;
}

.mechanics {
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: 680px;
  max-height: 372px;
  overflow: auto;
  border-radius: 22px;
  padding: 12px;
  z-index: 6;
}

.tray-title {
  color: #5f4cf2;
  border-bottom: 2px solid #6754ff;
  display: inline-block;
  margin: 0 0 12px;
  padding: 0 10px 8px;
  font-size: 12px;
  font-weight: 950;
}

.tray-title.second {
  margin-top: 16px;
}

.mechanic-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.mechanic-grid button {
  height: 74px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #3e465a;
  font-size: 11px;
  font-weight: 750;
  min-width: 0;
}

.mechanic-grid i {
  font-style: normal;
  font-size: 22px;
}

.mechanic-grid .active,
.mechanic-grid button:hover {
  border-color: rgba(104, 83, 255, 0.36);
  background: rgba(104, 83, 255, 0.08);
}

.playtest-card {
  right: 24px;
  bottom: 34px;
  width: 176px;
  border-radius: 19px;
  padding: 14px;
  z-index: 6;
}

.test-rows {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
}

.test-rows p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.test-rows span {
  color: #667085;
}

.test-rows b {
  color: #4a5266;
}

.test-rows .good {
  color: var(--green);
}

.mini-gradient {
  height: 40px;
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, #6655ff, #7f5cff);
  color: white;
  font-weight: 900;
}

.runtime-hud {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 46px;
  border-radius: 18px;
  display: none;
  grid-auto-flow: column;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  z-index: 10;
}

.runtime-hud p {
  margin: 0;
  min-width: 86px;
  height: 32px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  font-size: 11px;
}

.runtime-hud span {
  color: #667085;
  font-weight: 800;
}

.runtime-hud b {
  color: #1d2740;
  text-align: right;
  font-size: 12px;
}

.runtime-hud button {
  height: 32px;
  border-radius: 11px;
  padding: 0 14px;
  color: white;
  background: linear-gradient(135deg, #6555ff, #7d55ff);
  font-size: 12px;
  font-weight: 900;
}

.shooter-hud {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 13;
}

.shooter-hud * {
  pointer-events: none;
}

body[data-mode="play"].shooter-mode #gameCanvas {
  cursor: none;
}

body[data-mode="play"].round-result.shooter-mode #gameCanvas,
body[data-mode="play"].public-result.shooter-mode #gameCanvas {
  cursor: auto;
}

body[data-mode="play"].shooter-mode .shooter-hud {
  display: block;
}

body[data-mode="play"].round-result.shooter-mode .shooter-hud,
body[data-mode="play"].public-result.shooter-mode .shooter-hud {
  display: none;
}

body[data-mode="play"].flight-shooter-mode .shooter-hud {
  display: block;
}

body[data-mode="play"].flight-shooter-mode .crosshair b,
body[data-mode="play"].flight-shooter-mode .crosshair i {
  background: rgba(72, 240, 168, 0.95);
}

body.moorhunter-night[data-mode="play"].shooter-mode .crosshair b {
  background: #a8e8ff;
  box-shadow: 0 0 0 2px rgba(18, 23, 42, 0.22), 0 0 22px rgba(124, 219, 255, 0.92);
}

body.moorhunter-night[data-mode="play"].shooter-mode .crosshair i {
  background: rgba(202, 235, 255, 0.95);
}

body.moorhunter-night[data-mode="play"] .shooter-readout {
  border-color: rgba(140, 215, 255, 0.42);
  box-shadow: 0 18px 50px rgba(12, 34, 62, 0.28), 0 0 24px rgba(96, 191, 255, 0.18);
}

.interaction-prompt {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%) translateY(18px);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 18px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: rgba(20, 27, 38, 0.64);
  box-shadow: 0 18px 44px rgba(10, 18, 34, 0.26);
  color: white;
  font-size: 13px;
  font-weight: 920;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 15;
}

.interaction-prompt.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.interaction-prompt kbd {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 9px;
  background: linear-gradient(180deg, #58f3b1, #16b979);
  color: #062a1b;
  box-shadow: 0 0 0 6px rgba(71, 239, 166, 0.18), 0 0 28px rgba(71, 239, 166, 0.7);
  font-size: 21px;
  font-weight: 1000;
  animation: keyPulse 0.92s ease-in-out infinite alternate;
}

.interaction-prompt span {
  max-width: min(340px, 68vw);
  line-height: 1.2;
}

@keyframes keyPulse {
  from { transform: translateY(0); filter: brightness(1); }
  to { transform: translateY(-2px); filter: brightness(1.12); }
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

body[data-mode="play"].shooter-mode .crosshair {
  left: var(--shooter-x, 50%);
  top: var(--shooter-y, 50%);
  width: 64px;
  height: 64px;
}

.crosshair i,
.crosshair b {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.92);
}

.crosshair i:nth-child(1),
.crosshair i:nth-child(2) {
  left: 50%;
  width: 2px;
  height: 19px;
  transform: translateX(-50%);
}

.crosshair i:nth-child(1) {
  top: 0;
}

.crosshair i:nth-child(2) {
  bottom: 0;
}

.crosshair i:nth-child(3),
.crosshair i:nth-child(4) {
  top: 50%;
  width: 19px;
  height: 2px;
  transform: translateY(-50%);
}

.crosshair i:nth-child(3) {
  left: 0;
}

.crosshair i:nth-child(4) {
  right: 0;
}

.crosshair b {
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #f2b84b;
  box-shadow: 0 0 0 2px rgba(18, 23, 42, 0.22);
}

.shooter-readout {
  right: 22px;
  top: 86px;
  width: 178px;
  border-radius: 18px;
  padding: 9px;
  display: grid;
  gap: 7px;
}

.shooter-readout p {
  margin: 0;
  min-height: 36px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(30, 38, 70, 0.11);
}

.shooter-readout span {
  color: #667085;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.shooter-readout b {
  color: #172033;
  font-size: 14px;
  font-weight: 950;
  text-align: right;
}

.physics-mode-hud {
  right: 22px;
  top: 84px;
  width: 330px;
  border-radius: 20px;
  padding: 14px;
  display: none;
  z-index: 16;
}

.duel-hud {
  right: 22px;
  top: auto;
  bottom: 22px;
  width: 336px;
  border-radius: 16px;
  padding: 11px;
  display: none;
  z-index: 16;
}

.duel-mode-head,
.physics-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.duel-mode-head b,
.physics-mode-head b {
  color: #162033;
  font-size: 13px;
  font-weight: 950;
}

.duel-mode-head button,
.physics-mode-head button {
  height: 32px;
  border-radius: 11px;
  padding: 0 13px;
  color: white;
  background: linear-gradient(135deg, #6555ff, #7d55ff);
  font-size: 12px;
  font-weight: 900;
}

.duel-kpis,
.physics-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.duel-kpis p,
.physics-kpis p {
  margin: 0;
  min-height: 42px;
  border-radius: 11px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(30, 38, 70, 0.09);
}

.duel-kpis span,
.physics-kpis span {
  color: #667085;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.duel-kpis b,
.physics-kpis b {
  color: #1d2740;
  font-size: 15px;
  font-weight: 950;
}

.duel-help {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.duel-help > span:not(.fyrka-control) {
  min-height: 23px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(22, 28, 54, 0.08);
  color: #3e4a62;
  font-size: 10px;
  font-weight: 950;
}

.physics-mode-hud input {
  width: 100%;
  height: 38px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
  outline: 0;
  padding: 0 11px;
  color: #263149;
  font-size: 12px;
  font-weight: 800;
}

.duel-mode-actions,
.physics-mode-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.duel-mode-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.duel-mode-actions button,
.physics-mode-actions button {
  min-height: 34px;
  border-radius: 10px;
  background: rgba(22, 28, 54, 0.07);
  color: #263149;
  font-size: 12px;
  font-weight: 900;
}

.duel-mode-actions button.active,
.duel-mode-actions button:hover {
  color: white;
  background: linear-gradient(135deg, #0fb8d5, #6f55ff);
}

.physics-mode-actions button:nth-child(5),
.physics-mode-actions button:nth-child(6),
.physics-mode-actions button:last-child {
  color: white;
  background: linear-gradient(135deg, #1d9c72, #2d7df0);
}

.physics-labels {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: block;
}

.physics-label {
  position: absolute;
  transform: translate(-50%, -100%);
  min-width: 74px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #ffffff;
  background: rgba(19, 25, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.2);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.physics-label b {
  display: block;
  font-size: 11px;
  line-height: 1.1;
}

.physics-label span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}

.physics-label.score-label {
  min-width: 0;
  padding: 4px 9px;
  color: #182018;
  background: linear-gradient(180deg, #ffe27a, #ffb33d);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(255, 170, 42, 0.28);
}

.physics-label.score-label b {
  font-size: 16px;
}

.physics-label.score-label span {
  color: rgba(24, 32, 24, 0.68);
}

.physics-label.duel-label {
  min-width: 118px;
  padding-bottom: 7px;
}

.duel-label-bar {
  display: block;
  height: 6px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(255, 73, 73, 0.5);
  overflow: hidden;
}

.duel-label-bar em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1ee6ff, #68ff9f);
  box-shadow: 0 0 12px rgba(30, 230, 255, 0.75);
}

body[data-mode="play"] .runtime-hud,
body[data-mode="duel"] .runtime-hud,
body[data-mode="physics"] .runtime-hud,
body[data-mode="levelmap"] .runtime-hud {
  display: grid;
}

body[data-mode="levelmap"] .runtime-hud {
  top: 72px;
}

body[data-mode="duel"] .duel-hud,
body[data-mode="physics"] .physics-mode-hud {
  display: block;
}

.win-overlay {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 36px));
  border-radius: 22px;
  padding: 24px;
  text-align: center;
  display: none;
  z-index: 18;
}

.win-overlay.show {
  display: block;
}

.win-overlay h2 {
  margin: 0 0 8px;
  color: #1d2740;
  font-size: 28px;
  letter-spacing: 0;
}

.win-overlay p {
  margin: 0 0 16px;
  color: #667085;
  font-weight: 800;
}

.score-shot {
  position: relative;
  display: none;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0 0 14px;
  padding: 8px 12px 8px 8px;
  overflow: hidden;
  border: 1px solid rgba(35, 45, 72, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(230, 238, 246, 0.86));
  box-shadow: inset 0 -3px 0 rgba(35, 45, 72, 0.1), 0 12px 24px rgba(19, 28, 48, 0.12);
  text-align: left;
}

.score-shot.show {
  display: grid;
}

.score-shot::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 78px;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, rgba(105, 85, 255, 0.26) 0 10px, transparent 10px 18px);
  opacity: 0;
  animation: scoreTrail 0.72s ease-out both;
}

.score-shot i {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0 25%, transparent 25% 50%, rgba(0, 0, 0, 0.12) 50% 75%, transparent 75%),
    linear-gradient(135deg, #f7cf54, #d9921b);
  box-shadow: inset 0 -6px 0 rgba(87, 54, 8, 0.22), inset 6px 0 0 rgba(255, 255, 255, 0.22), 0 10px 14px rgba(122, 78, 12, 0.22);
  animation: scoreCubeIn 0.72s cubic-bezier(0.18, 1.24, 0.38, 1) both;
  image-rendering: pixelated;
}

.score-shot span,
.score-shot b {
  position: relative;
  z-index: 1;
}

.score-shot span {
  color: #57627a;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.score-shot b {
  color: #172033;
  font-size: 24px;
  font-weight: 1000;
  animation: scoreNumberIn 0.46s ease-out 0.22s both;
}

.win-overlay button {
  height: 40px;
  border-radius: 13px;
  padding: 0 18px;
  color: white;
  background: linear-gradient(135deg, #6555ff, #7d55ff);
  font-weight: 950;
}

.score-save {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: end;
  margin: 14px 0 12px;
  text-align: left;
}

.score-save label {
  display: grid;
  gap: 6px;
}

.score-save button {
  white-space: nowrap;
}

.end-leaderboard {
  display: none;
  margin-bottom: 14px;
}

body.public-game .score-save,
body.public-game .end-leaderboard {
  display: grid;
}

body:not([data-mode="play"]) .win-overlay {
  display: none !important;
}

@keyframes scoreCubeIn {
  from {
    opacity: 0;
    transform: translateX(-180px) rotate(-28deg) scale(0.72);
  }
  70% {
    opacity: 1;
    transform: translateX(7px) rotate(8deg) scale(1.08);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0) scale(1);
  }
}

@keyframes scoreNumberIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scoreTrail {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  45% {
    opacity: 1;
    clip-path: inset(0 12% 0 0);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
  }
}

body[data-mode="play"] .topbar,
body[data-mode="play"] .dock,
body[data-mode="play"] .ai-panel,
body[data-mode="play"] .kart-setup,
body[data-mode="play"] .architect-panel,
body[data-mode="play"] .tool-ribbon,
body[data-mode="play"] .panel-switcher,
body[data-mode="play"] .creator-start,
body[data-mode="play"] .gizmo-overlay,
body[data-mode="play"] .inspector,
body[data-mode="play"] .minimap-card,
body[data-mode="play"] .scene-tree,
body[data-mode="play"] .look-panel,
body[data-mode="play"] .mechanics,
body[data-mode="play"] .physics-lab,
body[data-mode="play"] .texture-designer-window,
body[data-mode="play"] .playtest-card,
body[data-mode="play"] .voxel-harvest-editor {
  display: none;
}

body[data-mode="play"].flight-shooter-mode .topbar {
  display: grid;
  grid-template-columns: 38px;
  left: auto;
  right: 14px;
  top: 14px;
  width: auto;
  min-width: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-mode="play"].flight-shooter-mode .topbar .brand,
body[data-mode="play"].flight-shooter-mode .topbar .tabs {
  display: none;
}

body[data-mode="play"].flight-shooter-mode .header-help {
  display: block;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
}

body[data-mode="physics"] .topbar,
body[data-mode="physics"] .dock,
body[data-mode="physics"] .ai-panel,
body[data-mode="physics"] .kart-setup,
body[data-mode="physics"] .architect-panel,
body[data-mode="physics"] .tool-ribbon,
body[data-mode="physics"] .panel-switcher,
body[data-mode="physics"] .creator-start,
body[data-mode="physics"] .gizmo-overlay,
body[data-mode="physics"] .inspector,
body[data-mode="physics"] .minimap-card,
body[data-mode="physics"] .scene-tree,
body[data-mode="physics"] .look-panel,
body[data-mode="physics"] .mechanics,
body[data-mode="physics"] .physics-lab,
body[data-mode="physics"] .texture-designer-window,
body[data-mode="physics"] .playtest-card,
body[data-mode="physics"] .voxel-harvest-editor {
  display: none;
}

body[data-mode="duel"] .topbar,
body[data-mode="duel"] .dock,
body[data-mode="duel"] .ai-panel,
body[data-mode="duel"] .kart-setup,
body[data-mode="duel"] .architect-panel,
body[data-mode="duel"] .tool-ribbon,
body[data-mode="duel"] .panel-switcher,
body[data-mode="duel"] .creator-start,
body[data-mode="duel"] .gizmo-overlay,
body[data-mode="duel"] .inspector,
body[data-mode="duel"] .minimap-card,
body[data-mode="duel"] .scene-tree,
body[data-mode="duel"] .look-panel,
body[data-mode="duel"] .mechanics,
body[data-mode="duel"] .physics-lab,
body[data-mode="duel"] .physics-mode-hud,
body[data-mode="duel"] .texture-designer-window,
body[data-mode="duel"] .playtest-card,
body[data-mode="duel"] .voxel-harvest-editor {
  display: none;
}

body[data-mode="levelmap"] .dock,
body[data-mode="levelmap"] .ai-panel,
body[data-mode="levelmap"] .kart-setup,
body[data-mode="levelmap"] .architect-panel,
body[data-mode="levelmap"] .tool-ribbon,
body[data-mode="levelmap"] .panel-switcher,
body[data-mode="levelmap"] .creator-start,
body[data-mode="levelmap"] .gizmo-overlay,
body[data-mode="levelmap"] .inspector,
body[data-mode="levelmap"] .scene-tree,
body[data-mode="levelmap"] .look-panel,
body[data-mode="levelmap"] .mechanics,
body[data-mode="levelmap"] .physics-lab,
body[data-mode="levelmap"] .physics-mode-hud,
body[data-mode="levelmap"] .texture-designer-window,
body[data-mode="levelmap"] .playtest-card,
body[data-mode="levelmap"] .voxel-harvest-editor {
  display: none;
}

body[data-mode="levelmap"] .minimap-card.open {
  left: 22px;
  right: auto;
  top: auto;
  bottom: 22px;
  width: min(420px, calc(100vw - 44px));
  z-index: 16;
}

body[data-mode="levelmap"] .minimap-card canvas {
  height: 190px;
}

body[data-mode="play"] .simple-mode-panel,
body[data-mode="play"] .simple-mode-controls,
body[data-mode="play"] .light-studio,
body[data-mode="duel"] .simple-mode-panel,
body[data-mode="physics"] .simple-mode-panel,
body[data-mode="levelmap"] .simple-mode-panel {
  display: none;
}

body[data-mode="duel"] .simple-mode-controls,
body[data-mode="duel"] .light-studio,
body[data-mode="physics"] .simple-mode-controls,
body[data-mode="physics"] .light-studio,
body[data-mode="levelmap"] .simple-mode-controls,
body[data-mode="levelmap"] .light-studio {
  display: none;
}

body[data-mode="light"] .simple-mode-panel,
body[data-mode="light"] .simple-mode-controls {
  display: none !important;
}

body.simple-editor-active .tool-ribbon,
body.simple-editor-active .panel-switcher,
body.simple-editor-active .creator-start,
body.simple-editor-active .ai-panel,
body.simple-editor-active .kart-setup,
body.simple-editor-active .architect-panel,
body.simple-editor-active .inspector,
body.simple-editor-active .mechanics,
body.simple-editor-active .scene-tree,
body.simple-editor-active .look-panel,
body.simple-editor-active .physics-lab,
body.simple-editor-active .minimap-card,
body.simple-editor-active .playtest-card {
  display: none !important;
}

body[data-mode="light"].simple-editor-active .tool-ribbon {
  display: flex !important;
  top: auto;
  left: 128px;
  right: 360px;
  bottom: 78px;
  transform: none;
  justify-content: center;
  max-width: none;
  overflow-x: auto;
  z-index: 18;
}

.shortcuts {
  right: 24px;
  bottom: 34px;
  width: 170px;
  border-radius: 17px;
  padding: 12px;
  z-index: 10;
  display: none;
}

.shortcuts summary {
  cursor: pointer;
  list-style: none;
  color: #1d2740;
  font-size: 12px;
  font-weight: 900;
}

.shortcuts summary::-webkit-details-marker {
  display: none;
}

.shortcuts summary::after {
  content: "?";
  float: right;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #6555ff, #7d55ff);
  display: inline-grid;
  place-items: center;
  font-size: 11px;
}

.shortcuts p {
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #465066;
}

.shortcuts p:last-child {
  margin-bottom: 0;
}

.shortcuts hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

.shortcuts kbd {
  background: rgba(31, 40, 65, 0.07);
  border-radius: 7px;
  padding: 4px 6px;
  font-size: 10px;
  color: #667085;
  font-weight: 900;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  transform: translate(-50%, 20px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(20, 24, 40, 0.88);
  color: white;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body[data-mode="light"] .toast {
  bottom: 76px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1400px) {
  .chips-top button:nth-child(3),
  .chips-top button:nth-child(4) {
    display: none;
  }

  .topbar {
    grid-template-columns: minmax(150px, 170px) minmax(170px, 200px) minmax(200px, 1fr) auto;
    gap: 10px;
  }

  .inspector {
    width: 330px;
  }

  .mechanics {
    width: 640px;
  }

  .mechanic-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

}

@media (max-width: 1050px) {
	  .dock,
	  .ai-panel,
	  .kart-setup,
	  .architect-panel,
	  .inspector,
	  .playtest-card,
	  .shortcuts,
	  .minimap-card,
	  .scene-tree,
	  .physics-lab,
	  .look-panel {
	    display: none;
	  }

  .topbar {
    left: 12px;
    right: 12px;
    top: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 44vw) 40px;
    height: 54px;
    gap: 8px;
  }

  .brand {
    display: none;
  }

  .brand small,
  .chips-top {
    display: none;
  }

  .project-pill {
    width: 100%;
    min-width: 0;
  }

  .tabs {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .mechanics {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    bottom: 18px;
  }

  .mechanic-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

	  .tool-ribbon {
	    top: 84px;
	  }

  .panel-switcher {
    top: 144px;
    left: 12px;
    right: 12px;
    transform: none;
    justify-content: flex-start;
  }

  .ai-panel,
  .architect-panel,
  .inspector,
  .scene-tree,
  .physics-lab,
  .look-panel,
  .simple-mode-panel,
  .minimap-card,
  .playtest-card {
    left: 12px;
    right: 12px;
    top: 202px;
    bottom: auto;
    width: auto;
    max-height: calc(100vh - 224px);
  }

  .simple-mode-panel {
    left: 12px;
    top: 84px;
    right: auto;
    width: calc(50vw - 18px);
    max-height: calc(100vh - 108px);
  }

  .simple-mode-controls {
    left: auto;
    right: 12px;
    top: 84px;
    width: calc(50vw - 18px);
    max-height: calc(100vh - 108px);
  }

  .light-studio {
    inset: 0;
  }

  .light-studio-header {
    left: 112px;
    right: 310px;
    top: 76px;
    padding: 10px 14px;
  }

  .light-studio-header h1 {
    font-size: clamp(20px, 3vw, 28px);
  }

  .light-studio-header p {
    font-size: 12px;
  }

  .light-tool-dock {
    left: 12px;
    top: 76px;
    width: 86px;
  }

  .light-inspector {
    right: 12px;
    top: 76px;
    width: 286px;
  }

  .light-test-bar {
    left: 112px;
    right: 310px;
    bottom: 12px;
  }

  body[data-mode="light"].simple-editor-active .tool-ribbon {
    left: 112px;
    right: 310px;
    bottom: 72px;
  }

  .duel-hud,
  .physics-mode-hud {
    left: 12px;
    right: 12px;
    top: 76px;
    width: auto;
  }

  body[data-mode="duel"] .duel-hud {
    left: auto;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: min(310px, calc(100vw - 24px));
  }

  .runtime-hud {
    left: 12px;
    right: 12px;
    top: 12px;
    transform: none;
    grid-auto-flow: column;
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    left: 8px;
    right: 8px;
    top: 8px;
    height: 100px;
    grid-template-columns: minmax(0, 1fr) 38px;
    grid-template-rows: 40px 42px;
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
  }

  .project-pill {
    grid-column: 1;
    grid-row: 1;
    height: 40px;
    border-radius: 12px;
    padding: 0 10px;
  }

  .header-help {
    grid-column: 2;
    grid-row: 1;
    width: 38px;
    min-width: 38px;
    height: 40px;
    border-radius: 12px;
  }

  .header-help summary {
    height: 40px;
  }

  .header-help .help-menu {
    top: 46px;
    width: min(240px, calc(100vw - 16px));
    max-height: calc(100vh - 122px);
    overflow: auto;
  }

  .header-help p {
    min-height: 36px;
    font-size: 12px;
  }

  .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 42px;
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 5px;
    border-radius: 13px;
  }

  .tab {
    min-width: 82px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1;
  }

  .tool-ribbon {
    top: 118px;
    max-width: calc(100vw - 16px);
    overflow-x: auto;
    left: 8px;
    right: 8px;
    transform: none;
  }

  .panel-switcher {
    top: 180px;
    left: 8px;
    right: 8px;
  }

  .simple-mode-panel {
    top: 118px;
    left: 8px;
    width: calc(50vw - 12px);
    max-height: calc(100vh - 128px);
  }

  .simple-mode-controls {
    top: 118px;
    right: 8px;
    width: calc(50vw - 12px);
    max-height: calc(100vh - 128px);
  }

  .light-studio {
    inset: 0;
    overflow: visible;
  }

  .light-studio-header,
  .light-tool-dock,
  .light-inspector,
  .light-test-bar {
    position: absolute;
    transform: none;
  }

  .light-studio-header {
    left: 102px;
    right: 8px;
    top: 118px;
    min-height: 0;
    padding: 9px 12px;
    text-align: left;
  }

  .light-studio-header h1 {
    font-size: clamp(20px, 4.8vw, 28px);
  }

  .light-tool-dock {
    left: 8px;
    top: 118px;
    width: 86px;
    max-height: calc(100vh - 128px);
    overflow: auto;
    grid-template-columns: 1fr;
  }

  .light-tool-dock button {
    min-height: 52px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .light-inspector {
    right: 8px;
    top: 220px;
    width: min(276px, calc(100vw - 112px));
    max-height: calc(100vh - 326px);
    overflow: auto;
  }

  .light-test-bar {
    left: 102px;
    right: 8px;
    bottom: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-mode="light"].simple-editor-active .tool-ribbon {
    top: 170px;
    left: 102px;
    right: 8px;
    bottom: auto;
    height: 44px;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: 54px;
    grid-template-columns: minmax(0, 1fr) 42px;
    grid-template-rows: 42px;
    gap: 6px;
    padding: 6px;
  }

  .tabs {
    display: none !important;
  }

  .project-pill {
    grid-column: 1;
    grid-row: 1;
    height: 42px;
  }

  .header-help {
    grid-column: 2;
    grid-row: 1;
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .header-help summary {
    height: 42px;
  }
}

@media (max-width: 480px) {
  .project-pill select {
    font-size: 13px;
  }

  .tab {
    min-width: 78px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .light-tool-dock,
  .light-inspector,
  .light-test-bar {
    position: static;
    width: auto;
    max-height: none;
    padding: 10px;
  }

  .light-studio {
    inset: 172px 8px 8px;
    overflow: auto;
  }

  body[data-mode="light"].simple-editor-active .tool-ribbon {
    top: 118px;
    left: 8px;
    right: 8px;
    bottom: auto;
    height: 46px;
  }

  .light-studio-header {
    position: static;
    width: auto;
    max-height: none;
    margin-bottom: 8px;
  }

  .light-tool-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 8px;
  }

  .light-inspector {
    margin-bottom: 8px;
  }

  .light-test-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simple-mode-panel {
    left: 8px;
    right: 8px;
    top: 118px;
    width: auto;
    max-height: 42vh;
  }

  .simple-mode-controls {
    left: 8px;
    right: 8px;
    top: calc(118px + 42vh + 8px);
    width: auto;
    max-height: calc(58vh - 134px);
  }
}

/* Minimal Glass skin: Variante 5 */
:root {
  --mg-bg: rgba(247, 250, 253, 0.56);
  --mg-bg-strong: rgba(255, 255, 255, 0.74);
  --mg-line: rgba(32, 42, 64, 0.12);
  --mg-line-strong: rgba(32, 42, 64, 0.18);
  --mg-text: #172033;
  --mg-muted: #687185;
  --mg-accent: #5968ff;
  --mg-accent-soft: rgba(89, 104, 255, 0.12);
  --mg-shadow: 0 16px 42px rgba(19, 28, 48, 0.12);
  --text: var(--mg-text);
  --muted: var(--mg-muted);
  --line: var(--mg-line);
  --glass: var(--mg-bg);
  --soft: rgba(255, 255, 255, 0.42);
  --shadow: var(--mg-shadow);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.glass,
.glass-soft,
.topbar,
.tool-ribbon,
.panel-switcher,
.creator-start,
.ai-panel,
.kart-setup,
.inspector,
.mechanics,
.architect-panel,
.scene-tree,
.look-panel,
.minimap-card,
.playtest-card,
.physics-lab,
.texture-designer-window,
.runtime-hud,
.duel-hud,
.physics-mode-hud {
  background: var(--mg-bg) !important;
  border: 1px solid var(--mg-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 28px rgba(19, 28, 48, 0.1) !important;
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
}

.topbar {
  left: 14px;
  right: 14px;
  top: 12px;
  height: 44px;
  grid-template-columns: minmax(112px, 150px) minmax(180px, 1fr) minmax(230px, 300px) 36px;
  gap: 8px;
  padding: 5px 6px 5px 10px;
}

.brand b {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand small {
  font-size: 9px;
  font-weight: 650;
}

.project-pill {
  height: 32px;
  border-radius: 6px !important;
  gap: 8px;
  padding: 0 8px;
}

.project-pill select {
  font-size: 13px;
  font-weight: 760;
}

.project-pill #saveState,
#saveState {
  min-width: 58px;
  height: 22px;
  border-radius: 6px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 760;
}

#saveState::before,
.project-pill #saveState::before {
  width: 5px;
  height: 5px;
  margin-right: 5px;
}

.tabs {
  height: 32px;
  min-width: 0;
  max-width: none;
  width: 100%;
  border-radius: 6px !important;
  gap: 2px;
  padding: 3px;
}

.tab {
  min-width: 54px;
  height: 26px;
  border-radius: 5px;
  padding: 0 10px;
  color: #465066;
  font-size: 12px;
  font-weight: 760;
}

.tab.active {
  color: #ffffff;
  background: #5968ff;
  box-shadow: none;
}

.header-help {
  width: 34px;
  min-width: 34px;
  height: 32px;
  border-radius: 6px !important;
}

.header-help summary {
  height: 32px;
  font-size: 15px;
}

.header-help .help-menu {
  top: 38px;
  width: 178px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.header-help p {
  width: auto;
  min-height: 30px;
  padding: 7px 9px;
  font-size: 11px;
}

.header-help hr {
  width: auto;
}

.header-help kbd {
  border-radius: 5px;
  font-size: 9px;
}

.tool-ribbon {
  top: 72px;
  height: 44px;
  gap: 3px;
  padding: 5px;
  max-width: calc(100vw - 28px);
}

.tool-ribbon button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: #44506a;
  font-size: 15px;
}

.tool-ribbon button:hover,
.tool-ribbon .active,
.tool-ribbon button[data-tool="move"].active {
  background: var(--mg-accent-soft);
  color: var(--mg-accent);
}

.panel-switcher {
  top: 122px;
  min-height: 36px;
  max-width: calc(100vw - 28px);
  gap: 4px;
  padding: 4px;
}

.panel-switcher button {
  height: 28px;
  min-width: 46px;
  border-radius: 5px;
  padding: 0 9px;
  color: #465066;
  font-size: 11px;
  font-weight: 760;
}

.panel-switcher button:hover,
.panel-switcher button.active {
  background: var(--mg-accent-soft);
  color: var(--mg-accent);
}

.creator-start {
  left: 50%;
  top: 168px;
  width: min(570px, calc(100vw - 48px));
  transform: translateX(-50%);
  padding: 12px;
  display: grid;
  gap: 10px;
  z-index: 15;
}

.creator-start-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.creator-start-head b {
  display: block;
  color: #172033;
  font-size: 18px;
  line-height: 1.05;
  font-weight: 900;
}

.creator-start-head span {
  display: block;
  margin-top: 4px;
  color: #596579;
  font-size: 12px;
  font-weight: 760;
}

#creatorStartAdvanced {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--mg-line) !important;
  background: rgba(255, 255, 255, 0.58) !important;
  color: #303b52;
  font-size: 11px;
  font-weight: 820;
}

.creator-idea-label {
  color: #536079;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

#creatorIdeaInput {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  line-height: 1.35;
}

.creator-examples,
.creator-flow {
  display: grid;
  gap: 7px;
}

.creator-examples {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creator-examples button,
.creator-flow button {
  border: 1px solid var(--mg-line) !important;
  background: rgba(255, 255, 255, 0.56) !important;
  color: #303b52;
  box-shadow: none !important;
  font-weight: 820;
}

.creator-examples button {
  min-height: 30px;
  font-size: 11px;
}

.creator-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creator-flow button {
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  padding: 6px 9px;
  text-align: left;
}

.creator-flow small {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: white;
  background: #5968ff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.creator-flow span {
  min-width: 0;
  font-size: 12px;
  line-height: 1.1;
}

.creator-examples button:hover,
.creator-flow button:hover,
.creator-flow button.active,
#creatorStartAdvanced:hover {
  background: var(--mg-accent-soft) !important;
  border-color: rgba(89, 104, 255, 0.25) !important;
  color: var(--mg-accent) !important;
}

.ai-panel,
.kart-setup,
.inspector,
.mechanics,
.architect-panel,
.scene-tree,
.look-panel,
.playtest-card,
.physics-lab {
  padding: 12px !important;
}

.ai-panel {
  left: 14px;
  top: 172px;
  width: 360px;
  max-height: calc(100vh - 198px);
}

.inspector {
  right: 14px;
  top: 172px;
  width: 318px;
  max-height: calc(100vh - 198px);
}

.mechanics {
  bottom: 16px;
  width: min(680px, calc(100vw - 28px));
  max-height: 280px;
}

.physics-lab {
  top: 72px;
  width: min(440px, calc(100vw - 28px));
}

.panel-head h2,
.playtest-card h3,
.minimap-card h3,
.tray-title {
  color: #1c2638;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
}

.panel-head h2 small,
.playtest-card h3 small {
  font-size: 10px;
  font-weight: 700;
  color: var(--mg-muted);
}

textarea,
input,
select,
.wide {
  border-radius: 6px !important;
  border: 1px solid var(--mg-line) !important;
  background: rgba(255, 255, 255, 0.62) !important;
  color: var(--mg-text);
  font-size: 12px;
  font-weight: 650;
}

button {
  border-radius: 6px !important;
  letter-spacing: 0;
}

.ai-op-grid button,
.asset-tabs button,
.mechanic-grid button,
.asset-grid button,
.materials button,
.cards4 button,
.camera-grid button,
.scene-actions button,
.physics-actions button,
.texture-studio button {
  border: 1px solid var(--mg-line) !important;
  background: rgba(255, 255, 255, 0.52) !important;
  color: #303b52;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-size: 10px;
  font-weight: 760;
}

.ai-op-grid button:hover,
.asset-tabs button:hover,
.mechanic-grid button:hover,
.asset-grid button:hover,
.materials button:hover,
.cards4 button:hover,
.camera-grid button:hover,
.scene-actions button:hover,
.physics-actions button:hover,
.texture-studio button:hover,
.asset-tabs .active,
.mechanic-grid button.active,
.materials button.active,
.cards4 button.active {
  background: var(--mg-accent-soft) !important;
  border-color: rgba(89, 104, 255, 0.25) !important;
  color: var(--mg-accent) !important;
}

.mechanic-grid,
.asset-grid {
  gap: 6px;
}

.mechanic-grid button,
.asset-grid button {
  min-height: 58px;
  height: 58px;
  padding: 6px 4px;
}

.mechanic-grid button span,
.asset-grid button span,
.materials button span,
.cards4 button span,
.texture-studio button span {
  font-size: 10px;
  line-height: 1.05;
}

.tray-title {
  margin-bottom: 8px;
  padding: 0 0 5px;
  border-bottom: 1px solid rgba(89, 104, 255, 0.28);
}

.transform-grid input {
  min-width: 0;
  height: 32px;
}

.toggle,
.slider,
.material-meta p,
.look-stats p,
.test-rows p,
.physics-report p {
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.42) !important;
  border-color: var(--mg-line) !important;
}

.gradient,
.mini-gradient,
#generateBtn,
#architectBuildBtn,
#runTest {
  background: #5968ff !important;
  color: white !important;
  box-shadow: none !important;
  border: 1px solid rgba(89, 104, 255, 0.35) !important;
}

.toast,
.gizmo-overlay {
  border-radius: 8px !important;
}

@media (max-width: 900px) {
  .topbar {
    left: 8px;
    right: 8px;
    top: 8px;
    height: 44px;
    grid-template-columns: minmax(0, 1fr) 34px;
    grid-template-rows: 32px;
    padding: 5px;
  }

  .brand {
    display: none;
  }

  .tabs {
    display: none;
  }

  .project-pill {
    grid-column: 1;
    grid-row: 1;
  }

  .header-help {
    grid-column: 2;
    grid-row: 1;
  }

  .tool-ribbon {
    top: 58px;
    left: 8px;
    right: 8px;
    transform: none;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .panel-switcher {
    top: 108px;
    left: 8px;
    right: 8px;
    transform: none;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .creator-start {
    left: 8px;
    right: 8px;
    top: 154px;
    width: auto;
    transform: none;
    max-height: calc(100vh - 170px);
  }

  .ai-panel,
  .kart-setup,
  .inspector,
  .architect-panel,
  .scene-tree,
  .look-panel,
  .physics-lab,
  .minimap-card,
  .playtest-card {
    left: 8px;
    right: 8px;
    top: 154px;
    width: auto;
    max-height: calc(100vh - 170px);
  }

  .mechanics {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    transform: none;
    max-height: 42vh;
  }
}

@media (max-width: 520px) {
  .project-pill select {
    font-size: 12px;
  }

  .project-pill #saveState,
  #saveState {
    display: none;
  }

  .mechanic-grid,
  .asset-grid,
  .texture-studio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .creator-start {
    gap: 8px;
    padding: 10px;
  }

  .creator-start-head {
    align-items: start;
  }

  .creator-start-head b {
    font-size: 16px;
  }

  .creator-start-head span {
    font-size: 11px;
  }

  .creator-examples button {
    padding: 0 6px;
    font-size: 10px;
  }

  .creator-flow button {
    min-height: 42px;
    grid-template-columns: 20px minmax(0, 1fr);
    padding: 5px 6px;
  }

  .creator-flow small {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .creator-flow span {
    font-size: 11px;
  }
}

/* Compact header: level lives in burger, mode tabs stay compact. */
.topbar {
  grid-template-columns: minmax(112px, 170px) minmax(210px, 360px) 34px !important;
  justify-content: center;
}

.topbar .tabs {
  justify-self: center;
  width: 100%;
  max-width: 360px;
}

.topbar .tab {
  flex: 1 1 0;
  min-width: 0;
}

.header-help .help-menu {
  width: 230px;
  padding: 8px;
}

.burger-level {
  display: grid;
  gap: 6px;
  padding: 0 0 8px;
  color: var(--mg-muted);
  font-size: 10px;
  font-weight: 820;
}

.burger-level select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px !important;
  border: 1px solid var(--mg-line) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--mg-text);
  font-size: 12px;
  font-weight: 760;
}

.header-help .help-menu hr {
  margin: 0 -8px;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: minmax(76px, 120px) minmax(150px, 1fr) 34px !important;
  }

  .brand {
    display: flex;
  }

  .brand small {
    display: none;
  }

  .tabs {
    display: flex;
  }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) 34px !important;
  }

  .brand {
    display: none;
  }

  .tabs {
    grid-column: 1;
    grid-row: 1;
  }
}

/* Burger submenu layout */
.header-help .burger-menu {
  width: 260px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.burger-section {
  border: 1px solid var(--mg-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.46);
  overflow: hidden;
}

.burger-section > summary {
  height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--mg-text);
  font-size: 12px;
  font-weight: 820;
  list-style: none;
}

.burger-section > summary::-webkit-details-marker {
  display: none;
}

.burger-section > summary::after {
  content: "⌄";
  color: var(--mg-muted);
  font-size: 12px;
}

.burger-section[open] > summary::after {
  transform: rotate(180deg);
}

.burger-section[open] > summary {
  border-bottom: 1px solid var(--mg-line);
  background: rgba(89, 104, 255, 0.07);
}

.burger-level {
  padding: 8px;
}

.burger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.burger-grid button {
  height: 32px;
  border: 1px solid var(--mg-line);
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.62);
  color: #303b52;
  font-size: 11px;
  font-weight: 780;
}

.burger-grid button:hover {
  background: var(--mg-accent-soft);
  color: var(--mg-accent);
  border-color: rgba(89, 104, 255, 0.24);
}

.burger-help {
  padding: 4px 10px 8px;
}

.header-help .burger-help p {
  width: auto;
  min-height: 28px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--mg-muted);
}

.header-help .burger-help p:first-of-type,
.header-help .burger-help p:last-child {
  border: 0;
  border-radius: 0;
}

/* Compact arcade HUD for public shooter games. */
body[data-mode="play"].shooter-mode .runtime-hud,
body[data-mode="play"].flight-shooter-mode .runtime-hud {
  top: 14px;
  left: 50%;
  right: auto;
  width: min(720px, calc(100vw - 28px));
  min-height: 42px;
  transform: translateX(-50%);
  grid-auto-flow: column;
  grid-template-columns: minmax(120px, 1.35fr) minmax(88px, 0.72fr) minmax(82px, 0.62fr) auto;
  gap: 6px;
  padding: 6px;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(12, 17, 25, 0.74), rgba(12, 17, 25, 0.52)) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24) !important;
}

body[data-mode="play"].shooter-mode .runtime-hud p,
body[data-mode="play"].flight-shooter-mode .runtime-hud p {
  position: relative;
  min-width: 0;
  height: 30px;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  padding: 0 9px;
}

body[data-mode="play"].shooter-mode .runtime-hud p:nth-of-type(3)::after,
body[data-mode="play"].flight-shooter-mode .runtime-hud p:nth-of-type(3)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--time-fill, 100%);
  height: 3px;
  background: linear-gradient(90deg, #67e8f9, #f8c14a);
}

body[data-mode="play"].shooter-mode .runtime-hud span,
body[data-mode="play"].flight-shooter-mode .runtime-hud span {
  color: rgba(238, 244, 255, 0.68);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
}

body[data-mode="play"].shooter-mode .runtime-hud b,
body[data-mode="play"].flight-shooter-mode .runtime-hud b {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 13px;
}

body[data-mode="play"].shooter-mode .runtime-hud button,
body[data-mode="play"].flight-shooter-mode .runtime-hud button {
  height: 30px;
  min-width: 64px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f8c14a, #e88125);
  color: #17110a;
  box-shadow: 0 8px 18px rgba(232, 129, 37, 0.22);
}

body[data-mode="play"].shooter-mode .crosshair,
body[data-mode="play"].flight-shooter-mode .crosshair {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.46));
}

body[data-mode="play"].shooter-mode .crosshair::before,
body[data-mode="play"].flight-shooter-mode .crosshair::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

body[data-mode="play"].shooter-mode .crosshair i,
body[data-mode="play"].flight-shooter-mode .crosshair i {
  background: rgba(255, 255, 255, 0.86);
}

body[data-mode="play"].shooter-mode .crosshair i:nth-child(1),
body[data-mode="play"].shooter-mode .crosshair i:nth-child(2),
body[data-mode="play"].flight-shooter-mode .crosshair i:nth-child(1),
body[data-mode="play"].flight-shooter-mode .crosshair i:nth-child(2) {
  width: 1px;
  height: 14px;
}

body[data-mode="play"].shooter-mode .crosshair i:nth-child(3),
body[data-mode="play"].shooter-mode .crosshair i:nth-child(4),
body[data-mode="play"].flight-shooter-mode .crosshair i:nth-child(3),
body[data-mode="play"].flight-shooter-mode .crosshair i:nth-child(4) {
  width: 14px;
  height: 1px;
}

body[data-mode="play"].shooter-mode .crosshair b,
body[data-mode="play"].flight-shooter-mode .crosshair b {
  width: 6px;
  height: 6px;
  background: #f8c14a;
  box-shadow: 0 0 0 4px rgba(248, 193, 74, 0.2), 0 0 18px rgba(248, 193, 74, 0.76);
}

body[data-mode="play"].shooter-mode .shooter-readout,
body[data-mode="play"].flight-shooter-mode .shooter-readout {
  right: 18px;
  top: 76px;
  width: 156px;
  gap: 6px;
  padding: 7px;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(9, 13, 20, 0.62), rgba(9, 13, 20, 0.36)) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22) !important;
}

body[data-mode="play"].shooter-mode .shooter-readout p,
body[data-mode="play"].flight-shooter-mode .shooter-readout p {
  position: relative;
  min-height: 30px;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  padding: 0 8px;
}

body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(2),
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(2) {
  order: -1;
  min-height: 42px;
  background: linear-gradient(135deg, rgba(248, 193, 74, 0.94), rgba(232, 129, 37, 0.9));
}

body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(1)::after,
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(1)::after,
body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(3)::after,
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(3)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
}

body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(1)::after,
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(1)::after {
  width: var(--time-fill, 100%);
  background: #67e8f9;
}

body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(3)::after,
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(3)::after {
  width: var(--ammo-fill, 100%);
  background: #9ef06d;
}

body[data-mode="play"].shooter-reloading .shooter-readout p:nth-child(3)::after {
  width: 100%;
  background: repeating-linear-gradient(90deg, #f8c14a 0 10px, #ef6b45 10px 20px);
}

body[data-mode="play"].shooter-mode .shooter-readout span,
body[data-mode="play"].flight-shooter-mode .shooter-readout span {
  position: relative;
  z-index: 1;
  color: rgba(238, 244, 255, 0.7);
  font-size: 9px;
  letter-spacing: 0;
}

body[data-mode="play"].shooter-mode .shooter-readout b,
body[data-mode="play"].flight-shooter-mode .shooter-readout b {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 14px;
}

body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(2) span,
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(2) span,
body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(2) b,
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(2) b {
  color: #17110a;
}

body[data-mode="play"].shooter-mode .shooter-readout p:nth-child(2) b,
body[data-mode="play"].flight-shooter-mode .shooter-readout p:nth-child(2) b {
  font-size: 20px;
}

body[data-mode="play"].shooter-combo-active .shooter-readout p:nth-child(4) {
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(103, 232, 249, 0.4);
}

body[data-mode="play"].shooter-mode .physics-label:not(.score-label),
body[data-mode="play"].flight-shooter-mode .physics-label:not(.score-label),
body.public-game .physics-label:not(.score-label) {
  display: none;
}

@media (max-width: 760px) {
  body[data-mode="play"].shooter-mode .runtime-hud,
  body[data-mode="play"].flight-shooter-mode .runtime-hud {
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
    grid-template-columns: minmax(0, 1fr) minmax(68px, 0.5fr) minmax(62px, 0.45fr);
  }

  body[data-mode="play"].shooter-mode .runtime-hud button,
  body[data-mode="play"].flight-shooter-mode .runtime-hud button {
    display: none;
  }

  body[data-mode="play"].shooter-mode .shooter-readout,
  body[data-mode="play"].flight-shooter-mode .shooter-readout {
    right: 8px;
    top: 66px;
    width: 132px;
  }
}
