:root {
  color-scheme: light;
  --bg: #e8e8e5;
  --panel: rgba(247, 247, 244, 0.95);
  --panel-solid: #f8f7f3;
  --line: rgba(59, 57, 51, 0.14);
  --text: #25231f;
  --muted: #74716a;
  --accent: #a87924;
  --accent-2: #d5b267;
  --gold: #c49a45;
  --gold-soft: #efe3c5;
  --charcoal: #34312c;
  --ink: #fffdf8;
  --shadow: 0 22px 60px rgba(43, 41, 36, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(232, 232, 229, 0.97), rgba(246, 246, 243, 0.9) 46%, rgba(221, 221, 216, 0.96)),
    url("assets/australian-racing-hero.png") center / cover fixed;
  color: var(--text);
  overflow-x: hidden;
}

#wordfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.06;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 48px);
  display: grid;
  place-items: center;
}

.workspace {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  background: var(--panel);
  border: 1px solid rgba(168, 121, 36, 0.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 34px);
  position: relative;
  overflow: hidden;
}

.workspace::before {
  display: none;
}

.workspace > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  left: clamp(-14px, 0.5vw, 10px);
  top: clamp(10px, 2vw, 18px);
  width: min(82%, 900px);
  height: clamp(94px, 12vw, 136px);
  opacity: 0.46;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.82) 0 16%, transparent 16% 100%),
    repeating-linear-gradient(92deg, rgba(196, 154, 69, 0.48) 0 3px, transparent 3px 30px),
    repeating-linear-gradient(92deg, rgba(89, 84, 72, 0.2) 0 1px, transparent 1px 30px),
    linear-gradient(1deg, transparent 0 27%, rgba(255, 255, 255, 0.9) 27% 31%, transparent 31% 58%, rgba(196, 154, 69, 0.36) 58% 62%, transparent 62% 84%, rgba(255, 255, 255, 0.76) 84% 88%, transparent 88%),
    linear-gradient(176deg, rgba(236, 233, 224, 0.92), rgba(255, 255, 255, 0.24) 72%, transparent);
  background-size: 100% 100%, 34px 100%, 34px 100%, 100% 100%, 100% 100%;
  border-top: 1px solid rgba(196, 154, 69, 0.26);
  border-left: 1px solid rgba(196, 154, 69, 0.22);
  border-radius: 8px 3px 3px 8px;
  clip-path: polygon(0 2%, 100% 0, 94% 70%, 2% 98%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -18px 34px rgba(89, 84, 72, 0.08),
    0 18px 42px rgba(89, 84, 72, 0.08);
  -webkit-mask-image: linear-gradient(90deg, #000 0 58%, rgba(0, 0, 0, 0.58) 76%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0 58%, rgba(0, 0, 0, 0.58) 76%, transparent 100%);
  transform: perspective(640px) rotateY(-38deg) rotateX(5deg) skewY(-4deg) scaleX(1.08);
  transform-origin: left center;
  pointer-events: none;
}

.topbar::after {
  content: "";
  position: absolute;
  left: clamp(34px, 8vw, 116px);
  top: clamp(96px, 12vw, 142px);
  width: min(68%, 760px);
  height: 18px;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent, rgba(196, 154, 69, 0.42), transparent 72%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.58) 0 28px, transparent 28px 58px);
  filter: blur(0.5px);
  transform-origin: left center;
  animation: gateSpeedLines 1.25s ease-out 0.12s both;
  pointer-events: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.brand-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  min-height: clamp(92px, 11vw, 124px);
  position: relative;
  overflow: hidden;
}

.brand-lockup::before {
  content: "";
  position: absolute;
  left: clamp(-12px, 0.5vw, 12px);
  top: clamp(34px, 4.4vw, 50px);
  width: min(64%, 690px);
  height: clamp(52px, 6vw, 74px);
  opacity: 0.44;
  background:
    linear-gradient(104deg, rgba(255, 255, 255, 0.84) 0 8%, transparent 8% 100%),
    repeating-linear-gradient(93deg, rgba(62, 58, 51, 0.34) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(93deg, transparent 0 16px, rgba(196, 154, 69, 0.34) 16px 18px, transparent 18px 26px),
    linear-gradient(0deg, rgba(62, 58, 51, 0.28) 0 24%, transparent 24% 100%),
    linear-gradient(180deg, rgba(239, 227, 197, 0.36), rgba(255, 255, 255, 0.1));
  background-size: 100% 100%, 34px 100%, 34px 100%, 100% 100%, 100% 100%;
  clip-path: polygon(0 7%, 100% 0, 93% 100%, 0 88%);
  border-left: 1px solid rgba(62, 58, 51, 0.18);
  -webkit-mask-image: linear-gradient(90deg, #000 0 62%, rgba(0, 0, 0, 0.5) 80%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0 62%, rgba(0, 0, 0, 0.5) 80%, transparent 100%);
  transform: perspective(560px) rotateY(-43deg) rotateX(3deg) skewY(-4deg) scaleX(1.12);
  transform-origin: left center;
  filter: drop-shadow(14px 18px 16px rgba(43, 41, 36, 0.08));
  pointer-events: none;
}

.brand-lockup > div:last-child {
  width: min(760px, 100%);
  text-align: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 7px;
  color: #8d692a;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 6vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--charcoal);
  text-shadow: none;
}

.brand-title {
  position: relative;
  display: inline-block;
  min-height: 1.05em;
  width: max-content;
  max-width: 100%;
  overflow: visible;
}

.brand-title::after {
  display: none;
  content: none;
}

.brand-short,
.brand-long {
  transform-origin: left center;
  will-change: opacity, transform;
}

.brand-short {
  display: none;
}

.brand-long {
  display: inline-block;
  position: relative;
  color: var(--charcoal);
  background: linear-gradient(180deg, #24221d, #4b3d23 56%, #9b732b 78%, #d9b860);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 16px rgba(43, 41, 36, 0.12));
  text-shadow: 0 2px 0 rgba(196, 154, 69, 0.14);
  animation: titleSlideToCentre 1.85s cubic-bezier(0.22, 0.84, 0.24, 1) 0.15s both;
}

.brand-long::after {
  display: none;
  content: none;
}

h2 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.mode-tabs,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  border-color: rgba(168, 121, 36, 0.42);
}

.tab {
  min-width: 0;
  padding: 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
}

.tab.active,
.chip.active {
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c89a42);
  border-color: rgba(168, 121, 36, 0.2);
  box-shadow: 0 10px 22px rgba(138, 98, 31, 0.18);
}

.tool-panel {
  display: none;
  padding-top: 24px;
}

.tool-panel.active {
  display: block;
}

.search-row,
.builder {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 210px) auto;
  gap: 12px;
  align-items: end;
}

.builder {
  grid-template-columns: minmax(190px, 1fr) minmax(170px, 230px) minmax(190px, 1fr) auto;
}

.alliteration-scan {
  grid-template-columns: minmax(190px, 1fr) minmax(170px, 230px) auto;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

input,
select,
textarea {
  min-height: 46px;
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 154, 69, 0.18);
}

textarea {
  min-height: 132px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
  outline: none;
}

.primary {
  min-width: 122px;
  padding: 0 18px;
  color: #2c261a;
  border: 0;
  background: linear-gradient(135deg, #f0daa0, #c99c45);
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(138, 98, 31, 0.18);
}

.filters {
  margin: 18px 0 10px;
}

.chip {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 800;
}

.result-summary {
  min-height: 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.results-grid,
.tips-grid,
.agent-grid,
.horse-grid,
.jockey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.result-card,
.tip-card,
.agent-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  padding: 16px;
}

.tip-card {
  border-color: rgba(196, 154, 69, 0.26);
  box-shadow: 0 14px 28px rgba(43, 41, 36, 0.08);
}

.tip-card-featured {
  border-left: 5px solid var(--gold);
}

.tip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 154, 69, 0.52);
}

.tips-board {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(59, 57, 51, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 38px rgba(43, 41, 36, 0.08);
}

.tips-board-head,
.tips-board-row {
  display: grid;
  grid-template-columns: minmax(126px, 168px) minmax(0, 1fr);
}

.tips-board-head {
  color: #6a5b3e;
  background: rgba(239, 227, 197, 0.64);
  border-bottom: 1px solid rgba(59, 57, 51, 0.1);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tips-board-head div {
  padding: 9px 12px;
}

.tips-board-row {
  min-height: 78px;
  border-bottom: 1px solid rgba(59, 57, 51, 0.09);
}

.tips-board-row:last-child {
  border-bottom: 0;
}

.tips-race-cell {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  background: rgba(250, 248, 241, 0.74);
  border-right: 1px solid rgba(59, 57, 51, 0.09);
}

.tips-race-cell strong {
  color: var(--charcoal);
  font-size: 0.93rem;
  line-height: 1.15;
}

.tips-race-cell span {
  color: #8a661f;
  font-size: 0.8rem;
  font-weight: 950;
}

.tips-race-cell small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.tip-tile-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 9px 10px;
  scrollbar-color: rgba(196, 154, 69, 0.55) rgba(59, 57, 51, 0.08);
}

.tip-tile {
  flex: 0 0 208px;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 92px;
  padding: 9px;
  border: 1px solid rgba(59, 57, 51, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.tip-tile.featured {
  border-color: rgba(196, 154, 69, 0.54);
  background:
    linear-gradient(135deg, rgba(238, 203, 119, 0.2), rgba(255, 255, 255, 0.78) 48%),
    rgba(255, 255, 255, 0.76);
}

.tip-tile-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.tip-tile-top strong {
  margin: 0;
  color: var(--charcoal);
  font-size: 0.92rem;
  line-height: 1.16;
}

.tip-tile-top span {
  min-width: 30px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #35260b;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: 1px solid rgba(141, 105, 42, 0.25);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 950;
}

.tip-tile small {
  color: #8a661f;
  font-size: 0.72rem;
  font-weight: 900;
}

.tip-tile p {
  max-height: 2.65em;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.32;
}

.tip-tile a {
  color: #745214;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.tip-tile a:hover {
  text-decoration: underline;
}

.tips-board-empty {
  padding: 18px;
  border: 1px solid rgba(59, 57, 51, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.tips-board-empty strong {
  display: block;
  margin-bottom: 4px;
}

.tips-board-empty small {
  color: var(--muted);
  font-weight: 750;
}

.result-card strong,
.tip-card strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.result-card p,
.tip-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tips-search {
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px) minmax(130px, 180px) auto;
}

.agent-search {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px);
}

.mix-search {
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) minmax(150px, 210px) auto;
}

.jockey-search,
.trainer-search {
  grid-template-columns: minmax(190px, 1fr) minmax(170px, 230px) minmax(190px, 1fr) auto;
}

.alliteration-scan {
  grid-template-columns: minmax(190px, 1fr) minmax(170px, 230px) auto;
}

.tip-notice,
.agent-banner,
.scan-status {
  margin: 14px 0 10px;
  padding: 12px 14px;
  color: #4a3510;
  background: rgba(239, 227, 197, 0.76);
  border: 1px solid rgba(196, 154, 69, 0.24);
  border-radius: 8px;
  line-height: 1.42;
  font-size: 0.92rem;
}

.agent-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  color: #4b463d;
  background: rgba(246, 244, 238, 0.9);
  border-color: rgba(196, 154, 69, 0.22);
}

.agent-banner strong {
  color: var(--accent);
}

.scan-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 0;
  color: #4b463d;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(196, 154, 69, 0.2);
  font-size: 0.86rem;
  font-weight: 750;
}

.scan-status strong {
  color: var(--accent);
}

.tip-head,
.tip-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.tip-head {
  margin-bottom: 10px;
}

.race-label,
.signal {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 850;
}

.race-label {
  color: #5e4820;
  background: rgba(239, 227, 197, 0.74);
  border: 1px solid rgba(196, 154, 69, 0.24);
}

.signal {
  color: #23312d;
  background: #e8e6df;
}

.signal.best {
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  box-shadow: none;
}

.tip-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tip-meta a {
  color: #8d692a;
  font-weight: 800;
  text-decoration: none;
}

.agent-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.agent-board .tip-tile-strip {
  padding: 8px 10px;
}

.agent-board .tip-tile {
  flex: 1 1 100%;
  min-height: 70px;
}

.agent-board .agent-reasons {
  margin-top: 4px;
}

.agent-board .agent-reasons span {
  padding: 2px 7px;
  font-size: 0.68rem;
}

.agent-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  border-color: rgba(196, 154, 69, 0.2);
  background:
    linear-gradient(145deg, rgba(246, 244, 238, 0.86), rgba(255, 255, 255, 0.76) 42%),
    rgba(255, 255, 255, 0.76);
}

.agent-rank {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  border-radius: 8px;
  font-weight: 950;
}

.agent-main strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.16rem;
}

.agent-main p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.agent-score {
  min-width: 38px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #2c261a;
  background: linear-gradient(135deg, #e9cf8b, #b98229);
  font-size: 0.82rem;
  font-weight: 950;
}

.agent-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.agent-reasons span {
  color: #5e4820;
  background: rgba(239, 227, 197, 0.58);
  border: 1px solid rgba(196, 154, 69, 0.22);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.horse-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.horse-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(196, 154, 69, 0.24);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  padding: 14px;
}

.horse-card strong {
  font-size: 1rem;
}

.horse-card span {
  width: fit-content;
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 950;
}

.horse-card small {
  color: var(--muted);
  font-weight: 750;
}

.jockey-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.jockey-card {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(196, 154, 69, 0.24);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  padding: 15px;
}

.jockey-card strong {
  color: var(--charcoal);
  font-size: 1.08rem;
}

.jockey-card span {
  width: fit-content;
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 950;
}

.jockey-card small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.wrapup-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.wrapup-kicker {
  display: block;
  margin-bottom: 6px;
  color: #8d692a;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wrapup-hero h2,
.wrapup-columns h2,
.protocol-card h2 {
  margin: 0 0 10px;
  color: var(--charcoal);
}

.wrapup-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.dashboard-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.dashboard-strip h2 {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
}

.signal-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.signal-legend span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4f4a42;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(196, 154, 69, 0.18);
  border-radius: 999px;
  padding: 4px 9px 4px 5px;
  font-size: 0.76rem;
  font-weight: 850;
}

.mix-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.mix-stats .stat-card {
  padding: 11px 12px;
}

.mix-stats .stat-card strong {
  font-size: 1.35rem;
}

.dashboard-note {
  margin-bottom: 12px;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.dashboard-hero h2 {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-action {
  min-height: 38px;
  padding: 0 13px;
  color: #2c261a;
  background: rgba(239, 227, 197, 0.66);
  border-color: rgba(196, 154, 69, 0.26);
  font-weight: 850;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

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

.dashboard-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(196, 154, 69, 0.22);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 14px 28px rgba(43, 41, 36, 0.07);
}

.dashboard-panel h2 {
  margin: 0;
  color: var(--charcoal);
}

.dashboard-list {
  display: grid;
  gap: 8px;
}

.dashboard-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(59, 57, 51, 0.1);
  background: rgba(250, 249, 244, 0.78);
  border-radius: 8px;
}

.dashboard-item span,
.dashboard-item small {
  display: block;
  color: var(--muted);
  font-weight: 750;
}

.dashboard-item strong {
  display: block;
  margin: 3px 0;
  color: var(--text);
}

.dashboard-item b {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  border-radius: 8px;
  font-size: 0.88rem;
}

.dashboard-empty {
  grid-template-columns: 1fr;
}

.meeting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.race-board {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(196, 154, 69, 0.22);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(43, 41, 36, 0.08);
}

.race-board-head,
.race-board-row {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
}

.race-board-head {
  color: #6a5120;
  background: rgba(239, 227, 197, 0.62);
  border-bottom: 1px solid rgba(196, 154, 69, 0.22);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.race-board-head div,
.race-track-cell {
  padding: 11px 14px;
}

.race-board-row {
  min-height: 76px;
  border-bottom: 1px solid rgba(59, 57, 51, 0.1);
}

.race-board-row:last-child {
  border-bottom: 0;
}

.race-track-cell {
  display: grid;
  align-content: center;
  gap: 4px;
  background: rgba(250, 249, 244, 0.72);
  border-right: 1px solid rgba(59, 57, 51, 0.1);
}

.race-track-cell strong {
  color: var(--charcoal);
  font-size: 0.95rem;
}

.race-track-cell span,
.race-track-cell small {
  color: var(--muted);
  font-weight: 750;
}

.race-track-cell span {
  font-size: 0.78rem;
}

.race-track-cell small {
  font-size: 0.72rem;
  line-height: 1.25;
}

.race-tile-strip {
  display: flex;
  gap: 6px;
  align-items: stretch;
  overflow-x: auto;
  padding: 10px;
  scrollbar-color: rgba(196, 154, 69, 0.45) rgba(239, 227, 197, 0.42);
}

.race-tile {
  flex: 0 0 132px;
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 9px;
  text-align: left;
  color: var(--text);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 238, 233, 0.86));
  border: 1px solid rgba(59, 57, 51, 0.1);
  border-radius: 8px;
  box-shadow: none;
}

.race-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(196, 154, 69, 0.38);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 227, 197, 0.58));
}

.race-tile.selected {
  border-color: rgba(168, 121, 36, 0.64);
  background: linear-gradient(180deg, rgba(239, 227, 197, 0.96), rgba(255, 255, 255, 0.88));
  box-shadow: inset 0 0 0 2px rgba(196, 154, 69, 0.22);
}

.alliteration-board .race-tile.has-alliteration {
  border-color: rgba(196, 154, 69, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 227, 197, 0.44));
}

.jockey-board .race-tile.has-jockey {
  border-color: rgba(196, 154, 69, 0.38);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 227, 197, 0.48));
}

.trainer-board .race-tile.has-trainer {
  border-color: rgba(196, 154, 69, 0.38);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 227, 197, 0.48));
}

.race-tile-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: baseline;
}

.race-tile-top strong {
  color: #171510;
  font-size: 0.95rem;
}

.race-tile-top span,
.race-tile small {
  color: #4f4a42;
  font-size: 0.72rem;
  font-weight: 800;
}

.race-tile small {
  line-height: 1.2;
}

.race-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 18px;
}

.race-badge {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  color: #2c261a;
  background: rgba(239, 227, 197, 0.8);
  border: 1px solid rgba(196, 154, 69, 0.22);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 950;
}

.race-badge.tip {
  background: linear-gradient(135deg, #efd99d, #c99c45);
}

.race-badge.allit {
  color: #3f3420;
  background: #eee7d6;
}

.race-badge.solo {
  color: #fdf8eb;
  background: #3e3a33;
}

.race-badge.trainer {
  color: #2c261a;
  background: linear-gradient(135deg, #e9cf8b, #c49a45);
}

.race-signal-list {
  display: none;
  max-height: 4.8em;
  overflow: auto;
  color: #6f6558;
  font-size: 0.64rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}

.jockey-board .race-signal-list,
.trainer-board .race-signal-list {
  display: block;
}

.alliteration-board .race-signal-list {
  display: block;
}

.race-board-empty {
  display: grid;
  gap: 4px;
  padding: 18px;
}

.race-board-empty small {
  color: var(--muted);
  font-weight: 750;
}

.selected-meeting-board {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.selected-meeting-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(59, 57, 51, 0.1);
}

.selected-meeting-head h2 {
  margin: 2px 0 4px;
  color: var(--charcoal);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.selected-meeting-head small {
  color: var(--muted);
  font-weight: 780;
}

.selected-race-list {
  display: grid;
  gap: 8px;
}

.race-list-button {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  text-align: left;
  border-radius: 8px;
}

.race-list-button:hover {
  transform: none;
}

.race-number-box {
  width: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  color: #2c261a;
  background: rgba(239, 238, 233, 0.92);
  border: 1px solid rgba(59, 57, 51, 0.08);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 950;
}

.race-list-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.race-list-main strong {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.race-list-main small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.race-list-side {
  min-width: 74px;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.race-list-side > span:first-child {
  color: #2c261a;
  background: rgba(239, 238, 245, 0.88);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.race-detail {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(196, 154, 69, 0.24);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(43, 41, 36, 0.07);
}

.race-detail.is-empty {
  color: var(--muted);
  background: rgba(250, 249, 244, 0.76);
}

.race-detail.is-empty strong,
.race-detail.is-empty span {
  display: block;
}

.race-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(59, 57, 51, 0.1);
}

.race-detail-head h2 {
  margin: 0 0 5px;
  color: var(--charcoal);
  font-size: clamp(1.15rem, 2vw, 1.6rem);
}

.race-detail-head small {
  color: var(--muted);
  font-weight: 750;
}

.race-detail-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.race-detail-counts span {
  color: #5e4820;
  background: rgba(239, 227, 197, 0.68);
  border: 1px solid rgba(196, 154, 69, 0.22);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 900;
}

.race-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.race-detail-runners {
  grid-column: 1 / -1;
}

.race-detail-grid section {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(59, 57, 51, 0.1);
  background: rgba(250, 249, 244, 0.68);
  border-radius: 8px;
}

.race-detail-grid h3 {
  margin: 0;
  color: #5e4820;
  font-size: 0.84rem;
  text-transform: uppercase;
}

.race-detail-list {
  display: grid;
  gap: 7px;
  max-height: 240px;
  overflow: auto;
}

.race-detail-item {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(196, 154, 69, 0.14);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 8px;
}

.race-detail-item strong {
  color: var(--text);
  font-size: 0.9rem;
}

.runner-detail-item > div {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.runner-detail-item strong {
  overflow-wrap: anywhere;
}

.runner-code-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.runner-code {
  min-height: 19px;
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 999px;
  color: #2c261a;
  background: rgba(239, 227, 197, 0.86);
  border: 1px solid rgba(196, 154, 69, 0.24);
  font-size: 0.62rem;
  font-weight: 950;
  white-space: nowrap;
}

.runner-code.jockey {
  color: #fffaf0;
  background: #3e3a33;
}

.runner-code.trainer,
.runner-code.tip {
  background: linear-gradient(135deg, #efd99d, #c99c45);
}

.runner-code.allit {
  background: #eee7d6;
}

.race-detail-item small,
.race-detail-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.meeting-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(196, 154, 69, 0.22);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 14px 28px rgba(43, 41, 36, 0.08);
}

.meeting-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.meeting-head strong {
  display: block;
  margin-top: 8px;
  color: var(--charcoal);
  font-size: 1.24rem;
}

.meeting-count {
  min-width: 74px;
  text-align: center;
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.meeting-meta,
.meeting-stats,
.meeting-alliteration {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meeting-meta span,
.meeting-stats span,
.meeting-alliteration span {
  color: #5e4820;
  background: rgba(239, 227, 197, 0.54);
  border: 1px solid rgba(196, 154, 69, 0.18);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.meeting-stats span {
  color: #4a3510;
  background: rgba(255, 250, 239, 0.78);
  border-color: rgba(196, 154, 69, 0.24);
}

.race-list {
  display: grid;
  gap: 8px;
}

.race-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(59, 57, 51, 0.1);
  background: rgba(250, 249, 244, 0.76);
  border-radius: 8px;
}

.race-row span {
  grid-row: span 2;
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  border-radius: 8px;
  padding: 6px 7px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 900;
}

.race-row strong {
  color: var(--text);
  font-size: 0.88rem;
}

.race-row small {
  color: var(--muted);
  font-weight: 750;
}

.results-entry {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(196, 154, 69, 0.2);
  background: rgba(246, 244, 238, 0.76);
  border-radius: 8px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-actions button {
  min-width: 140px;
  padding: 0 16px;
  font-weight: 850;
}

.stat-card,
.wrapup-card,
.wrapup-empty,
.protocol-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  padding: 14px;
}

.stat-card strong {
  display: block;
  color: #8d692a;
  font-size: 1.8rem;
  line-height: 1;
}

.stat-card span,
.wrapup-card small,
.wrapup-empty small {
  color: var(--muted);
  font-weight: 750;
}

.wrapup-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.wrapup-grid {
  display: grid;
  gap: 10px;
}

.wrapup-card {
  display: grid;
  gap: 7px;
}

.wrapup-card span {
  width: fit-content;
  color: #2c261a;
  background: linear-gradient(135deg, #efd99d, #c99c45);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.wrapup-card strong,
.wrapup-empty strong {
  color: var(--text);
}

.protocol-card {
  margin-top: 16px;
}

.protocol-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tag {
  color: #5e4820;
  background: rgba(239, 227, 197, 0.58);
  border: 1px solid rgba(196, 154, 69, 0.22);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 800;
}

@keyframes shine {
  0%,
  62% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

@keyframes titleSlideToCentre {
  0% {
    opacity: 0;
    transform: translateX(clamp(-420px, -42vw, -128px));
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes barrierPop {
  0% {
    opacity: 0;
    transform: translateX(-18px) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes gateSpeedLines {
  0% {
    opacity: 0;
    transform: translateX(-42px) scaleX(0.16);
  }

  24% {
    opacity: 0.68;
    transform: translateX(70px) scaleX(0.78);
  }

  70% {
    opacity: 0.28;
    transform: translateX(188px) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: translateX(260px) scaleX(0.36);
  }
}

@keyframes titleTrail {
  0%,
  15% {
    opacity: 0;
    transform: translateY(-50%) translateX(-80px) scaleX(0.18);
  }

  42% {
    opacity: 0.78;
    transform: translateY(-50%) translateX(18px) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(180px) scaleX(0.42);
  }
}

@keyframes landingDust {
  0%,
  58% {
    opacity: 0;
    transform: translateX(-34px) scaleX(0.32);
  }

  76% {
    opacity: 0.78;
    transform: translateX(4px) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: translateX(20px) scaleX(0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-short {
    display: none;
  }

  .brand-long {
    opacity: 1;
    animation: none;
    transform: none;
  }

  .topbar::after,
  .brand-title::after,
  .brand-long::after {
    animation: none;
  }

  .brand-title::after {
    display: none;
  }
}

@media (max-width: 820px) {
  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-strip {
    display: grid;
    align-items: start;
  }

  .signal-legend {
    justify-content: start;
  }

  .wrapup-hero,
  .dashboard-hero,
  .wrapup-columns {
    display: grid;
  }

  .wrapup-stats,
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .search-row,
  .builder,
  .alliteration-scan,
  .jockey-search,
  .trainer-search,
  .mix-search {
    grid-template-columns: 1fr;
  }

  .mix-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab {
    width: 100%;
  }

  .primary {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .mix-stats {
    grid-template-columns: 1fr;
  }

  .meeting-grid {
    grid-template-columns: 1fr;
  }

  .race-board-head {
    display: none;
  }

  .tips-board-head {
    display: none;
  }

  .race-board-row {
    grid-template-columns: 1fr;
  }

  .tips-board-row {
    grid-template-columns: 1fr;
  }

  .race-track-cell {
    border-right: 0;
    border-bottom: 1px solid rgba(59, 57, 51, 0.1);
  }

  .tips-race-cell {
    border-right: 0;
    border-bottom: 1px solid rgba(59, 57, 51, 0.1);
  }

  .race-tile {
    flex-basis: 168px;
    min-height: 128px;
  }

  .race-list-button {
    min-height: 78px;
    grid-template-columns: 50px minmax(0, 1fr);
    align-content: center;
  }

  .race-list-side {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
  }

  .race-number-box {
    width: 44px;
    min-height: 44px;
  }

  .race-tile-top {
    flex-wrap: wrap;
  }

  .race-tile small {
    overflow-wrap: anywhere;
  }

  .race-signal-list {
    max-height: none;
    overflow: visible;
  }

  .tip-tile {
    flex-basis: 218px;
  }

  .race-detail-head {
    display: grid;
  }

  .race-detail-counts {
    justify-content: start;
  }

  .race-detail-grid {
    grid-template-columns: 1fr;
  }

  .runner-detail-item > div {
    display: grid;
  }

  .runner-code-list {
    justify-content: start;
  }

  .brand-lockup {
    align-items: start;
  }

  .brand-lockup > div:last-child {
    padding-left: 0;
    text-align: center;
  }

  .brand-title {
    max-width: 100%;
  }
}
