/* World Gym WA reel portal. Brand values: brand/brand.json + brand/BRAND-NOTES.md. Phone first. */
@font-face { font-family: "Bevan"; src: url("assets/fonts/Bevan-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Arimo"; src: url("assets/fonts/Arimo-VF.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --red: #C41230;      /* brand primary */
  --dark: #1A1A1A;     /* brand dark: text, dark panels */
  --grey: #C7C7C7;     /* accent grey */
  --light: #F5F5F5;    /* light background */
  --rule: #D9D9D9;     /* rules / borders */
  --muted: #828282;    /* muted (large bold text only, for contrast) */
  --white: #FFFFFF;
  --green: #1E9E4A;    /* success tick: UI only, not a brand colour */
  --radius: 14px;
  --tap: 56px;
  --head: "Bevan", "Rockwell", Georgia, serif;
  --body: "Arimo", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--light); color: var(--dark);
  font-family: var(--body); font-size: 18px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--dark); outline-offset: 3px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; }
.brandbar {
  background: var(--red); color: var(--white);
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.logo-link { display: flex; align-items: center; min-height: 44px; }
.logo { height: 30px; width: auto; display: block; }
.brandbar-title { font-family: var(--head); font-size: 20px; margin-left: auto; letter-spacing: .5px; }
.steps {
  background: var(--dark); color: var(--grey);
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 17px; font-weight: 700;
}
.step { padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.step b {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 4px;
  border-radius: 50%; border: 2px solid currentColor; font-size: 14px;
}
.step.active { background: var(--red); color: var(--white); }
.step.done { color: var(--white); }
.step.done b { background: var(--green); border-color: var(--green); color: var(--white); }
.step-sep { color: var(--grey); }

/* layout */
main { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(40px + env(safe-area-inset-bottom)); outline: none; }
h1 { font-family: var(--head); font-weight: 400; font-size: 28px; line-height: 1.15; margin: 4px 0 16px; }
h2 { font-family: var(--head); font-weight: 400; font-size: 21px; margin: 28px 0 10px; }
p { margin: 0 0 12px; }
.lead { font-size: 19px; }
.card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 700; font-size: 19px; margin-bottom: 8px; }

/* big controls */
.select {
  width: 100%; min-height: 64px; padding: 0 48px 0 16px; border-radius: var(--radius);
  border: 2px solid var(--dark); background: var(--white); font-size: 20px; font-weight: 700;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dark) 50%), linear-gradient(135deg, var(--dark) 50%, transparent 50%);
  background-position: calc(100% - 26px) 50%, calc(100% - 18px) 50%;
  background-size: 8px 8px; background-repeat: no-repeat;
}
.select:disabled { opacity: 1; background-color: var(--light); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--tap); padding: 12px 20px; border-radius: var(--radius);
  border: 2px solid var(--dark); background: var(--white); color: var(--dark);
  font-weight: 700; font-size: 20px; text-decoration: none; text-align: center;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { background: var(--rule); border-color: var(--rule); color: var(--dark); cursor: not-allowed; opacity: .75; }
.btn-primary { background: var(--red); border-color: var(--red); color: var(--white); min-height: 72px; font-size: 24px; font-family: var(--head); font-weight: 400; }
.btn-dark { background: var(--dark); border-color: var(--dark); color: var(--white); }
.btn-green { background: var(--green); border-color: var(--green); color: var(--white); }
.btn-go {
  min-height: 140px; font-size: 64px; letter-spacing: 4px; border-radius: 24px;
  box-shadow: 0 8px 0 #8E0D23; margin-top: 8px;
}
.btn-go:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 4px 0 #8E0D23; }
.btn-go:disabled { box-shadow: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.linkbtn { background: none; border: 0; padding: 12px 4px; min-height: 48px; text-decoration: underline; font-weight: 700; font-size: 18px; }

/* upload */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 190px; padding: 20px; border: 3px dashed var(--dark); border-radius: 20px;
  background: var(--white); text-align: center; cursor: pointer; position: relative;
}
.drop.drag { background: #fff0f2; border-color: var(--red); }
.drop .big-emoji { font-size: 56px; line-height: 1; }
.drop strong { font-family: var(--head); font-weight: 400; font-size: 24px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.tile { position: relative; aspect-ratio: 9 / 12; border-radius: 12px; overflow: hidden; background: var(--dark); color: var(--white); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; }
.tile .name { position: absolute; left: 8px; top: 6px; font-size: 15px; font-weight: 700; text-shadow: 0 1px 3px #000; }
.tile .bar { position: absolute; left: 8px; right: 8px; bottom: 10px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.35); overflow: hidden; }
.tile .bar i { display: block; height: 100%; width: 0; background: var(--white); transition: width .2s linear; }
.tile .tick { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25); }
.tile .tick span { width: 64px; height: 64px; border-radius: 50%; background: var(--green); display: grid; place-items: center; font-size: 36px; color: var(--white); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.tile .fail { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: rgba(196,18,48,.85); font-weight: 700; padding: 8px; font-size: 16px; }
.hint { font-size: 17px; margin: 8px 0 0; }

/* recent */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li + li { margin-top: 8px; }
.recent button {
  width: 100%; min-height: var(--tap); display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--white); font-size: 17px;
}
.recent .em { font-size: 26px; }
.recent .what { flex: 1; min-width: 0; }
.recent .what b { display: block; }
.recent .st { font-weight: 700; white-space: nowrap; font-size: 16px; }

/* choose */
.notice { display: flex; gap: 10px; align-items: flex-start; background: #FFF6D6; border: 1px solid #E8D48A; border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 18px; }

/* working */
.stages { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.stages li { display: flex; align-items: center; gap: 14px; min-height: var(--tap); padding: 8px 14px; border-radius: 12px; background: var(--white); border: 1px solid var(--rule); font-size: 20px; font-weight: 700; }
.stages li .em { font-size: 28px; width: 36px; text-align: center; }
.stages li.now { border: 2px solid var(--red); }
.stages li.done .em::after { content: ""; }
.stages li.wait { opacity: .55; }
.progress { height: 22px; border-radius: 11px; background: var(--rule); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--red); border-radius: 11px; transition: width .6s ease;
  background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 100%);
  background-size: 200px 100%; background-repeat: no-repeat; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: -200px 0; } to { background-position: 600px 0; } }

/* review */
.player { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius); display: block; object-fit: contain; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; }
.tab { min-height: 48px; min-width: 64px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--dark); background: var(--white); font-weight: 700; font-size: 18px; }
.tab[aria-selected="true"] { background: var(--dark); color: var(--white); }
.caption { white-space: pre-wrap; font-size: 18px; }
.tags { font-weight: 700; margin-top: 8px; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip { min-height: var(--tap); padding: 0 16px; border-radius: 999px; border: 2px solid var(--dark); background: var(--white); font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: var(--white); }
.chip[aria-pressed="true"]::after { content: "✓"; }
textarea { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--dark); background: var(--white); font-size: 18px; resize: vertical; }
.count { text-align: right; font-size: 16px; margin: 4px 0 12px; }
.banner { border-radius: var(--radius); padding: 16px; margin-bottom: 16px; font-size: 19px; }
.banner-ok { background: #E6F5EC; border: 2px solid var(--green); }
.banner-bad { background: #FCE8EB; border: 2px solid var(--red); }
.banner-info { background: var(--white); border: 2px solid var(--dark); }
.banner h2 { margin-top: 0; }
.stack > * + * { margin-top: 12px; }

/* overlay (offline, sign-in, staff code) */
.overlay { position: fixed; inset: 0; z-index: 20; background: var(--dark); color: var(--white); display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.overlay .box { max-width: 420px; }
.overlay .big-emoji { font-size: 72px; }
.overlay h1 { color: var(--white); }
.overlay input { width: 100%; min-height: 64px; border-radius: var(--radius); border: 2px solid var(--white); padding: 0 16px; font-size: 22px; background: var(--white); color: var(--dark); margin-bottom: 12px; text-align: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid var(--rule); border-top-color: var(--red); animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  .steps { font-size: 15px; gap: 4px; }
  .btn-go { font-size: 52px; }
}
