/* styles.css — the CO2 Cannon faceplate. Ports the look of the SwiftUI cabinet:
   dark panel with two restrained colour washes, a compressed title, a segmented
   bank switch, and recessed pads that ignite in each gun's colour. */

:root {
  --accent: 97 225 242;          /* ACCENT = hsb(0.52, 0.6, 0.95) */
  --panel: 12 13 15;             /* Color(red:0.047, green:0.051, blue:0.059) */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: rgb(var(--panel));
  color: #fff;
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  /* Dark panel + two colour washes + a whisper of top sheen (ContentView.background). */
  background:
    radial-gradient(640px 640px at 0% 0%, rgba(var(--accent) / 0.10), transparent 70%),
    radial-gradient(560px 560px at 100% 100%, rgba(242, 109, 189, 0.07), transparent 70%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent 45%),
    rgb(var(--panel));
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;                 /* iOS Safari: 100vh counts the area behind the
                                     toolbar, clipping the bottom pads; dvh tracks
                                     the actually-visible viewport. */
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px 12px;
}

/* ---- Header ---- */
.header { display: flex; flex-direction: column; gap: 12px; }
.header-top { display: flex; align-items: flex-end; justify-content: space-between; }

.title {
  font-size: 30px;
  font-weight: 900;
  font-stretch: 75%;              /* compressed, where the variable font allows */
  letter-spacing: 1px;
  line-height: 1;
  background: linear-gradient(to right, #fff, rgba(var(--accent) / 0.85));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gauge { display: block; }
.gauge-label {
  font-family: var(--mono);
  font-size: 7px; font-weight: 600; letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.4);
}

.header-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }

.mode-picker {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
}
.mode-picker button {
  font-family: var(--font);
  font-size: 12px; font-weight: 800; letter-spacing: 1.5px;
  padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer;
  background: transparent; color: rgba(255, 255, 255, 0.55);
  transition: background 0.12s, color 0.12s;
}
.mode-picker button.active { background: rgb(var(--accent)); color: #000; }

/* The bank picker sits left; GUST + the Fog toggle take the leftover width and
   sit flush right (the mode-picker positioning of the pre-controls header). */
.right-controls { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }

/* GUST: a subtle chrome button (matches the Mac's wind control), also bound to W. */
.gust {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font);
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  padding: 7px 12px; border-radius: 6px; cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.12s;
}
.gust:hover { background: rgba(255, 255, 255, 0.09); }
.gust-ico { font-size: 11px; }

.fog-toggle {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.fog-toggle input { accent-color: rgb(var(--accent)); cursor: pointer; margin: 0; }

.divider { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 12px 0; }

/* ---- Grid ---- */
.grid-wrap { flex: 1; perspective: 900px; min-height: 0; touch-action: none; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  height: 100%;
  grid-auto-rows: 1fr;
  transform-origin: center;
  will-change: transform;
}

/* ---- Pad ---- */
.pad {
  position: relative;
  min-height: 96px;
  padding: 0;
  touch-action: none;             /* hold-to-spray must not be stolen by touch scroll/gesture */
  border: 1px solid rgb(var(--soft) / 0.30);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
  cursor: pointer;
  font-family: var(--font);
  color: #fff;
  text-align: left;
  transition: transform 0.12s cubic-bezier(0.2, 0.9, 0.3, 1.2), border-color 0.2s, background 0.2s;
}
.pad.lit { border-color: rgb(var(--led) / 0.55); background: rgba(255, 255, 255, 0.04); }
.pad.pressing { transform: scale(0.97); background: rgba(255, 255, 255, 0.06); }

.pad-bloom {
  position: absolute; inset: -8px; border-radius: 20px;
  background: rgb(var(--led));
  filter: blur(22px);
  opacity: 0;
  pointer-events: none;
}
.pad-wash {
  position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: linear-gradient(135deg, rgb(var(--soft) / 0.09), rgb(var(--soft) / 0.03));
  transition: background 0.2s;
}
.pad.lit .pad-wash {
  background: linear-gradient(135deg, rgb(var(--soft) / 0.20), rgb(var(--soft) / 0.08));
}

.pad-body {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between;
  height: 100%; padding: 14px; pointer-events: none;
}
.pad-top { display: flex; align-items: flex-start; justify-content: space-between; }

.led {
  width: 13px; height: 13px; border-radius: 50%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(255, 255, 255, 0.07));
  border: 0.75px solid rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.led-lens {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.45), rgb(var(--led)) 62%);
  opacity: 0.5;
  transition: opacity 0.18s, box-shadow 0.18s;
}
.pad.lit .led-lens {
  opacity: 1;
  box-shadow: 0 0 5px rgb(var(--led) / 0.9), 0 0 10px rgb(var(--led) / 0.45);
}

.badge {
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  min-width: 22px; height: 22px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

.pad-label { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.pad-name {
  font-size: 14px; font-weight: 800; font-stretch: 87%; letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.92);
  /* No truncation — a long name (e.g. CONFETTI CRACKLE) wraps centered rather
     than getting cut off with an ellipsis. Short names stay on one line. */
  white-space: normal; overflow-wrap: anywhere; line-height: 1.1;
}
.pad-blurb {
  font-family: var(--mono);
  font-size: 9px; font-weight: 500; letter-spacing: 0.4px; line-height: 1.25;
  color: rgba(255, 255, 255, 0.42);
}

.pad-particles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 3; pointer-events: none;
}

/* ---- Footer ---- */
.footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 10px; height: 16px;
  font-family: var(--mono);
  font-size: 10px; font-weight: 500; letter-spacing: 0.5px;
}
.hint { color: rgba(255, 255, 255, 0.5); }
.no-audio {
  font-size: 9px; font-weight: 800;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(230, 40, 40, 0.85); color: #fff;
}

/* ---- Whole-window steam ---- */
.steam {
  position: fixed; inset: 0; z-index: 50;
  width: 100vw; height: 100vh;
  height: 100dvh;
  pointer-events: none;
}
