/* Qualification theme
   Visual merge of the battle-tested `quals` CTFd UI and ctf.securinets.tn.
   Keep structural and behavioral rules in theme.css; this file is the visual layer. */

/* Type shared with ctf.securinets.tn: Montserrat for titles (as before), Inter for running text (the
   site's body font), JetBrains Mono for labels and numbers. Inter is self-hosted like the others
   (SIL OFL, see fonts/OFL-Inter.txt). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* metric-matched stand-in while Inter loads, so text does not jump when it arrives */
@font-face { font-family: "Inter Fallback"; src: local("Arial"); size-adjust: 107.4%; ascent-override: 90.2%; descent-override: 22.48%; line-gap-override: 0%; }

:root {
  --font-body: "Inter", "Inter Fallback", system-ui, sans-serif;
  --void: #070708;
  --surface: #101012;
  --raised: #19191c;
  --charcoal: #29292d;
  --line-strong: #424248;
  --signal: #df161d;
  --signal-hot: #fa2b32;
  --coral: #ff777b;
  --bone: #f5f3f1;
  --ash: #aaa7aa;
  --cyan: rgba(255, 115, 86, .5);
  --max: 1320px;
  --nav-h: 72px;
  --radius: 10px;
}

/* the page root matches the bar and footer, so the reserved scrollbar space is not a lighter strip */
html { background: var(--void); }

body.qualification-theme {
  background:
    radial-gradient(1000px 680px at 8% -8%, rgba(223, 22, 29, .11), transparent 62%),
    radial-gradient(900px 620px at 94% 12%, rgba(117, 13, 20, .10), transparent 65%),
    linear-gradient(180deg, #080809 0%, #070708 100%);
}

body.qualification-theme::after { opacity: .38; }

.qualification-ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.qualification-ambient::before {
  content: "";
  position: absolute;
  inset: -12%;
  opacity: .23;
  background-image:
    radial-gradient(circle, rgba(255, 91, 70, .9) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(223, 22, 29, .65) 0 1px, transparent 1.7px);
  background-position: 0 0, 37px 51px;
  background-size: 89px 97px, 131px 127px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 12%, transparent 74%);
  mask-image: radial-gradient(ellipse at center, #000 12%, transparent 74%);
  animation: qualification-drift 28s linear infinite alternate;
}

.qualification-ambient i {
  position: absolute;
  width: min(60vw, 880px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(223, 22, 29, .11), rgba(223, 22, 29, .04) 55%, transparent);
  opacity: .48;
  animation: qualification-float 11s ease-in-out infinite;
}

.qualification-ambient i:nth-child(1) { top: -34%; left: -22%; }
.qualification-ambient i:nth-child(2) { right: -26%; top: 5%; animation-delay: -4s; animation-duration: 14s; }
.qualification-ambient i:nth-child(3) { left: 30%; bottom: -50%; animation-delay: -7s; animation-duration: 16s; }

@keyframes qualification-drift {
  from { transform: translate3d(-1.5%, -1%, 0); }
  to { transform: translate3d(1.5%, 1%, 0); }
}

@keyframes qualification-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.06); }
}

/* Header: the clarity of quals with the softer portal treatment from ctf.securinets.tn. */
.nav {
  border-color: rgba(255, 255, 255, .09);
  background: rgba(7, 7, 8, .92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025), 0 14px 38px rgba(0, 0, 0, .18);
}

.nav .wrap { gap: clamp(18px, 2.5vw, 34px); }

.brand { gap: 11px; }
.brand > img:not(.brand-logo) { width: 34px; }
.brand .brand-logo { max-width: 170px; }
.brand-copy { display: grid; gap: 4px; min-width: 0; }
.brand .brand-name {
  display: flex;
  gap: .42em;
  color: var(--text);
  font: 800 12px/1 var(--font-display);
  letter-spacing: .055em;
}
.brand .brand-edition {
  display: block;
  color: var(--muted);
  font: 700 8px/1 var(--font-mono);
  letter-spacing: .19em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links { gap: clamp(15px, 2vw, 25px); }
.nav-links a, .nav-right a, .nav-right button { letter-spacing: .105em; }
/* Nav tabs: each link fills the bar's height (a generous hover area). Hover and keyboard focus: the
   label grows a little and glows red, with no underline. The current page keeps a red line on the
   bar's bottom edge with a soft glow. */
.nav-links { align-self: stretch; }
.nav-links a { display: flex; align-items: center; padding: 0 2px; }
.nav-links a > span {
  display: inline-block;
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1), text-shadow 220ms ease;
}
.nav-links a:not([aria-current="page"])::after { content: none; }
.nav-links a[aria-current="page"]::after {
  bottom: -1px; height: 2px; border-radius: 2px 2px 0 0;
  transform: scaleX(1); box-shadow: 0 0 14px rgba(223, 22, 29, .6);
}
.nav-links a:focus-visible { color: var(--text); outline: none; }
.nav-links a:focus-visible::before { content: ""; position: absolute; inset: 22px -8px; border: 2px solid var(--accent); border-radius: 6px; }
.nav-links a:focus-visible > span { transform: scale(1.08); text-shadow: 0 0 12px rgba(223, 22, 29, .7); }
@media (hover: hover) {
  .nav-links a:hover > span { transform: scale(1.08); text-shadow: 0 0 12px rgba(223, 22, 29, .7); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-links a > span { transition: none; }
}

.nav-right .btn-primary,
.nav-right .btn-primary[aria-current] {
  border-radius: 7px;
  box-shadow: 0 8px 28px rgba(223, 22, 29, .22);
}

.acct-menu,
.mobile-menu {
  overflow: hidden;
  border-color: rgba(255, 255, 255, .13);
  border-radius: var(--radius);
  background: rgba(16, 16, 18, .98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58);
}

/* Hero photography is retained locally; no external request is required.
   The hero fills the space between the top bar and the footer (no fixed heights to keep in sync). */
main.landing { display: flex; flex-direction: column; }
.landing .stage {
  flex: 1 0 auto;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(76px, 11vh, 130px) clamp(60px, 8vh, 96px);
}

.qualification-hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.qualification-hero-media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  opacity: .62;
  filter: saturate(.92) contrast(1.08);
  transform: scale(1.025);
  animation: qualification-hero-in 900ms cubic-bezier(.2, .8, .2, 1) both;
}

.qualification-hero-media::before,
.qualification-hero-media::after,
.qualification-hero-media span {
  content: "";
  position: absolute;
  inset: 0;
}

.qualification-hero-media::before {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 7, 8, .34), rgba(7, 7, 8, .5) 55%, #070708 100%),
    radial-gradient(ellipse at center, rgba(109, 0, 12, .12), rgba(7, 7, 8, .38) 72%);
}

.qualification-hero-media::after {
  z-index: 2;
  right: auto;
  width: 210%;
  opacity: .22;
  background: linear-gradient(120deg, transparent 23%, rgba(255, 84, 64, .2) 46%, transparent 68%);
  animation: qualification-sweep 18s linear infinite;
}

.qualification-hero-media span {
  z-index: 3;
  background: linear-gradient(90deg, rgba(223, 22, 29, .85), rgba(223, 22, 29, 0));
  width: 3px;
  right: auto;
  transform-origin: top;
  animation: qualification-rule-in 800ms 250ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes qualification-hero-in {
  from { opacity: 0; transform: scale(1.075); }
}

@keyframes qualification-sweep {
  from { transform: translateX(-76%); }
  to { transform: translateX(36%); }
}

@keyframes qualification-rule-in {
  from { transform: scaleY(0); }
}

.landing h1 { text-shadow: 0 8px 42px rgba(0, 0, 0, .72); }
.landing h1 .l1 { font-size: clamp(20px, 4.2vw, 50px); }
.landing h1 .l2 { color: #fff; }
.landing .date { margin-top: 22px; }
.landing .desc { color: #d1cdce; text-shadow: 0 2px 12px #000; }

/* Countdown drawn like ctf.securinets.tn's: large Montserrat digits, seconds in red, thin rules between the
   units, small spaced labels; a changed digit drops in from above (core.js). */
.countdown {
  --cd-unit: 56px; --cd-gap: 12px; --cd-rule: 36px;
  align-items: center; gap: calc(var(--cd-gap) * 2 + 1px);
  width: auto; margin-inline: auto; padding: 0; border: 0; background: none; box-shadow: none;
}
.countdown > div { position: relative; display: grid; justify-items: center; gap: 12px; width: var(--cd-unit); min-width: 0; }
.countdown > div + div::before {
  content: ""; position: absolute; top: 50%; left: calc(var(--cd-gap) * -1 - 1px);
  width: 1px; height: var(--cd-rule); background: var(--line-strong); transform: translateY(-50%);
}
.countdown b { display: inline-block; font: 700 36px/1 var(--font-display); letter-spacing: -.025em; color: var(--text); }
.countdown [data-s] { color: var(--accent); }
.countdown .label { font: 500 10px/1 var(--font-body); letter-spacing: .35em; text-transform: uppercase; color: var(--muted); }
.countdown-label {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 12px/1 var(--font-display); letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}
.countdown-label:not(:empty)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: cd-pulse 2s ease-in-out infinite; }
@keyframes cd-pulse { 50% { opacity: .35; } }
@media (min-width: 640px) { .countdown b { font-size: 48px; } }
@media (min-width: 768px) { .countdown { --cd-unit: 96px; --cd-gap: 28px; --cd-rule: 56px; } .countdown b { font-size: 72px; } }
@media (max-width: 360px) { .countdown { --cd-unit: 52px; --cd-gap: 9px; } }

.landing .cta { margin-top: 34px; }
.discord-link { margin-top: 20px; }

/* Keep the mark as a quiet breathing watermark, without its old arrival/glitch transition. */
.bgmark { opacity: .045; animation: none; }
.bgmark.center { z-index: 0; opacity: .075; top: 49%; }
.bgmark .intro,
.bgmark.center .intro,
.bgmark .intro.glitching { animation: none; }
.bgmark.center .glow { transition: none; }
.bgmark.center .glow::before { opacity: .65; }

/* Shared portal surfaces. */

.page-head h1 { text-shadow: 0 10px 44px rgba(0, 0, 0, .35); }

.btn,
.input,
.field input,
.field select,
.field textarea,
.seg,
.chip,
.tag,
.close,
.conn input,
.conn button { border-radius: 7px; }

.btn-primary {
  background: linear-gradient(135deg, #ef2027, #c70d16);
  box-shadow: 0 12px 32px rgba(223, 22, 29, .18);
}

.btn-ghost,
.btn-quiet,
.input,
.field input,
.field select,
.field textarea {
  background-color: rgba(16, 16, 18, .6);
}

.toolbar {
  border-color: rgba(255, 255, 255, .08);
  background: rgba(7, 7, 8, .94);
}

.cat { border-color: rgba(255, 255, 255, .075); }
.rows { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16, 16, 18, .46); }
.row { padding-inline: 12px; }
.row:last-child { border-bottom: 0; }

dialog.panel {
  border-left-color: rgba(255, 255, 255, .12);
  background: rgba(16, 16, 18, .985);
  box-shadow: -26px 0 80px rgba(0, 0, 0, .56);
}

dialog.panel::backdrop { background: rgba(0, 0, 0, .7); }

.rules-consent,
.state,
.note,
.graph[data-graph] {
  border-color: rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  background: rgba(16, 16, 18, .56);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .16);
}

.graph[data-graph] { padding: clamp(14px, 2.5vw, 24px); }

.podium {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 16, 18, .52);
}
.podium .rank { font-size: clamp(34px, 4vw, 56px); }
.podium .first { background: linear-gradient(135deg, rgba(223, 22, 29, .13), transparent 72%); }
.podium .first .rank { text-shadow: 0 0 30px rgba(223, 22, 29, .3); }

.table { overflow: hidden; }
.table tbody tr { background: rgba(8, 8, 9, .12); }
.table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .012); }
.table tr.me td { background: rgba(223, 22, 29, .09); }

.auth-side { isolation: isolate; overflow: hidden; }
.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(7, 7, 8, .36), rgba(7, 7, 8, .82)),
    url("../img/qualification-hero.jpg") center / cover no-repeat;
  opacity: .82;
}
.auth-side::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(7, 7, 8, .82));
}
.auth-side > * { position: relative; }

.site-foot {
  border-color: rgba(255, 255, 255, .08);
  background: rgba(7, 7, 8, .86);
}
.foot-name { display: grid; gap: 3px; }
.foot-name b { font: 800 11px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.foot-name small { color: var(--muted); font: 600 9px/1.3 var(--font-mono); letter-spacing: .08em; }
.foot-discord {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
}

@media (hover: hover) {
  .brand:hover img { filter: drop-shadow(0 0 13px rgba(223, 22, 29, .75)); }
  .btn-primary:not([disabled]):hover { box-shadow: 0 14px 38px rgba(223, 22, 29, .30); }
  .row:not([data-locked]):hover { background: rgba(255, 255, 255, .035); }
  .foot-discord:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .05); }
}

@media (max-width: 1000px) {
  .nav .wrap { gap: 14px; }
}

@media (max-width: 700px) {
  :root { --nav-h: 64px; }
  .landing .stage { padding-block: 58px 52px; }
  .qualification-hero-media img { object-position: 42% center; opacity: .55; }
  .podium { border-inline: 0; border-radius: 0; }
}

@media (max-width: 480px) {
  .brand-copy { gap: 2px; }
  .brand .brand-edition { font-size: 7px; letter-spacing: .12em; }
  .brand .brand-name .b1 { display: none; }
  .landing h1 .l1 { font-size: clamp(18px, 7vw, 28px); }
}

@media (prefers-reduced-motion: reduce) {
  .qualification-ambient::before,
  .qualification-ambient i,
  .qualification-hero-media img,
  .qualification-hero-media::after,
  .qualification-hero-media span { animation: none !important; }
}

/* ---------- notifications: every notice is a card with a thin gradient border ---------- */
.note-days { gap: 32px; }
.note-day-title { padding-bottom: 6px; border-bottom: 0; }
.notes { display: grid; gap: 12px; }
.note {
  padding: 16px 18px; border: 1px solid transparent; border-radius: 12px; box-shadow: none;
  background:
    linear-gradient(rgba(17, 16, 18, .94), rgba(17, 16, 18, .94)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .05) 45%, rgba(223, 22, 29, .32)) border-box;
}
.note.is-new {
  padding-left: 18px;
  background:
    linear-gradient(rgba(24, 14, 16, .96), rgba(24, 14, 16, .96)) padding-box,
    linear-gradient(135deg, rgba(255, 82, 88, .9), rgba(223, 22, 29, .35) 50%, rgba(255, 255, 255, .1)) border-box;
  box-shadow: 0 14px 36px -20px rgba(223, 22, 29, .6);
}

/* ---------- live notifications (toasts): same card, a link to all notifications, a timer line ---------- */
.toast {
  position: relative; overflow: hidden; gap: 8px; padding: 14px 16px 16px;
  border: 1px solid transparent; border-radius: 12px;
  background:
    linear-gradient(rgba(18, 16, 18, .98), rgba(18, 16, 18, .98)) padding-box,
    linear-gradient(135deg, rgba(255, 82, 88, .9), rgba(223, 22, 29, .3) 50%, rgba(255, 255, 255, .12)) border-box;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .8);
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 600 10px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toast-link { padding: 6px 0; color: var(--accent-text); text-decoration: none; }
.toast-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 82, 88, .6)); transform-origin: left;
  animation: toast-time linear forwards; animation-play-state: paused;
}
@keyframes toast-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (hover: hover) { .toast-link:hover { text-decoration: underline; text-underline-offset: 3px; } }
@media (hover: none) and (pointer: coarse) { .toast-link { padding: 14px 0; margin: -8px 0; } }
