/* Shared shell styles for The AI Blind Spot games.
   Each game sets the theme through CSS variables on :root:
   --bg --fg --accent --on-accent --card --line --chip --input --scrim --shadow
   --font-display --font-ui --display-weight --display-tracking --theme-style --demo-bg --bad */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden; overscroll-behavior: none;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}
body { position: fixed; inset: 0; }
canvas { display: block; position: fixed; inset: 0; touch-action: none; }

/* ---- Overlay and card ---- */
.ov {
  position: fixed; inset: 0; z-index: 10; display: flex;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .35s ease;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.ov.show { opacity: 1; pointer-events: auto; }
.card {
  position: relative; width: 100%; max-width: 384px; margin: auto; padding: 22px 20px 16px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  transform: translateY(16px) scale(.985); transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.ov.show .card { transform: none; }

/* Children rise in one after another each time a card opens. */
@keyframes bs-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes bs-pop { from { opacity: 0; transform: scale(.7); } }
@keyframes bs-sheen { 0%, 72% { left: -60%; } 100% { left: 130%; } }
@keyframes bs-breathe { 0%, 100% { transform: scaleX(.18); opacity: .55; } 50% { transform: scaleX(1); opacity: 1; } }
.ov.show .card > * { animation: bs-rise .55s cubic-bezier(.2,.8,.2,1) backwards; }
.ov.show .card > :nth-child(1) { animation-delay: .04s; }
.ov.show .card > :nth-child(2) { animation-delay: .08s; }
.ov.show .card > :nth-child(3) { animation-delay: .12s; }
.ov.show .card > :nth-child(4) { animation-delay: .17s; }
.ov.show .card > :nth-child(5) { animation-delay: .22s; }
.ov.show .card > :nth-child(6) { animation-delay: .27s; }
.ov.show .card > :nth-child(7) { animation-delay: .32s; }
.ov.show .card > :nth-child(8) { animation-delay: .37s; }
.ov.show .card > :nth-child(9) { animation-delay: .42s; }
.ov.show .card > :nth-child(n+10) { animation-delay: .47s; }
/* Wide cards group their contents; on phones the groups vanish and the children rise one by one. */
.ga, .gb { display: contents; }
.ov.show .card > .ga > *, .ov.show .card > .gb > * { animation: bs-rise .55s cubic-bezier(.2,.8,.2,1) backwards .06s; }
.ov.show .card > .ga > :nth-child(2) { animation-delay: .1s; }
.ov.show .card > .ga > :nth-child(3) { animation-delay: .14s; }
.ov.show .card > .ga > :nth-child(n+4) { animation-delay: .18s; }
.ov.show .card > .gb > * { animation-delay: .26s; }
.ov.show .card > .gb > :nth-child(2) { animation-delay: .3s; }
.ov.show .card > .gb > :nth-child(3) { animation-delay: .34s; }
.ov.show .card > .gb > :nth-child(n+4) { animation-delay: .38s; }

/* ---- Type ---- */
.kicker { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-top: 12px; font-weight: 600; }
h1 { font-family: var(--font-display); font-weight: var(--display-weight, 600); font-size: 44px; line-height: 1; margin: 6px 0 8px; letter-spacing: var(--display-tracking, 0); text-wrap: balance; }
.tag { font-size: 15px; line-height: 1.45; opacity: .82; text-wrap: balance; }
.label { font-size: 13.5px; opacity: .72; margin-top: 8px; line-height: 1.4; }
.theme { font-family: var(--font-display); font-size: 19px; line-height: 1.3; margin: 14px 2px 0; font-style: var(--theme-style, normal); text-wrap: balance; }
/* A fact from OpenText's story deck under the takeaway. */
.fact { margin: 10px 2px 0; font-size: 13px; line-height: 1.4; opacity: .75; text-wrap: balance; }
.fact b { font-weight: 700; opacity: 1; color: var(--accent); }
.fact small { font-size: 11px; opacity: .7; }
.who { font-size: 12px; opacity: .5; margin-top: 8px; }

/* ---- Co-brand marks ---- */
.bs-logos { display: inline-flex; gap: 6px; vertical-align: middle; }
.bs-lg { width: 26px; height: 26px; border-radius: 23%; overflow: hidden; display: block; box-shadow: 0 0 0 1px rgba(128,128,128,.28), 0 2px 6px -2px rgba(0,0,0,.35); }
.bs-ot img { display: block; width: 108%; height: 108%; margin: -4%; }

/* ---- "What this means" list ---- */
.meaning { margin: 16px 0 14px; padding: 2px 14px; text-align: left; border-radius: 16px; background: var(--chip); }
.meaning div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 0; font-size: 13px; line-height: 1.38; }
.meaning div + div { border-top: 1px solid var(--line); }
.meaning b { color: var(--accent); font-weight: 700; }
.meaning span { opacity: .88; }

/* ---- Round progress: 3 attempts ---- */
.pips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 14px; }
.pip i { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 7px; position: relative; overflow: hidden; }
.pip b { display: block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; opacity: .5; }
.pip small { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; font-variant-numeric: lining-nums tabular-nums; opacity: .4; }
.pip.done i { background: var(--accent); }
.pip.done b, .pip.cur b { opacity: .85; }
.pip.done small { opacity: 1; }
.pip.cur small { opacity: 1; color: var(--accent); }
.pip.cur i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: bs-breathe 1.8s ease-in-out infinite; }

/* ---- Sound switch ---- */
.srow { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 14px; font-size: 14px; }
.srow span { display: inline-flex; align-items: center; gap: 8px; opacity: .85; }
.srow svg { width: 18px; height: 18px; }
.toggle {
  position: relative; width: 52px; height: 30px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--chip); cursor: pointer; font-size: 0; color: transparent; transition: background .2s, border-color .2s;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--fg); opacity: .5; transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s, background .2s;
}
.toggle[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(22px); background: var(--on-accent); opacity: 1; }

/* ---- Buttons and links ---- */
.btn {
  position: relative; overflow: hidden; font: inherit; font-weight: 700; font-size: 17px; width: 100%; padding: 16px; border: 0;
  border-radius: 16px; background: var(--accent); color: var(--on-accent); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -2px 0 rgba(0,0,0,.12), 0 12px 24px -14px var(--accent);
  transition: transform .12s, filter .12s;
}
.btn:active { transform: scale(.975); filter: brightness(.94); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn.ghost { background: var(--chip); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn:not(.ghost):not(:disabled)::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; transform: skewX(-18deg);
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.34), transparent);
  animation: bs-sheen 4.8s 1.2s ease-in-out infinite;
}
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; }
.link { display: inline-block; padding: 4px; font-size: 13px; color: var(--fg); opacity: .62; text-decoration: none; }
button.link { font: inherit; font-size: 13px; background: none; border: 0; cursor: pointer; }

/* ---- Inputs (kept for any page that needs them) ---- */
input {
  font: inherit; font-size: 16px; width: 100%; padding: 13px 14px; border-radius: 12px; outline: none;
  border: 1px solid var(--line); background: var(--input); color: var(--fg); -webkit-user-select: text; user-select: text;
}
input::placeholder { color: var(--fg); opacity: .45; }
input:focus { border-color: var(--accent); }

/* ---- Tutorial ---- */
.tut .card { padding-top: 16px; }
.tuthead { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; opacity: .75; margin-bottom: 10px; }
.tuthead .link { letter-spacing: 0; text-transform: none; padding: 4px 0; }
.demo {
  position: relative; height: 230px; border-radius: 18px; overflow: hidden; background: var(--demo-bg, var(--bg));
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px -20px rgba(0,0,0,.6);
}
.demo canvas { position: absolute; inset: 0; touch-action: auto; }
.tut h2 { font-family: var(--font-display); font-weight: var(--display-weight, 600); font-size: 27px; line-height: 1.1; margin: 16px 0 6px; letter-spacing: var(--display-tracking, 0); }
.ttext { font-size: 15px; line-height: 1.45; opacity: .86; min-height: 66px; text-wrap: balance; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 12px 0 14px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--fg); opacity: .25; transition: width .25s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.dots i.on { width: 20px; opacity: 1; background: var(--accent); }
.tbtns { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }

/* ---- Results ---- */
.headline { font-family: var(--font-display); font-weight: var(--display-weight, 600); font-size: 23px; line-height: 1.15; margin-top: 6px; letter-spacing: var(--display-tracking, 0); }
.big {
  font-family: var(--font-display); font-weight: var(--display-weight, 600); font-size: 78px; line-height: 1; margin-top: 6px;
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: var(--display-tracking, 0);
}
.ov.show .card .big { animation: bs-pop .7s cubic-bezier(.2,1.5,.3,1) backwards .2s; }
.label.best {
  display: inline-block; opacity: 1; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: none; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent);
}
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 0 14px; text-align: left; }
.statgrid div { padding: 10px 12px 11px; border-radius: 14px; background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.statgrid b { display: block; font-family: var(--font-display); font-weight: var(--display-weight, 600); font-size: 26px; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.statgrid b small { font-size: 13px; opacity: .6; font-family: var(--font-ui, sans-serif); font-weight: 500; }
.statgrid span { display: block; font-size: 11.5px; opacity: .72; margin-top: 3px; line-height: 1.3; }
.statgrid .bad b { color: var(--bad, #e5484d); }
.statgrid .bad.zero b { color: inherit; }
.lbtitle { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin: 18px 2px 8px; }
.lb { list-style: none; display: grid; gap: 4px; text-align: left; margin-bottom: 4px; }
.lb li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--chip); font-size: 14px; }
.lb li.me { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 20px -14px var(--accent); }
.lb .pos { opacity: .6; font-variant-numeric: tabular-nums; font-weight: 700; }
.lb small { display: block; font-size: 11px; opacity: .65; }
.lb .sc { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb li.gap { display: block; background: none; text-align: center; padding: 0; opacity: .5; }

/* ---- In-game strip: the game's idea, then hosts · event · game · attempt, and a pause button ----
   It stays on screen all through play so a bystander, a photo or a screenshot can tell what this is. Games keep
   anything the player must touch above BS.SAFE_BOTTOM. */
.bs-strip {
  position: fixed; left: 0; right: 0; bottom: calc(9px + env(safe-area-inset-bottom, 0px)); z-index: 5;
  display: grid; justify-items: center; gap: 5px; padding: 0 10px;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.bs-strip.show { opacity: 1; }
.bs-cap {
  max-width: 100%; font-size: 12px; font-weight: 600; line-height: 1.25; letter-spacing: .005em; text-align: center; text-wrap: balance;
  padding: 4px 12px 5px; border-radius: 13px; color: var(--fg); background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); /* its own plate: game objects pass underneath */
}
.bs-mode {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  padding: 4px 5px 4px 6px; border-radius: 99px; background: var(--card); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bs-mode .bs-logos { gap: 3px; }
.bs-mode .bs-lg { width: 16px; height: 16px; box-shadow: 0 0 0 1px rgba(128,128,128,.25); }
.bs-mode .ev { opacity: .7; }
.bs-mode .gm::before, .bs-mode #bs-att::before { content: "·"; margin-right: 7px; opacity: .45; }
.bs-mode #bs-att { color: var(--accent); }
#bs-pause {
  pointer-events: auto; flex: none; width: 22px; height: 22px; margin-left: 1px; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px; background: var(--chip); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line);
}
#bs-pause i { width: 2.5px; height: 8px; border-radius: 1px; background: currentColor; opacity: .8; }
.bs-strip:not(.show) #bs-pause { pointer-events: none; }
@media (max-width: 379px) { .bs-mode .ev { display: none; } .bs-mode .gm::before { display: none; } } /* narrow phones: the host marks stand in for the event name */

/* ---- Pause card ---- */
.ov.pause { z-index: 9; }
.pcap { font-family: var(--font-display); font-size: 20px; line-height: 1.3; margin: 4px 4px 0; text-wrap: balance; }
.pstat { display: flex; justify-content: center; gap: 8px; margin: 18px 0 16px; }
.pstat div { flex: 1; max-width: 150px; padding: 10px 12px 11px; border-radius: 14px; background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.pstat b { display: block; font-family: var(--font-display); font-weight: var(--display-weight, 600); font-size: 24px; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.pstat span { display: block; font-size: 11.5px; opacity: .72; margin-top: 3px; }

/* ---- Results: brand row, deck line and OpenText's line ---- */
.ebrand { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 12px; font-weight: 600; opacity: .9; }
.ebrand .bs-lg { width: 20px; height: 20px; }
.ebrand .bs-logos { gap: 4px; }
.end .kicker { margin-top: 12px; letter-spacing: .12em; }
.end .fact { font-size: 13.5px; font-weight: 600; opacity: .9; }
.otl { margin: 12px 2px 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; line-height: 1.35; text-wrap: balance; }
.otl b { font-weight: 700; color: var(--accent); }
.otl[hidden] { display: none; }
.tidea { min-height: 17px; margin-top: 8px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--accent); text-wrap: balance; }

@media (max-height: 700px) {
  h1 { font-size: 38px; }
  .meaning div { padding: 8px 0; }
  .big { font-size: 64px; }
  .demo { height: 200px; }
}
/* Desktop: the same cards, laid out across the full screen in two columns. */
@media (min-width: 980px) and (min-height: 620px) {
  .ov { padding: 32px; }
  .card.wide {
    max-width: 980px; padding: 44px 48px 34px; border-radius: 30px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); column-gap: 52px; align-items: center;
  }
  .card.wide > .ga, .card.wide > .gb { display: block; }

  .intro { grid-template-areas: "a m" "b m"; }
  .intro > .ga { grid-area: a; align-self: end; }
  .intro > .gb { grid-area: b; align-self: start; padding-top: 20px; }
  .intro h1 { font-size: 60px; margin: 10px 0 12px; }
  .intro .tag { font-size: 17px; }
  .intro .meaning { grid-area: m; margin: 0; padding: 8px 24px; border-radius: 22px; }
  .intro .meaning div { grid-template-columns: 116px 1fr; gap: 14px; padding: 17px 0; font-size: 15px; line-height: 1.45; }

  .tut .card.wide { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "d h" "d b"; grid-template-rows: auto 1fr; align-items: start; }
  .tut .tuthead { grid-area: h; margin: 0; }
  .tut .demo { grid-area: d; height: min(460px, calc(100vh - 160px)); border-radius: 22px; }
  .tut .gb { grid-area: b; align-self: center; }
  .tut h2 { font-size: 36px; margin-top: 0; }
  .ttext { font-size: 17px; min-height: 100px; }

  .end { grid-template-areas: "a b"; align-items: center; }
  .end > .ga { grid-area: a; }
  .end > .gb { grid-area: b; }
  .end .headline { font-size: 28px; }
  .end .big { font-size: 96px; }
  .end .lbtitle { margin-top: 0; }
  .end .lb li { padding: 11px 14px; font-size: 15px; }
  .bs-cap { font-size: 16px; padding: 6px 16px 7px; border-radius: 16px; }
  .bs-mode { font-size: 12.5px; padding: 6px 7px 6px 9px; gap: 9px; }
  .bs-mode .bs-lg { width: 20px; height: 20px; }
  #bs-pause { width: 26px; height: 26px; }
  .bs-strip { bottom: 16px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .ov, .dots i, .toggle::after { transition: none; }
  .ov.show .card > *, .ov.show .card .big, .ov.show .card > .ga > *, .ov.show .card > .gb > *, .btn::after, .pip.cur i::after { animation: none !important; }
  .pip.cur i::after { opacity: .6; }
}
