/* KFAS tour: warm paper, ink type, the KFAS orange sampled from the logo. Logical properties throughout so Arabic is a true RTL layout. */
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url(assets/fonts/nunito-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url(assets/fonts/nunito-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito Sans"; font-weight: 800; font-display: swap; src: url(assets/fonts/nunito-sans-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 400; font-display: swap; src: url(assets/fonts/noto-sans-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 700; font-display: swap; src: url(assets/fonts/noto-sans-arabic-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 800; font-display: swap; src: url(assets/fonts/noto-sans-arabic-arabic-800-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
  --orange: #F47632;
  --orange-deep: #C4511A;
  --ink: #140B0A;
  --paper: #FFFAF4;
  --card: #FFFFFF;
  --muted: #6A5D57;
  --line: #EADFD5;
  --acc: var(--orange);
  --font: "Nunito Sans", "Noto Sans Arabic", system-ui, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:lang(ar) { --font: "Noto Sans Arabic", "Nunito Sans", system-ui, "Segoe UI", sans-serif; }

* { box-sizing: border-box; }
html { font-size: clamp(13px, calc(0.6vw + 0.9vh), 34px); }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); color: var(--ink); background: var(--paper);
  overflow: hidden; -webkit-font-smoothing: antialiased; line-height: 1.35;
}
body::before { /* the sail: a soft echo of the logo, tinted by the current section */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(70vmax 55vmax at 100% -10%, color-mix(in srgb, var(--acc) 17%, transparent), transparent 70%),
    radial-gradient(40vmax 30vmax at 0% 110%, color-mix(in srgb, var(--acc) 9%, transparent), transparent 70%);
  transition: background .6s;
}
:lang(ar) body::before, [dir=rtl] body::before { transform: scaleX(-1); }
h1, h2, p, ul, ol, dl, dd { margin: 0; padding: 0; }
button, a.mini { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.skip { position: fixed; inset-inline-start: .5rem; top: -4rem; z-index: 99; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: .5rem; }
.skip:focus { top: .5rem; }
[hidden] { display: none !important; }

#app { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

/* ------------------------------------------------------------- top bar */
.topbar { flex: none; display: flex; align-items: center; gap: 1.2rem; padding: .7rem 1.6rem; min-height: 4.3rem; }
.brand { border: 0; background: none; padding: 0; display: flex; align-items: center; }
.brand img { height: 2.9rem; width: auto; display: block; }
body[data-kind=cover] .brand { visibility: hidden; }
.sections { flex: 1; min-width: 0; display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; padding-inline: .5rem; }
.sections::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: .45rem 1rem; border-radius: 99px; font-weight: 700; font-size: 1.02rem; color: var(--muted); white-space: nowrap; transition: background .25s, color .25s; }
.tab:hover { color: var(--ink); background: rgba(20, 11, 10, .06); }
.tab.on { color: var(--ink); background: color-mix(in srgb, var(--acc) 22%, #fff); box-shadow: inset 0 -3px 0 var(--acc); }
body[data-kind=cover] .sections { visibility: hidden; }
.tools { display: flex; gap: .4rem; margin-inline-start: auto; }
.tool { position: relative; width: 2.7rem; height: 2.7rem; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; transition: transform .2s, border-color .2s, background .2s; }
.tool:hover { border-color: var(--ink); transform: translateY(-1px); }
.tool[aria-pressed=true] { background: var(--ink); border-color: var(--ink); }
.tool[aria-pressed=true] svg { stroke: #fff; }
.tool svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool .tl-text { font-weight: 800; font-size: 1.15rem; }
.tool::after { content: attr(data-tip); position: absolute; inset-block-end: -.3rem; inset-inline-end: -.3rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem; border-radius: .4rem; background: var(--ink); color: #fff; font: 800 .68rem/1.15rem var(--font); text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none; }
.tool:hover::after, .tool:focus-visible::after { opacity: 1; }

/* ------------------------------------------------------------- stage and steps */
#stage { flex: 1; min-height: 0; position: relative; outline: none; overflow: hidden auto; }
.step { min-height: 100%; padding: 1rem 5vw 1.4rem; display: grid; align-items: center; gap: 3rem; }
.step > *, .step li, .card, .lane, .tile { animation: rise .7s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#stage[data-dir=back] .step > * { animation-name: riseback; }
@keyframes riseback { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.kicker { font-weight: 800; font-size: 1.1rem; color: color-mix(in srgb, var(--acc) 70%, #000); margin-bottom: .6rem; }
:lang(en) .kicker { text-transform: uppercase; letter-spacing: .12em; }
h1 { font-weight: 800; line-height: 1.08; font-size: 3.6rem; text-wrap: balance; }
.lead { font-size: 1.7rem; line-height: 1.35; color: var(--muted); margin-top: 1rem; max-width: 30ch; text-wrap: balance; }
.hl { color: var(--orange); }

.primary { display: inline-flex; align-items: center; gap: .7rem; border: 0; background: var(--orange); color: var(--ink); font-weight: 800; font-size: 1.2rem; padding: .8rem 1.6rem; border-radius: 99px; box-shadow: 0 .35rem 0 var(--orange-deep); transition: transform .15s, box-shadow .15s; }
.primary:hover { transform: translateY(-2px); box-shadow: 0 .5rem 0 var(--orange-deep); }
.primary:active { transform: translateY(.2rem); box-shadow: 0 .15rem 0 var(--orange-deep); }
.primary svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.primary.xl { font-size: 1.7rem; padding: 1.05rem 2.2rem; margin-top: 2.2rem; }
[dir=rtl] .primary svg, [dir=rtl] .nav svg { transform: scaleX(-1); }

/* cover */
.cover { grid-template-columns: 1.25fr 1fr; }
.cover-logo { width: min(24rem, 100%); height: auto; display: block; margin-inline-start: -1.2rem; }
.cover h1 { font-size: 5.6rem; margin-top: .6rem; }
.cover .lead { font-size: 2.1rem; max-width: 22ch; }
.cover-mark { text-align: center; justify-self: center; }
.cover-mark img { width: min(26rem, 38vh + 8vw); height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 1rem 1.2rem rgba(180, 120, 20, .25)); }
/* the 50 years mark: it floats gently, a warm gold light breathes behind it, and now and then a glint sweeps across
   it (masked to the mark's own shape) */
.mark50 { position: relative; display: block; width: fit-content; margin: 0 auto; isolation: isolate; animation: float50 6.5s ease-in-out infinite; }
.mark50 img { animation: glow50 5s ease-in-out infinite; }
.mark50::before { content: ""; position: absolute; inset: -18% -14%; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 110, .75), rgba(240, 178, 60, .38) 45%, rgba(232, 160, 40, .12) 70%, transparent);
  filter: blur(6px); animation: halo50 4.6s ease-in-out infinite; }
.mark50::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 252, 235, .95) 49%, rgba(255, 236, 170, .55) 54%, transparent 66%) no-repeat;
  background-size: 260% 100%; background-position: 160% 0;
  -webkit-mask: url(assets/kfas-50-years-gold.png) center / contain no-repeat; mask: url(assets/kfas-50-years-gold.png) center / contain no-repeat;
  animation: glint50 12s ease-in-out 2.5s infinite; }
@keyframes float50 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.7rem); } }
@keyframes halo50 {
  0%, 100% { opacity: .55; transform: scale(.92); }
  45% { opacity: 1; transform: scale(1.06); }
  55% { opacity: .95; transform: scale(1.08); }
}
@keyframes glow50 {
  0%, 100% { filter: drop-shadow(0 0 .7rem rgba(255, 196, 70, .35)) drop-shadow(0 1rem 1.2rem rgba(180, 120, 20, .25)); }
  50% { filter: drop-shadow(0 0 1.6rem rgba(255, 204, 90, .65)) drop-shadow(0 1rem 1.2rem rgba(180, 120, 20, .25)); }
}
/* the glint takes about 2 s to cross (it used to flash past in 1 s), once every 12 s */
@keyframes glint50 { 0%, 80% { background-position: 160% 0; } 98%, 100% { background-position: -60% 0; } }
@media (prefers-reduced-motion: reduce) { .mark50, .mark50 img, .mark50::before, .mark50::after { animation: none; } .mark50::after { display: none; } }
.tag { font-weight: 800; font-size: 1.6rem; margin-top: 1.1rem; }
.since { color: var(--muted); font-size: 1.2rem; margin-top: .3rem; font-weight: 700; }

/* text: a title and a paragraph or two */
.text { align-content: center; }
.text-copy { max-width: 62rem; }
.text-copy h1 { font-size: 4.2rem; margin-bottom: 1.6rem; }
.text-copy .para { font-size: 2.05rem; line-height: 1.5; color: var(--ink); margin: 0 0 1.2rem; max-width: 52ch; text-wrap: pretty; }
.text-copy .para + .para { color: var(--muted); font-weight: 700; }
.text.with-art { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 3vw; align-items: center; }
.text.with-art .text-copy .para { font-size: 1.85rem; }

/* the learn-by-doing loop: a spark travels round the ring; each stop lights up as it passes */
.loop-art { justify-self: center; width: min(34rem, 100%); }
.loop-art svg { width: 100%; height: auto; display: block; overflow: visible; }
.loop-art .ring { fill: none; stroke: var(--ink); stroke-opacity: .16; stroke-width: 6; stroke-dasharray: 2 14; stroke-linecap: round; }
.loop-art .spark { fill: var(--orange); filter: drop-shadow(0 0 8px rgba(244, 118, 50, .9)); }
.loop-art .ln circle { fill: #fff; stroke: var(--ink); stroke-width: 4; }
.loop-art .ln .ico path { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.loop-art .ln { animation: lnOn 8s ease-in-out infinite; animation-delay: calc(var(--i) * 2s - .35s); transform-origin: 0 0; }
.loop-art .ln circle { animation: lnFill 8s ease-in-out infinite; animation-delay: calc(var(--i) * 2s - .35s); }
.loop-art .ll { font-weight: 800; font-size: 30px; fill: var(--ink); opacity: .55; animation: llOn 8s ease-in-out infinite; animation-delay: calc(var(--i) * 2s - .35s); }
.loop-art .lc { font-weight: 900; font-size: 30px; fill: var(--orange); }
@keyframes lnFill { 0%, 18%, 100% { fill: #fff; } 4%, 12% { fill: #ffd7bf; } }
@keyframes llOn { 0%, 18%, 100% { opacity: .55; } 4%, 12% { opacity: 1; } }
@keyframes lnOn { 0%, 18%, 100% { scale: 1; } 5% { scale: 1.16; } 12% { scale: 1.08; } }
@media (prefers-reduced-motion: reduce) { .loop-art .spark { display: none; } .loop-art .ln, .loop-art .ln circle, .loop-art .ll { animation: none; } }

/* reel: the games, a button to the hosting page, and their shots cross-fading with a slow push-in */
.reel { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3vw; align-items: center; }
.reel-copy h1 { font-size: 4.4rem; }
.reel-games { list-style: none; margin: 1.6rem 0 2rem; padding: 0; display: grid; gap: .7rem; }
.reel-games li { display: flex; align-items: center; gap: .8rem; font-size: 1.9rem; font-weight: 800; color: var(--muted); transition: color .4s, transform .4s; }
.reel-games li i { width: 1rem; height: 1rem; border-radius: 50%; background: var(--gc); box-shadow: 0 0 0 .3rem color-mix(in srgb, var(--gc) 22%, transparent); transition: transform .4s; }
.reel-games li.on { color: var(--ink); transform: translateX(.5rem); }
[dir=rtl] .reel-games li.on { transform: translateX(-.5rem); }
.reel-games li.on i { transform: scale(1.35); }
.reel-copy .primary { text-decoration: none; }
.reel-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 1.4rem; overflow: hidden; background: #120c0a; box-shadow: 0 0 0 4px var(--ink), 0 1.6rem 3rem rgba(20, 11, 10, .3); }
.reel-stage figure { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.1s ease; }
.reel-stage figure img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); }
.reel-stage figure.on { opacity: 1; }
.reel-stage figure.on img { animation: push 5.6s ease-out forwards; }
.reel-stage figure:nth-child(even).on img { animation-name: push2; }
@keyframes push { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.14) translate(-2%, -1.5%); } }
@keyframes push2 { from { transform: scale(1.14) translate(2%, 1%); } to { transform: scale(1.03) translate(0, 0); } }
.reel-cap { position: absolute; inset-inline-start: 1.2rem; bottom: 1.2rem; padding: .5rem 1rem; border-radius: .8rem; background: rgba(20, 11, 10, .78); color: #fff; font-weight: 800; font-size: 1.5rem; border-inline-start: .35rem solid var(--gc, var(--orange)); backdrop-filter: blur(4px); }
.reel-cap.pop { animation: capIn .6s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes capIn { from { opacity: 0; transform: translateY(.8rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reel-stage figure.on img, .reel-cap.pop { animation: none; } }

/* lobby: a game's party lobby filling the slide (the iframe itself is .lobby-frame, laid over #lobbySlot) */
.lobbystep { height: 100%; display: grid; grid-template-rows: auto 1fr; gap: .7rem; padding: .4rem 1.2vw 1rem; }
.lobby-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.lobby-bar h1 { font-size: 2.2rem; margin: 0 auto 0 0; }
[dir=rtl] .lobby-bar h1 { margin: 0 0 0 auto; }
.lobby-tabs { display: flex; gap: .4rem; }
.lobby-bar .mini { background: var(--ink); color: #fff; padding: .45rem .9rem; font-size: 1rem; }
.lobby-bar .lobby-tab[aria-pressed="true"] { background: var(--acc); color: var(--ink); }
.lobbystep .embed { min-height: 0; height: 100%; }
.lobby-frame { position: fixed; z-index: 3; border: 0; border-radius: 1.1rem; background: transparent; visibility: hidden; pointer-events: none; left: 0; top: 0; width: 10px; height: 10px; transform-origin: 0 0; }
.lobby-frame.on { visibility: visible; pointer-events: auto; }
.expanded .lobbystep { padding: .2rem .4vw .4rem; }
.expanded .lobbystep .lobby-bar h1 { display: none; }

/* points */
.points { align-content: center; gap: 2.5rem; }
.points .head .lead { max-width: 46ch; }
.cards { display: grid; gap: 1.4rem; grid-template-columns: repeat(3, 1fr); }
.cards.n4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 1.4rem; padding: 1.8rem 1.6rem 2rem; box-shadow: 0 .5rem 0 var(--line); }
.ico-wrap { width: 4.2rem; height: 4.2rem; border-radius: 50%; background: var(--orange); display: grid; place-items: center; margin-bottom: 1.2rem; }
.ico { width: 2.3rem; height: 2.3rem; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card h2 { font-size: 1.85rem; font-weight: 800; line-height: 1.15; }
.card p { font-size: 1.35rem; color: var(--muted); margin-top: .6rem; }

/* join + finale (QR) */
.join, .finale { grid-template-columns: 1.15fr 1fr; }
.join-copy h1, .fin-copy h1 { font-size: 4.2rem; }
.how { list-style: none; margin-top: 2rem; display: grid; gap: 1.1rem; }
.how li { display: flex; align-items: center; gap: 1.1rem; font-size: 1.85rem; font-weight: 700; }
.num { flex: none; width: 3rem; height: 3rem; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; }
.wifi { margin-top: 1.8rem; font-size: 1.5rem; display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; color: var(--muted); font-weight: 700; }
.wifi b { color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: .6rem; padding: .1rem .6rem; font-weight: 800; }
.turn { margin-top: 1.8rem; border-radius: 1.1rem; padding: 1rem 1.3rem 1.1rem; background: color-mix(in srgb, var(--acc) 17%, #fff); border-inline-start: .5rem solid var(--acc); }
.turn-h { font-weight: 800; font-size: 1.15rem; color: color-mix(in srgb, var(--acc) 55%, #000); }
:lang(en) .turn-h { text-transform: uppercase; letter-spacing: .1em; }
.turn-h .hand { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(.35rem); } }
[dir=rtl] .turn-h .hand { animation-name: nudgertl; } @keyframes nudgertl { 50% { transform: translateX(-.35rem); } }
.turn p { font-size: 1.55rem; font-weight: 700; margin-top: .3rem; line-height: 1.3; }
.qr { justify-self: center; text-align: center; display: grid; gap: 1.1rem; justify-items: center; }
.qr-card { background: #fff; padding: 1.3rem; border-radius: 1.6rem; border: 2px solid var(--line); box-shadow: 0 .6rem 0 var(--line), 0 1.6rem 3rem rgba(20, 11, 10, .12); }
.qr-card img { display: block; width: min(30rem, 38vw, 52vh); height: min(30rem, 38vw, 52vh); }
.qr-fail { max-width: 20rem; font-weight: 700; padding: 2rem 1rem; }
.qr-url { font: 800 2.1rem/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--ink); color: #fff; padding: .55rem 1.3rem; border-radius: .9rem; direction: ltr; unicode-bidi: isolate; word-break: break-all; max-width: 100%; }
.qr-warn { max-width: 28rem; color: #8a2d00; background: #FFE9D6; padding: .6rem 1rem; border-radius: .7rem; font-weight: 700; font-size: 1.1rem; }
.qr-other { font-size: 1rem; color: var(--muted); max-width: 32rem; word-break: break-all; }
.fin-copy .cover-logo { width: min(18rem, 100%); margin-bottom: 1rem; }
.fin-mark { display: flex; align-items: center; gap: 1.2rem; margin-top: 2rem; }
.fin-mark img { width: 7rem; height: 7rem; }
.fin-mark .tag { margin: 0; font-size: 1.5rem; max-width: 14ch; }

/* section openers */
.sect { grid-template-columns: 1.3fr 1fr; }
.sect h1 { font-size: 5.4rem; }
.bul { list-style: none; display: grid; gap: .85rem; margin-top: 1.6rem; }
.bul li { position: relative; padding-inline-start: 1.6rem; font-size: 1.45rem; font-weight: 600; line-height: 1.3; }
.bul li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: .7rem; height: .7rem; border-radius: 50%; background: var(--acc); }
.bul.big li { font-size: 1.7rem; }
.sect .lead { max-width: 24ch; color: var(--ink); font-weight: 700; }

.art { justify-self: center; position: relative; }
.art-rally { display: grid; gap: .9rem; padding: 1rem; }
.lane { --c: var(--orange); display: flex; align-items: center; gap: 1.2rem; width: min(24rem, 36vw); padding: .8rem 1.6rem; background: var(--c); color: #fff; font-weight: 800; border-radius: 1.1rem; box-shadow: 0 .4rem 0 rgba(0, 0, 0, .22); margin-inline-start: calc(var(--i) * 1.6rem); transform: skewX(-8deg); font-size: 2.6rem; }
.lane .sym { width: 3.2rem; text-align: center; }
[dir=rtl] .lane { transform: skewX(8deg); }
.art-dive { width: min(26rem, 34vw, 44vh); aspect-ratio: 1; }
.art-dive .sea { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #43C4C4, #0E8A94 55%, #0A4F66); box-shadow: 0 1.2rem 3rem rgba(14, 138, 148, .35); }
.art-dive .pearl { position: absolute; inset: 34%; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0 12%, #FDF6EA 35%, #E6D3B6 75%, #C9AE86); box-shadow: 0 .6rem 1.2rem rgba(0, 0, 0, .3); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-.8rem); } }
.bub { position: absolute; border-radius: 50%; border: .18rem solid rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .15); animation: float 6s linear infinite; }
.b1 { width: 1.4rem; height: 1.4rem; inset-inline-start: 18%; bottom: 14%; } .b2 { width: .9rem; height: .9rem; inset-inline-start: 70%; bottom: 20%; animation-delay: -2s; }
.b3 { width: 1.9rem; height: 1.9rem; inset-inline-start: 58%; bottom: 8%; animation-delay: -4s; } .b4 { width: .7rem; height: .7rem; inset-inline-start: 30%; bottom: 30%; animation-delay: -1s; }
@keyframes float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-14rem); opacity: 0; } }
.art-legends { display: grid; gap: 1.2rem; justify-items: center; }
.art-legends .row { display: flex; gap: .8rem; }
.art-legends .row.ar { direction: rtl; }
.tile { width: 5.8rem; height: 5.8rem; display: grid; place-items: center; background: #FBEED8; border: .2rem solid var(--ink); border-radius: .7rem; font-size: 3.4rem; font-weight: 800; box-shadow: .3rem .35rem 0 #7B4FA8; }
.art-legends .row.en .tile { width: 4.6rem; height: 4.6rem; font-size: 2.6rem; }
.tile:nth-child(odd) { transform: rotate(-3deg); } .tile:nth-child(even) { transform: rotate(2.5deg); }
.row.ar .tile:nth-child(3) { background: #F2D27A; }

/* live: caption + embedded game */
.live { grid-template-columns: minmax(17rem, 27%) 1fr; align-items: stretch; gap: 2rem; padding: .4rem 2.4vw 1rem; height: 100%; }
.cap { align-self: center; }
.cap h1 { font-size: 2.9rem; }
.cap .bul li { font-size: 1.4rem; }
.cap .turn p { font-size: 1.45rem; }
.embed { display: flex; flex-direction: column; min-width: 0; min-height: 22rem; border-radius: 1.1rem; overflow: hidden; background: #000; box-shadow: 0 0 0 3px var(--ink), 0 1.2rem 2.4rem rgba(20, 11, 10, .28); }
.embed-bar { flex: none; display: flex; align-items: center; gap: .6rem; background: var(--ink); color: #fff; padding: .45rem .8rem; min-height: 2.6rem; }
.dots { display: flex; gap: .3rem; margin-inline-end: .3rem; } .dots i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--acc); opacity: .9; } .dots i:nth-child(2) { opacity: .6; } .dots i:nth-child(3) { opacity: .35; }
.url { flex: 1; min-width: 0; font: 700 .95rem ui-monospace, Consolas, monospace; color: #cbbfb7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.mini { border: 0; background: rgba(255, 255, 255, .13); color: #fff; padding: .3rem .8rem; border-radius: .5rem; font-weight: 700; font-size: .92rem; text-decoration: none; white-space: nowrap; transition: background .2s; }
.mini:hover { background: var(--acc); color: var(--ink); }
.embed-body { position: relative; flex: 1; min-height: 0; background: #0d0807; }
.embed-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem; background: #17100e; color: #e8dcd3; font-weight: 700; font-size: 1.2rem; text-align: center; padding: 1rem; transition: opacity .4s; }
.loader.done { opacity: 0; pointer-events: none; }
.spin { width: 3rem; height: 3rem; border-radius: 50%; border: .35rem solid rgba(255, 255, 255, .2); border-top-color: var(--acc); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.expanded .live { grid-template-columns: 1fr; padding-inline: 1.2vw; }
.expanded .cap { display: none; }

/* film: a game deep link filling the slide */
.film { height: 100%; padding: .4rem 1.2vw 1rem; display: grid; }
.film .embed { min-height: 0; height: 100%; }
.film iframe { pointer-events: none; }
.expanded .film { padding: 0; }
.expanded .film .embed { border-radius: 0; box-shadow: none; }

/* bus */
.bus { align-content: center; gap: 1rem; }
.bus h1 { font-size: 4.6rem; }
.bus .lead { max-width: 40ch; }
.road { position: relative; display: grid; justify-items: center; padding-top: 1rem; }
.bus-img { width: min(70rem, 80vw, 128vh); height: auto; display: block; filter: drop-shadow(0 1.2rem 1rem rgba(20, 11, 10, .22)); animation: drive 1.6s var(--ease) both .2s; position: relative; z-index: 1; margin-bottom: .1rem; }   /* the drawing's wheels touch its bottom edge */
.line { width: 100%; height: .7rem; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--ink) 0 3.5rem, transparent 3.5rem 5rem); opacity: .85; }
@keyframes drive { from { transform: translateX(-60vw); } to { transform: none; } }

/* ------------------------------------------------------------- notes */
.notes { flex: none; background: var(--ink); color: #fff; padding: .9rem 2rem 1.1rem; max-height: 30vh; overflow: auto; border-top: .3rem solid var(--orange); }
.notes-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; color: #cbbfb7; margin-bottom: .3rem; font-weight: 700; }
.notes-head b { color: var(--orange); font-weight: 800; }
.notes p { font-size: 1.4rem; line-height: 1.45; max-width: 90ch; }

/* ------------------------------------------------------------- bottom bar */
.bar { flex: none; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 1.2rem; padding: .7rem 1.6rem .9rem; }
.nav { display: inline-flex; align-items: center; gap: .5rem; border: 2px solid var(--ink); background: #fff; border-radius: 99px; padding: .5rem 1.2rem; font-weight: 800; font-size: 1.1rem; transition: transform .15s, background .15s; }
.nav svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover:not(:disabled) { transform: translateY(-2px); }
.nav.next { background: var(--orange); border-color: var(--orange); }
.nav:disabled { opacity: .3; cursor: default; }
.progress { min-width: 0; padding-block: .6rem; }
.segments { display: flex; gap: .7rem; }
.seg { display: flex; gap: .2rem; min-width: 0; flex: 1 1 0; }
.cell { position: relative; flex: 1; height: .55rem; padding: 0; border: 0; border-radius: 99px; background: #E3D6CB; transition: background .3s, transform .3s; }
.cell::after { content: ""; position: absolute; inset: -.7rem -.1rem; }
.cell:hover { transform: scaleY(1.6); }
.cell.done { background: var(--acc); }
.cell.cur { background: var(--acc); transform: scaleY(1.7); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--acc) 35%, transparent); }
.counter { font-size: 1.15rem; color: var(--muted); font-weight: 700; min-width: 4.5rem; text-align: center; direction: ltr; }
.counter b { color: var(--ink); font-size: 1.4rem; font-weight: 800; }

/* ------------------------------------------------------------- overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 11, 10, .55); display: grid; place-items: center; padding: 1rem; backdrop-filter: blur(3px); }
.sheet { background: #fff; border-radius: 1.4rem; padding: 2rem 2.4rem; width: min(46rem, 100%); max-height: 100%; overflow: auto; }
.sheet h2 { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; }
.keys { display: grid; gap: .55rem; }
.keys > div { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; align-items: center; font-size: 1.1rem; }
.keys dt { display: flex; gap: .3rem; flex-wrap: wrap; }
kbd { font: 800 .95rem var(--font); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: .45rem; padding: .05rem .5rem; background: #fff; direction: ltr; }
.hint { margin: 1.2rem 0; padding: .8rem 1rem; border-radius: .8rem; background: color-mix(in srgb, var(--orange) 16%, #fff); font-size: 1.05rem; font-weight: 600; }
.toast { position: fixed; inset-inline: 0; bottom: 5rem; margin-inline: auto; width: fit-content; max-width: 90vw; background: var(--ink); color: #fff; padding: .8rem 1.4rem; border-radius: .8rem; font-weight: 700; z-index: 60; }

/* ------------------------------------------------------------- audience page (play.html) */
body.play { overflow: auto; height: auto; min-height: 100%; }
.play-wrap { position: relative; z-index: 1; max-width: 40rem; margin: 0 auto; padding: 1.2rem 1.2rem 3rem; font-size: 17px; }
.play-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.play-top img.logo { height: 3.2rem; width: auto; }
.play-top .lang { border: 2px solid var(--ink); background: #fff; border-radius: 99px; padding: .4rem 1.1rem; font-weight: 800; font-size: 1rem; }
.play-hero { margin: 1.6rem 0 1.2rem; display: flex; align-items: center; gap: 1rem; }
.play-hero h1 { font-size: 2.1rem; }
.play-hero p { color: var(--muted); font-weight: 700; margin-top: .3rem; font-size: 1.05rem; }
.play-hero img { width: 4.6rem; height: 4.6rem; flex: none; }
.gamelist { display: grid; gap: 1rem; margin-top: 1rem; }
.gcard { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 1.4rem; padding: 1.1rem 1.2rem; box-shadow: 0 .4rem 0 var(--gc); transition: transform .15s; }
.gcard:active { transform: translateY(.2rem); }
.gbadge { width: 4.4rem; height: 4.4rem; border-radius: 1.1rem; background: var(--gc); display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; color: #fff; }
.gcard h2 { font-size: 1.55rem; font-weight: 800; line-height: 1.15; }
.gcard p { font-size: 1.02rem; color: var(--muted); font-weight: 600; margin-top: .25rem; }
.gcard .go { display: inline-block; margin-top: .55rem; background: var(--gc); color: #fff; font-weight: 800; padding: .35rem 1rem; border-radius: 99px; font-size: 1rem; }
.play-foot { margin-top: 1.6rem; text-align: center; color: var(--muted); font-weight: 700; font-size: .95rem; }
.play-foot img { height: 3rem; margin: 0 auto .5rem; display: block; }

/* ------------------------------------------------------------- smaller screens */
@media (max-width: 1100px) { .tab { padding: .4rem .7rem; font-size: .95rem; } }
@media (max-width: 900px), (max-height: 520px) {
  html { font-size: 14px; }
  .sections { display: none; }
  .topbar { padding: .5rem 1rem; }
  .step { grid-template-columns: 1fr !important; gap: 1.4rem; padding: 1rem 1.2rem; align-content: start; }
  #stage { overflow-y: auto; }
  h1, .cover h1, .sect h1, .join-copy h1, .fin-copy h1, .bus h1 { font-size: 2.6rem; }
  .cover-mark img { width: 11rem; } .art { order: -1; transform: scale(.75); }
  .cards, .cards.n4 { grid-template-columns: 1fr 1fr; }
  .qr-card img { width: min(18rem, 70vw); height: min(18rem, 70vw); }
  .live { height: auto; }
  .embed { order: -1; height: 62vh; min-height: 0; } .cap { align-self: start; }
  .film { align-content: stretch; }   /* .step's align-content: start would collapse the film's embed to 0 px */
  .bar { gap: .6rem; padding: .5rem .8rem .7rem; grid-template-columns: auto 1fr auto; }
  .counter { display: none; } .nav span { display: none; } .nav { padding: .5rem .8rem; }
  .tool { width: 2.3rem; height: 2.3rem; } .tools { gap: .25rem; }
  .keys > div { grid-template-columns: 1fr; gap: .2rem; }
}
@media (max-width: 520px) { .cards, .cards.n4 { grid-template-columns: 1fr; } .tool[data-tip="P"] { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* play page: the room the host just opened, at the top */
.live { margin: 0 0 1.2rem; padding: 1.1rem 1.2rem 1rem; border-radius: 1.4rem; background: var(--gc, var(--orange)); color: #fff; box-shadow: 0 .4rem 0 rgba(20, 11, 10, .25); animation: liveIn .5s cubic-bezier(.2, .9, .3, 1.3); }
.live[hidden] { display: none; }
.live-h { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.live-room { font-weight: 800; letter-spacing: .12em; opacity: .9; margin-top: .2rem; }
.live-row { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.live-go { background: #fff; color: var(--ink); font-weight: 800; font-size: 1.2rem; padding: .6rem 1.3rem; border-radius: 99px; text-decoration: none; }
.live-stay { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .7); font-weight: 800; font-size: 1rem; padding: .5rem 1rem; border-radius: 99px; }
.live-count { margin-top: .5rem; font-weight: 700; opacity: .9; }
@keyframes liveIn { from { opacity: 0; transform: translateY(-.6rem) scale(.98); } to { opacity: 1; transform: none; } }

/* games: the four games, a picture each with what you do under it */
.gamesgrid { align-content: center; gap: 1.6rem; }
.gamesgrid h1 { font-size: 3.6rem; }
.gg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; }
.gg-card { background: #fff; border-radius: 1.2rem; overflow: hidden; box-shadow: 0 0 0 3px var(--ink), 0 .5rem 0 var(--gc); display: grid; grid-template-rows: auto auto 1fr; animation: rise .6s var(--ease, ease) both; animation-delay: calc(var(--i) * 90ms); }
.gg-pic { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 3px solid var(--ink); background: #120c0a; }
.gg-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 6s ease-out; }
.gg-card:hover .gg-pic img { transform: scale(1.06); }
.gg-card h2 { font-size: 1.7rem; font-weight: 800; padding: .9rem 1.1rem .2rem; display: flex; align-items: center; gap: .55rem; }
.gg-card h2::before { content: ""; width: .85rem; height: .85rem; border-radius: 50%; background: var(--gc); flex: none; }
.gg-card p { font-size: 1.22rem; line-height: 1.4; padding: 0 1.1rem 1.2rem; color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) { .gg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px), (max-height: 520px) {
  .text.with-art, .reel { grid-template-columns: 1fr !important; }
  .loop-art { width: min(22rem, 80vw); }
  .reel-copy h1 { font-size: 2.6rem; } .reel-games li { font-size: 1.3rem; }
  .gamesgrid h1 { font-size: 2.4rem; } .gg-card p { font-size: 1rem; }
}
@media (max-width: 560px) { .gg { grid-template-columns: 1fr; } }

/* phones in dark mode must not repaint the tour and the game list (the meta tags say the same) */
:root { color-scheme: only light; }
