/* ===== Hack The Code look =====
   Loaded last: retints the base tokens and reshapes the portal shell (header, home, panels,
   dialogs) into the red-on-black tactical style of hackthecode.github.io.
   The boards and cards of the games keep their own styles. */
:root {
  --bg: #050506;
  --bg-2: #0d0a0b;
  --surface: rgba(255, 60, 80, 0.035);
  --surface-2: rgba(255, 60, 80, 0.07);
  --surface-3: rgba(255, 60, 80, 0.13);
  --border: rgba(255, 70, 90, 0.17);
  --border-strong: rgba(255, 70, 90, 0.32);
  --text: #ece5dd;
  --muted: #94848a;
  --accent: #ff1f33;
  --accent-2: #9c0f1d;
  --accent-ink: #050506;
  --accent-soft: rgba(255, 31, 51, 0.14);
  --fringe: #2be0da;
  --radius: 3px;
  --radius-sm: 2px;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --font-display: 'Tektur', 'Arial Narrow', 'Segoe UI', sans-serif;
  --cut: 14px;
}

/* A game keeps the proportional face its layouts were tuned for. */
body.in-game { --font: var(--font-ui); }
.app-header, .tabbar { font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace; }

/* ---- atmosphere: grid, rain, scanlines ---- */
body { background: var(--bg); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(#33151a 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, #33151a 1px, transparent 1px) 0 0 / 56px 100%;
  opacity: .28;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 75%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .7) 100%),
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .22) 2px 3px);
}
#fx-rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .3; pointer-events: none; }
body.in-game::before, body.in-game::after, body.in-game #fx-rain { display: none; }
::selection { background: var(--accent); color: var(--bg); }

/* ---- header ---- */
.app-header { background: rgba(5, 5, 6, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.brand-mark img { width: 34px; height: 34px; display: block; outline: 1px solid var(--border-strong); filter: drop-shadow(0 0 8px rgba(255, 31, 51, .45)); }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.brand-name b { font-weight: 900; background: none; color: var(--accent); text-shadow: 0 0 18px rgba(255, 31, 51, .55); }
.nav-link { position: relative; border-radius: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-link:hover { background: transparent; color: var(--accent); }
.nav-link.active { background: transparent; color: var(--text); }
.top-nav .nav-link.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.lang-switch { border-radius: 0; background: transparent; border-color: var(--border-strong); }
.lang-switch button { border-radius: 0; }
.lang-switch button.on { background: var(--surface-3); }
.user-chip { border-radius: 0; font-size: 13px; }
.icon-btn { border-radius: 0; }
.icon-btn:hover { color: var(--accent); }
@media (max-width: 720px) {
  .brand-name { font-size: 18px; }
  .tabbar { background: rgba(5, 5, 6, .94); }
  .tabbar .nav-link { font-size: 10px; letter-spacing: .04em; }
}

/* ---- buttons ---- */
.btn {
  border-radius: 0; background: transparent;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}
.btn:hover { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: none; text-shadow: none; }
.btn-primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-online { background: var(--accent-soft); color: var(--text); }
.btn-online:hover { color: var(--accent); }
.btn-danger:hover { background: rgba(241, 109, 109, .22); color: #ffb3b3; border-color: rgba(241, 109, 109, .6); }
body:not(.in-game) .btn { font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
body:not(.in-game) .btn-sm { font-size: 12px; letter-spacing: .06em; }
body:not(.in-game) .btn-lg { font-size: 14px; }

/* ---- panels, forms, dialogs ---- */
.glass { background: var(--bg-2); border-color: var(--border); backdrop-filter: none; -webkit-backdrop-filter: none; }
.stat { background: var(--bg-2); border-left: 2px solid var(--accent); }
.stat-value, .kpi-value { font-family: var(--font-display); font-weight: 700; }
.stat-label, .kpi-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
input, select { border-radius: 0; background: rgba(0, 0, 0, .5); }
.modal-card { background: var(--bg-2); border-color: var(--border-strong); border-top: 2px solid var(--accent); }
.modal-title, .auth-card h1, .profile-head h1, .g-setup-card h2, .play-title { text-transform: uppercase; letter-spacing: .03em; }
.modal-body { color: var(--text); }
.toast { background: var(--bg-2); border-left: 2px solid var(--accent); }
.install-banner { background: var(--bg-2); border-color: var(--border-strong); }
.play-bar { background: var(--bg); }

/* ---- home ---- */
.eyebrow { font-size: 12px; letter-spacing: .28em; }
.eyebrow::before { content: "// "; color: var(--muted); }
.hero h1 { font-size: clamp(34px, 6vw, 68px); font-weight: 900; line-height: .98; letter-spacing: 0; text-transform: uppercase; text-wrap: balance; }
.hero h1 em { background: none; color: var(--accent); text-shadow: 0 0 26px rgba(255, 31, 51, .55); }
.lead { color: var(--text); font-size: 15.5px; }

/* the logo in a reticle */
.hero-id { margin: 0; justify-self: center; width: min(100%, 300px); padding: 12px; }
.id-frame { position: relative; aspect-ratio: 1; max-width: 100%; }
.id-frame::before, .id-frame::after { content: ""; position: absolute; pointer-events: none; z-index: 2; }
.id-frame::before {
  inset: -12px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 30px 2px, linear-gradient(var(--accent), var(--accent)) 0 0 / 2px 30px,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 30px 2px, linear-gradient(var(--accent), var(--accent)) 100% 0 / 2px 30px,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 30px 2px, linear-gradient(var(--accent), var(--accent)) 0 100% / 2px 30px,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 30px 2px, linear-gradient(var(--accent), var(--accent)) 100% 100% / 2px 30px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 6px var(--accent));
}
.id-frame::after {
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(255, 31, 51, .28) 50%, transparent) 0 0 / 100% 22% no-repeat;
  animation: id-sweep 4.5s linear infinite;
}
@keyframes id-sweep { from { background-position: 0 -30%; } to { background-position: 0 130%; } }
.id-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.id-frame .g { opacity: 0; mix-blend-mode: screen; }
.id-frame .g1 { animation: id-a 6.4s steps(1) infinite; }
.id-frame .g2 { animation: id-b 6.4s steps(1) infinite; filter: hue-rotate(160deg); }
.hero-id:hover .g { animation-duration: 1.1s; }
@keyframes id-a {
  0%, 86%, 100% { opacity: 0; }
  87% { opacity: .9; transform: translate(-10px, 0); clip-path: inset(18% 0 66% 0); }
  90% { opacity: .9; transform: translate(8px, 0); clip-path: inset(58% 0 28% 0); }
  93% { opacity: .9; transform: translate(-6px, 0); clip-path: inset(80% 0 6% 0); }
  95% { opacity: 0; }
}
@keyframes id-b {
  0%, 86%, 100% { opacity: 0; }
  88% { opacity: .7; transform: translate(9px, 0); clip-path: inset(40% 0 44% 0); }
  91% { opacity: .7; transform: translate(-7px, 0); clip-path: inset(6% 0 82% 0); }
  94% { opacity: 0; }
}
.hero-id figcaption { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hero-id figcaption b { color: var(--accent); }
@media (max-width: 820px) { .hero-id { order: -1; width: min(64%, 240px); } }

/* game cards: cut corners with a hairline that lights up in the game's colour */
.game-card {
  isolation: isolate; padding: 1px; border: 0; border-radius: 0; box-shadow: none;
  background: #33151a;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.game-card::before {
  content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--bg-2);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.game-card:not(.soon):hover { background: var(--accent-g); box-shadow: none; transform: translateY(-4px); }
.game-art { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.game-info h3 { font-weight: 700; font-size: 22px; letter-spacing: .02em; text-transform: uppercase; }
.game-card:not(.soon):hover h3 { text-shadow: 2px 0 0 rgba(43, 224, 218, .35); }
.game-info p { font-size: 13px; }
.play-pill { border-radius: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.game-meta { font-size: 11.5px; letter-spacing: .04em; }
.game-card.soon { background: #33151a; }
.game-card.soon::before { background: var(--bg); }

/* The logo effects are part of the look: they stay on unless FX is switched off on hackthecode.github.io. */
@media (prefers-reduced-motion: reduce) {
  .id-frame::after { animation-duration: 4.5s !important; animation-iteration-count: infinite !important; }
  .id-frame .g { animation-duration: 6.4s !important; animation-iteration-count: infinite !important; }
}
.fx-off .id-frame::after, .fx-off .id-frame .g { animation: none !important; }
.fx-off body::after { display: none; }

.made-by { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 34px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.made-by::before { content: "//"; color: var(--accent); }
.made-by a { color: var(--text); border-bottom: 1px solid var(--accent); }
.made-by a:hover { color: var(--accent); }
.hero-text { min-width: 0; }
.hero h1 { overflow-wrap: anywhere; }
