/* ───────── Keyforge design system (shared by the site and the admin panel) ───────── */
@font-face { font-family: Unbounded; src: url(/fonts/Unbounded-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: Unbounded; src: url(/fonts/Unbounded-Black.ttf) format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }

:root {
    --bg: #000; --l1: #0A0A0A; --l2: #111; --l3: #161616; --l4: #1C1C1F;
    --line: rgba(255,255,255,.06); --line2: rgba(255,255,255,.11);
    --text: #fff; --text2: rgba(255,255,255,.58); --text3: rgba(255,255,255,.32);
    --accent: #FF3D57; --accent-2: #FF6A7D; --accent-soft: rgba(255,61,87,.14); --accent-glow: rgba(255,61,87,.45);
    --violet: #7C6CFF; --mint: #00E0A4; --amber: #FFB020; --blue: #3D8BFF;
    --ok: #2BD576; --warn: #FFB020; --danger: #FF4D5E;
    --radius: 16px;
    --ease: cubic-bezier(.2,.8,.2,1);
    --display: Unbounded, Inter, "Segoe UI", sans-serif;
    --ui: Inter, "Segoe UI", system-ui, sans-serif;
    --mono: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Film grain over everything: kills the "plastic" black */
.grain { position: fixed; inset: -50%; width: 200%; height: 200%; pointer-events: none; z-index: 100; opacity: .045;
    background-image: url(/img/noise.png); animation: grain 8s steps(10) infinite; }
@keyframes grain { 0%,100% { transform: translate(0,0); } 10% { transform: translate(-5%,-10%); } 30% { transform: translate(3%,-15%); }
    50% { transform: translate(12%,9%); } 70% { transform: translate(9%,4%); } 90% { transform: translate(-1%,7%); } }

/* Type */
.display, h1, h2, h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; margin: 0; }
.eyebrow { font: 700 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--text3); }
.muted { color: var(--text2); } .faint { color: var(--text3); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }

/* Buttons */
.btn { --b: var(--l3); display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer;
    height: 48px; padding: 0 22px; border-radius: 13px; background: var(--b); color: var(--text); white-space: nowrap;
    font: 700 12px var(--display); letter-spacing: .07em; text-transform: uppercase;
    transition: transform .12s var(--ease), box-shadow .25s var(--ease), background .2s, filter .2s; position: relative; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { --b: var(--accent); box-shadow: 0 0 28px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-primary:hover { box-shadow: 0 0 48px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.25); filter: brightness(1.08); }
.btn-ghost { --b: transparent; color: var(--text2); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); filter: none; }
.btn-outline { --b: transparent; box-shadow: inset 0 0 0 1px var(--line2); }
.btn-outline:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); filter: none; }
.btn-danger { --b: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255,77,94,.45); }
.btn-danger:hover { --b: rgba(255,77,94,.1); filter: none; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 10px; border-radius: 10px; gap: 7px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 58px; padding: 0 30px; font-size: 13px; border-radius: 15px; }
.btn-icon { width: 38px; padding: 0; }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* Inputs */
.input, input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
    width: 100%; height: 46px; background: var(--l1); color: var(--text); border: 1px solid var(--line2); border-radius: 12px;
    padding: 0 14px; font: 14px var(--ui); outline: none; transition: border-color .15s, box-shadow .2s, background .2s; }
textarea { height: auto; padding: 12px 14px; resize: vertical; }
select { appearance: none; padding-right: 36px; cursor: pointer;
    background: var(--l1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='white' stroke-opacity='.5' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; }
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 20px rgba(255,61,87,.2); }
::placeholder { color: var(--text3); }
label.field { display: block; font-size: 12px; color: var(--text2); margin: 16px 0 7px; }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; white-space: nowrap;
    font: 700 9.5px var(--display); letter-spacing: .08em; text-transform: uppercase; background: var(--l3); color: var(--text2); }
.pill svg { width: 12px; height: 12px; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: rgba(43,213,118,.13); color: var(--ok); }
.pill.warn { background: rgba(255,176,32,.13); color: var(--warn); }
.pill.danger { background: rgba(255,77,94,.13); color: var(--danger); }
.pill.violet { background: rgba(124,108,255,.15); color: #A99FFF; }
.pill.glass { background: rgba(0,0,0,.55); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); backdrop-filter: blur(8px); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; flex: none; }

/* Key caps (same as the app) */
.keys { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.kc { display: inline-flex; align-items: center; height: 28px; min-width: 28px; justify-content: center; padding: 0 9px;
    background: var(--l3); border-radius: 7px; box-shadow: inset 0 -2px 0 rgba(255,255,255,.07), 0 1px 0 rgba(0,0,0,.6);
    font: 600 12.5px var(--ui); color: #fff; white-space: nowrap; }
.keys .plus { color: var(--text3); font-size: 12px; }
.keys .arrow { color: var(--accent); margin: 0 4px; }

/* Generative cover: layered radial light from the profile colour (see SiteHelpers.CoverStyle) */
.cover { position: relative; overflow: hidden; background-color: #050505; isolation: isolate; }
.cover::after { content: ""; position: absolute; inset: 0; background: url(/img/noise.png); opacity: .09; mix-blend-mode: overlay; pointer-events: none; }
.cover > .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Cards */
.card { background: var(--l1); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }

/* Logo mark */
.logo-mark { display: inline-block; flex: none; filter: drop-shadow(0 0 12px var(--accent-glow)); }

/* Reveal on scroll (site.js adds .in) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px; border-radius: 14px; background: var(--l2);
    box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 0 0 1px var(--line2); font-size: 14px; animation: toast-in .45s var(--ease) both; }
.toast.out { animation: toast-out .3s var(--ease) both; }
.toast .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(43,213,118,.15); color: var(--ok); }
.toast.error .ico { background: rgba(255,77,94,.15); color: var(--danger); }
.toast .ico svg { width: 14px; height: 14px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* Modal (native <dialog>) */
dialog.modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: min(460px, calc(100vw - 32px)); width: 100%; }
dialog.modal::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(6px); animation: fade .2s both; }
dialog.modal[open] .modal-card { animation: pop .32s var(--ease) both; }
.modal-card { background: var(--l1); border-radius: 18px; padding: 26px; box-shadow: 0 30px 90px rgba(0,0,0,.7), inset 0 0 0 1px var(--line2); }
.modal-card h3 { font-size: 16px; margin-bottom: 10px; }
.modal-card p { color: var(--text2); margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } }

/* Utility */
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
