/* Air Beat Board: session panel, token tray, inspector, channel strips, hints. */

.session-panel,
.channel-panel {
  min-height: 0;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 9px;
  opacity: 0.92;
}

.panel-title,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title strong,
.section-head strong {
  display: block;
  margin-top: 2px;
  font-size: 0.92rem;
  color: var(--text);
}

.session-card,
.session-focus,
.message-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.session-card {
  min-height: 168px;
  overflow: hidden;
  padding: 18px;
  display: grid;
  align-content: end;
  gap: 7px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.62)),
    url("../assets/studio-desk.png") center / cover;
}

.session-card span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.7rem;
  font-weight: 850;
}

.session-card strong {
  font-size: clamp(1.2rem, 2.6vw, 1.65rem);
  line-height: 1;
}

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

.session-stats div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.session-stats span,
.session-state-guide span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.61rem;
  font-weight: 850;
}

.session-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.02rem;
  color: var(--text);
}

.session-focus {
  padding: 11px;
  display: grid;
  gap: 10px;
}

.session-focus .section-head {
  align-items: start;
}

.session-focus .section-head strong {
  min-width: 0;
  max-width: 150px;
  text-align: right;
  line-height: 1.25;
}

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

.session-state-guide div {
  min-width: 0;
  min-height: 42px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.session-state-guide div.active {
  border-color: rgba(240, 196, 109, 0.56);
  background: rgba(240, 196, 109, 0.1);
}

.session-state-guide i {
  position: relative;
  width: 24px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.session-state-guide [data-state-key="first"] i {
  border-color: rgba(31, 18, 8, 0.68);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 235, 177, 0.5), transparent 27%),
    linear-gradient(135deg, #c3935b, #80502b 78%);
}

.session-state-guide [data-state-key="second"] i {
  border-color: rgba(31, 18, 8, 0.68);
  background:
    radial-gradient(circle at 70% 78%, rgba(255, 214, 135, 0.22), transparent 26%),
    linear-gradient(135deg, #3b3128, #151411 82%);
}

.session-state-guide [data-state-key="both"] i {
  border-color: rgba(31, 18, 8, 0.68);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 235, 177, 0.5), transparent 27%),
    linear-gradient(135deg, #c3935b, #80502b 78%);
}

.session-state-guide [data-state-key="both"] i::before {
  content: "";
  position: absolute;
  inset: -5px 4px 5px -4px;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid rgba(31, 18, 8, 0.6);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 236, 183, 0.44), transparent 28%),
    linear-gradient(135deg, #cda06a, #704627 74%);
}

.message-panel {
  min-height: 54px;
  padding: 12px;
  color: #efe3cb;
  line-height: 1.35;
  display: grid;
  align-items: center;
}

.message-undo {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 180, 63, 0.55);
  border-radius: 999px;
  background: rgba(255, 180, 63, 0.14);
  color: var(--amber);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.message-undo:hover {
  background: rgba(255, 180, 63, 0.26);
}

.bottom-dock {
  min-height: 138px;
  display: grid;
  grid-template-columns: minmax(240px, 0.86fr) minmax(360px, 1.14fr);
  gap: 10px;
}

.dock-section,
.left-actions {
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.left-actions {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.token-tray {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.token-tray .ghost-token:nth-child(n + 7) {
  opacity: 0.62;
}

.state-buttons,
.sample-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.state-dock {
  grid-template-rows: auto 1fr;
}

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

.inspector-tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.inspector-tab {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inspector-tab.active {
  color: #1b1006;
  background: var(--cyan);
}

.inspector-panel {
  min-width: 0;
  min-height: 0;
}

.state-btn {
  min-width: 0;
  min-height: 66px;
  padding: 8px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.state-btn small {
  color: var(--muted);
  font-weight: 800;
}

.state-btn.active {
  color: var(--cyan);
  border-color: rgba(240, 196, 109, 0.72);
  box-shadow: 0 0 18px rgba(240, 196, 109, 0.16);
}

.sound-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.sound-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.sound-title span,
.sound-control span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.61rem;
  font-weight: 850;
}

.sound-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sound-control b {
  font: inherit;
}

.sound-control output {
  color: var(--amber);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.sound-title strong {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  align-content: center;
}

.sound-control {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sound-control input {
  width: 100%;
}

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

.left-actions .sample-action {
  min-height: 44px;
  font-size: 0.74rem;
}

/* Pattern slots */
.slot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

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

.slot-chip,
.slot-action {
  min-width: 0;
  min-height: 40px;
  padding: 6px 4px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.slot-action {
  padding: 6px 10px;
  font-size: 0.7rem;
  color: var(--text);
}

.slot-chip:hover,
.slot-action:hover {
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--text);
}

.slot-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.slot-chip.filled i {
  background: var(--muted);
}

.slot-chip.active {
  color: var(--cyan);
  border-color: rgba(240, 196, 109, 0.62);
  background: rgba(240, 196, 109, 0.12);
}

.slot-chip.active i {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.slot-chip.pending {
  border-color: rgba(120, 255, 134, 0.6);
  color: var(--green);
}

.slot-chip.pending i {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: slot-pulse 600ms ease-in-out infinite alternate;
}

@keyframes slot-pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Groove browser */
.session-panel {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.session-groove {
  padding: 11px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.session-groove .section-head span,
.row-actions span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.61rem;
  font-weight: 850;
}

.session-groove .section-head strong {
  color: var(--cyan);
  font-size: 0.86rem;
}

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

.groove-chip,
.groove-action,
.row-action {
  min-width: 0;
  padding: 7px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.groove-chip:hover,
.groove-action:hover,
.row-action:hover {
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--text);
}

.groove-chip.active {
  color: var(--cyan);
  border-color: rgba(240, 196, 109, 0.62);
  background: rgba(240, 196, 109, 0.12);
}

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

.groove-action,
.row-action {
  color: var(--text);
}

.row-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
}

.shortcut-hint {
  margin: 0;
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.shortcut-hint kbd {
  display: inline-block;
  min-width: 1.3em;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.sample-action {
  min-width: 0;
  min-height: 66px;
  padding: 8px;
  color: var(--text);
  font-weight: 900;
}

.left-actions .sample-action {
  min-height: 54px;
  font-size: 0.82rem;
}

.channel-panel {
  grid-template-rows: auto 1fr;
}

.channel-strips {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 9px;
}

.channel-strip {
  min-height: 98px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.channel-strip.selected-row {
  border-color: rgba(240, 196, 109, 0.42);
  box-shadow: inset 0 0 0 1px rgba(240, 196, 109, 0.14), 0 0 18px rgba(240, 196, 109, 0.08);
}

.channel-meta {
  min-width: 0;
  display: grid;
  align-content: space-between;
}

.channel-meta strong {
  font-size: 0.92rem;
}

.row-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber);
}

.channel-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.knob-control {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.knob-control span,
.toggle-row span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.61rem;
  font-weight: 850;
}

.knob-control input {
  width: 100%;
}

.toggle-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  align-items: center;
}

.toggle-group {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.slot-group {
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
}

.toggle-group .toggle-button {
  min-width: 0;
  padding: 0 4px;
  font-size: 0.72rem;
}

.toggle-button {
  min-width: 34px;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.24);
  font-weight: 950;
  color: var(--muted);
}

.toggle-button.active {
  color: #1b1006;
  background: var(--cyan);
  border-color: rgba(240, 196, 109, 0.76);
}

.sound-toggles .toggle-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sound-toggles .toggle-button {
  min-height: 26px;
  font-size: 0.7rem;
}

/* Hit flash: the strip's dot pops and the border warms for one hit. */
.channel-strip.hit {
  border-color: rgba(255, 180, 63, 0.55);
  box-shadow: 0 0 18px rgba(255, 180, 63, 0.16);
}

.channel-strip.hit .row-dot {
  animation: dot-flash 170ms ease-out;
}

@keyframes dot-flash {
  0% { transform: scale(2); filter: brightness(1.7); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Drawer tab buttons (hidden on wider screens) */
.mobile-tabs {
  display: none;
}

.mobile-tabs button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-tabs button.active {
  color: var(--cyan);
  border-color: rgba(240, 196, 109, 0.6);
  background: rgba(240, 196, 109, 0.1);
}

/* First-run hint under the board */
.first-run-hint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(240, 196, 109, 0.4);
  border-radius: 10px;
  background: rgba(240, 196, 109, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.4;
  transition: opacity 200ms ease, transform 200ms ease;
}

.first-run-hint[hidden] {
  display: none;
}

.first-run-hint.leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.first-run-hint button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
