/* Dream PvP weboldal. Egy képernyős nyitóoldal: betöltőképernyő, mozgó rácsos
   háttér piros aurorával és egérkövető fénnyel, nagy felúszó cím, állapot-
   jelvény, (visszaszámláló), csatlakozás + Discord, futószalag. Szándékosan
   egyetlen sötét arculat. */
:root {
    --bg: #0e0e0e;
    --surface: #1b1b1b;
    --surface-2: #232323;
    --border: #2e2e2e;
    --fg: #fff;
    --muted: #a8a8a8;
    --dim: #6e6e6e;
    --swiss: #e50914;
    --swiss-hi: #ff2a35;
    --swiss-dark: #9c0a10;
    --swiss-soft: rgba(229, 9, 20, .12);
    --swiss-line: rgba(229, 9, 20, .35);
    --green: #4ade80;
    --green-soft: rgba(74, 222, 128, .12);

    --ease: cubic-bezier(.16, 1, .3, 1);
    --intro: 1.5s; /* a hero animációi a betöltőképernyő után indulnak */

    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    color-scheme: dark;
}
.preloader-seen { --intro: 0s; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--swiss-hi); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--swiss); color: #fff; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Logó (szöveges) ─────────────────────────────────────────────────── */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transform: skewX(-9deg);
}
.logo-word {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1;
    text-shadow: 0 4px 18px rgba(0, 0, 0, .6);
}
.logo-tag {
    padding: 4px 7px 3px;
    border-radius: 4px;
    background: var(--swiss);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    line-height: 1;
    box-shadow: 0 6px 20px -4px rgba(229, 9, 20, .7);
}
.logo-xl { flex-direction: column; gap: 10px; }
.logo-xl .logo-word { font-size: 64px; }
.logo-xl .logo-tag { padding: 6px 12px 5px; font-size: 22px; border-radius: 6px; }

/* ── Betöltőképernyő ─────────────────────────────────────────────────── */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    background: var(--bg);
    animation: preloader-out .6s ease var(--intro) forwards;
}
.preloader-seen .preloader { display: none; }
.preloader-logo {
    filter: blur(14px) grayscale(1) brightness(.4);
    opacity: 0;
    animation:
        preloader-logo .9s var(--ease) .05s forwards,
        preloader-pulse 1.6s ease-in-out 1s infinite;
}
.preloader-bar {
    width: 200px;
    max-width: 60vw;
    height: 2px;
    border-radius: 99px;
    overflow: hidden;
    background: rgba(229, 9, 20, .18);
}
.preloader-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 99px;
    background: var(--swiss);
    animation: fill 1.2s cubic-bezier(.4, 0, .2, 1) forwards;
}
.preloader-tag {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4em;
    margin-right: -.4em;
    color: var(--swiss);
    opacity: 0;
    animation: fade-in .6s .3s forwards;
}
@keyframes preloader-logo {
    to { filter: blur(0) grayscale(0) brightness(1) drop-shadow(0 0 28px rgba(229, 9, 20, .65)); opacity: 1; }
}
@keyframes preloader-pulse {
    0%, 100% { filter: drop-shadow(0 0 22px rgba(229, 9, 20, .5)); }
    50% { filter: drop-shadow(0 0 40px rgba(229, 9, 20, .8)); }
}
@keyframes preloader-out {
    to { opacity: 0; visibility: hidden; transform: translateY(-2%); }
}
@keyframes fill { to { width: 100%; } }
@keyframes fade-in { to { opacity: 1; } }

/* ── Oldal + háttér ──────────────────────────────────────────────────── */
.page {
    position: relative;
    min-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.page > :not(.bg) { position: relative; z-index: 1; }

.bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bg > * { position: absolute; inset: 0; }
.bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .3;
    filter: grayscale(.35) contrast(1.1);
}
.bg-grid {
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 20%, transparent 75%);
    animation: grid-pan 18s linear infinite;
}
.bg-aurora {
    inset: auto;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(70px);
    animation: aurora 14s ease-in-out infinite;
}
.bg-aurora.a1 {
    left: -18vmax;
    bottom: -32vmax;
    background: radial-gradient(circle, rgba(229, 9, 20, .38), transparent 65%);
}
.bg-aurora.a2 {
    right: -22vmax;
    top: -30vmax;
    background: radial-gradient(circle, rgba(156, 10, 16, .32), transparent 65%);
    animation-delay: -7s;
    animation-direction: reverse;
}
.bg-glow {
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 40%), rgba(229, 9, 20, .16), transparent 72%);
    opacity: 0;
    transition: opacity .4s;
}
.bg-glow.on { opacity: .9; }
.bg-fade {
    background:
        linear-gradient(180deg, rgba(14, 14, 14, .7) 0%, transparent 22%, transparent 60%, var(--bg) 100%),
        radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(14, 14, 14, .65) 100%);
}
@keyframes grid-pan { to { background-position: 64px 64px; } }
@keyframes aurora {
    0%, 100% { opacity: .75; transform: translate(-4%) scale(1); }
    50% { opacity: 1; transform: translate(4%, 3%) scale(1.12); }
}

/* ── Fejléc ──────────────────────────────────────────────────────────── */
.bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 32px 18px;
    border-bottom: 1px solid transparent;
    transition: background .3s, border-color .3s;
}
.bar.scrolled {
    background: rgba(14, 14, 14, .72);
    border-color: var(--border);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 40px 20px 64px;
    text-align: center;
}

.rise { animation: rise-in .9s var(--ease) both; animation-delay: calc(var(--intro) + var(--d, .35s)); }
.tagline.rise { --d: .45s; }
.countdown.rise, .open-block.rise { --d: .55s; }
.actions.rise { --d: .65s; }
.discord-stats.rise { --d: .75s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(40px); } }

.title {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 .22em;
    margin: -6px 0 -4px;
    font-size: clamp(64px, 13vw, 184px);
    font-weight: 900;
    letter-spacing: -.045em;
    line-height: .92;
    transform: skewX(-8deg);
}
.word { display: inline-block; overflow: hidden; padding: .04em .06em .08em; }
.word > span {
    display: inline-block;
    animation: word-rise .85s var(--ease) both;
    animation-delay: calc(var(--intro) + .05s);
}
.word + .word > span { animation-delay: calc(var(--intro) + .17s); }
@keyframes word-rise { from { opacity: 0; transform: translateY(110%) rotate(3deg); } }

.sheen {
    color: transparent;
    background: linear-gradient(100deg, var(--swiss) 0%, var(--swiss) 38%, #ff8a8f 50%, var(--swiss) 62%, var(--swiss) 100%) 0 0 / 240% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}
.word > .sheen {
    animation:
        word-rise .85s var(--ease) both,
        sheen 6s linear infinite;
    animation-delay: calc(var(--intro) + .17s), calc(var(--intro) + 1s);
}
@keyframes sheen {
    from { background-position: -140% 0; }
    to { background-position: 240% 0; }
}

/* ── Állapot-jelvény ─────────────────────────────────────────────────── */
.badge {
    --d: 0s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border: 1px solid var(--swiss-line);
    border-radius: 99px;
    background: var(--swiss-soft);
    color: var(--swiss-hi);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
    animation: pulse 1.6s ease-in-out infinite;
}
.badge.is-open {
    border-color: rgba(74, 222, 128, .3);
    background: var(--green-soft);
    color: var(--green);
}
@keyframes pulse { 50% { opacity: .3; } }

.tagline {
    max-width: 44ch;
    margin: 0;
    font-size: clamp(16px, 1.8vw, 19px);
    color: var(--muted);
    text-wrap: balance;
}

/* ── Visszaszámláló ──────────────────────────────────────────────────── */
.countdown { display: flex; gap: 12px; }
.cd-cell {
    position: relative;
    display: grid;
    gap: 6px;
    min-width: 92px;
    padding: 18px 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(27, 27, 27, .82);
    box-shadow: 0 0 0 1px rgba(229, 9, 20, .18), 0 14px 40px -20px rgba(229, 9, 20, .7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.cd-cell::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 22%;
    right: 22%;
    height: 2px;
    border-radius: 2px;
    background: var(--swiss);
    box-shadow: 0 0 12px var(--swiss);
}
.cd-cell b {
    font: 700 38px/1 var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.cd-cell span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--dim);
}

/* ── Nyitva: connect + létszám ───────────────────────────────────────── */
.open-block { display: grid; justify-items: center; gap: 12px; max-width: 100%; }

.connect {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    padding: 6px 6px 6px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(27, 27, 27, .85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.connect code {
    min-width: 0;
    font: 700 15px/1.2 var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: all;
}
.connect code > span:first-child { color: var(--swiss-hi); }
.copy {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--muted);
    font: 700 13px/1 var(--font-ui);
    cursor: pointer;
    transition: color .15s, background .15s;
}
.copy:hover { color: var(--fg); background: #2b2b2b; }
.copy.ok { background: var(--green-soft); color: var(--green); }

.players {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.players.is-down .live-dot { background: var(--dim); box-shadow: none; }

/* ── Gombok ──────────────────────────────────────────────────────────── */
.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: 800 15px/1 var(--font-ui);
    letter-spacing: .01em;
    text-decoration: none;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

.btn-glow {
    background: linear-gradient(135deg, var(--swiss), var(--swiss-dark));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(229, 9, 20, .6), 0 0 18px -2px var(--swiss), inset 0 1px 0 rgba(255, 255, 255, .25);
    animation: btn-glow 2.4s ease-in-out infinite;
}
.btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: btn-sheen 3.6s ease-in-out infinite;
    pointer-events: none;
}
.btn-glow:hover {
    box-shadow: 0 0 0 1px rgba(229, 9, 20, .8), 0 0 26px 2px var(--swiss), inset 0 1px 0 rgba(255, 255, 255, .3);
    animation-play-state: paused;
}
@keyframes btn-glow {
    50% { box-shadow: 0 0 0 1px rgba(229, 9, 20, .7), 0 0 28px 0 rgba(229, 9, 20, .75), inset 0 1px 0 rgba(255, 255, 255, .25); }
}
@keyframes btn-sheen {
    0%, 55% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

.btn-ghost,
body.is-open #discord-btn {
    background: rgba(27, 27, 27, .7);
    color: var(--fg);
    border-color: var(--border);
    box-shadow: none;
    animation: none;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
body.is-open #discord-btn::after { content: none; }
.btn-ghost:hover,
body.is-open #discord-btn:hover { background: rgba(35, 35, 35, .9); border-color: rgba(229, 9, 20, .45); }

.discord-stats {
    margin: -10px 0 0;
    font-size: 13px;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
}

/* ── Futószalag ──────────────────────────────────────────────────────── */
.marquee {
    overflow: hidden;
    padding: 16px 0;
    border-block: 1px solid var(--border);
    background: rgba(14, 14, 14, .6);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: marquee 28s linear infinite;
}
.marquee-track span {
    padding: 0 26px;
    font-size: clamp(20px, 2.6vw, 30px);
    font-weight: 900;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
    transform: skewX(-8deg);
}
.marquee-track span:nth-of-type(even) { color: rgba(255, 255, 255, .16); }
.marquee-track i {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    background: var(--swiss);
    box-shadow: 0 0 10px var(--swiss);
    transform: rotate(45deg);
}
@keyframes marquee { to { transform: translateX(-50%); } }

.foot {
    padding: 20px 28px;
    text-align: center;
    font-size: 12px;
    color: var(--dim);
}

/* ── 404 ─────────────────────────────────────────────────────────────── */
.err-code {
    font: 900 clamp(96px, 20vw, 200px)/1 var(--font-ui);
    letter-spacing: -.05em;
    transform: skewX(-8deg);
}

@media (max-width: 560px) {
    .bar { padding-inline: 16px; }
    .hero { padding-inline: 16px; gap: 22px; }
    .connect { width: 100%; }
    .connect code { flex: 1 1 auto; text-align: left; }
    .actions { width: 100%; }
    .actions .btn { flex: 1 1 auto; }
    .countdown { gap: 6px; width: 100%; }
    .cd-cell { min-width: 0; flex: 1 1 0; padding-inline: 4px; }
    .cd-cell b { font-size: 26px; }
    .logo-xl .logo-word { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; }
    .preloader { display: none; }
    .marquee-track { transform: none; }
}
