.scene-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
}

.scene-option {
  min-height: 38px;
  border-radius: 5px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.scene-option[aria-pressed="true"] {
  color: #06120d;
  border-color: #7fd4ff;
  background: #7fd4ff;
}

.app[data-scene="orca-grid"] .visual-shell,
.app[data-scene="orca-grid"] .energy-control {
  display: none;
}

.orca-grid-shell {
  position: relative;
  margin-top: 18px;
  border: 1px solid #23433d;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at var(--orca-selected-x, 12%) var(--orca-selected-y, 12%), rgba(127, 212, 255, calc(0.14 + var(--orca-pulse, 0) * 0.18)), transparent 24%),
    linear-gradient(135deg, #06110e 0%, #0d0f10 42%, #160d11 100%);
  box-shadow: inset 0 0 0 1px rgba(127, 212, 255, 0.08), 0 0 42px rgba(0, 0, 0, 0.28);
}

.orca-grid-shell[hidden] {
  display: none;
}

.orca-grid-scene {
  --orca-lime: #83e06d;
  --orca-cyan: #7fd4ff;
  --orca-coral: #ff7a66;
  --orca-gold: #f1c15d;
  --orca-ink: #050706;
}

.orca-machine {
  position: relative;
  min-height: 540px;
  padding: 14px;
}

.orca-machine::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 12.5% 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 16.666%;
  opacity: 0.54;
}

.orca-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.orca-title {
  color: var(--orca-lime);
}

.orca-cell-readout {
  color: var(--text);
}

.orca-density {
  color: var(--orca-cyan);
}

.orca-field {
  position: relative;
  z-index: 1;
  min-height: 390px;
  border: 1px solid rgba(127, 212, 255, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(131, 224, 109, 0.13), transparent 18%),
    radial-gradient(circle at 76% 78%, rgba(255, 122, 102, 0.12), transparent 22%),
    rgba(3, 6, 6, 0.74);
}

.orca-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.orca-board {
  position: absolute;
  inset: 14px;
  z-index: 2;
  display: grid;
  grid-template-columns: 46px repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.orca-axis,
.orca-cell {
  min-width: 0;
  min-height: 0;
  border-radius: 5px;
}

.orca-axis {
  display: grid;
  place-items: center;
  border: 1px solid rgba(131, 224, 109, 0.18);
  color: rgba(255, 247, 204, 0.72);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 900;
}

.orca-cell {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(127, 212, 255, 0.2);
  padding: 0;
  color: rgba(255, 247, 204, 0.76);
  background: rgba(2, 8, 8, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 130ms ease, color 130ms ease, background 130ms ease, transform 130ms ease, box-shadow 130ms ease;
}

.orca-cell:hover {
  border-color: rgba(127, 212, 255, 0.74);
  transform: translateY(-1px);
}

.orca-cell:focus-visible {
  outline: 3px solid rgba(127, 212, 255, 0.36);
  outline-offset: 2px;
}

.orca-cell.is-active {
  border-color: rgba(131, 224, 109, 0.74);
  color: #f8ffe8;
  background:
    radial-gradient(circle at 50% 30%, rgba(131, 224, 109, 0.28), transparent 46%),
    rgba(8, 20, 15, 0.92);
  box-shadow: inset 0 0 0 1px rgba(131, 224, 109, 0.22), 0 0 18px rgba(131, 224, 109, 0.16);
}

.orca-cell.is-selected {
  border-color: var(--orca-coral);
  transform: translateY(-2px) scale(1.02);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 102, 0.28), 0 0 28px rgba(255, 122, 102, 0.26);
}

.orca-cell-glyph {
  font-size: clamp(1.15rem, 4vw, 2.1rem);
  font-weight: 900;
  line-height: 1;
}

.orca-cell-column {
  position: absolute;
  right: 6px;
  bottom: 5px;
  color: rgba(127, 212, 255, 0.62);
  font-size: 0.62rem;
  font-weight: 900;
}

.orca-phrase {
  position: relative;
  z-index: 2;
  min-height: 74px;
  display: flex;
  align-items: center;
  padding: 14px 6px 0;
  overflow: hidden;
}

.orca-signal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18em;
  color: #fff7cc;
  font-size: clamp(1.15rem, 4.4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(241, 193, 93, 0.18);
}

.orca-signal span {
  display: inline-block;
  animation: orca-type-pulse 900ms cubic-bezier(0.18, 0.8, 0.22, 1) both;
  animation-delay: var(--char-delay);
}

.orca-grid-shell[data-active-lane="kick"] .orca-title,
.orca-grid-shell[data-active-lane="bass"] .orca-title {
  color: var(--orca-lime);
}

.orca-grid-shell[data-active-lane="snare"] .orca-title,
.orca-grid-shell[data-active-lane="choir"] .orca-title {
  color: var(--orca-coral);
}

.orca-grid-shell[data-active-lane="hat"] .orca-title,
.orca-grid-shell[data-active-lane="lead"] .orca-title {
  color: var(--orca-cyan);
}

@keyframes orca-type-pulse {
  0% {
    opacity: 0.34;
    transform: translateY(12px) scaleY(0.72);
  }

  38% {
    opacity: 1;
    transform: translateY(-3px) scaleY(1.28);
  }

  100% {
    opacity: 0.88;
    transform: translateY(0) scaleY(1);
  }
}

@media (max-width: 760px) {
  .scene-switcher {
    grid-template-columns: 1fr 1fr;
  }

  .orca-machine {
    min-height: 500px;
    padding: 10px;
  }

  .orca-header {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 8px 8px 12px;
  }

  .orca-field {
    min-height: 350px;
  }

  .orca-board {
    inset: 10px;
    grid-template-columns: 30px repeat(8, minmax(0, 1fr));
    gap: 4px;
  }

  .orca-axis {
    font-size: 0.68rem;
  }

  .orca-cell-column {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orca-cell,
  .orca-signal span {
    transition: none;
    animation: none;
  }
}
