/* dist/rugbyanimator/app/play.css
   Public play pages (/rugbyanimator/plays/...). Layered on top of session.css,
   which already defines the "Deep Pitch" tokens (--canvas, --surface, --green,
   …) — this file adds only the chrome those pages need and reuses those tokens
   rather than introducing a second palette. */

:root { --ball: #F2C53D; }

.ra-body { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- shared site header ---- */
.ra-sitehead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.ra-wordmark {
  color: var(--textPrimary); text-decoration: none;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.ra-sitenav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ra-sitenav a { color: var(--textDim); text-decoration: none; font-size: 14px; font-weight: 500; }
.ra-sitenav a:hover { color: var(--textPrimary); }
.ra-sitenav a[aria-current="page"] { color: var(--green); }
.ra-cta-sm {
  background: var(--green); color: var(--onGreen) !important;
  padding: 7px 14px; border-radius: 999px; font-weight: 700 !important;
}

/* ---- page shell ---- */
.ra-page { max-width: 680px; margin: 0 auto; padding: 22px 18px 48px; width: 100%; flex: 1; }

.ra-crumbs { font-size: 13px; color: var(--textFaint); margin-bottom: 14px; line-height: 1.6; }
.ra-crumbs a { color: var(--textDim); text-decoration: none; }
.ra-crumbs a:hover { color: var(--textPrimary); text-decoration: underline; }
.ra-crumbs .ra-sep { margin: 0 7px; opacity: 0.55; }

.ra-h1 { font-size: 30px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
.ra-desc { color: var(--textDim); font-size: 16px; line-height: 1.6; margin: 18px 0 0; }

/* ---- the animation ---- */
.ra-playermount {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; min-height: 200px;
}
.ra-loading-msg { color: var(--textFaint); text-align: center; padding: 72px 16px; margin: 0; font-size: 14px; }
.ra-playerfail { padding: 20px; color: var(--textDim); font-size: 14px; }

/* ---- chips ---- */
.ra-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ra-chip {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface2); color: var(--textDim);
  border: 1px solid var(--line); text-decoration: none;
}
a.ra-chip:hover { color: var(--textPrimary); border-color: var(--lineStrong); }
.ra-chip-cat { color: var(--textPrimary); }
.ra-chip-free { color: var(--green); border-color: rgba(91, 208, 138, 0.4); }
.ra-chip-pro { color: var(--textFaint); }

/* ---- calls to action ---- */
.ra-ctarow { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.ra-btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border-radius: 999px; font-size: 15px; font-weight: 700;
  text-decoration: none; box-sizing: border-box;
}
.ra-btn-primary { background: var(--green); color: var(--onGreen); }
.ra-btn-ghost { color: var(--textPrimary); border: 1px solid var(--lineStrong); }
.ra-btn:focus-visible, .ra-sitenav a:focus-visible, .ra-crumbs a:focus-visible {
  outline: 2px solid var(--green); outline-offset: 3px;
}

/* ---- search + category tabs ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ra-filterbar { margin: 26px 0 4px; }
.ra-searchwrap { display: block; }
.ra-search {
  width: 100%; box-sizing: border-box;
  background: var(--surface2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--textPrimary); font: inherit; font-size: 15px;
  padding: 12px 18px; -webkit-appearance: none; appearance: none;
}
.ra-search::placeholder { color: var(--textFaint); }
.ra-search:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(91, 208, 138, 0.18);
}
.ra-search::-webkit-search-cancel-button { filter: invert(0.7); }

.ra-tabs {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
}
.ra-tab {
  position: relative; padding: 8px 1px 11px;
  color: var(--textDim); text-decoration: none;
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
}
.ra-tab:hover { color: var(--textPrimary); }
.ra-tab.is-active { color: var(--textPrimary); }
.ra-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--green); border-radius: 2px;
}
.ra-tab:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

.ra-searchcount {
  margin: 12px 0 0; color: var(--textFaint); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ra-searchempty {
  margin: 22px 0 0; padding: 20px; text-align: center;
  color: var(--textDim); font-size: 14.5px;
  background: var(--surface); border: 1px dashed var(--lineStrong); border-radius: var(--radius);
}

/* ---- play lists ---- */
.ra-more, .ra-catsection { margin-top: 34px; }
.ra-more h2, .ra-catsection h2 { font-size: 18px; margin: 0 0 12px; }
.ra-catsection h2 a { color: var(--textPrimary); text-decoration: none; }
.ra-catsection h2 a:hover { text-decoration: underline; }
.ra-count {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; color: var(--textFaint); font-weight: 400; margin-left: 6px;
}
.ra-catblurb { color: var(--textDim); font-size: 14px; line-height: 1.55; margin: 0 0 14px; }

/* Tile grid, mirroring the iOS library. auto-fill keeps rows full at any width
   rather than stretching two tiles across a wide screen. */
.ra-playlist {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 460px) {
  .ra-playlist { grid-template-columns: minmax(0, 1fr); }
}
.ra-tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.ra-tile:hover { border-color: var(--lineStrong); transform: translateY(-2px); }
/* The anchor fills the tile so a grid-stretched tile has no dead strip at the
   bottom, and every tile in a row is clickable to the same depth. */
.ra-tile { display: flex; }
.ra-tile > a { display: flex; flex-direction: column; flex: 1; width: 100%; text-decoration: none; }

.ra-tile-thumb {
  position: relative; display: block;
  aspect-ratio: 5 / 4;              /* taller than the app's 4:3 — two per row
                                       leaves room, and it crops the pitch less */
  background: var(--surface2);
}
.ra-thumb { display: block; width: 100%; height: 100%; }

.ra-tile-badge, .ra-tile-lock {
  position: absolute; top: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(8, 41, 28, .78);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line);
}
.ra-tile-badge { left: 8px; color: var(--textPrimary); }
.ra-tile-lock { right: 8px; color: var(--ball, #F2C53D); }

/* Title and blurb get fixed line budgets rather than relying on
   -webkit-line-clamp, which does not clamp reliably here (display computed as
   flow-root, so the clamp was ignored and tiles came out uneven). Fixed heights
   make every tile identical, which is what makes the grid read as a grid. */
.ra-tile-title {
  display: block; padding: 11px 12px 0;
  color: var(--textPrimary); font-weight: 600; font-size: 14.5px; line-height: 19px;
  height: 49px;                     /* 11px padding + exactly two 19px lines */
  overflow: hidden;
}
.ra-tile-blurb {
  display: block; padding: 5px 12px 13px;
  color: var(--textDim); font-size: 12.5px; line-height: 18px;
  height: 54px;                     /* 5+13px padding + exactly two 18px lines */
  overflow: hidden;
}

.ra-othercats { margin-top: 40px; }
.ra-othercats h2 { font-size: 15px; margin: 0 0 10px; color: var(--textDim); }
.ra-othercats a { margin-right: 8px; }

/* ---- footer ---- */
.ra-pagefoot {
  border-top: 1px solid var(--line); margin-top: auto;
  padding: 20px 18px; display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: center; background: var(--surface);
}
.ra-pagefoot a { color: var(--textDim); text-decoration: none; font-size: 13px; }
.ra-pagefoot a:hover { color: var(--textPrimary); }

@media (max-width: 520px) {
  .ra-h1 { font-size: 25px; }
  .ra-sitehead { padding: 12px 14px; }
  .ra-sitenav { gap: 14px; }
  .ra-btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
