/* REKT ARCADE - base, layout, navigation, typography */
/* Bungee (SIL OFL 1.1, assets/fonts/OFL.txt): display face for the homepage headline and scoreboard only. Latin subset, 14 KB. */
@font-face { font-family: "Bungee"; font-style: normal; font-weight: 400; font-display: swap; src: url("../../assets/fonts/bungee.woff2") format("woff2"); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.5; min-height: 100vh; min-height: 100svh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.modal-open { overflow: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; margin: 0 0 .5em; letter-spacing: .01em; text-transform: uppercase; }
h1 { font-size: clamp(2rem, 7vw, 3.4rem); }
h2 { font-size: clamp(1.25rem, 3.6vw, 1.7rem); margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .8rem; }
.dim { color: var(--dim); }
.center { text-align: center; }
.mono { font-family: var(--f-mono); }
.lead { font-size: clamp(1rem, 2.4vw, 1.2rem); color: #d9d6ff; max-width: 60ch; }
.kicker { display: block; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .22em; color: var(--lime); text-transform: uppercase; margin-bottom: .6rem; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 max(16px, var(--safe-l)) 0 max(16px, var(--safe-r)); }
.view { min-height: 60vh; outline: none; padding-top: calc(var(--top-h) + var(--safe-t)); padding-bottom: 0; scroll-padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); scroll-padding-top: calc(var(--top-h) + var(--safe-t) + 12px); }
.view.enter { animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page { max-width: 1180px; margin: 0 auto; padding: 28px max(16px, var(--safe-l)) 40px max(16px, var(--safe-r)); }
.page.narrow { max-width: 780px; }
.err { background: #1a0b16; border: 1px solid var(--red); padding: 12px; overflow: auto; font-family: var(--f-mono); font-size: .8rem; }

/* atmosphere */
.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(900px 500px at 12% -10%, rgba(155,107,255,.22), transparent 60%),
  radial-gradient(800px 500px at 100% 10%, rgba(255,43,214,.14), transparent 60%),
  radial-gradient(900px 600px at 50% 120%, rgba(43,228,255,.10), transparent 60%), var(--bg); }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.10) 3px); mix-blend-mode: multiply; opacity: .5; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: #000; padding: 10px 14px; z-index: 200; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 2px; }

/* buttons: notched pixel style with a hard drop */
.btn { --c: var(--lime); --d: var(--lime-d); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 0 22px; border: 0; cursor: pointer; font-family: var(--f-display); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; color: #0a0820; background: var(--c); text-decoration: none !important;
  clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 calc(100% - var(--notch)), 0 var(--notch)); box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); transition: transform .08s, filter .15s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px) scale(.99); filter: brightness(.95); }
.btn.big { min-height: 56px; font-size: 1.05rem; padding: 0 30px; }
.btn.ghost { background: transparent; color: var(--lime); box-shadow: inset 0 0 0 2px var(--lime); clip-path: none; border-radius: 4px; }
.btn.ghost:hover { background: rgba(183,255,42,.1); }
.btn.danger { --c: var(--red); color: #fff; }
.btn[disabled] { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }
.icon-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 1rem; touch-action: manipulation; }
.icon-btn:hover { border-color: var(--lime); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 1rem 0; }

/* top bar */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: calc(var(--top-h) + var(--safe-t)); padding-top: var(--safe-t); background: #07061a; border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; height: var(--top-h); gap: 12px; }
.brand { display: flex; align-items: center; text-decoration: none !important; }
.nav { display: none; gap: 2px; }
.nav a { white-space: nowrap; color: var(--dim); font-family: var(--f-display); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; padding: 10px 12px; border-radius: 6px; text-decoration: none; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--lime); background: rgba(183,255,42,.08); box-shadow: inset 0 -2px 0 var(--lime); }
.bar-right { display: flex; align-items: center; gap: 8px; }
.profile-chip { display: none; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none !important; }
.profile-chip .chip-t { display: grid; line-height: 1.1; } .profile-chip b { font-size: .8rem; } .profile-chip small { color: var(--lime); font-family: var(--f-mono); font-size: .65rem; }
.profile-chip .av, .who .av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: block; }
.burger { display: inline-flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.burger i { width: 20px; height: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
.nav-open .burger i:nth-child(1) { transform: translateY(7px) rotate(45deg); } .nav-open .burger i:nth-child(2) { opacity: 0; } .nav-open .burger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.drawer { position: fixed; inset: calc(var(--top-h) + var(--safe-t)) 0 0 0; z-index: 55; background: rgba(7,6,26,.97); padding: 18px 20px calc(var(--tab-h) + var(--safe-b) + 20px); display: grid; align-content: start; gap: 4px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s; overflow-y: auto; }
.nav-open .drawer { transform: none; opacity: 1; visibility: visible; }
.drawer a { font-family: var(--f-display); font-size: 1.4rem; text-transform: uppercase; color: var(--text); padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.drawer a.active { color: var(--lime); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); padding-left: var(--safe-l); padding-right: var(--safe-r); display: grid; grid-template-columns: repeat(5, 1fr); background: #0a0820; border-top: 1px solid var(--line2); box-shadow: 0 -14px 22px -6px rgba(5,4,26,.92); transform: translateZ(0); }
.tabbar a { display: grid; place-items: center; align-content: center; gap: 2px; color: var(--dim); font-size: .62rem; font-family: var(--f-display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; min-height: 48px; }
.tabbar a.active { color: var(--lime); } .tabbar a.active .svg { filter: drop-shadow(0 0 6px var(--lime)); }
.in-game .tabbar, .in-game .footer { display: none; } .in-game .view { padding-bottom: calc(var(--safe-b) + 16px); }
@media (min-width: 1100px) {
  .nav { display: flex; } .profile-chip { display: inline-flex; } .burger, .tabbar, .drawer { display: none; }
  .view { padding-bottom: 0; }
}

/* logo */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 38px; height: 38px; display: block; filter: drop-shadow(0 0 8px rgba(183,255,42,.45)); } .logo-mark svg { width: 100%; height: 100%; }
.logo-word { display: inline-grid; line-height: .85; transform: skewX(-6deg); }
.logo-word b { font-family: var(--f-display); font-size: 1.5rem; color: var(--text); letter-spacing: .04em; text-shadow: 2px 2px 0 var(--mag), 4px 4px 0 var(--mag-d); }
.logo-word em { font-style: normal; font-family: var(--f-mono); font-weight: 700; font-size: .62rem; letter-spacing: .5em; color: var(--lime); margin-top: 3px; }
.logo.small .logo-mark { width: 28px; height: 28px; } .logo.small .logo-word b { font-size: 1.1rem; }
.svg { display: inline-block; line-height: 0; } .svg svg { width: 100%; height: 100%; }

/* footer */
.footer { border-top: 1px solid var(--line); background: #05041200; padding: 36px 0 calc(var(--tab-h) + var(--safe-b) + 32px); margin-top: 40px; }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
.foot-grid b { display: block; font-family: var(--f-display); text-transform: uppercase; font-size: .8rem; letter-spacing: .1em; margin-bottom: 8px; color: var(--lime); }
.foot-grid a { display: block; color: var(--dim); padding: 4px 0; font-size: .9rem; } .foot-grid a:hover { color: var(--text); }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 1.2fr 1fr 1fr 1.4fr; } }
@media (min-width: 1100px) { .footer { padding-bottom: 28px; } }

/* motion preferences */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } body::after { display: none; } }
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
[data-motion="reduce"] body::after { display: none; }

/* mobile bottom-bar clearance: the page never ends under the tabbar; anchors and focus scroll clear of it */
html { scroll-padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); scroll-padding-top: calc(var(--top-h) + var(--safe-t) + 12px); }
.tabbar a { min-height: var(--tab-h); }
@media (min-width: 1100px) { html { scroll-padding-bottom: 24px; } }

/* The footer (always after .view outside games) already clears the tab bar; .view must not reserve it twice. */

/* Long unbroken strings (a contract address in prose) wrap instead of widening the page. */
p, li, dd, td { overflow-wrap: break-word; }
.bullets li, .faq-a p { overflow-wrap: anywhere; }

/* Bottom tab bar on phones (iOS Safari's floating toolbar resizes the viewport while scrolling):
   - its background extends below the screen edge, so page content never shows underneath it;
   - it slides away with the header while scrolling down and returns on scroll up (body.bar-hidden),
     so it does not visibly jump as Safari collapses and expands its own toolbar. */
.tabbar { transition: transform .22s ease; will-change: transform; transform: translateZ(0); }
.tabbar::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 240px; background: #0a0820; pointer-events: none; }
@media (max-width: 1099px) { body.bar-hidden:not(.nav-open) .tabbar { transform: translateY(100%); } }

/* Phones: the header is part of the page, not fixed. iOS Safari resizes its own toolbars while scrolling, which made a
   fixed header drift down and let content show above it. In the page flow it scrolls away with the content and can
   never move on its own; the bottom tab bar keeps navigation in reach. Desktop keeps the fixed header. */
@media (max-width: 1099px) {
  .topbar, body.bar-hidden:not(.nav-open) .topbar { position: absolute; transform: none; transition: none; will-change: auto; }
}
