/* ==========================================================================
   HEJSAN.TV – public styles
   Palette: stage-night navy, HEJSAN signal blue (logo), frost (".TV" in logo)
   ========================================================================== */
@font-face { font-family: "Outfit"; src: url("../fonts/outfit.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff") format("woff"); font-weight: 300 900; font-display: swap; }

:root {
  --night: #060a12;
  --deck: #0d1422;
  --rig: #18233a;
  --rig-2: #22304c;
  --line: rgba(191, 225, 248, .12);
  --signal: #12a4ec;
  --signal-hi: #3cb8f4;
  --signal-ink: #03121d;
  --frost: #bfe1f8;
  --paper: #eaf1f8;
  --fog: #8d9bb2;
  --danger: #ff6170;
  --ok: #3ddc97;
  --gx: clamp(16px, 4vw, 60px);
  --radius: 6px;
  --display: "Outfit", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar: 68px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
body {
  margin: 0; min-height: 100vh; background: var(--night); color: var(--paper);
  font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--fog); }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--paper); color: var(--night); padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { left: 8px; }

.ic { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: 0 1.3em; border-radius: var(--radius); border: 0;
  font: 650 1rem/1 var(--body); white-space: nowrap; transition: background-color .15s, transform .15s;
}
.btn .ic { width: 1.35em; height: 1.35em; }
.btn--play { background: var(--paper); color: var(--night); padding-left: 1.05em; }
.btn--play:hover { background: #fff; }
.btn--primary { background: var(--signal); color: var(--signal-ink); }
.btn--primary:hover { background: var(--signal-hi); }
.btn--glass { background: rgba(141, 155, 178, .32); color: var(--paper); backdrop-filter: blur(6px); }
.btn--glass:hover { background: rgba(141, 155, 178, .45); }
.btn--danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn--danger:hover { background: rgba(255, 97, 112, .12); }
.btn--small { min-height: 36px; padding: 0 1em; font-size: .9rem; }
.btn--block { width: 100%; }
.btn.is-disabled { opacity: .6; cursor: not-allowed; }
.btn:active { transform: scale(.98); }
.link-btn { background: none; border: 0; padding: 0; color: var(--frost); text-decoration: underline; text-underline-offset: 3px; }

.round-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(6, 10, 18, .55); border: 2px solid rgba(234, 241, 248, .55); color: var(--paper);
  transition: border-color .15s, background-color .15s;
}
.round-btn:hover { border-color: var(--paper); background: rgba(6, 10, 18, .8); }
.round-btn .ic { width: 22px; height: 22px; }
.round-btn .when-on { display: none; }
.round-btn.is-on .when-on { display: block; }
.round-btn.is-on .when-off { display: none; }
.like-btn.is-on { color: var(--signal); border-color: var(--signal); }
.like-count { font-weight: 650; min-width: 1ch; margin-left: -4px; color: var(--paper); }
.icon-btn { background: none; border: 0; padding: 8px; display: grid; place-items: center; color: var(--paper); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35em; height: 24px; padding: 0 .6em;
  font: 650 .75rem/1 var(--body); border-radius: 5px; letter-spacing: .01em;
}
.badge .ic { width: 13px; height: 13px; }
.badge--new { background: var(--signal); color: var(--signal-ink); }
.badge--early { color: var(--frost); box-shadow: inset 0 0 0 1.5px var(--frost); background: rgba(6, 10, 18, .7); border-radius: 7px; }
.badge--draft { background: #f2c14e; color: #221800; }
.res { border: 1px solid rgba(234, 241, 248, .5); border-radius: 4px; padding: 1px 6px; font-size: .78em; font-weight: 650; }
.chip { display: inline-flex; align-items: center; gap: .35em; font-size: .82rem; color: var(--fog); }
.chip .ic { width: 15px; height: 15px; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); padding: 0 var(--gx);
  background: rgba(6, 10, 18, .96); transition: background-color .3s;
}
.topbar--over { background: linear-gradient(180deg, rgba(6, 10, 18, .85), rgba(6, 10, 18, 0)); }
.topbar--over.is-scrolled { background: rgba(6, 10, 18, .96); }
.brand img { width: 140px; height: auto; }
.mainnav { display: flex; gap: 22px; font-size: .95rem; }
.mainnav a { color: #c7d2e0; transition: color .15s; }
.mainnav a:hover { color: var(--paper); }
.mainnav a[aria-current] { color: var(--paper); font-weight: 650; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-switch { font-size: .85rem; color: var(--fog); display: inline-flex; align-items: center; gap: 5px; }
.lang-switch .lang-ic, .lang-switch .lang-code { display: none; }
.lang-switch:hover { color: var(--paper); }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; display: inline-block; margin-left: 5px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.lang-pop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 150px; background: var(--deck, #101826); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); z-index: 60; }
.lang-pop a { padding: 8px 12px; border-radius: 6px; font-size: .9rem; color: #c7d2e0; }
.lang-pop a:hover, .lang-pop a:focus-visible { background: rgba(191, 225, 248, .08); color: var(--paper); }

.searchbox { position: relative; display: flex; align-items: center; }
.searchbox input {
  width: 0; opacity: 0; height: 38px; border: 1px solid transparent; background: transparent; padding: 0;
  transition: width .25s, opacity .2s, padding .25s; border-radius: 6px;
}
.searchbox.is-open input, .searchbox input:focus { width: min(260px, 40vw); opacity: 1; padding: 0 12px; border-color: var(--line); background: rgba(6, 10, 18, .9); }
.searchbox input::-webkit-search-cancel-button { filter: invert(1); }
.search-pop {
  position: absolute; top: calc(100% + 10px); right: 0; width: min(420px, 92vw); max-height: 70vh; overflow: auto;
  background: var(--deck); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.search-pop h3 { font: 650 .78rem/1 var(--body); color: var(--fog); padding: 10px 10px 6px; letter-spacing: .02em; }
.sp-item { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 6px; }
.sp-item:hover, .sp-item.is-active { background: var(--rig); }
.sp-item img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: var(--rig); }
.sp-item strong { display: block; font-weight: 600; line-height: 1.25; }
.sp-item span { font-size: .82rem; color: var(--fog); }
.sp-all { display: block; text-align: center; padding: 10px; color: var(--frost); font-size: .9rem; }

.usermenu { position: relative; }
.avatar-btn { background: none; border: 0; padding: 0; border-radius: 50%; display: block; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 12px); min-width: 220px; background: var(--deck);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.usermenu-who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenu-who strong { display: block; }
.usermenu-who span { color: var(--fog); font-size: .85rem; }
.usermenu-pop a, .usermenu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 6px;
  background: none; border: 0; text-align: left; font-size: .95rem;
}
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--rig); }
.usermenu-pop form { margin: 0; }

/* Always a perfect square/circle, also inside tables and flex rows */
.avatar { --s: 36px; width: var(--s); height: var(--s); min-width: var(--s); min-height: var(--s); max-width: none; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center; flex: none; background: var(--rig); }
.avatar--initial {
  width: var(--s); height: var(--s); display: inline-grid; place-items: center;
  background: hsl(var(--h) 45% 32%); color: hsl(var(--h) 80% 90%); font: 700 calc(var(--s) * .45)/1 var(--display);
}

.tabbar { display: none; }

/* ---------- Main ---------- */
main { padding-top: var(--topbar); min-height: 70vh; }
main.main--flush { padding-top: 0; }
.page { padding: clamp(24px, 4vw, 48px) var(--gx) 64px; }
.page--narrow { max-width: 760px; margin: 0 auto; }
.page-head { margin-bottom: 28px; max-width: 70ch; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 750; }
.page-head--split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; max-width: none; }
.lede { color: #b9c5d6; font-size: 1.08rem; margin: 10px 0 0; }
.crumbs { margin: 0 0 6px; font-size: .9rem; }
.crumbs a { color: var(--fog); }
.crumbs a:hover { color: var(--paper); }
.empty { color: var(--fog); padding: 40px 0; }

.flashes { position: fixed; top: calc(var(--topbar) + 10px); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(560px, 92vw); }
.flash {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 8px;
  background: var(--rig); border-left: 4px solid var(--signal); box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.flash span { flex: 1; }
.flash--error { border-left-color: var(--danger); }
.flash--success { border-left-color: var(--ok); }
.flash-x { background: none; border: 0; color: var(--fog); padding: 4px; }
.verify-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center; padding: 10px var(--gx); background: #10233a; color: var(--frost); font-size: .9rem; margin: 0; }
main.main--flush .verify-bar { position: relative; z-index: 3; margin-top: var(--topbar); }

/* ---------- Hero ---------- */
.hero { position: relative; height: min(92vh, 56.25vw + 140px); min-height: 540px; overflow: hidden; background: var(--night); }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; }
.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity .9s ease; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero-slide.is-active .hero-bg { animation: drift 16s ease-out both; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1); } }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 10, 18, .92) 0%, rgba(6, 10, 18, .6) 32%, rgba(6, 10, 18, 0) 62%),
    linear-gradient(0deg, var(--night) 0%, rgba(6, 10, 18, .55) 22%, rgba(6, 10, 18, 0) 48%);
}
.hero-copy { position: absolute; left: var(--gx); bottom: clamp(120px, 20vh, 220px); width: min(620px, 88vw); }
.hero-where { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #c7d2e0; font-size: .95rem; margin-bottom: 14px; }
.hero-where .ic { color: var(--signal); width: 18px; height: 18px; }
.hero-when { color: var(--fog); margin-left: 6px; }
.hero-title { margin-bottom: 16px; }
.t-main { display: block; font: 800 clamp(2.4rem, 5.6vw, 4.8rem)/.95 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.t-sub { display: block; font: 500 clamp(1.1rem, 2vw, 1.6rem)/1.2 var(--display); color: var(--frost); margin-top: .35em; letter-spacing: 0; }
.hero-desc { color: #d3dceb; font-size: 1.05rem; max-width: 52ch; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); margin: 14px 0 0; }
.hero-copy .actions { margin-top: 22px; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: #c7d2e0; font-size: .95rem; }
.meta-line .ic { width: 17px; height: 17px; margin-right: 4px; vertical-align: -3px; color: var(--fog); }
.meta-line a:hover { color: var(--paper); text-decoration: underline; }
.hero-dots { position: absolute; right: var(--gx); bottom: clamp(130px, 21vh, 230px); display: flex; gap: 8px; z-index: 2; }
.hero-dot { width: 34px; height: 20px; padding: 8px 0; background: none; border: 0; }
.hero-dot span { display: block; height: 3px; background: rgba(234, 241, 248, .3); border-radius: 2px; overflow: hidden; position: relative; }
.hero-dot span::after { content: ""; position: absolute; inset: 0; background: var(--paper); transform: scaleX(0); transform-origin: left; }
.hero-dot.is-active span::after { animation: dotfill var(--hero-ms, 9s) linear forwards; }
.hero.is-paused .hero-dot.is-active span::after { animation-play-state: paused; }
@keyframes dotfill { to { transform: scaleX(1); } }

/* ---------- Rows & cards ---------- */
.rows { position: relative; z-index: 2; padding-bottom: 40px; }
.rows--lifted { margin-top: clamp(-110px, -12vh, -60px); }
.row { margin: 0 0 clamp(28px, 3.4vw, 44px); }
.row-head { padding: 0 var(--gx); margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.row-head h2 { font-size: clamp(1.15rem, 1.6vw, 1.45rem); font-weight: 650; }
.row-head h2 a { display: inline-flex; align-items: center; gap: 4px; }
.row-chev { width: 18px; height: 18px; color: var(--signal); opacity: 0; transform: translateX(-6px); transition: .2s; }
.row-head h2 a:hover .row-chev, .row-head h2 a:focus-visible .row-chev { opacity: 1; transform: none; }
.row-sub { margin: 0; color: var(--fog); font-size: .9rem; }

.rail-wrap { position: relative; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * var(--gx) - 4 * 10px) / 5);
  gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gx);
  padding: 4px var(--gx) 10px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-btn {
  position: absolute; top: 4px; bottom: 48px; z-index: 3; width: calc(var(--gx) - 6px); min-width: 36px; border: 0;
  background: rgba(6, 10, 18, .7); color: var(--paper); display: grid; place-items: center; opacity: 0; transition: opacity .2s, background-color .2s;
}
.rail-btn .ic { width: 30px; height: 30px; transition: transform .15s; }
.rail-btn:hover .ic { transform: scale(1.2); }
.rail-btn--prev { left: 0; border-radius: 0 6px 6px 0; }
.rail-btn--next { right: 0; border-radius: 6px 0 0 6px; }
.rail-wrap:hover .rail-btn, .rail-btn:focus-visible { opacity: 1; }

.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; }
.card-media { position: relative; display: block; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--rig); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .3s; }
.card-play {
  position: absolute; inset: auto auto 10px 10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--night); opacity: 0; transform: translateY(6px); transition: .25s;
}
.card-play .ic { width: 18px; height: 18px; }
.card:hover .card-media img, .card:focus-visible .card-media img { transform: scale(1.06); filter: brightness(.82); }
.card:hover .card-play, .card:focus-visible .card-play { opacity: 1; transform: none; }
.card .badge { position: absolute; top: 8px; left: 8px; }
.card-time { position: absolute; right: 8px; bottom: 8px; font-size: .75rem; font-weight: 650; background: rgba(6, 10, 18, .78); padding: 2px 6px; border-radius: 4px; }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(234, 241, 248, .25); }
.card-progress span { display: block; height: 100%; background: var(--signal); }
.card-text { display: grid; gap: 1px; padding: 0 2px; }
.card-title { font-weight: 650; font-size: .95rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { color: var(--fog); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ranked "most watched" row: outlined numerals in frost */
.row--ranked .rail { grid-auto-columns: calc((100% - 2 * var(--gx) - 3 * 10px) / 4); }
.card--ranked { display: grid; grid-template-columns: 38% 1fr; grid-template-rows: auto auto; column-gap: 0; align-items: end; }
.card--ranked .card-rank {
  grid-row: 1; font: 900 clamp(5rem, 11vw, 10.5rem)/.78 var(--display); letter-spacing: -.08em; text-align: right;
  color: #3a5480; padding-right: .04em; margin-right: -.07em; position: relative; z-index: 0;
}
.card--ranked .card-media { grid-row: 1; aspect-ratio: 3/4; z-index: 1; box-shadow: -8px 0 18px rgba(6, 10, 18, .55); }
.card--ranked .card-media img { object-position: var(--fx, 50%) 50%; }
.card--ranked .card-text { grid-column: 1 / -1; padding-left: 38%; }
.card--ranked:hover .card-rank { color: #4d6c9e; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 44vw), 1fr)); gap: 22px 12px; }

.nextup {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 var(--gx) 34px; padding: 14px 18px;
  border-radius: 10px; background: linear-gradient(90deg, rgba(18, 164, 236, .16), rgba(18, 164, 236, .04)); border: 1px solid rgba(18, 164, 236, .35);
}
.nextup-label { display: inline-flex; gap: 8px; align-items: center; color: var(--frost); font-size: .9rem; }
.nextup-label .ic { color: var(--signal); }
.nextup-clock { margin-left: auto; font: 700 1.1rem/1 var(--display); font-variant-numeric: tabular-nums; color: var(--paper); }

.join {
  margin: 20px var(--gx) 0; padding: clamp(24px, 4vw, 44px); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; justify-content: space-between; background: var(--deck); border: 1px solid var(--line);
}
.join h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 750; margin-bottom: 8px; }
.join p { color: #b9c5d6; margin: 0; max-width: 60ch; }

/* ---------- Detail (modal + page) ---------- */
.modal { position: fixed; inset: 0; z-index: 80; overflow-y: auto; overscroll-behavior: contain; }
.modal-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); animation: fade .2s ease; }
.modal-panel {
  position: relative; width: min(1100px, 96vw); margin: 3vh auto 6vh; background: var(--deck); border-radius: 12px;
  overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: pop .28s cubic-bezier(.2, .8, .2, 1);
}
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(6, 10, 18, .8); color: var(--paper); display: grid; place-items: center; }
.modal-x:hover { background: var(--night); }
.modal-body.is-loading { min-height: 60vh; display: grid; place-items: center; }
.modal-body.is-loading::after { content: ""; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--rig-2); border-top-color: var(--signal); animation: spin .8s linear infinite; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }
body.no-scroll, html:has(> body.no-scroll) { overflow: hidden; overscroll-behavior: none; }

.detail-page { padding: 24px var(--gx) 64px; }
.detail-page .detail { max-width: 1100px; margin: 0 auto; background: var(--deck); border-radius: 12px; overflow: hidden; }
.detail-hero { position: relative; aspect-ratio: 16/8; min-height: 300px; }
.detail-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-shade { position: absolute; inset: 0; background: linear-gradient(0deg, var(--deck) 0%, rgba(13, 20, 34, .5) 35%, rgba(13, 20, 34, 0) 65%), linear-gradient(90deg, rgba(13, 20, 34, .6), transparent 60%); }
.detail-head { position: absolute; left: clamp(20px, 4vw, 48px); right: clamp(20px, 4vw, 48px); bottom: clamp(16px, 3vw, 36px); }
.detail-title { margin-bottom: 20px; }
.detail-title .t-main { font-size: clamp(1.9rem, 4.4vw, 3.4rem); }
.detail-title .t-sub { font-size: clamp(1rem, 1.6vw, 1.3rem); }
.detail-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); gap: 32px; padding: 8px clamp(20px, 4vw, 48px) 8px; }
.detail-main .meta-line { margin-bottom: 14px; }
.early-note { padding: 12px 14px; border-radius: 8px; border: 1.5px solid rgba(191, 225, 248, .5); color: var(--frost); font-size: .95rem; }
.prose { color: #d3dceb; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--frost); text-decoration: underline; }
.facts { margin: 0; display: grid; gap: 10px; align-content: start; font-size: .92rem; }
.facts div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.facts dt { color: var(--fog); }
.facts dd { margin: 0; }
.facts a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--rig-2); text-underline-offset: 3px; }
.facts a:hover { text-decoration-color: var(--frost); }
.detail-sec { padding: 28px clamp(20px, 4vw, 48px) 8px; }
.page .detail-sec { padding-left: 0; padding-right: 0; }
.detail-sec h2 { font-size: 1.35rem; font-weight: 650; margin-bottom: 16px; }
.detail-sec .grid { grid-template-columns: repeat(auto-fill, minmax(min(230px, 44vw), 1fr)); }
.detail .detail-sec:last-child { padding-bottom: 40px; }
.count { color: var(--fog); font-weight: 400; font-family: var(--body); font-size: .8em; margin-left: 4px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 0; }

.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--rig); }
.photo-link { display: block; width: 100%; height: 100%; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.photo-thumb:hover img { transform: scale(1.05); }
.photo-more { position: absolute; inset: 0; z-index: 1; color: var(--paper); transition: background-color .2s; display: grid; place-items: center; background: rgba(6, 10, 18, .65); font: 700 1.6rem/1 var(--display); }
.photo-more--mob { display: none; }
.photo-more:hover { background: rgba(6, 10, 18, .5); }

/* ---------- Comments ---------- */
.comment-cta { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 8px; background: var(--rig); }
.comment-cta .ic { color: var(--signal); width: 24px; height: 24px; }
.comment-cta a { color: var(--frost); text-decoration: underline; }
.comment-form { display: flex; gap: 12px; margin-bottom: 24px; }
.comment-form-main { flex: 1; }
.comment-form textarea {
  width: 100%; resize: vertical; min-height: 48px; padding: 12px 14px; border-radius: 8px; background: var(--night);
  border: 1px solid var(--line); line-height: 1.45;
}
.comment-form textarea:focus { border-color: var(--signal); outline: none; }
.comment-form-bar { display: flex; justify-content: flex-end; margin-top: 8px; }
.comment-list, .comment-replies { list-style: none; margin: 0; padding: 0; }
.comment { display: flex; gap: 12px; padding: 14px 0; }
.comment + .comment { border-top: 1px solid var(--line); }
.comment-replies .comment { border-top: 0; padding: 10px 0 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.comment-head time { color: var(--fog); font-size: .82rem; }
.comment-body { margin-top: 4px; color: #d8e1ee; overflow-wrap: anywhere; }
.comment-body p { margin: 0 0 .5em; }
.comment-body a { color: var(--frost); text-decoration: underline; }
.comment-actions { display: flex; gap: 14px; margin-top: 4px; }
.comment-actions button { background: none; border: 0; padding: 0; color: var(--fog); font-size: .82rem; font-weight: 600; }
.comment-actions button:hover { color: var(--paper); }
.comment.is-hidden > .comment-main > .comment-body { opacity: .45; }
.role-tag { font-size: .7rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(18, 164, 236, .18); color: var(--signal-hi); }
.role-tag--warn { background: rgba(242, 193, 78, .18); color: #f2c14e; }
.comment-replies .comment-form { margin: 10px 0 0; }

/* ---------- Browse ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.tile { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--rig); isolation: isolate; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; z-index: -2; }
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(6, 10, 18, .9), rgba(6, 10, 18, .1) 70%); }
.tile:hover img { transform: scale(1.05); }
.tile-text { position: absolute; left: 20px; right: 20px; bottom: 16px; display: grid; gap: 2px; }
.tile-text strong { font: 750 1.6rem/1.1 var(--display); letter-spacing: -.02em; }
.tile-text span { color: #c7d2e0; font-size: .9rem; }
.tile--events { background: radial-gradient(120% 120% at 100% 0%, rgba(18, 164, 236, .45), transparent 55%), var(--deck); border: 1px solid var(--line); }

.sorter { display: flex; gap: 6px; flex-wrap: wrap; }
.sorter a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: #c7d2e0; font-size: .9rem; }
.sorter a:hover { border-color: var(--fog); color: var(--paper); }
.sorter a[aria-current] { background: var(--paper); color: var(--night); border-color: var(--paper); font-weight: 650; }

/* ---------- Events timeline ---------- */
.upcoming { margin-bottom: 40px; display: grid; gap: 10px; }
.upcoming h2 { font-size: 1.2rem; margin-bottom: 6px; }
.upcoming-item { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 16px 18px; border-radius: 10px; border: 1px solid rgba(18, 164, 236, .4); background: rgba(18, 164, 236, .07); }
.timeline { display: grid; gap: 8px; }
.tl-year { display: grid; grid-template-columns: clamp(110px, 16vw, 230px) 1fr; gap: 0 clamp(16px, 3vw, 40px); align-items: start; padding-top: 18px; border-top: 1px solid var(--line); }
.tl-num {
  position: sticky; top: calc(var(--topbar) + 12px); font: 800 clamp(3rem, 7vw, 6rem)/.85 var(--display); letter-spacing: -.05em;
  color: rgba(191, 225, 248, .2); font-variant-numeric: tabular-nums;
}
.tl-list { list-style: none; margin: 0; padding: 0 0 18px; display: grid; gap: 4px; }
.ev {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto 96px; gap: 16px; align-items: center;
  padding: 10px 12px; border-radius: 8px; transition: background-color .15s;
}
a.ev:hover { background: var(--deck); }
a.ev:hover strong { color: #fff; }
.ev--plain { opacity: .62; }
.ev-date { color: var(--fog); font-size: .88rem; font-variant-numeric: tabular-nums; }
.ev-name { display: grid; }
.ev-name strong { font-weight: 650; }
.ev-loc { color: var(--fog); font-size: .88rem; }
.ev-chips { display: flex; gap: 14px; }
.ev-thumb { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: var(--rig); }
.ev-thumb--none { background: transparent; }

.event-hero { position: relative; min-height: min(70vh, 640px); display: flex; align-items: flex-end; padding: calc(var(--topbar) + 40px) var(--gx) 36px; margin-top: calc(var(--topbar) * -1); }
.event-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-shade { position: absolute; inset: 0; background: linear-gradient(0deg, var(--night) 0%, rgba(6, 10, 18, .6) 45%, rgba(6, 10, 18, .2)); }
.event-head { position: relative; max-width: 760px; }
.event-head h1 { font: 800 clamp(2.2rem, 5vw, 4.2rem)/1 var(--display); letter-spacing: -.035em; margin-bottom: 14px; }
.event-head .prose { margin-top: 16px; }
.event-page .page { padding-top: 8px; }

.gallery { columns: 4 260px; column-gap: 10px; }
.gallery-item { position: relative; display: block; margin-bottom: 10px; border-radius: 6px; overflow: hidden; background: var(--rig); break-inside: avoid; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .2s; }
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item:target { outline: 3px solid var(--signal); }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(3, 5, 9, .96); display: grid; place-items: center; touch-action: none; overscroll-behavior: contain; overflow: hidden; }
.lb-figure { will-change: transform; }
.lb-figure { margin: 0; max-width: 94vw; max-height: 90vh; display: grid; gap: 10px; justify-items: center; }
.lb-figure img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 4px; }
.lb-figure figcaption { color: var(--fog); font-size: .9rem; text-align: center; }
.lb-x, .lb-nav { position: fixed; border: 0; background: rgba(24, 35, 58, .8); color: var(--paper); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.lb-x { top: 18px; right: 18px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-x:hover, .lb-nav:hover { background: var(--rig-2); }

/* ---------- Search ---------- */
.bigsearch { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--rig-2); padding: 6px 0 12px; margin-bottom: 20px; }
.bigsearch .ic { width: 30px; height: 30px; color: var(--fog); }
.bigsearch input { flex: 1; background: none; border: 0; font: 600 clamp(1.5rem, 3.5vw, 2.4rem)/1.2 var(--display); outline: none; min-width: 0; }
.bigsearch:focus-within { border-color: var(--signal); }
.ev-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ev-results a { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 10px 12px; border-radius: 8px; }
.ev-results a:hover { background: var(--deck); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .9rem; color: #c7d2e0; font-weight: 600; }
.field small { color: var(--fog); font-size: .8rem; }
.field input:not([type=checkbox]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 8px; background: var(--night);
  border: 1px solid var(--rig-2); transition: border-color .15s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input[list] { height: 46px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(18, 164, 236, .2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: #c7d2e0; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--signal); flex: none; }
.check a { color: var(--frost); text-decoration: underline; }
.hp { position: absolute; left: -9999px; }

.auth-wrap { position: relative; min-height: calc(100vh - var(--topbar)); min-height: calc(100svh - var(--topbar)); display: grid; place-items: center; padding: 40px 16px; overflow: hidden; }
.auth-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); }
.auth-shade { position: absolute; inset: 0; background: radial-gradient(80% 80% at 50% 50%, rgba(6, 10, 18, .7), rgba(6, 10, 18, .95)); }
.auth-card { position: relative; width: min(440px, 100%); background: rgba(13, 20, 34, .94); border: 1px solid var(--line); border-radius: 14px; padding: clamp(24px, 5vw, 40px); }
.auth-card h1 { font-size: 2rem; font-weight: 750; margin-bottom: 18px; }
.auth-pitch { color: #b9c5d6; }
.auth-links { margin: 16px 0 0; font-size: .9rem; }
.auth-links a, .auth-alt a { color: var(--frost); }
.auth-alt { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--fog); }

.account-head { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.account-head h1 { font-size: 2rem; font-weight: 750; }
.account-head p { margin: 4px 0 0; }
.group-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 24px; }
.stats div { background: var(--deck); border-radius: 10px; padding: 14px 16px; }
.stats dt { color: var(--fog); font-size: .85rem; }
.stats dd { margin: 2px 0 0; font: 750 1.6rem/1 var(--display); }
.panel { background: var(--deck); border: 1px solid var(--line); border-radius: 12px; padding: clamp(18px, 3vw, 28px); margin-bottom: 18px; }
.panel h2 { font-size: 1.25rem; margin-bottom: 16px; }
.panel--danger { border-color: rgba(255, 97, 112, .35); }
.avatar-form { display: flex; align-items: end; gap: 16px; margin-bottom: 16px; }

.prose-page h1 { font-size: 2.4rem; margin-bottom: 20px; }
.prose-page h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.prose-page p { color: #d3dceb; max-width: 70ch; }
.prose-page a { color: var(--frost); text-decoration: underline; }

.error-page { text-align: center; padding-top: 12vh; padding-bottom: 14vh; }
.error-code { font: 900 clamp(5rem, 16vw, 11rem)/.9 var(--display); color: rgba(191, 225, 248, .22); margin: 0 0 16px; letter-spacing: -.05em; }
.error-page h1 { font-size: 1.8rem; }
.error-page .actions { justify-content: center; margin-top: 24px; }

/* ---------- Footer ---------- */
.sitefoot { margin-top: 40px; padding: 48px var(--gx) 28px; border-top: 1px solid var(--line); color: #b9c5d6; font-size: .92rem; }
.sitefoot-grid { display: grid; grid-template-columns: 2fr 1fr 1.3fr 1fr; gap: 32px; }
.sitefoot h2 { font: 650 .95rem/1 var(--body); color: var(--paper); margin-bottom: 14px; }
.sitefoot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sitefoot a:hover { color: var(--paper); text-decoration: underline; }
.sitefoot-about img { width: 120px; height: auto; margin-bottom: 14px; }
.sitefoot-about p { max-width: 42ch; }
.hejsan-meaning { color: var(--fog); font-size: .88rem; }
.socials { display: flex; gap: 6px; flex-wrap: wrap; }
.socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--deck); }
.socials a:hover { background: var(--rig-2); text-decoration: none; }
.socials .ic { width: 20px; height: 20px; }
.sitefoot-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--fog); font-size: .85rem; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 95; opacity: 0; pointer-events: none;
  background: var(--paper); color: var(--night); padding: 12px 18px; border-radius: 8px; font-weight: 600; transition: .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .rail { grid-auto-columns: calc((100% - 2 * var(--gx) - 3 * 10px) / 4); }
  .row--ranked .rail { grid-auto-columns: calc((100% - 2 * var(--gx) - 2 * 10px) / 3); }
}
@media (max-width: 980px) {
  .rail { grid-auto-columns: calc((100% - 2 * var(--gx) - 2 * 10px) / 3); }
  .mainnav { display: none; }
  .sitefoot-grid { grid-template-columns: 1fr 1fr; }
  .detail-body { grid-template-columns: 1fr; gap: 20px; }
  .ev { grid-template-columns: 120px minmax(0, 1fr) 80px; }
  .ev-chips { grid-column: 2; grid-row: 2; }
  .ev-thumb { grid-column: 3; grid-row: 1 / span 2; width: 80px; }
}
@media (max-width: 700px) {
  :root { --topbar: 56px; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  /* Centre the login box in the space between the top bar and the tab bar */
  .auth-wrap { min-height: calc(100vh - var(--topbar) - 62px - env(safe-area-inset-bottom)); min-height: calc(100svh - var(--topbar) - 62px - env(safe-area-inset-bottom)); padding: 24px 16px; }
  .brand img { width: 112px; }
  /* Mobile: a globe with the language code (e.g. EN) instead of the whole name */
  .lang-switch { font-size: .78rem; font-weight: 700; letter-spacing: .04em; padding: 6px 2px; min-height: 36px; }
  .lang-switch .lang-full { display: none; }
  .lang-switch .lang-ic, .lang-switch .lang-code { display: inline-block; }
  .lang-switch .lang-ic { width: 18px; height: 18px; }
  .topbar-tools { gap: 12px; }
  .searchbox { display: none; }
  .topbar .btn--small { min-height: 32px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(6, 10, 18, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; font-size: .68rem; color: var(--fog); }
  .tabbar a[aria-current] { color: var(--paper); }
  .tabbar a[aria-current] .ic { color: var(--signal); }
  .tabbar .ic { width: 22px; height: 22px; }
  .rail { grid-auto-columns: 44%; gap: 8px; }
  .row--ranked .rail { grid-auto-columns: 62%; }
  .rail-btn { display: none; }
  /* Near-square hero on phones: the 16:9 poster cropped where the admin chose */
  .hero { height: auto; min-height: 0; aspect-ratio: 4/5; max-height: 86vh; }
  .hero-bg { object-position: var(--fx, 50%) 50%; }
  .hero-shade { background: linear-gradient(0deg, var(--night) 0%, rgba(6, 10, 18, .82) 30%, rgba(6, 10, 18, .2) 62%, rgba(6, 10, 18, .35) 100%); }
  .hero-copy { bottom: 46px; }
  .hero-where { margin-bottom: 10px; font-size: .88rem; }
  .hero-title { margin-bottom: 12px; }
  .hero-copy .actions { margin-top: 18px; }
  .hero-desc { display: none; }
  .hero-dots { left: var(--gx); right: auto; bottom: 14px; }
  .rows--lifted { margin-top: 18px; }
  .modal-panel { width: 100%; margin: 0; border-radius: 0; min-height: 100vh; }
  .detail-hero { aspect-ratio: 4/5; max-height: 80vh; min-height: 0; }
  .detail-bg { object-position: var(--fx, 50%) 50%; }
  .photo-strip { grid-template-columns: repeat(3, 1fr); }
  .photo-strip .photo-thumb:nth-child(n+7) { display: none; }
  .photo-more--desk { display: none; }
  .photo-more--mob { display: grid; }
  .tl-year { grid-template-columns: 1fr; }
  .tl-num { position: static; font-size: 3rem; margin-bottom: 8px; }
  .ev { grid-template-columns: minmax(0, 1fr) 80px; gap: 4px 12px; padding: 10px 4px; }
  .ev-date { grid-column: 1; grid-row: 1; }
  .ev-name { grid-column: 1; grid-row: 2; }
  .ev-chips { grid-column: 1; grid-row: 3; }
  .ev-thumb { grid-column: 2; grid-row: 1 / span 3; }
  .sitefoot-grid { grid-template-columns: 1fr; }
  .stats dd { font-size: 1.3rem; }
  .lb-nav { display: none; }
  .flashes { top: calc(var(--topbar) + 6px); }
}
@media (hover: none) {
  .rail-btn { display: none; }
  .card-play { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* File inputs & form buttons */
.field input[type=file] { font-size: .9rem; color: var(--fog); }
.field input[type=file]::file-selector-button {
  margin-right: 12px; padding: 9px 14px; border: 0; border-radius: 6px; background: var(--rig-2); color: var(--paper); font: 600 .9rem var(--body); cursor: pointer;
}
.field input[type=file]::file-selector-button:hover { background: #2c3d5f; }
.form > .btn:not(.btn--block) { justify-self: start; }

.error-detail { max-width: 760px; margin: 18px auto 0; padding: 14px 16px; border-radius: 8px; background: var(--deck); border: 1px solid rgba(255, 97, 112, .4); text-align: left; font-size: .9rem; overflow-wrap: anywhere; }

/* ---------- Profile picture ---------- */
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.a-label-ish { display: block; font-size: .9rem; color: #c7d2e0; font-weight: 600; margin-bottom: 8px; }
.avatar-edit .actions { gap: 14px; }
.avatar-edit label.btn { cursor: pointer; }

.crop { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; }
.crop-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .78); animation: fade .2s ease; }
.crop-panel { position: relative; width: min(440px, 100%); background: var(--deck); border: 1px solid var(--line); border-radius: 16px; padding: 22px; animation: pop .25s cubic-bezier(.2, .8, .2, 1); }
.crop-panel h2 { font-size: 1.35rem; margin-bottom: 6px; }
.crop-panel > p { font-size: .9rem; margin-bottom: 16px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #000; cursor: grab; touch-action: none; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; will-change: transform; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(6, 10, 18, .62); outline: 2px solid rgba(234, 241, 248, .85); outline-offset: -2px; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; color: var(--fog); }
.crop-zoom .ic { width: 16px; height: 16px; }
.crop-zoom .ic--big { width: 24px; height: 24px; }
.crop-zoom input { flex: 1; accent-color: var(--signal); }
.crop-actions { justify-content: flex-end; margin-top: 16px; }

/* Continue watching: remove button */
.card-wrap { position: relative; min-width: 0; transition: opacity .25s, transform .25s; }
.card-wrap.is-leaving { opacity: 0; transform: scale(.92); }
.card-remove {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgba(6, 10, 18, .78); color: var(--paper);
  box-shadow: inset 0 0 0 1.5px rgba(234, 241, 248, .45); opacity: 0; transition: opacity .2s, background-color .15s;
}
.card-remove .ic { width: 16px; height: 16px; }
.card-wrap:hover .card-remove, .card-remove:focus-visible { opacity: 1; }
.card-remove:hover { background: var(--paper); color: var(--night); }
@media (hover: none) { .card-remove { opacity: 1; } }

/* Photographer credits */
.credits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.credit { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--deck); border: 1px solid var(--line); font-size: .9rem; }
.credit img, .credit-initial { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.credit-initial { display: grid; place-items: center; background: var(--rig-2); font: 700 .8rem/1 var(--display); }
a.credit:hover { border-color: var(--fog); }
.credit .ic { width: 14px; height: 14px; color: var(--fog); }
.lb-figure figcaption a { color: var(--frost); text-decoration: underline; }

/* Opening the player in place (swap.js) */
.swap-cover { position: fixed; inset: 0; z-index: 200; background: #000; display: grid; place-items: center; animation: swapIn .15s ease; }
.swap-spin { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes swapIn { from { opacity: 0; } }

/* Closed site (IP whitelist) */
.gate { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(90% 70% at 50% 20%, #0d1a2e, #05080f 70%); }
.gate-card { width: min(480px, 100%); text-align: center; display: grid; justify-items: center; gap: 18px; }
.gate-card img { width: 170px; height: auto; margin-bottom: 10px; }
.gate-card h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 750; line-height: 1.1; }
.gate-card p { color: #b9c5d6; line-height: 1.55; margin: 0; }
.gate-card .btn { margin-top: 6px; }
.gate-login { color: var(--fog); font-size: .85rem; margin-top: 18px; }
.gate-login:hover { color: var(--paper); }

/* Events list: a small pile of photos for events without video */
.ev-stack { position: relative; display: block; background: none; overflow: visible; }
.ev-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; background: var(--rig);
  border: 1.5px solid rgba(255, 255, 255, .85); box-shadow: 0 3px 10px rgba(0, 0, 0, .55); transition: transform .25s ease; }
.ev-stack img:last-of-type { transform: scale(.86); }
.ev-stack--3 img:nth-child(1) { transform: translate(-10px, 3px) rotate(-10deg) scale(.8); }
.ev-stack--3 img:nth-child(2) { transform: translate(10px, -3px) rotate(8deg) scale(.82); }
.ev-stack--2 img:nth-child(1) { transform: translate(9px, -3px) rotate(8deg) scale(.82); }
a.ev:hover .ev-stack img:last-of-type { transform: scale(.9); }
a.ev:hover .ev-stack--3 img:nth-child(1) { transform: translate(-15px, 4px) rotate(-14deg) scale(.8); }
a.ev:hover .ev-stack--3 img:nth-child(2) { transform: translate(15px, -4px) rotate(12deg) scale(.82); }
a.ev:hover .ev-stack--2 img:nth-child(1) { transform: translate(14px, -4px) rotate(12deg) scale(.82); }
.ev-stack-more { position: absolute; right: -2px; bottom: -4px; z-index: 2; padding: 2px 7px; border-radius: 999px; background: var(--paper); color: #05080f;
  font: 700 .7rem/1.4 var(--body, inherit); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }

/* Start page: random photos from the galleries */
.row-shuffle { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: none; color: var(--fog); font: 600 .82rem/1 var(--body, inherit); cursor: pointer; transition: color .15s, border-color .15s; }
.row-shuffle:hover { color: var(--paper); border-color: rgba(255, 255, 255, .35); }
.row-shuffle .ic { width: 15px; height: 15px; }
.row-shuffle.is-spinning .ic { animation: spin .6s ease; }
.rail--photos { grid-auto-columns: calc((100% - 2 * var(--gx) - 6 * 10px) / 7); transition: opacity .25s; }
.rail--photos.is-loading { opacity: .35; }
.row--photos .rail-btn { bottom: 10px; }
.photo-card { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--rig); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.photo-card::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(0deg, rgba(6, 10, 18, .85), transparent); opacity: .9; transition: opacity .25s; }
.photo-card-ev { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 1; font-size: .78rem; font-weight: 600; line-height: 1.25; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.photo-card:hover img, .photo-card:focus-visible img { transform: scale(1.06); }
@media (max-width: 980px) { .rail--photos { grid-auto-columns: calc((100% - 2 * var(--gx) - 4 * 10px) / 5); } }
@media (max-width: 700px) {
  .rail--photos { grid-auto-columns: 34%; }
  .row--photos .row-head { align-items: center; flex-wrap: wrap; }
  .row--photos .row-sub { order: 3; flex-basis: 100%; }
  .row-shuffle span { display: none; }
  .row-shuffle { padding: 7px; }
}

/* Hero: "Photos" button when the video's event has a gallery */
.btn--photos .btn-count { margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .78em; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  /* Three buttons don't fit on a phone: the photos button becomes icon + number */
  .btn--photos > span:not(.btn-count) { display: none; }
  .btn--photos .btn-count { margin-left: 0; background: none; padding: 0; font-size: inherit; }
  .hero-copy .actions:has(.btn--photos):not(:has(a[href="/login"])) { flex-wrap: nowrap; }
  .hero-copy .actions:has(.btn--photos) { gap: 8px; }
  .hero-copy .actions:has(.btn--photos) .btn { padding-left: 14px; padding-right: 14px; gap: 7px; white-space: nowrap; }
}

/* Photo captions: on the photo in the gallery, and as a headline in the lightbox */
.gallery-item.has-caption::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(0deg, rgba(6, 10, 18, .88), transparent); pointer-events: none; }
.gallery-cap { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 1; color: #fff; font-size: .82rem; font-weight: 600; line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; pointer-events: none; }
.lb-figure figcaption { display: grid; gap: 4px; max-width: min(760px, 94vw); }
.lb-text { color: var(--paper); font-size: 1rem; font-weight: 600; line-height: 1.4; }
.lb-meta { color: var(--fog); font-size: .85rem; }
@media (max-width: 700px) { .gallery-cap { font-size: .74rem; left: 8px; right: 8px; bottom: 6px; } }

/* Category page: the category image as a backdrop that fades into the page */
.cat-page { position: relative; isolation: isolate; }
.cat-page--bg { padding-top: var(--topbar); min-height: 70vh; }
.cat-bg { position: absolute; z-index: -1; inset: 0 0 auto; height: min(88vh, 900px); overflow: hidden; pointer-events: none; }
.cat-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; opacity: .55; }
.cat-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 18, .55) 0%, rgba(6, 10, 18, .25) 22%, rgba(6, 10, 18, .7) 62%, var(--night) 100%),
              linear-gradient(90deg, rgba(6, 10, 18, .6) 0%, transparent 55%); }
.cat-page--bg .page-head h1, .cat-page--bg .page-head .lede { text-shadow: 0 2px 16px rgba(0, 0, 0, .6); }
.cat-page--bg .page-head { padding-top: clamp(40px, 12vh, 140px); }
@media (max-width: 700px) {
  .cat-bg { height: 70vh; }
  .cat-page--bg .page-head { padding-top: 40px; }
}

/* Start page: the YouTube channel in numbers */
.ytband { margin: 8px var(--gx) clamp(28px, 3.4vw, 44px); padding: clamp(20px, 3vw, 32px); border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 24px; align-items: center;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 0, 51, .16), transparent 55%), var(--deck); border: 1px solid var(--line); }
.ytband-intro { display: flex; gap: 14px; align-items: center; }
.ytband-logo { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: #ff0033; color: #fff; box-shadow: 0 8px 24px rgba(255, 0, 51, .35); }
.ytband-logo .ic { width: 28px; height: 28px; }
.ytband h2 { font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 700; }
.ytband p { margin: 2px 0 0; color: var(--fog); font-size: .9rem; }
.ytband-stats { display: flex; justify-content: space-around; gap: 16px; margin: 0; }
.ytband-stats div { display: flex; flex-direction: column-reverse; align-items: center; text-align: center; }
.ytband-stats dd { margin: 0; font: 800 clamp(1.5rem, 2.6vw, 2.2rem)/1.05 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ytband-stats dt { color: var(--fog); font-size: .82rem; margin-top: 4px; }
.ytband-btn { background: #ff0033; color: #fff; }
.ytband-btn:hover { background: #e6002e; }
@media (max-width: 980px) {
  .ytband { grid-template-columns: 1fr auto; }
  .ytband-stats { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
}
@media (max-width: 560px) {
  .ytband { grid-template-columns: 1fr; text-align: left; }
  .ytband-btn { grid-row: 3; justify-self: stretch; }
  .ytband-stats dd { font-size: 1.35rem; }
}

/* Members-only (exclusive) films: gold instead of the blue early-access badge */
.badge--exclusive { color: #ffd76a; box-shadow: inset 0 0 0 1.5px rgba(255, 215, 106, .85); }

/* "See all" at the end of a row that has more videos than it shows */
.row-all { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--fog); white-space: nowrap; }
.row-all span { font-weight: 400; }
.row-all .ic { width: 16px; height: 16px; }
.row-all:hover, .row-all:focus-visible { color: var(--paper); }
.rail-more-box { display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; padding: 10px;
  background: linear-gradient(135deg, rgba(18, 164, 236, .16), rgba(191, 225, 248, .05)); border: 1px solid var(--line); transition: background-color .2s, border-color .2s; }
.rail-more-n { font: 700 clamp(1.4rem, 2.4vw, 2rem)/1 var(--display); color: var(--paper); }
.rail-more-t { font-size: .85rem; color: var(--frost); }
.rail-more-ic { width: 22px; height: 22px; color: var(--signal); transition: transform .2s; }
.rail-more:hover .rail-more-box, .rail-more:focus-visible .rail-more-box { border-color: rgba(18, 164, 236, .5); }
.rail-more:hover .rail-more-ic { transform: translateX(4px); }

/* Cookie banner (both choices look the same: refusing is as easy as accepting) */
.consent { position: fixed; z-index: 90; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: center; pointer-events: none; }
.consent[hidden] { display: none; }
.consent-inner { pointer-events: auto; width: min(720px, 100%); background: rgba(13, 20, 34, .97); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); backdrop-filter: blur(8px); }
.consent h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
.consent p { margin: 0; color: #c7d2e0; font-size: .9rem; line-height: 1.5; }
.consent p a { color: var(--frost); text-decoration: underline; text-underline-offset: 3px; }
.consent-details { display: grid; gap: 8px; margin-top: 14px; }
.consent-cat { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 10px; background: rgba(191, 225, 248, .05); border: 1px solid var(--line); cursor: default; }
label.consent-cat { cursor: pointer; }
.consent-cat strong { display: block; font-size: .92rem; }
.consent-cat small { display: block; color: var(--fog); font-size: .8rem; line-height: 1.45; margin-top: 2px; }
.consent-always { flex: none; font-size: .78rem; color: var(--fog); white-space: nowrap; }
.consent-toggle { flex: none; appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--rig-2, #2a3448); position: relative; cursor: pointer; transition: background-color .2s; }
.consent-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.consent-toggle:checked { background: var(--signal); }
.consent-toggle:checked::after { transform: translateX(18px); }
.consent-toggle:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.consent-btn { background: var(--paper); color: #0b1220; min-width: 150px; }
.consent-btn:hover { background: #fff; }
.consent-more { font-size: .88rem; margin-left: 4px; }
@media (max-width: 700px) {
  .consent { left: 8px; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .consent-inner { padding: 14px 16px; }
  .consent-actions .consent-btn { flex: 1 1 140px; min-width: 0; }
}
.watch-body .consent { bottom: 90px; }
.cookie-table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: .9rem; }
.cookie-table th, .cookie-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cookie-table th { color: var(--fog); font-weight: 600; }
@media (max-width: 600px) { .cookie-table { font-size: .82rem; } .cookie-table th, .cookie-table td { padding: 6px; } }

/* ---------- Community: profiles, badges, comment hearts, "I was there", notifications ---------- */
.comment-author { font-weight: 700; color: var(--paper); }
.comment-author:hover { text-decoration: underline; text-underline-offset: 3px; }
.comment-actions { align-items: center; }
.comment-actions .comment-like { display: inline-flex; align-items: center; gap: 4px; }
.comment-like .ic { width: 15px; height: 15px; }
.comment-like .when-on { display: none; color: #ff5470; }
.comment-like.is-on .when-on { display: block; }
.comment-like.is-on .when-off { display: none; }
.comment-like.is-on { color: var(--paper); }
.comment-like:disabled { cursor: default; opacity: .6; }
.comment-like:disabled:hover { color: var(--fog); }
a.ts { font-variant-numeric: tabular-nums; color: var(--signal); font-weight: 600; text-decoration: none; }
a.ts:hover { text-decoration: underline; }
a.mention { color: var(--frost); font-weight: 600; }

.profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: start; margin-bottom: 20px; }
.profile-who h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 750; line-height: 1.1; }
.profile-who > p { margin: 6px 0 0; }
.profile-bio { margin-top: 12px; max-width: 62ch; color: #c7d2e0; }
.profile-bio p { margin: 0 0 6px; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; color: var(--fog); font-size: .92rem; }
.profile-chips strong { color: var(--paper); font-size: 1.05rem; }
.badges { list-style: none; padding: 0; margin: 0 0 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.badge-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(191, 225, 248, .06); border: 1px solid var(--line); }
.badge-item strong { display: block; font-size: .88rem; line-height: 1.2; }
.badge-item small { display: block; color: var(--fog); font-size: .76rem; line-height: 1.2; }
.badge-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, rgba(18, 164, 236, .35), rgba(18, 164, 236, .1)); color: var(--frost); flex: none; }
.badge-ic .ic { width: 17px; height: 17px; }
.profile-sec { margin-top: 34px; }
.profile-sec h2 { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 650; margin-bottom: 14px; }
.profile-sec h2 .ic { width: 20px; height: 20px; color: var(--signal); }
.profile-hidden { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--fog); font-size: .92rem; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 10px; }
.profile-hidden .ic { width: 18px; height: 18px; }
.profile-hidden a { color: var(--frost); text-decoration: underline; text-underline-offset: 3px; }
.profile-events { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.profile-events li { display: flex; min-width: 0; }
.profile-events a { position: relative; isolation: isolate; overflow: hidden; flex: 1; min-height: 92px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 14px 16px; border-radius: 10px; background: var(--deck, #101826); border: 1px solid var(--line); transition: border-color .2s; }
.profile-events a:hover { border-color: rgba(18, 164, 236, .5); }
.profile-events strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.profile-events .muted { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-events a.has-img > :not(.pe-img) { position: relative; z-index: 1; text-shadow: 0 1px 6px rgba(5, 9, 18, .8); }
.pe-img { position: absolute; z-index: 0; top: 0; right: 0; height: 100%; width: 62%; object-fit: cover; opacity: .55; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 75%); mask-image: linear-gradient(90deg, transparent 0%, #000 75%); transition: opacity .25s, transform .4s; }
.profile-events a:hover .pe-img { opacity: .75; transform: scale(1.04); }
@media (min-width: 700px) {
  .pe-img { width: 85%; opacity: .32; -webkit-mask-image: linear-gradient(90deg, transparent 5%, #000 90%); mask-image: linear-gradient(90deg, transparent 5%, #000 90%); }
  .profile-events a:hover .pe-img { opacity: .5; }
}
.profile-activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 820px; }
.profile-activity > li { display: grid; grid-template-columns: 128px 1fr; gap: 14px; align-items: start; }
.pa-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--rig); }
.pa-head { margin: 0 0 4px; color: var(--fog); font-size: .88rem; }
.pa-head a { color: var(--paper); font-weight: 600; }
.pa-head time { margin-left: 6px; font-size: .8rem; }
.pa-body p { margin: 0 0 4px; }
.pa-likes { display: inline-flex; align-items: center; gap: 4px; color: var(--fog); font-size: .8rem; }
.pa-likes .ic { width: 13px; height: 13px; color: #ff5470; }
.account-profile-link { margin: -8px 0 18px; }
.privacy-set { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 14px; margin: 4px 0 6px; display: grid; gap: 10px; }
.privacy-set legend { padding: 0 6px; font-weight: 650; font-size: .95rem; }
.privacy-set > p { margin: 0; font-size: .86rem; }
@media (max-width: 700px) {
  .profile-head { grid-template-columns: auto 1fr; gap: 16px; }
  .profile-head .avatar { --s: 72px !important; }
  .profile-edit { grid-column: 1 / -1; justify-self: start; }
  .profile-activity > li { grid-template-columns: 88px 1fr; gap: 10px; }
}

.attend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.attend-btn { background: rgba(141, 155, 178, .32); color: var(--paper); backdrop-filter: blur(6px); }
.attend-btn .when-on { display: none; }
.attend-btn.is-on { background: var(--signal); color: var(--signal-ink); }
.attend-btn.is-on .when-on { display: inline-block; }
.attend-btn.is-on .when-off { display: none; }
.attend-faces { display: inline-flex; }
.attend-faces a { margin-left: -8px; border-radius: 50%; box-shadow: 0 0 0 2px #0a0f1a; display: inline-flex; }
.attend-faces a:first-child { margin-left: 0; }
.attend-label { color: #c7d2e0; font-size: .9rem; }

.notifmenu { position: relative; }
.notif-btn { position: relative; }
.notif-btn .ic { width: 22px; height: 22px; }
.notif-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff5470; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.notif-count[hidden] { display: none; }
.notif-pop { position: absolute; right: -8px; top: calc(100% + 10px); width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--deck, #101826); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); z-index: 60; }
.notif-pop-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 8px; position: sticky; top: 0; background: inherit; }
.notif-pop-head a { font-size: .84rem; color: var(--frost); }
.notif-list { list-style: none; margin: 0; padding: 0 6px 6px; display: grid; gap: 2px; }
.notif a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 8px; border-radius: 8px; }
.notif a:hover { background: rgba(191, 225, 248, .06); }
.notif.is-new a { background: rgba(18, 164, 236, .09); }
.notif-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--rig); color: var(--signal); }
.notif-main { display: grid; gap: 2px; font-size: .9rem; line-height: 1.35; }
.notif-excerpt { color: var(--fog); font-size: .84rem; }
.notif-time { color: var(--fog); font-size: .76rem; }
.notif-thumb { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.notif-empty { padding: 18px 14px; color: var(--fog); margin: 0; }
.page .notif-list { padding: 0; }
@media (max-width: 700px) { .notif-pop { position: fixed; right: 12px; left: 12px; width: auto; top: 60px; } .notif-thumb { width: 72px; } }
a.ev--plain:hover { opacity: .9; }
.chip--attended { color: var(--signal); }
.chip--attended .ic { color: var(--signal); }
.event-nothing { max-width: 60ch; }
/* Event without a picture: a soft glow in the site's colours instead of a big empty space */
.event-hero--plain { min-height: 0; padding-top: calc(var(--topbar) + clamp(48px, 9vw, 110px)); padding-bottom: 32px;
  background:
    radial-gradient(ellipse 70% 120% at 12% 0%, rgba(18, 164, 236, .30), transparent 60%),
    radial-gradient(ellipse 60% 90% at 88% 10%, rgba(120, 90, 255, .18), transparent 60%),
    linear-gradient(180deg, #0c1a2e 0%, var(--night) 100%); }
.event-hero--plain .event-shade { background: linear-gradient(0deg, var(--night) 0%, transparent 70%); }

/* Profile cover image */
.profile--cover { position: relative; isolation: isolate; padding-top: calc(var(--topbar) + clamp(110px, 17vw, 230px)); }
.profile-cover { position: absolute; z-index: -1; inset: 0 0 auto 0; height: clamp(300px, 34vw, 520px); overflow: hidden; pointer-events: none; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.85) 45%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.85) 45%, transparent 100%); }
.profile-cover::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,9,18,.55) 0%, transparent 22%), linear-gradient(90deg, rgba(5,9,18,.55) 0%, transparent 60%); }
.profile--cover .profile-who h1, .profile--cover .profile-who > p { text-shadow: 0 2px 14px rgba(5,9,18,.75); }
.profile--cover .profile-head .avatar { box-shadow: 0 0 0 4px var(--night), 0 8px 30px rgba(0,0,0,.45); }
@media (max-width: 700px) {
  .profile--cover { padding-top: calc(var(--topbar) + 96px); }
  .profile-cover { height: 300px; }
}
.cover-form { display: grid; gap: 8px; margin: 4px 0 22px; max-width: 560px; }
.cover-preview { position: relative; aspect-ratio: 16 / 5; border-radius: 10px; overflow: hidden; background: var(--deck, #101826); border: 1px solid var(--line); cursor: ns-resize; touch-action: none; }
.cover-preview.is-empty { cursor: default; display: grid; place-items: center; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.cover-preview-empty { display: inline-flex; align-items: center; gap: 8px; color: var(--fog); font-size: .9rem; }
.cover-pos { display: grid; gap: 4px; font-size: .88rem; color: var(--fog); }
.cover-pos input { width: 100%; accent-color: #12a4ec; }
.cover-form .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cover-form label.btn { cursor: pointer; }

/* Login / register: member perks beside the form */
.auth-grid { position: relative; width: min(440px, 100%); }
.auth-grid .auth-card { width: 100%; }
.auth-wrap--perks .auth-grid { width: min(960px, 100%); display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.auth-perks { background: rgba(13, 20, 34, .78); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 30px); }
.auth-perks h2 { font-size: 1.35rem; font-weight: 750; margin: 0 0 16px; }
.auth-perks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-perks li { display: flex; gap: 12px; align-items: flex-start; }
.perk-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(18, 164, 236, .16); color: #4cc3ff; }
.perk-ic .ic { width: 17px; height: 17px; }
.auth-perks strong { display: block; font-size: .98rem; }
.auth-perks small { display: block; color: #aab7c9; font-size: .86rem; line-height: 1.4; margin-top: 1px; }
.perk-free { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--paper); font-weight: 600; font-size: .92rem; }
.perk-free .ic { width: 16px; height: 16px; color: #3ddc97; }
@media (max-width: 860px) {
  .auth-wrap--perks .auth-grid { grid-template-columns: 1fr; width: min(440px, 100%); }
  .auth-perks h2 { font-size: 1.15rem; }
}
.profile-country { white-space: nowrap; }
.profile-country .flag { font-size: 1.05em; }

.profile-watched { display: grid; gap: 6px; margin-top: 12px; max-width: 320px; color: var(--fog); font-size: .92rem; }
.profile-watched strong { color: var(--paper); font-size: 1.05rem; }
.pw-bar { display: block; height: 6px; border-radius: 3px; background: rgba(141, 155, 178, .22); overflow: hidden; }
.pw-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12a4ec, #6fd0ff); }

/* XP and levels */
.lvl-tier-0 { --lvl: #8d9bb2; --lvl2: #5d6b82; }
.lvl-tier-1 { --lvl: #3ddc97; --lvl2: #1f9e6a; }
.lvl-tier-2 { --lvl: #12a4ec; --lvl2: #0b6fa3; }
.lvl-tier-3 { --lvl: #8b6cff; --lvl2: #5a3fd6; }
.lvl-tier-4 { --lvl: #ff9f43; --lvl2: #d9721a; }
.lvl-tier-5 { --lvl: #ff4d6d; --lvl2: #c22745; }
.lvl-tier-6 { --lvl: #ffd23f; --lvl2: #d4a20a; }
.lvl-tier-7 { --lvl: #ff6ec7; --lvl2: #12a4ec; }
.lvl-ring { position: relative; display: inline-grid; place-items: center; padding: 4px; border-radius: 50%; background: conic-gradient(from 210deg, var(--lvl), var(--lvl2), var(--lvl)); flex: none; align-self: start; }
.lvl-ring > .avatar { box-shadow: 0 0 0 3px var(--night) !important; }
.lvl-ring.lvl-tier-7 { background: conic-gradient(#ff6ec7, #ffd23f, #3ddc97, #12a4ec, #8b6cff, #ff6ec7); }
.lvl-ring--sm { padding: 2px; }
.lvl-ring--sm > .avatar { box-shadow: 0 0 0 2px var(--night) !important; }
.lvl-num { position: absolute; bottom: -4px; right: -2px; min-width: 30px; height: 30px; padding: 0 7px; display: grid; place-items: center; border-radius: 15px;
  background: var(--lvl); color: #07101d; font-weight: 800; font-size: .9rem; box-shadow: 0 0 0 3px var(--night); }
.profile-level { max-width: 560px; margin: -4px 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(16, 24, 38, .7); }
.pl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.pl-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--lvl); color: #07101d; font-weight: 750; font-size: .8rem; white-space: nowrap; }
.pl-badge.lvl-tier-7 { background: linear-gradient(90deg, #ff6ec7, #ffd23f, #3ddc97, #12a4ec); }
.pl-top { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--frost); }
.pl-top .ic { width: 15px; height: 15px; }
.pl-bar { height: 8px; border-radius: 4px; }
.pl-next { margin: 6px 0 0; font-size: .85rem; }
.pl-recent { margin-top: 10px; font-size: .88rem; }
.pl-recent summary { cursor: pointer; color: var(--fog); }
.pl-recent ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.pl-recent time { font-size: .8rem; margin-left: 4px; }
.pl-recent a { color: var(--frost); }
.pl-plus { display: inline-block; min-width: 38px; color: #3ddc97; font-weight: 700; }
.lvl-pill { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 750; line-height: 1.6; color: #07101d; background: var(--lvl); }
.lvl-pill.lvl-tier-7 { background: linear-gradient(90deg, #ff6ec7, #ffd23f, #3ddc97, #12a4ec); }
.xp-toast { position: fixed; z-index: 90; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); opacity: 0;
  padding: 10px 18px; border-radius: 999px; background: rgba(13, 20, 34, .96); border: 1px solid rgba(61, 220, 151, .45); color: var(--paper);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: opacity .3s, transform .3s; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.xp-toast b { color: #3ddc97; }
.xp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.xp-toast--level { border-color: rgba(255, 210, 63, .6); background: linear-gradient(90deg, rgba(40, 30, 6, .97), rgba(13, 20, 34, .97)); }
.xp-toast--level b { color: #ffd23f; }
@media (max-width: 700px) { .xp-toast { bottom: calc(78px + env(safe-area-inset-bottom)); } }
.top-me { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 16px; }
.seg-tabs { display: flex; gap: 6px; margin: 8px 0 14px; }
.seg-tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--fog); font-size: .92rem; }
.seg-tabs a[aria-current] { background: var(--paper); color: #07101d; border-color: var(--paper); font-weight: 650; }
.top-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 6px; }
.top-list li { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 10px; background: var(--deck, #101826); border: 1px solid var(--line); }
.top-list li.is-me { border-color: rgba(18, 164, 236, .6); }
.top-rank { width: 28px; text-align: center; font-weight: 800; color: var(--fog); }
.top-1 .top-rank { color: #ffd23f; } .top-2 .top-rank { color: #d6dde8; } .top-3 .top-rank { color: #e0a36b; }
.top-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.top-who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-who small { display: block; font-size: .8rem; }
.top-score { font-weight: 750; white-space: nowrap; }
.top-score small { color: var(--fog); font-weight: 600; }
.xp-how h2 { font-size: 1.25rem; margin: 24px 0 10px; }
.xp-table { width: 100%; border-collapse: collapse; }
.xp-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.xp-val { text-align: right; color: #3ddc97; font-weight: 750; white-space: nowrap; }
.lvl-titles { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.small { font-size: .85rem; }
@media (max-width: 700px) { .lvl-num { min-width: 24px; height: 24px; font-size: .78rem; } }

/* Games hub */
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 18px; margin-bottom: 26px; }
.g-card { background: var(--deck, #101826); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px; }
.g-card h2, .g-h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; margin: 0 0 6px; }
.g-card h2 .ic, .g-h2 .ic { width: 20px; height: 20px; color: #4cc3ff; }
.quiz-photo { margin: 10px 0 12px; border-radius: 10px; overflow: hidden; background: var(--rig); aspect-ratio: 3 / 2; }
.quiz-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-opt { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(141,155,178,.1); color: var(--paper); font-weight: 600; font-size: .92rem; line-height: 1.25; }
.quiz-opt:not(:disabled):hover { border-color: rgba(18,164,236,.7); background: rgba(18,164,236,.12); }
.quiz-opt:disabled { cursor: default; opacity: .75; }
.quiz-opt.is-right { opacity: 1; border-color: #3ddc97; background: rgba(61,220,151,.18); }
.quiz-opt.is-wrong { opacity: 1; border-color: #ff4d6d; background: rgba(255,77,109,.16); }
.quiz-result { margin-top: 12px; }
.quiz-result p { margin: 0 0 4px; }
.quiz-result a { color: var(--frost); }
.quiz-stats { margin: 10px 0 0; }
.g-login { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; color: var(--fog); font-size: .9rem; }
.ch-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px; }
.ch-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.ch-check { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(141,155,178,.16); color: var(--fog); }
.ch-check .ic { width: 15px; height: 15px; }
.ch-list li.is-done .ch-check { background: #3ddc97; color: #07101d; }
.ch-main { display: grid; gap: 4px; min-width: 0; }
.ch-label a { color: var(--paper); }
.ch-list li.is-done .ch-label { text-decoration: line-through; text-decoration-color: rgba(61,220,151,.7); }
.ch-main small { font-size: .78rem; }
.ch-xp { color: #3ddc97; font-weight: 750; font-size: .9rem; }
.ch-bonus { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--fog); font-size: .9rem; }
.ch-bonus .ic { width: 16px; height: 16px; color: #ffd23f; }
.ch-bonus.is-done { color: #ffd23f; font-weight: 650; }
.game-tile { display: grid; grid-template-columns: 96px 1fr; gap: 6px 16px; align-items: center; color: var(--paper); transition: border-color .2s, transform .2s; }
.game-tile:hover { border-color: rgba(18,164,236,.6); transform: translateY(-2px); }
.game-tile .btn { grid-column: 2; justify-self: start; margin-top: 6px; }
.game-tile-body { display: grid; gap: 3px; }
.game-tile-body strong { font-size: 1.15rem; }
.game-art { grid-row: span 2; width: 96px; height: 96px; border-radius: 14px; background-color: #0e1728; background-repeat: no-repeat; background-position: center; background-size: 70%; }
.game-tile--snake .game-art { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M8 52 V34 a8 8 0 0 1 8-8 h20 a8 8 0 0 0 8-8 v-6' fill='none' stroke='%2312a4ec' stroke-width='9' stroke-linecap='round'/%3E%3Crect x='36' y='2' width='16' height='14' rx='2' fill='%23dceaf7'/%3E%3Cpath d='M39 4v4M42 4v4M45 4v4M48 4v4' stroke='%23e8b923' stroke-width='2'/%3E%3Crect x='48' y='40' width='9' height='15' rx='3' fill='%2339d98a'/%3E%3C/svg%3E"); }
.game-tile--runner .game-art { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='24' cy='14' r='6' fill='%23f1c8a0'/%3E%3Crect x='17' y='6' width='14' height='5' fill='%230b1220'/%3E%3Crect x='17' y='21' width='14' height='18' rx='5' fill='%2312a4ec'/%3E%3Crect x='26' y='17' width='18' height='10' rx='2' fill='%232b2f3a'/%3E%3Ccircle cx='46' cy='22' r='2.5' fill='%235ec8ff'/%3E%3Cpath d='M24 39 L16 54 M24 39 L32 54' stroke='%231f2a44' stroke-width='5' stroke-linecap='round'/%3E%3Crect x='44' y='42' width='14' height='14' rx='2' fill='%235b6474'/%3E%3Cpath d='M2 57 H62' stroke='%2312a4ec' stroke-width='2'/%3E%3C/svg%3E"); }

/* Game page */
.game-page .crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--fog); }
.game-page .crumbs .ic { width: 16px; height: 16px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.game-main h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 6px 0 12px; }
.game-stage { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0b1220; user-select: none; -webkit-user-select: none; touch-action: none; }
.game-stage[data-game="snake"] { max-width: min(640px, 100%, calc(100svh - 230px)); }
.game-stage canvas { display: block; width: 100%; height: auto; }
.game-hud { position: absolute; top: 8px; left: 12px; right: 12px; display: flex; justify-content: space-between; font-size: .9rem; color: #c7d2e0; pointer-events: none; text-shadow: 0 1px 4px #000; }
.game-hud b { color: var(--paper); font-size: 1.05rem; margin-left: 4px; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6, 10, 18, .62); backdrop-filter: blur(2px); cursor: pointer; }
.game-overlay[hidden] { display: none; }
.game-msg { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 16px; color: var(--paper); }
.game-msg strong { font-size: 1.6rem; }
.gm-score { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.gm-best { color: #ffd23f; font-weight: 700; }
.gm-sub { color: var(--fog); font-size: .9rem; min-height: 1.2em; }
.game-help { margin: 10px 0 0; }
.dpad, .runpad { display: none; }
@media (pointer: coarse) {
  .dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 54px); gap: 6px; justify-content: center; margin: 12px auto 0; }
  .dpad button, .runpad button { border: 1px solid var(--line); background: rgba(141,155,178,.16); color: var(--paper); border-radius: 12px; font-size: 1.2rem; touch-action: none; }
  .dpad [data-dir="up"] { grid-column: 2; grid-row: 1; } .dpad [data-dir="left"] { grid-column: 1; grid-row: 2; }
  .dpad [data-dir="down"] { grid-column: 2; grid-row: 2; } .dpad [data-dir="right"] { grid-column: 3; grid-row: 2; }
  .runpad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .runpad button { height: 62px; font-size: 1rem; font-weight: 700; }
}
.game-side h2 { font-size: 1.15rem; margin: 6px 0 8px; }
.seg-tabs button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--fog); font-size: .9rem; }
.seg-tabs button.is-on { background: var(--paper); color: #07101d; border-color: var(--paper); font-weight: 650; }
.top-list--compact li { padding: 6px 10px; gap: 8px; }
.top-list--compact .top-rank { width: 20px; }
@media (max-width: 900px) { .game-layout { grid-template-columns: 1fr; } }
body.page-game .tabbar { display: none; }

/* Reactions */
.reacts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.react { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px !important; border-radius: 999px; border: 1px solid var(--line) !important; background: rgba(141,155,178,.1) !important; font-size: .78rem !important; color: var(--fog); }
.react.is-on { border-color: rgba(18,164,236,.7) !important; background: rgba(18,164,236,.16) !important; color: var(--paper); }
.react:disabled { opacity: .7; cursor: default; }
.react-add { position: relative; }
.react-pop { position: absolute; z-index: 20; bottom: calc(100% + 6px); left: -8px; display: grid; grid-template-columns: repeat(4, 40px); gap: 2px; padding: 5px; border-radius: 12px; background: #141e30; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.react-pop[hidden] { display: none; }
@media (min-width: 700px) { .react-pop { grid-template-columns: repeat(8, 40px); } }
.react-pop button { display: grid; justify-items: center; min-width: 34px; padding: 4px !important; border-radius: 8px; font-size: 1.2rem !important; line-height: 1; }
.react-pop button:not(:disabled):hover { background: rgba(141,155,178,.18) !important; }
.react-pop button:disabled { filter: grayscale(1); opacity: .45; cursor: not-allowed; }
.react-pop small { font-size: .55rem; color: var(--fog); margin-top: 2px; }

/* Cover effects (unlocked with levels) */
.profile-cover.fx-zoom img { animation: fx-zoom 24s ease-in-out infinite alternate; }
@keyframes fx-zoom { from { transform: scale(1); } to { transform: scale(1.12) translate(-1.5%, 1%); } }
.profile-cover.fx-shimmer::before, .profile-cover.fx-rainbow::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%); background-size: 250% 100%; animation: fx-shimmer 6s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%); mask-image: linear-gradient(180deg, #000 30%, transparent 95%); }
@keyframes fx-shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.profile-cover.fx-sparkle::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(2px 2px at 12% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 32% 64%, #fff, transparent), radial-gradient(2px 2px at 54% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 71% 58%, #fff, transparent), radial-gradient(2.5px 2.5px at 86% 18%, #fff, transparent), radial-gradient(1.5px 1.5px at 22% 80%, #fff, transparent), radial-gradient(2px 2px at 92% 70%, #fff, transparent);
  animation: fx-twinkle 3.2s ease-in-out infinite alternate; }
@keyframes fx-twinkle { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .35; transform: translateY(-6px); } }
.profile-cover.fx-aurora::before, .profile-cover.fx-rainbow::after { content: ""; position: absolute; inset: -20%; z-index: 1; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background: radial-gradient(40% 50% at 20% 30%, rgba(61,220,151,.55), transparent 70%), radial-gradient(40% 50% at 70% 20%, rgba(139,108,255,.55), transparent 70%), radial-gradient(35% 45% at 50% 70%, rgba(18,164,236,.45), transparent 70%);
  filter: blur(20px); animation: fx-aurora 14s ease-in-out infinite alternate; }
@keyframes fx-aurora { from { transform: translate(-4%, 0) rotate(0deg); } to { transform: translate(4%, 3%) rotate(8deg); } }
.profile-cover.fx-pulse img { animation: fx-pulse 5s ease-in-out infinite; }
@keyframes fx-pulse { 0%, 100% { filter: saturate(1) brightness(1); } 50% { filter: saturate(1.35) brightness(1.12) hue-rotate(-12deg); } }
.profile-cover.fx-rainbow::after { filter: blur(24px) hue-rotate(0deg); animation: fx-aurora 14s ease-in-out infinite alternate, fx-hue 10s linear infinite; }
@keyframes fx-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
.profile-cover.fx-rainbow img { -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.85) 45%, transparent 100%); }
@media (prefers-reduced-motion: reduce) { .profile-cover [class], .profile-cover img, .profile-cover::before, .profile-cover::after { animation: none !important; } }
.cover-fx { margin-top: 6px; }

.hud-right { display: inline-flex; align-items: center; gap: 12px; }
.game-sound { pointer-events: auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(6,10,18,.55); color: var(--paper); position: relative; z-index: 2; }
.game-sound .ic { width: 17px; height: 17px; }
.game-sound .when-off { display: none; }
.game-sound.is-off .when-on { display: none; }
.game-sound.is-off .when-off { display: block; }

/* Game controls: no text selection, magnifier or "Copy / Look up" menu when holding a button on phones */
.game-stage, .dpad, .runpad, .dpad button, .runpad button, .game-sound {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }

/* Filmaren on phones: the game area is low, so the "game over" box goes side by side instead of stacked */
@media (max-width: 600px) {
  .game-stage[data-game="runner"] .game-msg { grid-template-columns: auto auto; column-gap: 18px; row-gap: 2px; align-items: center; justify-items: start; text-align: left; padding: 8px 12px; }
  .game-stage[data-game="runner"] .game-msg > * { grid-column: 1; }
  .game-stage[data-game="runner"] .game-msg > .btn, .game-stage[data-game="runner"] .game-msg > button, .game-stage[data-game="runner"] .game-msg > .gm-btns { grid-column: 2; grid-row: 1 / span 4; padding: 8px 14px; }
  .game-stage[data-game="runner"] .game-msg strong { font-size: 1.05rem; }
  .game-stage[data-game="runner"] .gm-score { font-size: 1.7rem; }
  .game-stage[data-game="runner"] .gm-best { font-size: .85rem; }
  .game-stage[data-game="runner"] .gm-sub { font-size: .75rem; max-width: 30ch; line-height: 1.25; }
  .game-stage .game-msg > span:only-of-type { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .game-stage[data-game="runner"] .game-msg { column-gap: 12px; padding: 4px 10px; }
  .game-stage[data-game="runner"] .game-msg strong { font-size: .95rem; }
  .game-stage[data-game="runner"] .gm-score { font-size: 1.35rem; }
  .game-stage[data-game="runner"] .gm-sub { font-size: .7rem; }
  .game-stage[data-game="runner"] .game-msg > button { padding: 7px 12px; font-size: .85rem; }
}

/* Phones: the game buttons sit at the bottom of the screen, where the thumbs are */
@media (pointer: coarse) {
  body.page-game .runpad, body.page-game .dpad {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; margin: 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(5, 9, 18, .97) 60%, rgba(5, 9, 18, 0)); }
  body.page-game .dpad { justify-content: center; grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(2, 60px); }
  body.page-game .runpad button { height: 74px; }
  body.page-game main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  /* the square snake board must not end up under the buttons */
  body.page-game .game-stage[data-game="snake"] { max-width: min(100%, calc(100svh - 340px - env(safe-area-inset-bottom))); margin-inline: auto; }
  body.page-game .site-footer, body.page-game footer { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* Filmaren: memory meter in the top bar */
.mem { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.mem-rec { font-style: normal; color: #ff4d6d; }
.mem-rec::before { content: "●"; margin-right: 3px; }
.mem-track { display: block; width: clamp(54px, 18vw, 150px); height: 8px; border-radius: 4px; background: rgba(0,0,0,.55); overflow: hidden; margin: 0 !important; }
.mem-track > span { display: block; height: 100%; width: 0; border-radius: inherit; background: #3ddc97; transition: width .2s linear; }
.mem[data-level="warn"] .mem-track > span { background: #ffd23f; }
.mem[data-level="full"] .mem-track > span { background: #ff4d6d; }
.mem em { font-style: normal; color: #e8eef7; white-space: nowrap; }
.mem[data-level="full"] em, .mem[data-level="full"] .mem-rec { animation: mem-blink .8s steps(2, start) infinite; color: #ff4d6d; }
@keyframes mem-blink { to { visibility: hidden; } }
@media (max-width: 600px) { .mem { font-size: .62rem; gap: 4px; } .game-hud { font-size: .78rem; } }
@media (prefers-reduced-motion: reduce) { .mem[data-level="full"] em, .mem[data-level="full"] .mem-rec { animation: none; } }

/* Top bar of the games: three fixed columns and same-width digits, so nothing slides sideways as numbers change */
.game-hud { display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: start; font-variant-numeric: tabular-nums; }
.game-hud > :first-child { justify-self: start; }
.game-hud > :last-child { justify-self: end; grid-column: 3; }
.game-hud > .mem { justify-self: center; }
.mem { position: relative; }
.mem em { display: inline-block; min-width: 11.5ch; text-align: left; font-variant-numeric: tabular-nums; }
.mem[data-level="full"]::after { content: attr(data-warn); position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; color: #ff4d6d; font-size: .9em; font-weight: 800; animation: mem-blink .8s steps(2, start) infinite; }
@media (prefers-reduced-motion: reduce) { .mem[data-level="full"]::after { animation: none; } }

.hud-star { display: none; color: #ffd23f; }
/* Phones, Filmaren: room for the memory meter between the numbers */
@media (max-width: 600px) {
  .game-stage[data-game="runner"] .hud-l { display: none; }
  .game-stage[data-game="runner"] .hud-star { display: inline; }
  .game-stage[data-game="runner"] .game-hud { left: 8px; right: 8px; }
  .game-stage[data-game="runner"] .mem-rec { font-size: 0; }
  .game-stage[data-game="runner"] .mem-rec::before { font-size: .7rem; margin: 0; }
  .game-stage[data-game="runner"] .mem-track { width: 52px; }
  .game-stage[data-game="runner"] .mem em { min-width: 10.5ch; }
}

/* Memory */
.memory { position: relative; max-width: 620px; }
.memory-hud { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: .9rem; color: #c7d2e0; font-variant-numeric: tabular-nums; }
.memory-hud b { color: var(--paper); font-size: 1.05rem; margin-left: 3px; }
.memory-hud .hud-star { display: inline; }
.memory-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(6px, 1.6vw, 12px); }
.mcard { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: none; perspective: 700px; cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mcard:disabled { cursor: default; }
.mcard-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .35s ease; }
.mcard.is-open .mcard-in, .mcard.is-matched .mcard-in { transform: rotateY(180deg); }
.mcard-back, .mcard-front { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mcard-back { background: radial-gradient(circle at 30% 25%, rgba(18,164,236,.35), transparent 55%), linear-gradient(135deg, #12223a, #0b1424);
  border: 1px solid rgba(18,164,236,.35); display: grid; place-items: center; }
.mcard-back::after { content: "HEJSAN.TV"; font: 800 clamp(.5rem, 1.9vw, .8rem)/1 var(--display, sans-serif); letter-spacing: .04em; color: rgba(76,195,255,.75); }
.mcard:not(:disabled):hover .mcard-back { border-color: rgba(18,164,236,.8); }
.mcard-front { transform: rotateY(180deg); background: #0b1220 center / cover no-repeat; border: 2px solid transparent; }
.mcard.is-matched .mcard-front { border-color: #3ddc97; box-shadow: 0 0 0 2px rgba(61,220,151,.25); }
.mcard.is-miss .mcard-front { border-color: #ff4d6d; }
.memory-overlay { border-radius: 12px; }
.memory .game-msg { max-width: 420px; }
.gm-from { font-size: .8rem; color: var(--fog); }
.gm-from a { color: var(--frost); }
@media (prefers-reduced-motion: reduce) { .mcard-in { transition: none; } }
.game-tile--memory .game-art { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='6' y='10' width='22' height='22' rx='4' fill='%2312223a' stroke='%2312a4ec' stroke-width='2'/%3E%3Crect x='36' y='10' width='22' height='22' rx='4' fill='%23e07b39'/%3E%3Ccircle cx='47' cy='18' r='4' fill='%23ffd23f'/%3E%3Cpath d='M38 30 l7-7 5 5 4-3 4 5z' fill='%23123a2a'/%3E%3Crect x='6' y='38' width='22' height='22' rx='4' fill='%23e07b39'/%3E%3Ccircle cx='17' cy='46' r='4' fill='%23ffd23f'/%3E%3Cpath d='M8 58 l7-7 5 5 4-3 4 5z' fill='%23123a2a'/%3E%3Crect x='36' y='38' width='22' height='22' rx='4' fill='%2312223a' stroke='%2312a4ec' stroke-width='2'/%3E%3C/svg%3E"); }

.games-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: 10px; }
.games-grid--3 .game-tile { grid-template-columns: 72px 1fr; }
.games-grid--3 .game-art { width: 72px; height: 72px; }
#games + .games-grid { margin-top: 26px; }

.gm-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (max-width: 600px) { .game-stage[data-game="runner"] .game-msg > .gm-btns { grid-column: 2; grid-row: 1 / span 4; flex-direction: column; } .gm-btns .btn { padding: 8px 14px; } }

.memory-hud { grid-template-columns: repeat(3, auto) auto; align-items: center; }
.memory-hud .hud-right { display: inline-flex; align-items: center; gap: 10px; }
.memory-hud .game-sound { width: 28px; height: 28px; background: rgba(141,155,178,.16); }

/* ------------------------------------------------------------------ */
/*  Phones held sideways: the game fills the screen. The game area      */
/*  keeps its shape (same view for every player), and only grows/shrinks */
/* ------------------------------------------------------------------ */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  body.page-game { --gx: 0px; overflow: hidden; }
  body.page-game .topbar, body.page-game .sitefoot, body.page-game .tabbar, body.page-game .consent,
  body.page-game .game-main h1, body.page-game .game-help, body.page-game .g-login, body.page-game .game-side { display: none !important; }
  body.page-game main { padding: 0 !important; min-height: 0; }
  body.page-game .game-page { padding: 0; height: var(--app-h, 100svh); overflow: hidden; }
  body.page-game .game-layout { display: block; height: 100%; }
  body.page-game .game-main { height: var(--app-h, 100svh); display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 6px calc(10px + var(--safe-r, env(safe-area-inset-right))) 6px calc(10px + var(--safe-l, env(safe-area-inset-left))); box-sizing: border-box; }
  /* Back to the games list: a small round button in the corner */
  body.page-game .crumbs { position: fixed; z-index: 50; top: calc(8px + var(--app-top, 0px)); left: calc(8px + var(--safe-l, env(safe-area-inset-left))); margin: 0; }
  body.page-game .crumbs a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(13,20,34,.8); border: 1px solid var(--line); font-size: 0; line-height: 0; gap: 0; padding: 0; color: var(--paper); }
  body.page-game .crumbs .ic { display: block; width: 18px; height: 18px; margin: 0; flex: none; }

  /* Filmaren: Duck to the left, the game in the middle, Jump to the right */
  body.page-game .game-stage[data-game="runner"] { order: 2; flex: none; margin: 0;
    width: min(calc(var(--app-w, 100vw) - 2 * 92px - 2 * 12px - 20px - var(--safe-l, env(safe-area-inset-left)) - var(--safe-r, env(safe-area-inset-right))), calc((var(--app-h, 100svh) - 12px) * 800 / 360)); }
  body.page-game .runpad { display: contents !important; position: static !important; }
  body.page-game .runpad button { padding: 0 4px; flex: 0 0 92px; width: 92px; align-self: stretch; height: auto !important; margin: 52px 0 10px; /* starts below the back button */
    font-size: .95rem; border-radius: 18px; display: grid; place-items: center; }
  body.page-game .runpad [data-act="duck"] { order: 1; }
  body.page-game .runpad [data-act="jump"] { order: 3; }

  /* Kabelormen: the square board as big as the height allows, the arrows to the right */
  body.page-game .game-stage[data-game="snake"] { flex: none; margin: 0 !important; max-width: none !important;
    width: min(calc(var(--app-h, 100svh) - 12px), calc(var(--app-w, 100vw) - 260px - var(--safe-l, env(safe-area-inset-left)) - var(--safe-r, env(safe-area-inset-right)))); }
  body.page-game .dpad { position: static !important; padding: 0 !important; background: none !important; margin: 0 !important;
    grid-template-columns: repeat(3, 64px) !important; grid-template-rows: repeat(3, 64px) !important; }
  body.page-game .dpad [data-dir="up"] { grid-column: 2; grid-row: 1; } body.page-game .dpad [data-dir="left"] { grid-column: 1; grid-row: 2; }
  body.page-game .dpad [data-dir="down"] { grid-column: 2; grid-row: 3; } body.page-game .dpad [data-dir="right"] { grid-column: 3; grid-row: 2; }

  /* Memory: the board fills the height, time and moves to the left of it */
  body.page-game .memory { display: flex; align-items: center; gap: 14px; max-width: none; height: 100%; }
  body.page-game .memory-hud { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 0; min-width: 96px; }
  body.page-game .memory-board { width: min(calc(var(--app-h, 100svh) - 12px), calc(var(--app-w, 100vw) - 150px - var(--safe-l, env(safe-area-inset-left)) - var(--safe-r, env(safe-area-inset-right)))); flex: none; gap: 6px; }
  body.page-game .memory-overlay { inset: 0; }
  body.page-game .game-msg { padding: 8px 14px; }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  html:has(body.page-game) { overflow: hidden; }
  body.page-game .runpad button { font-size: .85rem; flex-direction: column; gap: 4px; }
}

/* Other games, at the bottom of the side panel */
.game-more { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.game-more h3 { font-size: .95rem; margin: 0 0 2px; color: var(--fog); font-weight: 650; }
.game-more-link { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 10px; color: var(--paper); font-weight: 600; background: rgba(141,155,178,.08); }
.game-more-link:hover { background: rgba(18,164,236,.14); }
.game-more-link .game-art { width: 38px; height: 38px; border-radius: 8px; flex: none; }
.game-more-link .ic { width: 16px; height: 16px; margin-left: auto; color: var(--fog); }

/* Computers and large tablets: the game and its leaderboard as one panel in the middle of the page */
@media (min-width: 901px) and (min-height: 601px), (min-width: 901px) and (pointer: fine) {
  body.page-game .game-page { width: fit-content; max-width: 100%; margin-inline: auto; box-sizing: border-box; }
  body.page-game .game-layout { grid-template-columns: auto 290px; gap: 0; align-items: stretch; width: fit-content; max-width: 100%;
    background: linear-gradient(180deg, rgba(18,34,58,.55), rgba(13,20,34,.85)); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.35); }
  body.page-game .game-main { padding: 22px 26px 20px; min-width: 0; }
  body.page-game .game-main h1 { margin-top: 0; }
  body.page-game .game-side { padding: 22px 22px 20px; border-left: 1px solid var(--line); background: rgba(5,9,18,.35); }
  body.page-game .game-side h2 { margin-top: 0; }
  /* Sizes that keep each game's shape and leave room for the panel */
  body.page-game .game-stage[data-game="runner"] { width: min(860px, calc(100vw - 2 * var(--gx, 24px) - 400px)); }
  body.page-game .game-stage[data-game="snake"] { width: min(600px, calc(100vh - 310px), calc(100vw - 2 * var(--gx, 24px) - 400px)); max-width: none; }
  body.page-game .memory { width: min(600px, calc(100vh - 330px), calc(100vw - 2 * var(--gx, 24px) - 400px)); }
  body.page-game .game-help { max-width: 62ch; }
  body.page-game .game-side { min-width: 0; }
}
/* Long names in the game top lists are shortened instead of pushing the score out */
.top-list li, .top-who { min-width: 0; }
.top-who > span:last-child { min-width: 0; overflow: hidden; }
.top-list--compact .top-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* Memory: columns may shrink below their content (no overflow on small boards), and the logo on the card backs */
.memory-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mcard { min-width: 0; }
.mcard-back::after { content: ""; width: 72%; height: 30%; background: url("/assets/img/logo@2x.png") center / contain no-repeat; opacity: .85; }
.memory-hud { grid-template-columns: repeat(4, auto); min-width: 0; font-size: clamp(.74rem, 1.6vh + .3vw, .9rem); }
.memory-hud b { font-size: 1.15em; }

/* Memory start/finish screen: blur the cards themselves (soft edges all round) instead of a blurred overlay box with hard edges */
.memory-overlay { -webkit-backdrop-filter: none; backdrop-filter: none; inset: -12px; border-radius: 18px; background: rgba(6, 10, 18, .45); }
.memory:has(> .memory-overlay:not([hidden])) .memory-board,
.memory:has(> .memory-overlay:not([hidden])) .memory-hud { filter: blur(3px); opacity: .7; transition: filter .25s, opacity .25s; }
.memory-board, .memory-hud { transition: filter .25s, opacity .25s; }
