/* Montserrat and Anton, SIL Open Font License 1.1 (latin subsets) */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/Montserrat.woff2) format('woff2'); }
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/Anton.woff2) format('woff2'); }

:root {
  --bg: #0e0b1d;
  --panel: #191431;
  --line: rgba(255, 255, 255, .1);
  --text: #f3f1fb;
  --muted: #a9a3c4;
  --accent: #ff3d6e;
  --ok: #3ee08a;
  --bad: #ff5a5a;
  --display: Anton, Impact, 'Arial Narrow', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 61, 110, .18), transparent 60%),
    radial-gradient(800px 500px at 110% 0%, rgba(47, 125, 225, .16), transparent 60%),
    var(--bg);
  color: var(--text); font: 500 16px/1.5 Montserrat, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
main { flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); background: rgba(14, 11, 29, .7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { font-family: var(--display); font-size: 1.35rem; letter-spacing: .06em; text-decoration: none; }
.brand b, h1 b { font-weight: 400; color: var(--accent); }
.brand-mark { color: var(--accent); font-size: .9em; }
nav { display: flex; align-items: center; gap: 10px; }
nav form { margin: 0; }
.lang { font-size: .9rem; font-weight: 700; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 10px; }
.lang:hover { color: var(--text); background: var(--line); }

button, .btn { font: inherit; font-weight: 800; border: 0; border-radius: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn { background: var(--accent); color: #fff; padding: 14px 24px; font-size: 1.05rem; box-shadow: 0 4px 0 #a51f44, 0 12px 30px rgba(255, 61, 110, .35); transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a51f44; }
button.ghost { background: transparent; color: var(--text); padding: 6px 12px; font-size: .9rem; box-shadow: inset 0 0 0 2px var(--line); }
button.ghost:hover { box-shadow: inset 0 0 0 2px var(--muted); }
:focus-visible { outline: 3px solid #ffd36b; outline-offset: 3px; }

.notice { padding: 10px 14px; border-radius: 12px; background: rgba(47, 125, 225, .14); border: 1px solid rgba(47, 125, 225, .4); }
.notice.err { background: rgba(255, 90, 90, .12); border-color: rgba(255, 90, 90, .45); }

/* ---------------------------------------------------------------- login */
.login { display: grid; place-items: center; }
.hero { text-align: center; max-width: 560px; padding: 6vh 0; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 14vw, 5.4rem); line-height: .95; letter-spacing: .03em; margin: 18px 0 14px; text-shadow: 0 6px 0 rgba(0, 0, 0, .35); }
.tagline { font-size: 1.1rem; margin: 0 0 22px; }
.hero .btn { margin-top: 8px; }
.hero-icons { display: flex; justify-content: center; gap: 10px; font-size: 2rem; }
.hero-icons span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); animation: bob 2.8s ease-in-out infinite; }
.hero-icons span:nth-child(2n) { animation-delay: -1.4s; }
.hero-icons span:nth-child(3n) { animation-delay: -.7s; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

/* ---------------------------------------------------------------- dashboard */
.welcome h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 8vw, 3rem); letter-spacing: .02em; margin: 6px 0 4px; }
.welcome p { margin: 0 0 24px; max-width: 680px; }
.games { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.game {
  --c: var(--accent);
  --bg: var(--panel);
  height: 100%; display: flex; flex-direction: column; gap: 12px;
  padding: 0 0 18px; border-radius: 20px; text-decoration: none; position: relative; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, var(--panel)), var(--panel) 55%);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.game:hover { transform: translateY(-3px); border-color: var(--c); box-shadow: 0 16px 34px rgba(0, 0, 0, .45), 0 0 0 1px var(--c), 0 0 28px color-mix(in srgb, var(--c) 35%, transparent); }
.banner { display: grid; place-items: center; height: 150px; padding: 14px 22px; background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--bg) 70%, #fff 6%), var(--bg) 75%); border-bottom: 3px solid var(--c); }
.banner img { display: block; max-width: 100%; max-height: 122px; object-fit: contain; transition: transform .2s; }
.game:hover .banner img { transform: scale(1.04); }
.g-sdl .banner img { max-height: 60px; }
.body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0 18px; }
.desc { color: #d9d5ea; font-size: .95rem; }
.tags { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.st { font-size: .8rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.st::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #6b6585; }
.st.up::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.st.down { color: #ffb0b0; }
.st.down::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.play { font-weight: 800; color: #fff; background: var(--c); padding: 7px 14px; border-radius: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }

footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
