* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #0b0d14;
  color: #e9ecf5;
  line-height: 1.55;
  overflow-x: hidden;
}
::selection { background: rgba(255, 92, 158, .35); }

/* background: a dark wall of hidden arrow outlines, exposed where the light beams pass.
   the arrows are drawn on a canvas (wallArrows in the script): nothing is painted
   outside the beams, and each arrow's opacity follows the beams' brightness falloff */
.wall {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.glow {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .32), rgba(255, 255, 255, .10) 50%, transparent 95%);
}
.glow-a {
  width: 800px; height: 800px;
  top: -360px; left: -320px;
  animation: glow-drift-a 46s ease-in-out infinite alternate;
  /* leans toward the cursor on top of the drift */
  translate: calc(var(--mx, 0px) * .14) calc(var(--my, 0px) * .14);
  transition: translate .9s ease-out;
}
.glow-b {
  width: 800px; height: 800px;
  bottom: -360px; right: -320px;
  animation: glow-drift-b 54s ease-in-out infinite alternate;
  translate: calc(var(--mx, 0px) * .10) calc(var(--my, 0px) * .10);
  transition: translate 1.2s ease-out;
}
/* each hue slowly travels between opposite edges of the screen and back */
@keyframes glow-drift-a {
  from { transform: translate(0, 0); }
  to   { transform: translate(calc(100vw - 160px), calc(100vh - 80px)); }
}
@keyframes glow-drift-b {
  from { transform: translate(0, 0); }
  to   { transform: translate(calc(-100vw + 160px), calc(-100vh + 80px)); }
}
@media (prefers-reduced-motion: reduce) {
  .glow-a, .glow-b { animation: none; transition: none; translate: none; }
}

.page { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 48px 20px 72px; }

/* ---------- header ---------- */
header { text-align: center; margin-bottom: 36px; }
h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ff5c9e, #b47cff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.subtitle { margin: 0; color: #a4adc2; font-size: 1.05rem; }
.credits { margin: 18px 0 0; color: #6b7488; font-size: .85rem; }

.pill {
  display: inline-block; padding: 1px 9px; margin: 0 1px;
  border-radius: 999px; font-weight: 600; font-size: .92em;
}
.pill-pink { background: rgba(255, 92, 158, .14); color: #ff8ab8; border: 1px solid rgba(255, 92, 158, .35); }
.pill-purple { background: rgba(140, 124, 246, .13); color: #b3a4ff; border: 1px solid rgba(140, 124, 246, .35); }

/* ---------- cards ---------- */
.card {
  background: #141826;
  border: 1px solid #262c3f;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  margin-bottom: 18px;
}
h2 { margin: 0 0 10px; font-size: 1.15rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: #aeb6c9; font-size: .95rem; }
.card a { color: #ff8ab8; text-decoration: none; border-bottom: 1px solid rgba(255, 92, 158, .35); }
.card a:hover { color: #ffb3d1; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px; }
.grid .card { margin-bottom: 18px; }
.grid .card.wide { grid-column: 1 / -1; }

/* ---------- page layout: content column + sticky lane preview sidebar ---------- */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 408px;
  gap: 18px;
  align-items: start;
}
.col-main { grid-column: 1; grid-row: 1; }
.col-rest { grid-column: 1; }
.card.col-side { grid-column: 2; grid-row: 1 / 4; margin-bottom: 0; position: sticky; top: 20px; }
@media (max-width: 980px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .cols > .col-main, .cols > .col-rest, .cols > .card.col-side { grid-column: auto; grid-row: auto; }
  .card.col-side { position: static; margin-bottom: 18px; }
  .preview-head .drag-btn { display: none; }   /* no side columns to swap on phones */
}
@media (min-width: 981px) {
  body.side-left .cols { grid-template-columns: 408px minmax(0, 1fr); }
  body.side-left .cols > .card.col-side { grid-column: 1; grid-row: 1 / 4; }
  body.side-left .cols > .col-main, body.side-left .cols > .col-rest { grid-column: 2; }
}

/* ---------- converter ---------- */
.segmented {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: #0e1220; border: 1px solid #262c3f;
  padding: 6px; border-radius: 14px; margin-bottom: 24px;
}
.seg {
  position: relative; z-index: 1;          /* labels sit above the moving highlight */
  padding: 11px 10px; border: 0; border-radius: 9px;
  background: transparent; color: #98a1b6;
  font-family: inherit; font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: color .2s;
  white-space: normal;      /* narrow screens: labels wrap instead of clipping */
}
.seg:hover { color: #d7dce8; }
.seg.active { color: #fff; transition-duration: .15s; }
.seg.leaving { transition-delay: .5s; }    /* the label we left dims once the arrow has moved off it */

/* the highlight: one full-size layer whose clip-path is animated (pill -> arrow -> pill).
   drop-shadow lives on the wrapper so the glow follows the clipped shape */
.seg-thumb {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  filter: drop-shadow(0 6px 9px rgba(255, 92, 158, .35));
}
.seg-fill {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #ff5c9e, #b47cff) no-repeat;
  clip-path: inset(0 round 9px);
}
.segmented:not(.has-thumb) .seg-thumb { display: none; }
.segmented:not(.has-thumb) .seg.active {   /* fallback if the script never runs */
  background: linear-gradient(135deg, #ff5c9e, #b47cff);
  box-shadow: 0 6px 18px rgba(255, 92, 158, .35);
}

.field { margin-bottom: 18px; }
.field label {
  display: block; margin-bottom: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #8b94a8;
}
.field input {
  width: 100%; padding: 13px 16px;
  font-family: inherit; font-size: 1.05rem;
  color: #e9ecf5; background: #0e1220;
  border: 1px solid #2a3047; border-radius: 12px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #525b6e; }
.field input:focus { border-color: #ff5c9e; box-shadow: 0 0 0 3px rgba(255, 92, 158, .16); }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
body.has-error #speed { border-color: #e0566e; box-shadow: 0 0 0 3px rgba(224, 86, 110, .14); }

.options-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: end; }
.options-row .field { margin-bottom: 0; }
.check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px; cursor: pointer; user-select: none;
  background: #0e1220; border: 1px solid #2a3047; border-radius: 12px;
  min-height: 48px;
}
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #ff5c9e; flex-shrink: 0; cursor: pointer; }
.check .label { font-size: .92rem; font-weight: 600; }
.check .hint { display: block; font-size: .78rem; color: #7d8699; font-weight: 400; }
.check:hover { border-color: #3a4260; }

body.e2m #maniaOnly { display: none; }
.mode-note {
  display: none; margin: -6px 0 18px;
  font-size: .84rem; color: #b3a4ff;
  background: rgba(140, 124, 246, .1); border: 1px solid rgba(140, 124, 246, .3);
  padding: 10px 14px; border-radius: 10px;
}
body.e2m .mode-note { display: block; }

.result {
  text-align: center; padding: 26px 20px 22px;
  background: #0e1220; border: 1px dashed #2a3047; border-radius: 16px;
  margin-top: 4px;
}
.result-label {
  display: block; margin-bottom: 4px;
  font-size: .74rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #8b94a8;
}
.result-value {
  display: block; font-size: clamp(2.6rem, 9vw, 3.7rem); font-weight: 800;
  line-height: 1.1; letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ff5c9e, #b47cff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-variant-numeric: tabular-nums;
}
.result-sub { display: block; margin-top: 8px; color: #7d8699; font-size: .85rem; }

/* ---------- lane preview ---------- */
.preview-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.preview-title {
  font-size: .74rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #8b94a8;
}
.preview-meta { flex: 1; text-align: right; color: #7d8699; font-size: .78rem; font-variant-numeric: tabular-nums; }
.fs-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: .78rem; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  background: #0e1220; color: #c7cddb; border: 1px solid #2a3047;
}
.fs-btn:hover { border-color: #ff5c9e; color: #fff; }
.fs-btn svg { display: block; }
.drag-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 8px; cursor: grab; touch-action: none; user-select: none;
  background: #0e1220; color: #c7cddb; border: 1px solid #2a3047;
}
.drag-btn:hover { border-color: #b47cff; color: #fff; }
.drag-btn:active { cursor: grabbing; }
.drag-btn svg { display: block; }
body.dragging-side { cursor: grabbing !important; user-select: none; }
body.dragging-side .card.col-side {
  filter: grayscale(.85) brightness(.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  pointer-events: none;
  will-change: transform;
}
.ups-btn {
  display: block; width: 100%; margin-top: 10px;
  font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  background: #0e1220; color: #c7cddb; border: 1px solid #2a3047;
  text-transform: none; letter-spacing: normal;
}
.ups-btn:hover { border-color: #ff5c9e; color: #fff; }
body.ups .ups-btn { border-color: #ff5c9e; color: #ff87b6; box-shadow: 0 0 14px rgba(255, 92, 158, .25); }
body.ups #laneCanvas { transform: scaleY(-1); }   /* upscroll: receptors at top, notes rise */

.lane-wrap {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  background: #0e1220; border: 1px solid #262c3f; border-radius: 14px;
  padding: 14px;
}
#laneCanvas { display: block; border-radius: 8px; }

/* fullscreen lane (real Fullscreen API + in-page fallback) */
.lane-wrap:fullscreen {
  background: #0b0d14; border: 0; border-radius: 0; padding: 24px;
}
.lane-wrap.fs-fallback {
  position: fixed; inset: 0; z-index: 60;
  background: #0b0d14; border: 0; border-radius: 0; padding: 24px;
}
.lane-wrap:fullscreen .fs-exit, .lane-wrap.fs-fallback .fs-exit { display: flex; }
.lane-wrap:fullscreen .fs-meta, .lane-wrap.fs-fallback .fs-meta { display: block; }
.fs-meta {
  display: none; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  color: #7d8699; font-size: .8rem; font-variant-numeric: tabular-nums; z-index: 2;
}
.fs-exit {
  display: none; position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid #2a3047;
  background: #141826; color: #c7cddb; cursor: pointer;
}
.fs-exit:hover { border-color: #ff5c9e; color: #fff; }
.fs-exit svg { display: block; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 7, 12, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #161a28; border: 1px solid #2c324a; border-radius: 16px;
  max-width: 430px; width: 100%; padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.modal h3 { margin: 0 0 8px; font-size: 1.05rem; }
.modal p { margin: 0 0 14px; color: #aeb6c9; font-size: .92rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.btn {
  font-family: inherit; font-size: .9rem; font-weight: 600;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  background: #0e1220; color: #c7cddb; border: 1px solid #2a3047;
}
.btn:hover { border-color: #3a4260; color: #e9ecf5; }
.btn-primary {
  background: linear-gradient(135deg, #ff5c9e, #b47cff);
  border: 0; color: #fff;
  box-shadow: 0 6px 18px rgba(255, 92, 158, .35);
}
.btn-primary:hover { color: #fff; filter: brightness(1.07); }
.modal-input { margin: 0 0 14px; }
.modal-input label {
  display: block; margin-bottom: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #8b94a8;
}
.modal-input input {
  width: 100%; padding: 11px 13px;
  font-family: inherit; font-size: 1rem;
  color: #e9ecf5; background: #0e1220;
  border: 1px solid #2a3047; border-radius: 10px; outline: none;
}
.modal-input input:focus { border-color: #ff5c9e; box-shadow: 0 0 0 3px rgba(255, 92, 158, .16); }
.modal-hint { margin: 8px 0 0 !important; color: #7d8699 !important; font-size: .78rem !important; }

/* ---------- reference table ---------- */
.tablehead {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.tablehead input {
  width: 200px; padding: 9px 13px;
  font-family: inherit; font-size: .9rem;
  color: #e9ecf5; background: #0e1220;
  border: 1px solid #2a3047; border-radius: 10px; outline: none;
}
.tablehead input:focus { border-color: #b47cff; box-shadow: 0 0 0 3px rgba(180, 124, 255, .14); }
.tablehead input::placeholder { color: #525b6e; }
.table-note { color: #7d8699; font-size: .8rem; margin: 0 0 18px !important; }

.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 22px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th {
  padding: 9px 8px; color: #8b94a8;
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid #262c3f;
}
tbody td, tbody th { padding: 8px; text-align: center; font-variant-numeric: tabular-nums; }
tbody th { color: #c7cddb; font-weight: 700; }
tbody td { color: #a4adc2; }
tbody tr { border-bottom: 1px solid rgba(38, 44, 63, .5); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .035); }
.no-match {
  display: none; text-align: center; padding: 18px;
  color: #7d8699; font-size: .9rem;
}
.tables.empty + .no-match, .no-match.visible { display: block; }

footer { text-align: center; color: #5d6478; font-size: .82rem; margin-top: 34px; }
footer a { color: #8f97ab; text-decoration: none; border-bottom: 1px solid #333a52; }

@media (max-width: 560px) {
  .page { padding: 36px 14px 56px; }
  .card { padding: 20px; }
  .options-row { grid-template-columns: 1fr; }
  .check { height: auto; min-height: 48px; }
  .tablehead input { width: 100%; font-size: 16px; }   /* 16px stops iOS zoom-on-focus */
}

/* ================= restyle: flat, typographic, less "template" =================
   one gradient left in the whole page: the sliding arrow. everything else is
   solid ink, hairlines and a single pink. */
:root {
  --ink: #101011; --panel: #171718; --well: #0f0f10;
  --line: #2c2c2f; --line-2: #3d3d42;
  --text: #ece8e1; --muted: #9a968e; --faint: #6e6b65;
  --pink: #ff5c9e;
  --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
}
body { font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--ink); color: var(--text); }
.page { max-width: 1120px; padding-top: 56px; }

header { text-align: left; margin-bottom: 40px; max-width: 640px; }
h1 {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.045em; line-height: .95;
  font-size: clamp(2.8rem, 8vw, 4.6rem); margin: 0 0 18px;
  background: none; -webkit-text-fill-color: currentColor; color: var(--text);
}
.subtitle { color: var(--muted); font-size: 1.1rem; }
.pill { padding: 0; margin: 0; border: 0; border-bottom: 2px solid; border-radius: 0; background: none; font-weight: 600; }
.pill-pink { color: var(--text); border-color: var(--pink); background: none; }
.pill-purple { color: var(--text); border-color: #b47cff; background: none; }
.credits { color: var(--faint); font-size: .85rem; margin-top: 14px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: none; padding: 24px; }
h2 { font-family: var(--display); font-size: 1.3rem; letter-spacing: -0.02em; }
.card p { color: var(--muted); }
.card a { color: var(--text); border-bottom-color: var(--pink); }
.card a:hover { color: var(--pink); }

/* labels: plain sentence case instead of tracked small caps */
.field label, .modal-input label, .preview-title, .result-label {
  text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 600; color: var(--muted);
}
thead th { text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 600; color: var(--muted); }

.segmented { background: var(--well); border-color: var(--line); border-radius: 8px; }
.seg { border-radius: 5px; color: var(--muted); }
.seg-fill { clip-path: inset(0 round 5px); }
.seg-thumb { filter: drop-shadow(0 4px 8px rgba(255, 92, 158, .22)); }
.segmented:not(.has-thumb) .seg.active { box-shadow: none; }

.field input, .modal-input input, .tablehead input, .check, .fs-btn, .drag-btn, .ups-btn, .btn {
  background: var(--well); border-color: var(--line); border-radius: 5px; color: var(--text);
}
.field input { font-family: var(--display); font-weight: 700; font-size: 1.35rem; padding: 12px 14px; letter-spacing: -0.01em; }
.field input::placeholder, .tablehead input::placeholder { color: var(--faint); font-weight: 500; }
.field input:focus, .modal-input input:focus, .tablehead input:focus {
  border-color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink);
}
body.has-error #speed { border-color: #e0566e; box-shadow: inset 0 0 0 1px #e0566e; }
.check:hover, .btn:hover { border-color: var(--line-2); }
.fs-btn:hover, .ups-btn:hover, .drag-btn:hover { border-color: var(--pink); }
body.ups .ups-btn { border-color: var(--pink); color: var(--pink); box-shadow: none; }
.check .hint { color: var(--faint); }
.mode-note { background: none; border: 0; border-left: 2px solid #b47cff; border-radius: 0; color: var(--muted); padding: 2px 0 2px 12px; }

/* result: a big numeral between two rules, no dashed box */
.result {
  background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  border-radius: 0; text-align: left; padding: 22px 0 20px; margin-top: 8px;
}
.result-value {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.05em; line-height: 1;
  font-size: clamp(3.2rem, 10vw, 5.2rem);
  background: none; -webkit-text-fill-color: currentColor; color: var(--pink);
}
.result-sub { color: var(--faint); }

.lane-wrap { background: var(--well); border-color: var(--line); border-radius: 6px; }
.modal { background: var(--panel); border-color: var(--line-2); border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.btn-primary { background: var(--pink); color: #1a0a12; box-shadow: none; border: 1px solid var(--pink); }
.btn-primary:hover { color: #1a0a12; filter: none; background: #ff7aae; border-color: #ff7aae; }

thead th { border-bottom-color: var(--line-2); }
tbody tr { border-bottom-color: var(--line); }
tbody th { color: var(--text); font-family: var(--display); font-weight: 700; }
tbody td { color: var(--muted); }
tbody tr:hover { background: rgba(255, 92, 158, .07); }
footer { color: var(--faint); }
::selection { background: rgba(255, 92, 158, .4); }

/* ================= more edge: square, hard-ruled, angled ================= */
.wall { -webkit-mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.15) 85%); mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.15) 85%); }
.card, .segmented, .seg, .field input, .modal-input input, .tablehead input, .check, .fs-btn, .drag-btn,
.ups-btn, .btn, .lane-wrap, #laneCanvas, .modal, .fs-exit { border-radius: 0; }
.seg-fill { clip-path: inset(0 round 2px); }
.card { border-color: var(--line-2); }
.card.col-main { border-top: 3px solid var(--pink); box-shadow: 8px 8px 0 rgba(255, 92, 158, .13); }
.card.col-side { border-top: 3px solid var(--text); }
h1::after {                                              /* slash-cut bar, same angle as the arrow head */
  content: ""; display: block; width: 96px; height: 9px; margin-top: 22px; background: var(--pink);
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}
h1 { margin-bottom: 20px; font-size: clamp(3rem, 9vw, 5.4rem); }
.field input { border-bottom: 2px solid var(--line-2); }
.result { border-top: 2px solid var(--text); }
.result-value { text-shadow: 4px 4px 0 rgba(255, 92, 158, .2); }
.btn, .fs-btn, .ups-btn, .seg { font-weight: 700; }
thead th { border-bottom: 2px solid var(--line-2); }
tbody tr:hover { background: rgba(255, 92, 158, .1); box-shadow: inset 3px 0 0 var(--pink); }

/* title banner: a purple parallelogram leaning right (~28deg). white edge on the left side,
   deep purple edge on the right side; the text is counter-skewed so it stays upright */
header { max-width: none; }
header .subtitle, header .credits { max-width: 640px; }
h1::after { content: none; }
/* hard offset copy of the banner behind it, same trick as the main card's offset shadow */
h1 { font-size: clamp(2rem, 7.4vw, 4.6rem); margin: 0 0 30px; filter: drop-shadow(.11em .09em 0 rgba(255, 92, 158, .5)); }
.banner {
  display: inline-block; margin-left: .36em;
  padding: .12em .8em .16em;
  background: #9a55e8;
  border-left: .07em solid #fff;
  border-right: .07em solid #4a1d96;
  transform: skewX(-28deg);
}
.banner-text {
  display: inline-block; transform: skewX(28deg); color: #fff; white-space: nowrap;
  /* deep purple outline drawn behind the fill (paint-order), so the letters keep their full weight */
  -webkit-text-stroke: .05em #4a1d96; paint-order: stroke fill;
  text-shadow: 0 0 1px #4a1d96;
  -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision;
}

/* ---- mode switch: the two blocks that swap places glide open/shut instead of popping ---- */
#maniaOnly, .note-wrap {
  display: grid;
  transition: grid-template-rows .65s cubic-bezier(.3, 0, .2, 1), opacity .35s ease, visibility 0s;
}
#maniaOnly { grid-template-rows: 1fr; opacity: 1; visibility: visible; }
#maniaOnly > .options-row, .note-inner { min-height: 0; overflow: hidden; }
body.e2m #maniaOnly {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .65s cubic-bezier(.3, 0, .2, 1), opacity .3s ease, visibility 0s .65s;
}
.note-wrap {
  grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .65s cubic-bezier(.3, 0, .2, 1), opacity .3s ease, visibility 0s .65s;
}
body.e2m .note-wrap {
  grid-template-rows: 1fr; opacity: 1; visibility: visible;
  transition: grid-template-rows .65s cubic-bezier(.3, 0, .2, 1), opacity .4s ease .2s, visibility 0s;
}
.mode-note { display: block; margin: 0 0 18px; }
@media (prefers-reduced-motion: reduce) { #maniaOnly, .note-wrap, body.e2m #maniaOnly, body.e2m .note-wrap { transition: none; } }

/* the labels of the direction switch must never paint over the fullscreen lane preview */
.segmented { isolation: isolate; }
.card.col-side:has(.lane-wrap.fs-fallback), .card.col-side:has(.lane-wrap:fullscreen) { z-index: 60; }

/* ---- (?) button: the intro text stays hidden until it is clicked ---- */
.title-row { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; margin-bottom: 30px; }
.title-row h1 { margin: 0; }
.help-btn {
  width: 2.5rem; height: 2.5rem; padding: 0; cursor: pointer;
  font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1;
  background: var(--well); color: var(--text); border: 2px solid var(--text); border-radius: 0;
  transform: skewX(-28deg); box-shadow: 3px 3px 0 rgba(255, 92, 158, .35);
  transition: background .2s, color .2s, border-color .2s;
}
.help-btn span { display: block; transform: skewX(28deg); }
.help-btn:hover { border-color: var(--pink); color: var(--pink); }
.help-btn[aria-expanded="true"] { background: var(--pink); border-color: var(--pink); color: #1a0a12; }
.about {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .55s cubic-bezier(.3, 0, .2, 1), opacity .3s ease, visibility 0s .55s;
}
.about.open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .55s cubic-bezier(.3, 0, .2, 1), opacity .4s ease .15s, visibility 0s; }
.about-inner { min-height: 0; overflow: hidden; }
.about-inner .subtitle { margin-top: -6px; }
.about-inner .credits { padding-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .about, .about.open { transition: none; } }

/* hard offset shadow on every card, same as the converter card's */
.card { box-shadow: 8px 8px 0 rgba(255, 92, 158, .13); }

/* "Keep in mind": the title banner again, smaller; the ! leans with the parallelogram */
.h2-banner { font-size: 1.45rem; margin: 4px 0 18px; filter: drop-shadow(.11em .09em 0 rgba(255, 92, 158, .5)); }
.h2-banner .banner { padding: .14em .8em .18em; }
.h2-banner .banner-text { transform: skewX(8deg); }       /* net lean of ~20deg: italic that follows the slanted edges */
.bang {
  display: inline-block; margin-right: .14em;
  color: #e5192b; -webkit-text-stroke: .09em #fff; paint-order: stroke fill; text-shadow: 0 0 1px #fff;
}

/* ---- accuracy counter + judgment pop-up ---- */
.acc {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l v" "s v" "r r"; column-gap: 16px; row-gap: 2px; align-items: center;
  width: 100%; margin-top: 18px; padding: 12px 16px; text-align: left; font-family: inherit; color: var(--text); cursor: pointer;
  background: var(--well); border: 1px solid var(--line-2); border-top: 3px solid var(--pink); border-radius: 0;
  box-shadow: 4px 4px 0 rgba(255, 92, 158, .2);
}
.acc:hover { border-color: var(--pink); }
.acc-label { grid-area: l; font-size: .75rem; font-weight: 600; color: var(--muted); }
.acc-sub { grid-area: s; font-size: .75rem; color: var(--faint); }
.acc-val { grid-area: v; font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; letter-spacing: -.04em; color: var(--pink); font-variant-numeric: tabular-nums; }
.acc-fs { display: none; }
.lane-wrap:fullscreen .acc-fs, .lane-wrap.fs-fallback .acc-fs { display: grid; position: absolute; top: 16px; left: 16px; width: auto; margin: 0; z-index: 3; }

/* insert coin + play modes */
.coin { margin-top: 14px; }
.coin-btn {
  width: 100%; padding: 12px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; cursor: pointer;
  background: var(--pink); color: #1a0a12; border: 1px solid var(--pink); border-radius: 0; box-shadow: 4px 4px 0 rgba(255, 255, 255, .15);
}
.coin-btn:not(.on) { animation: coinblink 1.4s steps(2, start) infinite; }
.coin-btn.on { background: var(--well); color: var(--text); border-color: var(--line-2); }
@keyframes coinblink { 50% { opacity: .55; } }
.coin-panel {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .5s cubic-bezier(.3, 0, .2, 1), opacity .3s ease, visibility 0s .5s;
}
.coin-panel.open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .5s cubic-bezier(.3, 0, .2, 1), opacity .35s ease .1s, visibility 0s; }
.coin-inner { min-height: 0; overflow: hidden; }
.coin-row { display: flex; gap: 10px; align-items: stretch; padding: 14px 0 4px; flex-wrap: wrap; }
.mode-toggle { display: flex; flex: 1; min-width: 190px; border: 1px solid var(--line-2); }
.mode-toggle button { flex: 1; padding: 10px 8px; font-family: inherit; font-weight: 700; font-size: .88rem; background: var(--well); color: var(--muted); border: 0; border-radius: 0; cursor: pointer; }
.mode-toggle button[aria-pressed="true"] { background: #9a55e8; color: #fff; }
.bpm { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.bpm input { width: 74px; padding: 9px 10px; font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--text); background: var(--well); border: 1px solid var(--line); border-bottom: 2px solid var(--line-2); border-radius: 0; }
.bpm input:focus { outline: 0; border-color: var(--pink); }
@media (prefers-reduced-motion: reduce) { .coin-btn:not(.on) { animation: none; } .coin-panel, .coin-panel.open { transition: none; } }

#judge {
  position: absolute; left: 50%; top: 50%; z-index: 5; pointer-events: none; opacity: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; --jc: #ff5c9e; --jd: #7a1747;
}
#judge.pop { animation: jpop .75s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes jpop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  14%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  26%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  72%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1); }
}
#judge[data-j="marvelous"] { --jc: #ff5c9e; --jd: #7a1747; }
#judge[data-j="perfect"]   { --jc: #f0b400; --jd: #6b4a00; }
#judge[data-j="great"]     { --jc: #22b573; --jd: #0b4f33; }
#judge[data-j="good"]      { --jc: #3d8fe8; --jd: #123e78; }
#judge[data-j="bad"]       { --jc: #9a55e8; --jd: #4a1d96; }
#judge[data-j="miss"]      { --jc: #e5192b; --jd: #5c0a12; }
.j-wrap { font-size: 1.45rem; filter: drop-shadow(.11em .09em 0 rgba(255, 92, 158, .5)); }
.j-banner {
  display: inline-block; padding: .1em .8em .14em; transform: skewX(-28deg); background: var(--jc);
  border-left: .07em solid #fff; border-right: .07em solid var(--jd);
  font-family: var(--display); font-weight: 800; line-height: 1; letter-spacing: -.03em;
}
.j-text {
  display: inline-block; transform: skewX(28deg); color: #fff; white-space: nowrap;
  -webkit-text-stroke: .05em var(--jd); paint-order: stroke fill; text-shadow: 0 0 1px var(--jd);
}
.j-ms { font-family: var(--display); font-weight: 700; font-size: .8rem; color: var(--text); text-shadow: 0 2px 0 var(--ink); min-height: 1.2em; }
.lane-wrap:not(.fs-fallback):not(:fullscreen) { position: relative; }
.lane-wrap:fullscreen .j-wrap, .lane-wrap.fs-fallback .j-wrap { font-size: 2.2rem; }

/* ---- insert-coin flow ---- */
[hidden] { display: none !important; }
.acc-ratio { grid-area: r; margin-top: 6px; font-size: .75rem; color: var(--muted); }
.acc-ratio b { color: var(--text); font-variant-numeric: tabular-nums; }
.segmented.mini { margin-bottom: 0; padding: 4px; gap: 4px; flex: 1; min-width: 190px; }
.gseg {
  position: relative; z-index: 1; padding: 9px 6px; border: 0; border-radius: 0; background: transparent; color: var(--muted);
  font-family: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; transition: color .2s;
}
.gseg:hover { color: #d7dce8; }
.gseg.active { color: #fff; transition-duration: .15s; }
.gseg.leaving { transition-delay: .42s; }

#attract {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; pointer-events: none; white-space: nowrap;
  padding: .4em .8em; background: rgba(16, 16, 17, .8); border: 1px solid var(--line-2);
  font-family: var(--display); font-weight: 800; font-size: 1rem; letter-spacing: -.01em; color: var(--pink);
  animation: attractflash 1.1s steps(2, start) infinite;
}
@keyframes attractflash { 50% { opacity: 0; } }
.lane-wrap:fullscreen #attract, .lane-wrap.fs-fallback #attract { font-size: 1.6rem; }

#keyHints { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 4; display: none; }
#keyHints.in, #keyHints.out { display: block; }
.key-hint { position: absolute; transform: translate(-50%, -50%); filter: drop-shadow(.1em .08em 0 rgba(255, 92, 158, .5)); }
.kh {
  display: inline-block; padding: .16em .7em .2em; background: #9a55e8;
  border-left: .08em solid #fff; border-right: .08em solid #4a1d96; transform: skewX(-28deg);
  font-family: var(--display); font-weight: 800; line-height: 1;
}
.kh-t { display: inline-block; transform: skewX(10deg); color: #fff; -webkit-text-stroke: .05em #4a1d96; paint-order: stroke fill; }
#keyHints.in .kh  { animation: khin .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms); }
#keyHints.out .kh { animation: khout .65s cubic-bezier(.6, 0, .9, .5) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes khin  { from { transform: translateX(var(--fromL)) skewX(-28deg); } to { transform: translateX(0) skewX(-28deg); } }
@keyframes khout { from { transform: translateX(0) skewX(-28deg); } to { transform: translateX(var(--toR)) skewX(-28deg); } }

#pressKey { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; font-size: 1.05rem; filter: drop-shadow(.11em .09em 0 rgba(255, 92, 158, .5)); }
.pk { display: inline-block; padding: .35em 1em .4em; background: #f2c230; border-left: .08em solid #fff; border-right: .08em solid #7a5a00; transform: skewX(-28deg); animation: pkpulse 1s ease-in-out infinite alternate; }
.pk span { display: inline-block; transform: skewX(10deg); white-space: nowrap; font-family: var(--display); font-weight: 800; color: #fff; -webkit-text-stroke: .05em #7a5a00; paint-order: stroke fill; }
@keyframes pkpulse { from { opacity: .72; } to { opacity: 1; } }
.lane-wrap:fullscreen #pressKey, .lane-wrap.fs-fallback #pressKey { font-size: 1.7rem; }
@media (prefers-reduced-motion: reduce) { #attract, .pk { animation: none; } #keyHints .kh { animation-duration: .01s !important; animation-delay: 0s !important; } }
