:root {
  --bg: #05070b;
  --bg-2: #0a1018;
  --panel: #101820;
  --line: rgba(77, 159, 255, 0.28);
  --gold: #4aa3ff;
  --gold-2: #9dceff;
  --text: #eef3f9;
  --muted: #9aabc0;
  --green: #1d6fd8;
  --danger-soft: #121820;
  --ink: #061018;
  --radius: 16px;
  --max: 1120px;
  --header-h: 52px;
  --header-bg: #e8eef4;
  --header-ink: #0b1a2e;
  --header-muted: #3d5066;
  --header-line: rgba(37, 110, 190, 0.32);
  --header-blue: #1a6fd4;
  --hero-gold: #e2b860;
  --red: #b42323;
  --blue: #1d4e9e;
  --bib-yellow: #f0c400;
  --bib-green: #2fbf5a;
  --bib-orange: #ef7a1a;
  --bib-white: #f4f7fb;
  --bib-ink: #1a1208;
  --danger: #ffc9c9;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body:not(.is-coach) #coach-share,
body:not(.is-coach) #roster-block,
body:not(.is-coach) #coach-actions,
body:not(.is-coach) #shape-controls,
body:not(.is-coach) #take-rec,
body:not(.is-coach) #take-stop-top,
body:not(.is-coach) #frame-rec,
body:not(.is-coach) #frame-dock,
body:not(.is-coach) #draw-toggle,
body:not(.room-open) #shape-controls,
body:not(.room-open) #take-rec,
body:not(.room-open) #take-stop-top,
body:not(.room-open) #frame-rec,
body:not(.room-open) #frame-dock,
body:not(.room-open) #draw-toggle {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.55;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  border-top: 1px solid var(--header-line);
  box-shadow: 0 8px 24px rgba(11, 26, 46, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  width: min(100% - 32px, var(--max));
  min-height: var(--header-h);
  margin-inline: auto;
  padding-block: 6px;
}

.header-inner h1 {
  min-width: 0;
  font-family: Oswald, Impact, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: clamp(0.95rem, 3.6vw, 1.2rem);
  line-height: 1;
  color: var(--header-ink);
  text-transform: uppercase;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

main {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

body.in-room main {
  width: min(var(--max), calc(100% - 32px));
}

h1, h2, p {
  margin: 0;
}

h2 {
  font-family: Oswald, Impact, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.block.fold-block {
  padding: 0;
  border: 0;
  background: transparent;
}

.fold:not([open]) > :not(summary) {
  display: none;
}

.fold > summary,
.fold-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(226, 184, 96, 0.18), rgba(226, 184, 96, 0.05) 46%, rgba(8, 10, 14, 0)),
    linear-gradient(180deg, #2c2418, #12100c 72%);
  color: var(--hero-gold);
  font-family: Oswald, Impact, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

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

.fold > summary::marker {
  content: "";
}

.fold-ico {
  display: inline-flex;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.fold-ico svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fold > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}

.fold[open] > summary::after {
  transform: translateY(-3px) rotate(45deg);
}

.fold > summary:hover {
  border-color: var(--hero-gold);
  background:
    linear-gradient(90deg, rgba(226, 184, 96, 0.28), rgba(226, 184, 96, 0.08) 50%, rgba(8, 10, 14, 0)),
    linear-gradient(180deg, #3a2c18, #16130e 72%);
}

.fold > summary:focus-visible {
  outline: 2px solid var(--hero-gold);
  outline-offset: 3px;
}

.fold-title {
  margin: 0 0 14px;
  cursor: default;
}

.fold[open] > summary {
  margin-bottom: 12px;
}

.fold[open] > :not(summary) {
  padding: 0 8px 2px;
}

.muted, .hint {
  color: var(--muted);
  line-height: 1.45;
}

.hint {
  margin-top: 6px;
  font-size: 0.95rem;
}

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

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--hero-gold);
  background: transparent;
  color: var(--hero-gold);
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

form button[type="submit"], .tabs button.is-on {
  background: var(--hero-gold);
  color: var(--ink);
  border-color: var(--hero-gold);
}

form button[type="submit"] {
  width: 100%;
}

button.secondary {
  width: 100%;
  margin-top: 10px;
}

button.danger {
  border-color: #e07a7a;
  color: var(--danger);
  background: transparent;
}

.site-header #sign-out {
  min-height: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--header-line);
  background: transparent;
  color: var(--header-ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.lang-switch {
  position: relative;
  flex-shrink: 0;
}

.lang-switch button {
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  background: none;
  border: 0;
  color: var(--header-ink);
  cursor: pointer;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--header-line) !important;
  border-radius: 999px;
  font-weight: 700;
}

.lang-current:hover,
.lang-switch.is-open .lang-current {
  color: var(--header-blue);
  background: rgba(26, 111, 212, 0.1);
}

.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 150px;
  padding: 6px;
  background: #f4f7fa;
  border: 1px solid var(--header-line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(11, 26, 46, 0.12);
}

.lang-switch.is-open .lang-menu {
  display: grid;
  gap: 2px;
}

.lang-menu button {
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.lang-menu button:hover {
  background: rgba(26, 111, 212, 0.1);
}

.lang-menu button.is-active {
  background: var(--header-blue);
  color: #fff;
  font-weight: 700;
}

label, fieldset {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

fieldset {
  border: 0;
  padding: 0;
}

legend {
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  padding: 10px 12px;
}

.pass-field {
  position: relative;
}

.pass-field input {
  padding-right: 52px;
}

#password-eye {
  position: absolute;
  right: 6px;
  bottom: 4px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

#password-eye svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

#password-eye[aria-pressed="true"] {
  color: var(--hero-gold);
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
}

.phone-row.has-ddd {
  grid-template-columns: minmax(0, 1.15fr) 72px minmax(0, 1fr);
}

#phone-ddd {
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.phone-row select {
  padding-right: 6px;
  text-overflow: ellipsis;
}

#phone-hint {
  display: block;
  margin-top: 6px;
}

.auth-link {
  display: flex;
  width: 100%;
  margin-top: 8px;
  min-height: 0;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--hero-gold);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

input[readonly] {
  letter-spacing: 0.18em;
  font-weight: 700;
}

.notice {
  position: fixed;
  z-index: 70;
  top: calc(var(--header-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(calc(100% - 24px), 440px);
  margin: 0;
  padding: 12px 12px 12px 14px;
  border-radius: 12px;
  background: #3a1414;
  color: #ffd0d0;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.notice p {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}

.notice #notice-close {
  flex: 0 0 auto;
  width: 32px;
  min-width: 32px;
  height: 32px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.notice #notice-close:hover,
.notice #notice-close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

#pitch-wrap:fullscreen > .notice,
#pitch-wrap:-webkit-full-screen > .notice,
.notice.is-full {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 360px);
  text-align: center;
}

#pitch-wrap:fullscreen > .notice p,
#pitch-wrap:-webkit-full-screen > .notice p,
.notice.is-full p {
  text-align: center;
}

.notice.ok {
  background: #102418;
  color: #d7f5c8;
}

.tabs, .pair, .colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tabs {
  margin-bottom: 14px;
}

.block {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

#coach-share {
  padding: 10px 12px;
}

.share-title {
  margin-bottom: 2px;
  font-weight: 700;
  line-height: 1.3;
}

.share-name {
  margin: 0 0 8px;
  color: var(--hero-gold);
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#share-code {
  width: 7.4rem;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 4px 8px;
  text-align: center;
}

#copy-code,
#copy-link {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  padding: 0 8px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.stack {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.room-row, .member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.room-row:first-child, .member:first-child {
  padding-top: 0;
}

.room-row:last-child, .member:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.room-copy, .member .who {
  flex: 1;
  min-width: 0;
}

.room-copy strong, .member .who {
  display: block;
  overflow-wrap: anywhere;
}

.room-copy span, .empty {
  color: var(--muted);
}

.room-search {
  display: block;
  margin: 0 0 10px;
}

.room-search .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.room-search input {
  width: 100%;
  min-height: 40px;
}

.room-row > button,
.room-row .room-share {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  flex: none;
}

.room-row > button svg,
.room-row .room-share svg {
  display: block;
}

.room-share-wrap {
  position: relative;
  flex: none;
}

.room-share-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 6px;
  min-width: 10.5rem;
  padding: 8px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.room-share-menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  background: transparent;
  color: var(--hero-gold);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.room-share-menu button:hover {
  border-color: var(--hero-gold);
  background: rgba(226, 184, 96, 0.12);
}

.room-row > button.room-remove {
  border-color: #e07a7a;
  color: var(--danger);
}

.pill {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold-2);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.pill.closed {
  border-color: var(--muted);
  color: var(--muted);
}

.badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
  color: white;
}

.badge.red { background: var(--red); }
.badge.blue { background: var(--blue); }
.badge.yellow { background: var(--bib-yellow); color: var(--bib-ink); }
.badge.green { background: var(--bib-green); }
.badge.orange { background: var(--bib-orange); }
.badge.white {
  background: var(--bib-white);
  color: var(--bib-ink);
  box-shadow: inset 0 0 0 1px rgba(10, 16, 24, 0.45);
}

.badge.mine {
  box-shadow: 0 0 0 3px var(--hero-gold);
}

.color-choice span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid transparent;
  font-weight: 700;
  color: white;
}

.color-choice.red span { background: var(--red); }
.color-choice.blue span { background: var(--blue); }
.color-choice.yellow span { background: var(--bib-yellow); color: var(--bib-ink); }
.color-choice.green span { background: var(--bib-green); }
.color-choice.orange span { background: var(--bib-orange); }
.color-choice.white span { background: var(--bib-white); color: var(--bib-ink); }

.color-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-choice input:checked + span {
  border-color: var(--hero-gold);
}

.color-choice input:focus-visible + span {
  outline: 2px solid var(--hero-gold);
  outline-offset: 2px;
}

.member select {
  width: 132px;
  flex: none;
}

.roster-clear {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.roster-clear-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.roster-clear-btn svg {
  display: block;
}

.roster-clear-btn.red { color: var(--red); border-color: rgba(180, 35, 35, 0.55); }
.roster-clear-btn.blue { color: var(--blue); border-color: rgba(29, 78, 158, 0.55); }
.roster-clear-btn.yellow { color: var(--bib-yellow); border-color: rgba(240, 196, 0, 0.55); }
.roster-clear-btn.green { color: var(--bib-green); border-color: rgba(47, 191, 90, 0.55); }
.roster-clear-btn.orange { color: var(--bib-orange); border-color: rgba(239, 122, 26, 0.55); }
.roster-clear-btn.white {
  color: var(--bib-white);
  border-color: rgba(244, 247, 251, 0.45);
}

.member .remove {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  flex: none;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  border-color: #e07a7a;
  color: var(--danger);
  background: transparent;
}

.team-label {
  margin: 16px 0 8px;
  font-family: Oswald, Impact, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-2);
}

.team-label:first-child {
  margin-top: 0;
}

#room-back {
  margin-top: 12px;
}

#pitch-wrap {
  position: relative;
  margin-top: 12px;
}

.frame-dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100% - 12px);
  padding: 4px 6px;
  border-radius: 14px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  background: rgba(6, 10, 16, 0.88);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  touch-action: none;
  pointer-events: auto;
  cursor: grab;
}

.frame-dock.is-drag {
  cursor: grabbing;
}

.frame-grip {
  flex: 0 0 auto;
  color: var(--hero-gold);
  font-size: 14px;
  letter-spacing: -2px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.dock-strip {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.dock-nav {
  flex: 0 0 auto;
  width: 28px !important;
  min-width: 28px;
  min-height: 36px !important;
  height: 36px;
  margin: 0;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid rgba(226, 184, 96, 0.45);
  background: rgba(4, 7, 12, 0.55);
  color: var(--hero-gold);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  touch-action: manipulation;
  pointer-events: auto;
}

.dock-nav:disabled {
  opacity: 0.28;
}

.dock-strip.is-plain .dock-nav {
  display: none;
}

.frame-thumbs {
  display: flex;
  gap: 4px;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  max-width: 36vw;
  padding: 2px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
}

.frame-thumbs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.frame-chip {
  position: relative;
  flex: 0 0 auto;
}

.frame-thumb {
  width: 28px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(226, 184, 96, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
}

.frame-chip.is-on .frame-thumb {
  border-color: var(--hero-gold);
  background: rgba(226, 184, 96, 0.55);
  box-shadow: 0 0 0 1px var(--hero-gold);
}

.frame-x {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 1;
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  background: #140e08;
}

.frame-dock button {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  font-size: 0.85rem;
  touch-action: manipulation;
  pointer-events: auto;
}

.frame-dock .frame-icon {
  width: 36px;
  padding: 0;
}

.frame-count {
  flex: 0 0 auto;
  color: var(--hero-gold);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.frame-speed-switch {
  position: relative;
  flex: 0 0 auto;
}

.frame-dock .frame-speed {
  width: auto;
  min-width: 52px;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

.frame-speed-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: none;
  min-width: 64px;
  padding: 6px;
  transform: translateX(-50%);
  background: #0b1118;
  border: 1px solid rgba(226, 184, 96, 0.55);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.frame-speed-switch.is-open .frame-speed-menu {
  display: grid;
  gap: 2px;
}

.frame-speed-menu button {
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hero-gold);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.frame-speed-menu button:hover {
  background: rgba(226, 184, 96, 0.16);
}

.frame-speed-menu button.is-active {
  background: rgba(226, 184, 96, 0.35);
  box-shadow: inset 0 0 0 1px rgba(226, 184, 96, 0.7);
}

.frame-dock .frame-thumb {
  width: 28px;
  height: 22px;
  min-height: 22px;
  padding: 0;
}

.frame-dock .frame-x {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}

#take-count {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: Oswald, Impact, sans-serif;
  font-size: clamp(72px, 20vh, 180px);
  font-weight: 600;
  line-height: 1;
  color: var(--hero-gold);
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

#take-name {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 7, 11, 0.62);
  touch-action: auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#take-name.is-keyboard {
  align-items: flex-start;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: 10px;
}

#take-name form {
  width: min(100%, 420px);
  margin: 0;
  padding: 20px;
  border: 1px solid var(--hero-gold);
  border-radius: var(--radius);
  background: var(--panel);
  max-height: 100%;
  overflow: auto;
}

#take-name h2 {
  margin: 0 0 12px;
  font-family: Oswald, Impact, sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#take-name input,
#take-name button {
  touch-action: auto;
}

@media (max-height: 480px) {
  #take-name {
    align-items: flex-start;
  }

  #take-name form {
    padding: 12px 14px;
  }

  #take-name h2 {
    margin-bottom: 8px;
    font-size: 1.15rem;
  }

  #take-name .pair {
    gap: 8px;
  }
}

#film-end,
#film-job {
  position: absolute;
  inset: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 7, 11, 0.55);
  touch-action: auto;
}

#film-end .film-card,
#film-job .film-card,
#ask .film-card {
  width: min(100%, 420px);
  margin: 0;
  padding: 20px;
  border: 1px solid var(--hero-gold);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: center;
}

#film-end p,
#film-job h2 {
  margin: 0 0 14px;
  font-family: Oswald, Impact, sans-serif;
  font-size: clamp(28px, 6vw, 56px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--hero-gold);
}

#film-job h2 {
  font-size: 1.4rem;
  color: var(--text);
}

#film-job p {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

#ask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 7, 11, 0.62);
  touch-action: auto;
}

#ask .film-card p {
  margin: 0 0 16px;
  font-size: 1.15rem;
  line-height: 1.4;
}

#ask button {
  touch-action: auto;
}

#ask-actions.sides {
  grid-template-columns: 1fr;
}

#ask-actions .ask-cancel {
  grid-column: 1 / -1;
}

.film-meter {
  height: 10px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.film-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--hero-gold);
}

#film-chip {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  z-index: 13;
  display: flex;
  gap: 6px;
  align-items: center;
}

#film-chip button {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 14px;
}

#film-chip-cancel {
  width: 32px;
  padding: 0;
  font-size: 18px;
}

#shape-apply,
#take-rec,
#frame-rec,
#take-stop-play,
#draw-toggle {
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  line-height: 1;
}

#pitch-wrap:fullscreen,
#pitch-wrap:-webkit-full-screen {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #08301a;
  overflow: hidden;
}

#pitch-wrap:fullscreen #pitch-view,
#pitch-wrap:-webkit-full-screen #pitch-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
}

#pitch-wrap:fullscreen .shape-bar,
#pitch-wrap:-webkit-full-screen .shape-bar {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  left: auto;
  bottom: auto;
  z-index: 8;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 0;
  padding: 6px;
  gap: 6px;
  align-items: flex-end;
  justify-content: flex-end;
  border-radius: 18px;
  background: rgba(5, 7, 11, 0.78);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

#pitch-wrap:fullscreen .shape-bar button,
#pitch-wrap:-webkit-full-screen .shape-bar button,
#pitch-wrap:fullscreen .shape-bar select,
#pitch-wrap:-webkit-full-screen .shape-bar select {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

#bar-toggle {
  display: none;
}

#pitch-wrap:fullscreen #bar-toggle,
#pitch-wrap:-webkit-full-screen #bar-toggle {
  display: inline-flex;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  opacity: 0.72;
  background: rgba(5, 7, 11, 0.55);
}

#pitch-wrap:fullscreen.is-bar-open .shape-bar,
#pitch-wrap:-webkit-full-screen.is-bar-open .shape-bar {
  padding-right: 46px;
}

#pitch-wrap:fullscreen.is-bar-open #bar-toggle,
#pitch-wrap:-webkit-full-screen.is-bar-open #bar-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  opacity: 1;
  background: transparent;
}

#pitch-wrap:fullscreen:not(.is-bar-open) .shape-bar,
#pitch-wrap:-webkit-full-screen:not(.is-bar-open) .shape-bar {
  padding: 0;
  gap: 0;
  background: transparent;
  box-shadow: none;
}

#pitch-wrap:fullscreen:not(.is-bar-open) .shape-bar > .shape-tools,
#pitch-wrap:-webkit-full-screen:not(.is-bar-open) .shape-bar > .shape-tools,
#pitch-wrap:fullscreen:not(.is-bar-open) .shape-bar > .shape-actions,
#pitch-wrap:-webkit-full-screen:not(.is-bar-open) .shape-bar > .shape-actions {
  display: none !important;
}

.take-stop-top {
  display: none;
}

#pitch-wrap:fullscreen:not(.is-bar-open).is-taking .shape-bar,
#pitch-wrap:-webkit-full-screen:not(.is-bar-open).is-taking .shape-bar {
  flex-direction: row-reverse;
  align-items: center;
  padding: 6px;
  gap: 6px;
  background: rgba(5, 7, 11, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

#pitch-wrap:fullscreen:not(.is-bar-open).is-taking #take-stop-top,
#pitch-wrap:-webkit-full-screen:not(.is-bar-open).is-taking #take-stop-top {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 88px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #9d1c1c;
  background: #9d1c1c;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

#pitch-wrap:fullscreen:not(.is-bar-open).is-taking #bar-toggle,
#pitch-wrap:-webkit-full-screen:not(.is-bar-open).is-taking #bar-toggle {
  opacity: 1;
  width: 36px;
  height: 36px;
  min-height: 36px;
  background: rgba(5, 7, 11, 0.55);
}

#pitch-view {
  width: 100%;
  aspect-ratio: 105 / 68;
  overflow: hidden;
  border: 2px solid rgba(226, 184, 96, 0.75);
  border-radius: 16px;
  background: #08301a;
  touch-action: none;
  user-select: none;
  container-type: inline-size;
}

#pitch.inking {
  cursor: crosshair;
}

html.is-inking,
html.is-inking body {
  touch-action: none;
  overscroll-behavior: none;
}

#ink-catch {
  position: absolute;
  inset: 0;
  z-index: 6;
  touch-action: none;
  background: transparent;
}

#ink-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

#ink-svg .ink-halo {
  fill: none;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 10;
  stroke-linecap: round;
}

#ink-svg .ink-stroke,
#ink-svg .ink-zone {
  fill: none;
  stroke: #ffe08a;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#ink-svg .ink-halo.is-dash,
#ink-svg .ink-stroke.is-dash {
  stroke-dasharray: 16 12;
}

#ink-svg .ink-link-halo {
  fill: none;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 9;
  stroke-linecap: round;
}

#ink-svg .ink-link {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

#ink-svg .ink-head {
  fill: #ffe08a;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 4;
  stroke-linejoin: round;
}

#ink-svg .ink-zone {
  fill: rgba(255, 224, 138, 0.16);
}

#ink-items,
#ink-notes {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#ink-notes {
  z-index: 4;
}

.ink-item {
  position: absolute;
  pointer-events: none;
}

.ink-item svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ink-item.is-on {
  filter: drop-shadow(0 0 4px rgba(255, 224, 138, 0.95));
}

.ink-item.note {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    0 0 3px #061018,
    0 1px 2px #061018,
    1px 0 0 #061018,
    -1px 0 0 #061018,
    0 1px 0 #061018,
    0 -1px 0 #061018;
  container-type: size;
}

.ink-item.note span {
  display: block;
  width: 100%;
  font-size: min(68cqh, 24cqw);
}

#ink-editor {
  position: absolute;
  z-index: 7;
  margin: 0;
  padding: 2px 8px;
  border: 2px solid var(--hero-gold);
  border-radius: 8px;
  background: rgba(6, 16, 24, 0.78);
  color: #fff;
  font-weight: 700;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.1;
  text-align: center;
  transform: translate(-50%, -50%);
  min-width: 140px;
  max-width: 72%;
}

.ink-ruler {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  font-weight: 700;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  visibility: hidden;
  pointer-events: none;
}

.ink-stem {
  position: absolute;
  height: 2px;
  background: rgba(255, 224, 138, 0.9);
  transform-origin: 0 50%;
  pointer-events: none;
}

.ink-handle {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #143a22;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ink-handle.is-size {
  background: #e2b860;
  border-radius: 8px;
}

.ink-handle.ball-size {
  z-index: 8;
}

.ink-handle.is-rot {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 7px, #143a22 8px),
    conic-gradient(from 40deg, transparent 0 200deg, #ffe08a 0 320deg, transparent 0);
}

.draw-bar {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 13;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  width: max-content;
  max-width: calc(100% - 12px);
  margin: 0;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  background: rgba(6, 10, 16, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  touch-action: none;
  pointer-events: auto;
  cursor: grab;
}

.draw-bar.is-drag {
  cursor: grabbing;
}

.draw-grip {
  flex: 0 0 auto;
  align-self: center;
  color: var(--hero-gold);
  font-size: 14px;
  letter-spacing: -2px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.draw-bar .dock-strip {
  flex: 0 1 auto;
  max-width: min(78vw, 560px);
  padding: 0;
  border: 1px solid rgba(226, 184, 96, 0.45);
  border-radius: 10px;
  background: rgba(4, 7, 12, 0.55);
}

.draw-bar .dock-nav {
  align-self: stretch;
  height: auto;
  min-height: 36px !important;
  border: 0;
  border-radius: 0 !important;
  background: rgba(226, 184, 96, 0.08);
}

.draw-bar .dock-nav[data-dir="-1"] {
  border-right: 1px solid rgba(226, 184, 96, 0.28);
  border-radius: 9px 0 0 9px !important;
}

.draw-bar .dock-nav[data-dir="1"] {
  border-left: 1px solid rgba(226, 184, 96, 0.28);
  border-radius: 0 9px 9px 0 !important;
}

.draw-bar .choice {
  flex: 0 1 auto;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: repeat(6, max-content);
  grid-auto-flow: row;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
}

.draw-bar .choice::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.draw-bar .choice button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  border-right: 1px solid rgba(226, 184, 96, 0.28);
  border-bottom: 1px solid rgba(226, 184, 96, 0.28);
  background: transparent;
  color: var(--hero-gold);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  touch-action: manipulation;
  pointer-events: auto;
}

.draw-bar .choice button:nth-child(6n) {
  border-right: 0;
}

.draw-bar .choice button:nth-child(n + 7) {
  border-bottom: 0;
}

.draw-bar .choice button svg {
  flex: 0 0 auto;
  display: block;
}

.draw-bar .choice button.is-on {
  background: var(--hero-gold);
  color: var(--ink);
}

.draw-bar .choice button.is-on svg [stroke="#061018"],
.draw-bar .choice button.is-on svg circle[stroke="#061018"] {
  stroke: var(--ink);
}

#draw-clear {
  flex: 0 0 auto;
  align-self: stretch;
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 140, 140, 0.45);
  background: rgba(80, 18, 18, 0.55);
  color: #ffd0d0;
  font-size: 0.82rem;
  touch-action: manipulation;
  pointer-events: auto;
}

#draw-close,
.draw-bar .draw-x {
  position: static;
  flex: 0 0 auto;
  align-self: stretch;
  width: 36px;
  height: auto;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(226, 184, 96, 0.4);
  background: rgba(4, 7, 12, 0.55);
  color: var(--hero-gold);
  font-size: 18px;
  line-height: 1;
  touch-action: manipulation;
  pointer-events: auto;
}

@media (max-width: 720px) {
  .draw-bar .dock-strip {
    max-width: min(82vw, 420px);
  }

  .draw-bar .choice {
    grid-template-columns: repeat(6, minmax(40px, max-content));
  }

  .draw-bar .choice button {
    min-width: 40px;
    padding: 0 8px;
  }

  .draw-bar .choice button span {
    display: none;
  }

  #draw-clear {
    padding: 0 10px;
    font-size: 0.75rem;
  }
}

#pitch {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  background:
    repeating-linear-gradient(
      90deg,
      #127a3a 0 7.5%,
      #0e6c33 7.5% 15%
    );
}

.mark {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.mark.half {
  left: 50%;
  top: 0;
  width: 0;
  height: 100%;
}

.mark.circle {
  left: 50%;
  top: 50%;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.mark.box {
  top: 20%;
  width: 16%;
  height: 60%;
}

.mark.box.left { left: 0; border-left: 0; }
.mark.box.right { right: 0; border-right: 0; }

.mark.small {
  top: 32%;
  width: 7%;
  height: 36%;
}

.mark.small.left { left: 0; border-left: 0; }
.mark.small.right { right: 0; border-right: 0; }

.mark.goal {
  top: 38%;
  width: 2%;
  height: 24%;
  background: rgba(255, 255, 255, 0.2);
}

.mark.goal.left { left: 0; border-left: 0; }
.mark.goal.right { right: 0; border-right: 0; }

#pitch-ball,
.pitch-ball,
.token {
  position: absolute;
  transform: translate(-50%, -50%);
}

#pitch-balls {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

#pitch-ball,
.pitch-ball {
  width: calc(2.6% * var(--ball-s, 1));
  min-width: calc(18px * var(--ball-s, 1));
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  z-index: 6;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  background:
    radial-gradient(circle at 35% 35%, #fff 0 28%, #111 30% 42%, #fff 44% 70%, #111 72% 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

#pitch-ball::before,
.pitch-ball::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
}

#pitch-ball.dragging,
.pitch-ball.dragging {
  z-index: 7;
  cursor: grabbing;
}

#ball-park {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: grab;
  background:
    radial-gradient(circle at 35% 35%, #fff 0 28%, #111 30% 42%, #fff 44% 70%, #111 72% 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

#pitch-replay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

#pitch-replay .token,
#pitch-replay .pitch-ball {
  pointer-events: none;
}

.token {
  width: 5.2%;
  aspect-ratio: 1;
  height: auto;
  z-index: 3;
  container-type: inline-size;
  touch-action: none;
}

.token .num {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 46cqi;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
}

.token .disc {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.token.red .disc { background: var(--red); }
.token.blue .disc { background: var(--blue); }
.token.yellow .disc { background: var(--bib-yellow); }
.token.green .disc { background: var(--bib-green); }
.token.orange .disc { background: var(--bib-orange); }
.token.white .disc {
  background: var(--bib-white);
  border-color: var(--bib-ink);
}

.token.yellow .num,
.token.white .num {
  color: var(--bib-ink);
  text-shadow: none;
}

.token.mine {
  z-index: 4;
}

.token.mine .disc {
  border-color: #fff4d2;
  box-shadow:
    0 0 0 18cqi var(--hero-gold),
    0 0 0 24cqi rgba(28, 16, 0, 0.9);
}

.token.movable {
  cursor: grab;
}

.token.dragging {
  z-index: 5;
  cursor: grabbing;
}

#pitch-view.locked .token,
#pitch-view.locked #pitch-ball,
#pitch-view.locked .pitch-ball {
  cursor: default;
}

#shape-controls {
  display: contents;
}

.shape-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

body:not(.is-coach) .shape-tools {
  width: auto;
}

.shape-tools > #pitch-full {
  flex: 0 0 40px;
}

.shape-tools > #shape-controls,
.shape-tools .shape-line {
  flex: 1 1 auto;
  min-width: 0;
}

.shape-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.shape-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.shape-actions > button {
  border-radius: 999px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  background: transparent;
  color: var(--hero-gold);
  font-weight: 700;
}

.shape-actions > button:hover {
  border-color: var(--hero-gold);
  background: rgba(226, 184, 96, 0.12);
}

.shape-bar label {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  gap: 0;
}

.shape-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#shape-block,
#shape-form {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 4px 16px 4px 8px;
  font-size: 15px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23eef3f9' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 8px 5px;
}

.shape-color-wrap {
  position: relative;
  flex: 0 0 40px;
}

#shape-color-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
}

.shape-color-swatch {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

#shape-color-btn.red .shape-color-swatch { background: #b42323; }
#shape-color-btn.blue .shape-color-swatch { background: #1d4e9e; }
#shape-color-btn.yellow .shape-color-swatch { background: #f0c400; }
#shape-color-btn.green .shape-color-swatch { background: #2fbf5a; }
#shape-color-btn.orange .shape-color-swatch { background: #ef7a1a; }
#shape-color-btn.white .shape-color-swatch { background: #f4f7fb; }

.shape-color-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 14;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: min(72vw, 220px);
  padding: 8px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.shape-color-option {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid transparent;
  background: transparent;
  display: grid;
  place-items: center;
}

.shape-color-option::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.shape-color-option.red::before { background: #b42323; }
.shape-color-option.blue::before { background: #1d4e9e; }
.shape-color-option.yellow::before { background: #f0c400; }
.shape-color-option.green::before { background: #2fbf5a; }
.shape-color-option.orange::before { background: #ef7a1a; }
.shape-color-option.white::before { background: #f4f7fb; }

.shape-color-option.is-on {
  border-color: var(--hero-gold);
}

.shape-line .shape-color-wrap { flex: 0 0 40px; }
.shape-line label:nth-of-type(1) { flex: 1.1 1 5rem; }
.shape-line label:nth-of-type(2) { flex: 0 0 0; width: 0; overflow: hidden; }

#pitch-full,
#shape-apply,
#shape-add,
#shape-clear {
  position: relative;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  flex: 0 0 40px;
}

#pitch-full {
  display: grid;
  place-items: center;
}

#pitch-full::after {
  content: attr(title);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  padding: 4px 8px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  border-radius: 8px;
  background: #121820;
  color: var(--hero-gold);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

#pitch-full:hover::after,
#pitch-full:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

#pitch-full svg {
  display: block;
}

.shape-clear-wrap {
  position: relative;
  flex: 0 0 40px;
}

#shape-apply::after,
#shape-add::after,
#shape-clear::after {
  content: attr(title);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  padding: 4px 8px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  border-radius: 8px;
  background: #121820;
  color: var(--hero-gold);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

#shape-apply:hover::after,
#shape-apply:focus-visible::after,
#shape-add:hover::after,
#shape-add:focus-visible::after,
#shape-clear:hover::after,
#shape-clear:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.shape-clear-wrap.is-open #shape-clear::after {
  opacity: 0;
  visibility: hidden;
}

#shape-apply svg,
#shape-add svg,
#shape-clear svg {
  display: block;
}

.shape-clear-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 14;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: min(72vw, 280px);
  padding: 8px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.shape-clear-menu .roster-clear-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.shape-clear-menu .roster-clear-btn .shape-clear-pin {
  display: block;
  width: 14px;
  height: 14px;
  margin-bottom: 1px;
}

.shape-clear-menu .roster-clear-btn .shape-clear-bin {
  display: block;
  width: 13px;
  height: 13px;
}

#pitch-wrap:fullscreen .shape-bar label,
#pitch-wrap:-webkit-full-screen .shape-bar label {
  flex: 0 0 auto;
  width: max-content;
}

#pitch-wrap:fullscreen .shape-line,
#pitch-wrap:-webkit-full-screen .shape-line {
  width: max-content;
  max-width: 100%;
}

#pitch-wrap:fullscreen #shape-block,
#pitch-wrap:-webkit-full-screen #shape-block,
#pitch-wrap:fullscreen #shape-form,
#pitch-wrap:-webkit-full-screen #shape-form {
  width: auto;
  padding: 0 16px 0 8px;
  font-size: 15px;
  background-position: right 5px center;
}

#pitch-wrap:fullscreen #shape-form,
#pitch-wrap:-webkit-full-screen #shape-form { width: 5.4rem; }

#pitch-wrap:fullscreen #pitch-full,
#pitch-wrap:-webkit-full-screen #pitch-full,
#pitch-wrap:fullscreen #shape-apply,
#pitch-wrap:-webkit-full-screen #shape-apply,
#pitch-wrap:fullscreen #shape-add,
#pitch-wrap:-webkit-full-screen #shape-add,
#pitch-wrap:fullscreen #shape-clear,
#pitch-wrap:-webkit-full-screen #shape-clear,
#pitch-wrap:fullscreen #shape-color-btn,
#pitch-wrap:-webkit-full-screen #shape-color-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

#pitch-wrap:fullscreen .shape-color-wrap,
#pitch-wrap:-webkit-full-screen .shape-color-wrap,
#pitch-wrap:fullscreen .shape-clear-wrap,
#pitch-wrap:-webkit-full-screen .shape-clear-wrap {
  flex-basis: 34px;
}

#pitch-wrap:fullscreen .shape-color-swatch,
#pitch-wrap:-webkit-full-screen .shape-color-swatch {
  width: 18px;
  height: 18px;
}

#pitch-wrap:fullscreen .shape-clear-menu,
#pitch-wrap:-webkit-full-screen .shape-clear-menu,
#pitch-wrap:fullscreen .shape-color-menu,
#pitch-wrap:-webkit-full-screen .shape-color-menu {
  top: calc(100% + 8px);
  bottom: auto;
}

#pitch-wrap:fullscreen .shape-clear-menu,
#pitch-wrap:-webkit-full-screen .shape-clear-menu {
  right: 0;
  left: auto;
}

#pitch-wrap:fullscreen .shape-color-menu,
#pitch-wrap:-webkit-full-screen .shape-color-menu {
  left: 0;
  right: auto;
}

.choice {
  display: flex;
}

.choice button {
  min-height: 40px;
  border-radius: 0;
  padding: 8px 12px;
}

.choice button:first-child {
  border-radius: 12px 0 0 12px;
}

.choice button:last-child {
  border-radius: 0 12px 12px 0;
}

.choice button + button {
  margin-left: -2px;
}

#take-rec.is-on,
#frame-rec.is-on {
  background: #9d1c1c;
  color: #fff;
  border-color: #9d1c1c;
}

#draw-toggle.is-on {
  background: var(--hero-gold);
  color: var(--ink);
  border-color: var(--hero-gold);
}

.take-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.take-row .take-name {
  flex: 1 1 auto;
  min-width: 0;
}

.take-row .take-name strong,
.take-row .take-name .hint {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.take-row .pair {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.take-row button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.take-row button.take-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.take-row button.take-action svg {
  display: block;
  flex: 0 0 auto;
}

.take-row button.icon-remove {
  width: 32px;
  min-width: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.take-row button.icon-remove svg {
  display: block;
}

@media (max-width: 720px) {
  .take-row .pair {
    gap: 4px;
  }

  .take-row button.take-action {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
  }

  .take-row button.take-action .take-action-label {
    display: none;
  }
}

.take-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}

.take-name .hint {
  margin: 0;
}

.take-rename {
  display: flex;
  flex: 1 1 220px;
  gap: 8px;
  align-items: center;
}

.take-rename input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
}

body.in-intro {
  background: #05070b;
}

body.in-intro main {
  width: min(1120px, calc(100% - 24px));
  padding: 12px 0 64px;
}

body.in-intro .site-header {
  background: rgba(232, 238, 244, 0.92);
  backdrop-filter: blur(8px);
}

#intro-login {
  min-height: 36px;
  padding: 0 16px;
  background: #102033;
  color: var(--hero-gold);
  font-size: 0.95rem;
}

.intro h2 {
  font-size: clamp(1.55rem, 3.6vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.intro-kicker {
  margin: 0 0 8px;
  color: var(--hero-gold);
  font-family: Oswald, Impact, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-brand {
  margin: 0 0 8px !important;
  color: var(--hero-gold) !important;
  font-family: Oswald, Impact, sans-serif;
  font-size: clamp(1.7rem, 5vw, 2.8rem) !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.intro-cta {
  margin-top: 18px;
  background: var(--hero-gold);
  color: var(--ink);
  border-color: var(--hero-gold);
}

.intro-hero {
  position: relative;
  min-height: min(78vh, 680px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(226, 184, 96, 0.35);
}

.intro-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.intro-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 36rem;
  padding: 36px 24px 30px;
  background: linear-gradient(180deg, transparent, rgba(5, 7, 11, 0.78) 22%, rgba(5, 7, 11, 0.96));
}

.intro-hero-copy h2 {
  color: #fff;
  font-size: clamp(1.7rem, 4.4vw, 2.55rem);
}

.intro-hero-copy p:not(.intro-brand) {
  color: #d7e0ea;
  max-width: 40ch;
}

.intro-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: center;
  margin-top: 42px;
}

.intro-feature.is-flip {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.intro-feature.is-flip .intro-feature-copy { order: 2; }
.intro-feature.is-flip .intro-shot { order: 1; }

.intro-feature.is-voice {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(226, 184, 96, 0.3);
  background:
    radial-gradient(circle at 85% 0, rgba(226, 184, 96, 0.14), transparent 36%),
    linear-gradient(180deg, #16120c, #0b0a08);
}

.intro-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.intro-list li {
  position: relative;
  margin-top: 10px;
  padding-left: 18px;
  color: #d5deea;
}

.intro-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hero-gold);
}

.intro-shot {
  position: relative;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(226, 184, 96, 0.28);
  background: #0c1218;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.intro-shot > img {
  display: block;
  width: 100%;
  height: auto;
}

.demo-live-mini {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: min(52%, 280px);
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--hero-gold);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.demo-pitch.is-match .demo-token {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  font-size: 0.58rem;
}

.demo-pitch.is-match .demo-ball {
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-width: 1px;
}

.demo-token.m1 { animation: match1 7s ease-in-out infinite; }
.demo-token.m2 { animation: match2 7s ease-in-out infinite; }
.demo-token.m3 { animation: match3 7s ease-in-out infinite; }
.demo-token.m4 { animation: match4 7s ease-in-out infinite; }
.demo-token.m5 { animation: match5 7s ease-in-out infinite; }
.demo-token.m6 { animation: match6 7s ease-in-out infinite; }
.demo-token.m7 { animation: match7 7s ease-in-out infinite; }
.demo-token.m8 { animation: match8 7s ease-in-out infinite; }
.demo-token.m9 { animation: match9 7s ease-in-out infinite; }
.demo-token.m10 { animation: match10 7s ease-in-out infinite; }
.demo-ball.bm { animation: match-ball 7s ease-in-out infinite; }

.demo-pitch.is-frames .demo-token {
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  font-size: 0.7rem;
}

.demo-arrow {
  position: absolute;
  left: 34%;
  top: 48%;
  width: 22%;
  height: 3px;
  background: var(--hero-gold);
  transform: rotate(-12deg);
  transform-origin: left center;
  z-index: 1;
  animation: frames-arrow 6s ease-in-out infinite;
}

.demo-arrow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -5px;
  border-left: 10px solid var(--hero-gold);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.demo-token.f1 { animation: fr1 6s ease-in-out infinite; }
.demo-token.f2 { animation: fr2 6s ease-in-out infinite; }
.demo-token.f3 { animation: fr3 6s ease-in-out infinite; }
.demo-token.f4 { animation: fr4 6s ease-in-out infinite; }
.demo-token.f5 { animation: fr5 6s ease-in-out infinite; }
.demo-token.f6 { animation: fr6 6s ease-in-out infinite; }
.demo-token.f7 { animation: fr7 6s ease-in-out infinite; }
.demo-token.f8 { animation: fr8 6s ease-in-out infinite; }
.demo-token.f9 { animation: fr9 6s ease-in-out infinite; }
.demo-token.f10 { animation: fr10 6s ease-in-out infinite; }
.demo-token.f11 { animation: fr11 6s ease-in-out infinite; }
.demo-token.f12 { animation: fr12 6s ease-in-out infinite; }
.demo-token.f13 { animation: fr13 6s ease-in-out infinite; }
.demo-token.f14 { animation: fr14 6s ease-in-out infinite; }
.demo-ball.bf { animation: fr-ball 6s ease-in-out infinite; }

.demo-draw-tools {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  max-width: none;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(226, 184, 96, 0.55);
  background: rgba(6, 10, 16, 0.9);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}

.demo-draw-tools span {
  flex: 1 1 0;
  padding: 10px 6px;
  border: 0;
  border-radius: 0;
  border-right: 1px solid rgba(226, 184, 96, 0.28);
  background: transparent;
  color: var(--hero-gold);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  animation: tool-pop 4.8s ease-in-out infinite;
}

.demo-draw-tools span:last-child {
  border-right: 0;
}

.demo-draw-tools span.is-on {
  background: var(--hero-gold);
  color: var(--ink);
}

.demo-draw-tools span:nth-child(2) { animation-delay: 0.6s; }
.demo-draw-tools span:nth-child(3) { animation-delay: 1.2s; }
.demo-draw-tools span:nth-child(4) { animation-delay: 1.8s; }
.demo-draw-tools span:nth-child(5) { animation-delay: 2.4s; }
.demo-draw-tools span:nth-child(6) { animation-delay: 3s; }

.demo-mic-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(226, 184, 96, 0.35);
}

.demo-mic-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 0 5px rgba(255, 107, 107, 0.18);
  animation: rec-blink 1.2s steps(2, end) infinite;
}

.film-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
}

.film-wave i {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--hero-gold);
  animation: wave 1.1s ease-in-out infinite;
}

.film-wave i:nth-child(odd) { animation-delay: 0.12s; }
.film-wave i:nth-child(3n) { animation-delay: 0.28s; }

.demo-pitch {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(226, 184, 96, 0.12), transparent 40%),
    linear-gradient(180deg, #1a3a22, #0d1c12 68%);
  border: 1px solid rgba(238, 243, 249, 0.12);
  border-radius: 18px;
}

.demo-pitch.is-board { height: 300px; }
.demo-pitch.is-mini { height: 100%; border: 0; border-radius: 0; }

.pitch-lines {
  width: 100%;
  height: 100%;
  color: rgba(238, 243, 249, 0.55);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
}

.demo-token,
.demo-ball,
.demo-cone,
.demo-path,
.demo-zone,
.demo-hand {
  position: absolute;
  z-index: 1;
}

.demo-token {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.demo-pitch.is-mini .demo-token {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  font-size: 0.55rem;
}

.demo-token.red { background: #b42323; }
.demo-token.blue { background: #1d4e9e; }
.demo-token.is-you { box-shadow: 0 0 0 3px var(--hero-gold), 0 8px 18px rgba(0, 0, 0, 0.35); }

.demo-ball {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #111;
  z-index: 2;
}

.demo-pitch.is-mini .demo-ball {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-width: 1px;
}

.demo-cone {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 14px solid #ef7a1a;
}

.demo-cone.c1 { left: 58%; top: 24%; }

.demo-path {
  left: 24%;
  top: 62%;
  width: 38%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hero-gold));
  transform: rotate(-16deg);
  transform-origin: left center;
  animation: path-draw 6.5s ease-in-out infinite;
}

.demo-zone {
  left: 56%;
  top: 28%;
  width: 18%;
  height: 28%;
  border: 2px solid rgba(226, 184, 96, 0.7);
  border-radius: 10px;
  background: rgba(226, 184, 96, 0.12);
  animation: zone-pulse 5s ease-in-out infinite;
}

.demo-hand {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50% 50% 40% 50%;
  background: #f0c8a0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
  animation: hand-drag 6.5s ease-in-out infinite;
  z-index: 4;
}

.demo-token.t1 { animation: tok1 6.5s ease-in-out infinite; }
.demo-token.t5 { animation: tok5 6.5s ease-in-out infinite; }
.demo-token.t7 { animation: tok7 5s ease-in-out infinite; }
.demo-token.t8 { animation: tok8 5s ease-in-out infinite; }
.demo-ball.b1 { animation: ball1 6.5s ease-in-out infinite; }
.demo-ball.b3 { animation: ball3 5s ease-in-out infinite; }

.demo-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 12px 12px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.95);
  border: 1px solid rgba(226, 184, 96, 0.35);
}

.demo-dock span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 184, 96, 0.35);
  color: var(--hero-gold);
  font-family: Oswald, Impact, sans-serif;
  animation: chip-on 5s ease-in-out infinite;
}

.demo-dock span:nth-child(2) { animation-delay: 1s; }
.demo-dock span:nth-child(3) { animation-delay: 2s; }
.demo-dock span:nth-child(4) { animation-delay: 3s; }
.demo-dock span:nth-child(5) { animation-delay: 4s; }
.demo-dock span.is-on {
  background: var(--hero-gold);
  color: #1a1208;
}

.demo-play {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 12px solid var(--hero-gold);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.intro-steps-row {
  margin-top: 48px;
  text-align: center;
}

.intro-steps-row > h2 {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.demo-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
  margin-top: 18px;
}

.flow-card {
  padding: 18px 14px;
  border-radius: 18px;
  border: 1px solid rgba(226, 184, 96, 0.28);
  background: #101820;
  text-align: center;
}

.flow-card strong {
  display: block;
  margin-top: 10px;
  font-family: Oswald, Impact, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.flow-card p {
  margin-top: 8px;
  font-size: 0.95rem;
}

.flow-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 16px;
  background: #17202a;
  position: relative;
}

.flow-icon.is-eye::before,
.flow-icon.is-eye::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.flow-icon.is-eye::before {
  width: 28px;
  height: 16px;
  border: 2px solid var(--hero-gold);
}

.flow-icon.is-eye::after {
  width: 8px;
  height: 8px;
  background: var(--hero-gold);
  animation: blink 3s ease-in-out infinite;
}

.flow-icon.is-phone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 30px;
  margin: -15px 0 0 -9px;
  border-radius: 4px;
  border: 2px solid #4aa3ff;
  animation: phone-tilt 2.4s ease-in-out infinite;
}

.flow-icon.is-boot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 26px;
  height: 12px;
  margin: -6px 0 0 -13px;
  border-radius: 4px 12px 6px 4px;
  background: #2fbf5a;
  animation: boot-kick 2.2s ease-in-out infinite;
}

.flow-arrow {
  width: 28px;
  height: 2px;
  align-self: center;
  background: var(--hero-gold);
  position: relative;
}

.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border-left: 8px solid var(--hero-gold);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.intro-close {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 22px;
  align-items: center;
  margin-top: 48px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(226, 184, 96, 0.32);
  background: linear-gradient(180deg, #16120c, #0b0a08);
}

.intro-close img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

.intro-close > div {
  text-align: left;
  padding: 8px 8px 8px 4px;
}

@keyframes match1 {
  0%, 100% { left: 10%; top: 50%; }
  50% { left: 14%; top: 48%; }
}
@keyframes match2 {
  0%, 100% { left: 22%; top: 28%; }
  50% { left: 30%; top: 24%; }
}
@keyframes match3 {
  0%, 100% { left: 24%; top: 72%; }
  50% { left: 34%; top: 66%; }
}
@keyframes match4 {
  0%, 100% { left: 36%; top: 42%; }
  50% { left: 48%; top: 36%; }
}
@keyframes match5 {
  0%, 100% { left: 42%; top: 58%; }
  50% { left: 56%; top: 48%; }
}
@keyframes match6 {
  0%, 100% { left: 90%; top: 50%; }
  50% { left: 86%; top: 52%; }
}
@keyframes match7 {
  0%, 100% { left: 76%; top: 26%; }
  50% { left: 68%; top: 32%; }
}
@keyframes match8 {
  0%, 100% { left: 74%; top: 74%; }
  50% { left: 64%; top: 68%; }
}
@keyframes match9 {
  0%, 100% { left: 64%; top: 40%; }
  50% { left: 54%; top: 44%; }
}
@keyframes match10 {
  0%, 100% { left: 60%; top: 60%; }
  50% { left: 48%; top: 54%; }
}
@keyframes match-ball {
  0%, 100% { left: 40%; top: 52%; }
  35% { left: 50%; top: 44%; }
  70% { left: 62%; top: 50%; }
}
@keyframes fr1 {
  0%, 100% { left: 8%; top: 50%; }
  50% { left: 12%; top: 48%; }
}
@keyframes fr2 {
  0%, 100% { left: 18%; top: 22%; }
  50% { left: 26%; top: 20%; }
}
@keyframes fr3 {
  0%, 100% { left: 18%; top: 78%; }
  50% { left: 28%; top: 72%; }
}
@keyframes fr4 {
  0%, 100% { left: 28%; top: 36%; }
  50% { left: 38%; top: 32%; }
}
@keyframes fr5 {
  0%, 100% { left: 30%; top: 64%; }
  50% { left: 42%; top: 58%; }
}
@keyframes fr6 {
  0%, 100% { left: 40%; top: 48%; }
  50% { left: 52%; top: 40%; }
}
@keyframes fr7 {
  0%, 100% { left: 38%; top: 58%; }
  50% { left: 54%; top: 52%; }
}
@keyframes fr8 {
  0%, 100% { left: 92%; top: 50%; }
  50% { left: 88%; top: 52%; }
}
@keyframes fr9 {
  0%, 100% { left: 82%; top: 22%; }
  50% { left: 74%; top: 28%; }
}
@keyframes fr10 {
  0%, 100% { left: 80%; top: 78%; }
  50% { left: 70%; top: 72%; }
}
@keyframes fr11 {
  0%, 100% { left: 70%; top: 34%; }
  50% { left: 60%; top: 38%; }
}
@keyframes fr12 {
  0%, 100% { left: 72%; top: 66%; }
  50% { left: 58%; top: 60%; }
}
@keyframes fr13 {
  0%, 100% { left: 62%; top: 46%; }
  50% { left: 50%; top: 50%; }
}
@keyframes fr14 {
  0%, 100% { left: 60%; top: 56%; }
  50% { left: 48%; top: 46%; }
}
@keyframes fr-ball {
  0%, 100% { left: 36%; top: 52%; }
  30% { left: 48%; top: 44%; }
  65% { left: 60%; top: 50%; }
}
@keyframes frames-arrow {
  0%, 100% { transform: rotate(-12deg) scaleX(0.45); opacity: 0.45; }
  50% { transform: rotate(-12deg) scaleX(1); opacity: 1; }
}
@keyframes tok1 {
  0%, 100% { left: 22%; top: 34%; }
  50% { left: 40%; top: 26%; }
}
@keyframes tok5 {
  0%, 100% { left: 80%; top: 66%; }
  50% { left: 66%; top: 56%; }
}
@keyframes tok7 {
  0%, 100% { left: 28%; top: 58%; }
  50% { left: 54%; top: 40%; }
}
@keyframes tok8 {
  0%, 100% { left: 72%; top: 36%; }
  50% { left: 58%; top: 52%; }
}
@keyframes ball1 {
  0%, 100% { left: 28%; top: 56%; }
  40% { left: 48%; top: 44%; }
  75% { left: 66%; top: 34%; }
}
@keyframes ball3 {
  0%, 100% { left: 32%; top: 60%; }
  50% { left: 58%; top: 42%; }
}
@keyframes hand-drag {
  0%, 100% { left: 22%; top: 34%; }
  50% { left: 40%; top: 26%; }
}
@keyframes path-draw {
  0%, 100% { transform: rotate(-16deg) scaleX(0.35); opacity: 0.4; }
  50% { transform: rotate(-16deg) scaleX(1); opacity: 1; }
}
@keyframes zone-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes tool-pop {
  0%, 70%, 100% { transform: scale(1); background: rgba(8, 10, 14, 0.82); }
  12% { transform: scale(1.06); background: rgba(226, 184, 96, 0.22); }
}
@keyframes blink {
  0%, 90%, 100% { opacity: 1; }
  95% { opacity: 0.15; }
}
@keyframes phone-tilt {
  0%, 100% { transform: translate(-50%, -50%) rotate(-6deg); }
  50% { transform: translate(-50%, -50%) rotate(8deg); }
}
@keyframes boot-kick {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 24px; }
}
@keyframes chip-on {
  0%, 14%, 100% { background: transparent; color: var(--hero-gold); }
  6% { background: var(--hero-gold); color: #1a1208; }
}

@media (max-width: 860px) {
  .intro-feature,
  .intro-feature.is-flip,
  .intro-close,
  .demo-flow {
    grid-template-columns: 1fr;
  }
  .intro-feature.is-flip .intro-feature-copy,
  .intro-feature.is-flip .intro-shot {
    order: 0;
  }
  .flow-arrow {
    width: 4px;
    height: 28px;
    margin: 0 auto;
  }
  .flow-arrow::after {
    right: -3px;
    top: auto;
    bottom: -1px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--hero-gold);
    border-bottom: 0;
  }
  .intro-hero {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .intro-hero-photo {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center 40%;
  }
  .intro-hero-copy {
    max-width: none;
    padding: 18px 16px 20px;
    background: #0a0e14;
  }
  .intro-hero-copy h2 {
    font-size: clamp(1.35rem, 6vw, 1.85rem);
  }
  .intro-shot {
    display: flex;
    flex-direction: column;
  }
  .demo-live-mini {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 180px;
    border-radius: 0;
    border-width: 0;
    border-top: 1px solid rgba(226, 184, 96, 0.35);
  }
  .intro-close > div { text-align: center; }
  .intro-close .intro-cta { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-token,
  .demo-ball,
  .demo-hand,
  .demo-path,
  .demo-zone,
  .demo-arrow,
  .demo-live-mini,
  .demo-draw-tools span,
  .demo-mic-dot,
  .film-wave i,
  .demo-dock span,
  .flow-icon.is-eye::after,
  .flow-icon.is-phone::before,
  .flow-icon.is-boot::before {
    animation: none !important;
  }
}
