/* SHREDLINGS - mini site (mobile-first, no framework, neon synthwave look)
   Fonts hosted locally (no third-party requests on load), licences in fonts/:
   - Fredoka (headings, Latin) and Nunito (body, Latin): OFL_Fredoka.txt, OFL_Nunito.txt
   - Noto Sans (Cyrillic for Russian, loaded only when Cyrillic text is shown): OFL.txt
   - Noto Sans Arabic (Arabic, loaded only when Arabic text is shown): OFL.txt
   - Simplified Chinese: system fonts (keeps the site light)
   Layout uses logical properties (inline/block) so it mirrors automatically with dir="rtl". */

@font-face { font-family: "Fredoka"; src: url("../fonts/Fredoka-latin.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-latin.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }
/* Cyrillic only: the browser downloads these files only when Cyrillic characters are on the page */
@font-face { font-family: "Noto Sans Cyr"; src: url("../fonts/NotoSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Noto Sans Cyr"; src: url("../fonts/NotoSans-Bold.ttf") format("truetype"); font-weight: 600 900; font-display: swap; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
/* Arabic only */
@font-face { font-family: "Noto Sans Arabic"; src: url("../fonts/NotoSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Sans Arabic"; src: url("../fonts/NotoSansArabic-Bold.ttf") format("truetype"); font-weight: 600 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  --bg: #07020f;
  --bg-2: #120527;
  --surface: #160833;
  --surface-2: #200b47;
  --line: rgba(255, 255, 255, .10);
  --text: #f5f0ff;
  --muted: #c4b8e6;
  --pink: #ff2bd6;
  --cyan: #22e6ff;
  --violet: #9b5cff;
  --sun: #ffb800;
  --ink: #0b0318;
  --focus: #fff35c;
  /* instrument colours (GDD 4) */
  --red: #ff3b5c;
  --blue: #2f8bff;
  --yellow: #ffe14d;
  --purple: #b26bff;
  /* difficulties */
  --easy: #22e6ff;
  --medium: #ff2bd6;
  --hard: #ffb800;
  --radius: 18px;
  --radius-sm: 12px;
  --font-head: "Fredoka", "Noto Sans Cyr", "Noto Sans Arabic", system-ui, sans-serif;
  --font-body: "Nunito", "Noto Sans Cyr", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --arabic: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --gutter: 16px;
  --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 15% -10%, rgba(155, 92, 255, .25), transparent 60%),
    radial-gradient(900px 500px at 100% 35%, rgba(255, 43, 214, .12), transparent 60%),
    radial-gradient(900px 500px at 0% 80%, rgba(34, 230, 255, .08), transparent 60%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}
/* Simplified Chinese: system CJK fonts */
html:lang(zh-Hans) body { font-family: var(--font-body), var(--cjk); }
html:lang(zh-Hans) .h2, html:lang(zh-Hans) .h3, html:lang(zh-Hans) .btn, html:lang(zh-Hans) .badge,
html:lang(zh-Hans) .hero__kicker, html:lang(zh-Hans) .level__name, html:lang(zh-Hans) .store__txt b { font-family: var(--cjk); font-weight: 700; letter-spacing: 0; }
/* Arabic: Arabic font everywhere, no letter-spacing (it breaks joined letters) */
html:lang(ar) body, html:lang(ar) .h2, html:lang(ar) .h3, html:lang(ar) .btn, html:lang(ar) .badge,
html:lang(ar) .hero__kicker, html:lang(ar) .level__name, html:lang(ar) .store__txt b, html:lang(ar) .store__txt small { font-family: var(--arabic); letter-spacing: 0; }
html:lang(ar) body { line-height: 1.8; }

img, svg { display: block; max-width: 100%; }
a { color: var(--cyan); }
a:hover { color: #9ff4ff; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.ico { width: 1.25em; height: 1.25em; flex: none; }
.ico--lg { width: 2rem; height: 2rem; }
.ico--xl { width: 2.6rem; height: 2.6rem; }
/* directional icons (play triangle) flip in RTL */
[dir="rtl"] .ico--flip { transform: scaleX(-1); }

.skip {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100;
  background: var(--pink); color: var(--ink); font-weight: 800;
  padding: .6rem 1rem; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- Top bar ---------- */
.topbar { background: rgba(7, 2, 15, .9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.topbar__in { max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand__icon { width: 34px; height: 34px; border-radius: 8px; }
.brand__name { font: 700 1.25rem/1 var(--font-head); letter-spacing: 2px; text-shadow: 0 0 10px rgba(255, 43, 214, .8); }
.langpick { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.langpick select {
  appearance: none; -webkit-appearance: none;
  min-height: 44px; padding-block: .45rem; padding-inline: .9rem 2.2rem;
  border-radius: 999px; border: 2px solid rgba(34, 230, 255, .55);
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  color: var(--text); font: 700 1rem/1.2 var(--font-body), var(--cjk), var(--arabic); cursor: pointer;
}
[dir="rtl"] .langpick select { background-position: 18px 55%, 12px 55%; }
.langpick select:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(34, 230, 255, .4); }
.langpick option { background: var(--surface); color: var(--text); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(2rem, 6vw, 4rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1fr 1.15fr; } }
.hero__copy { text-align: center; }
@media (min-width: 900px) { .hero__copy { text-align: start; } }
.hero__kicker {
  display: inline-block; margin: 0 0 .8rem; padding: .25rem .9rem; border-radius: 999px;
  border: 1px solid rgba(34, 230, 255, .5); color: var(--cyan);
  font: 700 .9rem/1.3 var(--font-head); letter-spacing: .5px; background: rgba(34, 230, 255, .08);
}
.hero__title {
  margin: 0; font: 700 clamp(2.7rem, 11vw, 5.2rem)/1 var(--font-head); letter-spacing: clamp(2px, .6vw, 6px);
  color: #fff;
  text-shadow: 0 0 6px #fff, 0 0 18px var(--pink), 0 0 42px var(--pink), 0 0 80px rgba(155, 92, 255, .8);
}
/* TODO LOGO: when the logo/banner is ready, replace the text title with <img src="images/logo.png" alt="SHREDLINGS"> (keep the h1). */
.hero__subtitle { margin: 1rem auto 1.4rem; max-width: 34rem; font: 600 clamp(1.1rem, 4.2vw, 1.4rem)/1.4 var(--font-head); }
@media (min-width: 900px) { .hero__subtitle { margin-inline: 0; } }
.hero__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (min-width: 900px) { .hero__ctas { justify-content: flex-start; } }
.hero__platforms { margin: 1rem 0 0; color: var(--muted); font-size: .95rem; }

/* hero video: real video on top, neon CSS placeholder underneath (shown while no video is available) */
.hero__video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000;
  border: 2px solid rgba(255, 43, 214, .55); box-shadow: 0 0 0 1px rgba(34, 230, 255, .25), 0 0 40px rgba(255, 43, 214, .35), 0 20px 50px rgba(0, 0, 0, .55); }
.hero__video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; z-index: 2; }
.hero__video.is-ready video { opacity: 1; }
.hero__video.is-ready .neon { visibility: hidden; }

/* ---------- Neon placeholder (pure CSS) ---------- */
.neon { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #12002e 0%, #2a0650 48%, #07020f 48.2%, #07020f 100%); }
.neon__sun { position: absolute; left: 50%; top: 10%; width: 38%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: linear-gradient(180deg, #ffe14d 0%, #ff8a3d 45%, #ff2bd6 100%);
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 9%, transparent 9% 11%); mask: repeating-linear-gradient(180deg, #000 0 9%, transparent 9% 11%);
  filter: drop-shadow(0 0 24px rgba(255, 43, 214, .8)); }
.neon__floor { position: absolute; left: -50%; right: -50%; bottom: 0; height: 52%; transform-origin: 50% 0; transform: perspective(220px) rotateX(58deg);
  background-image: linear-gradient(rgba(34, 230, 255, .8) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 43, 214, .8) 2px, transparent 2px);
  background-size: 48px 48px; animation: floor 1.6s linear infinite; }
@keyframes floor { from { background-position: 0 0; } to { background-position: 0 48px; } }
.neon__orb { position: absolute; width: 11%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 10%, var(--c) 35%, transparent 70%);
  box-shadow: 0 0 22px var(--c), 0 0 44px var(--c); animation: orb 5s ease-in-out infinite; }
.neon__orb::after { content: ""; position: absolute; inset: -40%; border-radius: 50%; border: 2px solid var(--c); opacity: .7; animation: ring 2.4s linear infinite; }
.neon__orb--1 { --c: var(--red); left: 14%; top: 22%; }
.neon__orb--2 { --c: var(--blue); right: 15%; top: 30%; animation-delay: -1.6s; }
.neon__orb--3 { --c: var(--yellow); left: 45%; top: 48%; width: 8%; animation-delay: -3.2s; }
@keyframes orb { 0%, 100% { transform: translate(0, 0) rotate(0); } 33% { transform: translate(14px, -10px) rotate(8deg); } 66% { transform: translate(-10px, 8px) rotate(-6deg); } }
@keyframes ring { from { transform: scale(.8) rotate(0); opacity: .8; } to { transform: scale(1.3) rotate(360deg); opacity: 0; } }
.neon__eq { position: absolute; inset-inline: 6%; bottom: 7%; height: 18%; display: flex; align-items: flex-end; gap: 2%; }
.neon__eq i { flex: 1; height: 30%; border-radius: 3px 3px 0 0; background: linear-gradient(0deg, var(--pink), var(--cyan)); box-shadow: 0 0 8px rgba(34, 230, 255, .7); animation: eq 1.1s ease-in-out infinite alternate; }
.neon__eq i:nth-child(2n) { animation-duration: .8s; } .neon__eq i:nth-child(3n) { animation-duration: 1.4s; animation-delay: -.4s; }
.neon__eq i:nth-child(5n) { animation-duration: .65s; animation-delay: -.2s; }
@keyframes eq { from { height: 12%; } to { height: 100%; } }
.neon__label { position: absolute; inset-inline: 0; top: 60%; text-align: center; padding: 0 1rem;
  font: 700 clamp(.95rem, 3.4vw, 1.3rem)/1.2 var(--font-head); letter-spacing: 1px; color: #fff;
  text-shadow: 0 0 8px var(--cyan), 0 0 20px var(--cyan); }
html:lang(zh-Hans) .neon__label { font-family: var(--cjk); }
html:lang(ar) .neon__label { font-family: var(--arabic); letter-spacing: 0; }
@media (prefers-reduced-motion: reduce) { .neon__floor, .neon__orb, .neon__orb::after, .neon__eq i { animation: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.35rem; border-radius: 999px; border: 2px solid transparent;
  font: 700 1.05rem/1.1 var(--font-head); text-decoration: none; cursor: pointer;
  transition: transform .15s, background-color .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn--primary { background: linear-gradient(90deg, var(--pink), var(--violet)); color: #fff; box-shadow: 0 0 18px rgba(255, 43, 214, .55); }
.btn--primary:hover { color: #fff; box-shadow: 0 0 28px rgba(255, 43, 214, .85); }
.btn--ghost { background: rgba(7, 2, 15, .55); color: #fff; border-color: var(--cyan); box-shadow: inset 0 0 12px rgba(34, 230, 255, .25); }
.btn--ghost:hover { color: #fff; background: rgba(34, 230, 255, .12); }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }
.h2 { font: 700 clamp(1.7rem, 6vw, 2.5rem)/1.15 var(--font-head); margin: 0 0 .8rem; letter-spacing: .3px; }
.h2::after { content: ""; display: block; width: 72px; height: 4px; margin-top: .6rem; border-radius: 4px; background: linear-gradient(90deg, var(--pink), var(--cyan)); box-shadow: 0 0 10px rgba(255, 43, 214, .7); }
[dir="rtl"] .h2::after { background: linear-gradient(-90deg, var(--pink), var(--cyan)); }
.h3 { font: 700 1.3rem/1.25 var(--font-head); margin: 0 0 .5rem; }
.lead { max-width: 46rem; color: var(--muted); font-size: 1.1rem; margin: 0 0 1.4rem; }
.about .lead { color: var(--text); }

.badges { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.badge { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid rgba(34, 230, 255, .3); font: 600 1rem/1.2 var(--font-head); }
.badge .ico { color: var(--cyan); }

/* How to play: 3 gesture cards */
.cards { display: grid; gap: 14px; margin-top: 1rem; }
@media (min-width: 860px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 1.4rem 1.3rem; box-shadow: 0 0 24px rgba(0, 0, 0, .25); }
.card--knob { --accent: var(--cyan); }
.card--orb { --accent: var(--pink); }
.card--chord { --accent: var(--sun); }
.card p { margin: 0 0 .8rem; }
.card__icon { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); margin-bottom: .9rem;
  background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.card__hand { color: var(--accent); font-weight: 800; font-size: .95rem; margin: 0 0 .3rem !important; text-transform: uppercase; letter-spacing: .8px; }
html:lang(ar) .card__hand, html:lang(zh-Hans) .card__hand { letter-spacing: 0; text-transform: none; }
.note { margin: 1.2rem 0 0; padding: .9rem 1.1rem; border-radius: var(--radius-sm); background: rgba(155, 92, 255, .14); border: 1px dashed rgba(155, 92, 255, .55); }

.colors { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.colors li { display: flex; align-items: center; gap: .7rem; padding: .65rem .9rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.colors i { width: 18px; height: 18px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 10px var(--c); }

.levels__title { margin-top: 2.4rem; }
.levels { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .levels { grid-template-columns: repeat(3, 1fr); } }
.level { display: grid; gap: .3rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--lv); }
.level--easy { --lv: var(--easy); }
.level--medium { --lv: var(--medium); }
.level--hard { --lv: var(--hard); }
.level__bars { display: flex; gap: 4px; align-items: flex-end; height: 18px; }
.level__bars i { width: 6px; border-radius: 2px; background: var(--lv); box-shadow: 0 0 8px var(--lv); }
.level__bars i:nth-child(1) { height: 40%; } .level__bars i:nth-child(2) { height: 70%; } .level__bars i:nth-child(3) { height: 100%; }
.level__name { font: 700 1.2rem/1.2 var(--font-head); color: var(--lv); }

.safety { margin-top: 2rem; display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem 1.3rem; border-radius: var(--radius); background: rgba(255, 243, 92, .07); border: 2px solid rgba(255, 243, 92, .4); }
.safety__ico { color: var(--focus); }
.safety p { margin: 0; }

/* Languages */
.langlist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.langlist li { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font: 600 1.05rem/1.2 var(--font-head); }
.langlist li[lang="zh-Hans"] { font-family: var(--cjk); }
.langlist li[lang="ar"] { font-family: var(--arabic); }
@media (min-width: 760px) { .langlist { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Trailer (YouTube facade) */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__placeholder { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.video__placeholder[disabled] { cursor: default; }
.video__placeholder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(1.1); }
.video__placeholder:not([disabled]):hover .video__play { transform: scale(1.08); }
.video__overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: .8rem; text-align: center; padding: 1rem; background: rgba(7, 2, 15, .35); }
.video__play { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--pink), var(--violet)); color: #fff; box-shadow: 0 0 0 10px rgba(255, 43, 214, .22), 0 0 30px rgba(255, 43, 214, .7); transition: transform .15s; }
.video__text { display: block; margin: 0; font: 700 clamp(1.1rem, 4vw, 1.5rem)/1.2 var(--font-head); text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }

/* Platforms */
.stores { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .stores { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .stores { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.store { display: flex; align-items: center; gap: .9rem; min-height: 72px; padding: .8rem 1.1rem; border-radius: 16px;
  background: #0b0418; color: #fff; text-decoration: none; border: 2px solid rgba(255, 255, 255, .22);
  transition: border-color .15s, transform .15s, background-color .15s, box-shadow .15s; }
.store:hover { color: #fff; border-color: var(--cyan); background: #140830; transform: translateY(-2px); }
.store .ico { color: var(--cyan); }
.store--first { border-color: var(--pink); box-shadow: 0 0 20px rgba(255, 43, 214, .35); }
.store--first .ico { color: var(--pink); }
.store__txt { display: grid; line-height: 1.15; }
.store__txt small { font: 600 .8rem/1.2 var(--font-body); color: var(--muted); }
html:lang(zh-Hans) .store__txt small { font-family: var(--cjk); }
.store__txt b { font: 700 1.2rem/1.2 var(--font-head); }
.store__txt span { font-size: .85rem; color: var(--muted); }
.store--later { border-style: dashed; }
.store--later .ico { color: var(--muted); }

/* ---------- Leaderboard: style for the HTML fragment from ws.php?action=board&format=html ----------
   Expected classes from the server (new SHREDLINGS server): .shr-board, .shr-board--easy|--medium|--hard,
   .shr-board__title, .shr-table (table or list), .shr-row, .shr-rank, .shr-nick, .shr-score, .shr-date */
.board-slot { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; }
.board-slot :has(> .shr-board) { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; grid-column: 1 / -1; }
.board-status { grid-column: 1 / -1; margin: 0; padding: 1.2rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); text-align: center; color: var(--muted); }
.board-status--error { color: var(--text); border-color: rgba(255, 59, 92, .55); background: rgba(255, 59, 92, .10); }
.board-link { margin: 1.2rem 0 0; }
.shr-board { --lv: var(--pink); background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--lv); border-radius: var(--radius); padding: 1rem 1rem 1.1rem; min-width: 0; overflow: hidden; }
.shr-board--easy { --lv: var(--easy); }
.shr-board--medium { --lv: var(--medium); }
.shr-board--hard { --lv: var(--hard); }
.shr-board__title { font: 700 1.25rem/1.2 var(--font-head); color: var(--lv); margin: 0 0 .7rem; text-shadow: 0 0 10px var(--lv); }
html:lang(zh-Hans) .shr-board__title { font-family: var(--cjk); }
html:lang(ar) .shr-board__title { font-family: var(--arabic); }
.shr-board p { margin: .4rem 0; color: var(--muted); font-size: .95rem; }
table.shr-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.shr-table caption { text-align: start; color: var(--muted); font-size: .9rem; padding-bottom: .4rem; }
table.shr-table th { text-align: start; font: 700 .78rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
table.shr-table td { padding: .45rem .4rem; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: middle; }
table.shr-table tr:last-child td { border-bottom: 0; }
.shr-table:not(table) { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.shr-table:not(table) .shr-row { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; grid-template-areas: "rank nick score" "rank date date"; align-items: center; column-gap: .6rem; padding: .45rem .5rem; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.shr-table:not(table) .shr-rank { grid-area: rank; }
.shr-table:not(table) .shr-nick { grid-area: nick; }
.shr-table:not(table) .shr-score { grid-area: score; }
.shr-table:not(table) .shr-date { grid-area: date; }
.shr-row:nth-child(even) { background: rgba(255, 255, 255, .03); }
.shr-rank { font: 800 1rem/1 var(--font-head); color: var(--lv, var(--pink)); width: 2.2em; text-align: center; }
.shr-nick { font-weight: 700; overflow-wrap: anywhere; min-width: 0; unicode-bidi: plaintext; }
.shr-score { font: 800 1.05rem/1 var(--font-head); color: #fff; text-align: end; white-space: nowrap; }
.shr-date { color: var(--muted); font-size: .8rem; white-space: nowrap; }
table.shr-table .shr-date { text-align: end; }
@media (max-width: 380px) { table.shr-table .shr-date { display: none; } }

/* Privacy notes */
.privacy-list { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: 10px; }
.privacy-list li { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.privacy-list .ico { color: var(--cyan); margin-top: .2rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: #05010b; padding: 2rem 0 2.5rem; }
.footer__in { display: grid; gap: 1rem; justify-items: center; text-align: center; }
.footer__madvf { display: inline-flex; align-items: center; gap: .8rem; color: var(--text); text-decoration: none; }
.footer__madvf img { width: 56px; height: 56px; border-radius: 50%; }
.footer__madvf small { display: block; color: var(--muted); font-size: .85rem; }
.footer__madvf b { font: 700 1.15rem/1.2 var(--font-head); }
.footer__links a { color: var(--muted); text-underline-offset: 3px; }
.footer__links a:hover { color: #fff; }
.footer__copy { margin: 0; color: var(--muted); font-size: .9rem; }
@media (min-width: 760px) { .footer__in { grid-template-columns: auto 1fr auto; text-align: start; justify-items: start; align-items: center; } .footer__links { justify-self: center; } }

/* ---------- "Coming soon" dialog ---------- */
.modal { border: 0; padding: 0; overflow: visible; background: transparent; color: var(--text); max-width: min(92vw, 420px); width: 100%; }
.modal::backdrop { background: rgba(4, 1, 10, .78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .22s ease-out; }
.modal.is-fallback { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 1000; box-shadow: 0 0 0 100vmax rgba(4, 1, 10, .78); }
.modal__box { position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 2px solid var(--pink); box-shadow: 0 0 30px rgba(255, 43, 214, .45); border-radius: 22px; padding: 1.8rem 1.5rem 1.5rem; text-align: center; }
.modal .h2::after { margin-inline: auto; }
.modal p { margin: 0 0 1.3rem; font-size: 1.1rem; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } .btn, .store { transition: none; } }

/* ---------- Videos: two click-to-play slots with captions ---------- */
.videos { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.video-item { margin: 0; }
.video video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.video__cap { margin: .7rem 0 0; color: var(--muted); font: 600 1rem/1.3 var(--font-head); text-align: center; }

/* ---------- Screenshots: gallery + full-screen viewer ---------- */
.shots { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.shot { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #000; cursor: zoom-in;
  aspect-ratio: 16 / 9; transition: transform .15s, border-color .15s, box-shadow .15s; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot:hover, .shot:focus-visible { transform: translateY(-2px); border-color: var(--pink); box-shadow: 0 0 22px rgba(255, 43, 214, .45); }
.shot--tall { aspect-ratio: 9 / 16; }

.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(4, 1, 10, .94); color: #fff; overflow: hidden; }
.viewer::backdrop { background: rgba(4, 1, 10, .9); }
.viewer.is-fallback { position: fixed; inset: 0; z-index: 1000; }
.viewer[open] { display: grid; place-items: center; }
.viewer__fig { margin: 0; width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 12px; box-sizing: border-box; }
.viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 0 40px rgba(255, 43, 214, .35); }
.viewer__btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: rgba(20, 8, 48, .8); color: #fff; font: 700 30px/1 var(--font-head); }
.viewer__btn:hover, .viewer__btn:focus-visible { border-color: var(--pink); box-shadow: 0 0 18px rgba(255, 43, 214, .6); }
.viewer__btn--prev { inset-inline-start: 12px; top: 50%; transform: translateY(-50%); }
.viewer__btn--next { inset-inline-end: 12px; top: 50%; transform: translateY(-50%); }
.viewer__btn--close { inset-inline-end: 12px; top: 12px; }
[dir="rtl"] .viewer__btn--prev span, [dir="rtl"] .viewer__btn--next span { display: inline-block; transform: scaleX(-1); }
.viewer__count { position: absolute; bottom: 14px; left: 0; right: 0; margin: 0; text-align: center; color: var(--muted); font-size: .95rem; }
.no-scroll, .no-scroll body { overflow: hidden; }

/* Store buttons: live link (URL set in js/stores.js) */
.store--live { border-color: var(--cyan); }
.store--live .ico { color: var(--cyan); }
.store__txt { min-width: 0; }

/* Video slot without a YouTube ID yet: clean poster, dimmed play, small "Video soon" note */
.video__placeholder[disabled] img { filter: brightness(.8) saturate(1.05); }
.video__placeholder[disabled] .video__overlay { background: linear-gradient(180deg, transparent 55%, rgba(7, 2, 15, .55)); }
.video__placeholder[disabled] .video__play { opacity: .55; box-shadow: 0 0 0 8px rgba(255, 43, 214, .12); }
.video__placeholder[disabled] .video__text { font: 700 .85rem/1 var(--font-head); letter-spacing: .04em; padding: .45rem .8rem; border-radius: 999px;
  background: rgba(7, 2, 15, .7); border: 1px solid var(--line); text-shadow: none; }
.video__cap:empty { display: none; }
@media (min-width: 1100px) { .videos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
