:root {
  --bg: #0a0a0a; --fg: #f3f3f3; --muted: #7b7b7b; --line: #222;
  --ok: #6dff8a; --bad: #ff5d5d;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.nav {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between;
  align-items: center; padding: 14px 20px; background: rgba(10,10,10,.92);
  border-bottom: 1px solid var(--line); letter-spacing: .25em; font-size: .8rem; font-weight: 700;
}
.counter { letter-spacing: .15em; }
.counter.full { color: var(--bad); }

main { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.hero { min-height: calc(100vh - 56px); display: flex; flex-direction: column;
        justify-content: center; align-items: center; text-align: center; padding: 56px 0; }

.big { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .35em;
       font-size: clamp(1.9rem, 8vw, 4.2rem); font-weight: 800; line-height: 1.05; letter-spacing: .02em; }
.arrow { font-style: normal; color: var(--muted); font-size: .6em; animation: float 2.6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(7px); opacity: 1; } }

.tagline { margin: 3rem 0 2rem; color: var(--muted); font-size: 1.15rem; letter-spacing: .08em; }
#panel { width: 100%; max-width: 440px; }
#panel p { margin: .6rem 0; }

form { display: flex; flex-direction: column; gap: 12px; margin-top: 1.2rem; }
input {
  width: 100%; padding: 16px; font: inherit; font-size: 16px; text-align: center; letter-spacing: .15em;
  color: var(--fg); background: transparent; border: 1px solid #333; border-radius: 4px; outline: none;
  text-transform: uppercase;
}
input::placeholder { color: #555; }
input:focus { border-color: var(--fg); }
button {
  padding: 16px; font: inherit; font-weight: 700; letter-spacing: .25em; cursor: pointer;
  color: var(--bg); background: var(--fg); border: 0; border-radius: 4px; transition: opacity .2s;
}
button:hover { opacity: .85; }
button:disabled { opacity: .35; cursor: not-allowed; }

.msg { min-height: 1.4em; color: var(--bad); font-size: .9rem; }
h2 { margin: 0 0 .6rem; letter-spacing: .2em; font-size: 1.4rem; }
h2.ok, .ok { color: var(--ok); }
h2.bad, .bad { color: var(--bad); }
h2.shake { animation: shake .45s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.lead { font-size: 1.2rem; font-weight: 700; }
.note { color: var(--muted); font-size: .92rem; }
.note strong { color: var(--fg); }
.ticket { font-size: 1.3rem; font-weight: 800; letter-spacing: .1em; }
#cPseudo { word-break: break-all; }
.special { animation: reveal .8s ease both; }
@keyframes reveal { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.block { padding: 48px 0; border-top: 1px solid var(--line); text-align: center; }
.block h3 { margin: 0 0 1.2rem; font-size: .8rem; letter-spacing: .3em; color: var(--muted); }
.stats { display: flex; justify-content: space-around; gap: 16px; flex-wrap: wrap; }
.stats small { display: block; color: var(--muted); letter-spacing: .2em; font-size: .7rem; }
.stats b { font-size: 1.6rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 6px 0; font-variant-numeric: tabular-nums; word-break: break-all; }
.list .pending { color: var(--muted); }
.recent li { font-size: .9rem; color: var(--muted); }
.recent .y { color: var(--ok); } .recent .n { color: var(--bad); }
.muted { color: var(--muted); }
.foot { padding: 32px 20px; text-align: center; color: var(--muted); letter-spacing: .2em; font-size: .75rem; }

body.closed #statsBlock, body.closed #recentBlock, body.closed #tagline { display: none; }

body.admin { padding: 20px; max-width: 1100px; margin: 0 auto; }
.kpis { display: flex; gap: 24px; list-style: none; padding: 0; flex-wrap: wrap; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .8rem; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }

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

.admin input { text-transform: none; letter-spacing: normal; text-align: left; }
.admin form { max-width: 360px; }
.admin .err { color: var(--bad); }
.admin .inline { display: inline; max-width: none; margin-left: 16px; }
.admin .inline button { padding: 8px 16px; letter-spacing: .1em; }
