* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0b0d1a;
    --text: #eef0ff;
    --muted: rgba(238, 240, 255, 0.6);
    --line: rgba(255, 255, 255, 0.12);
    --card: rgba(255, 255, 255, 0.055);
    --accent: #7c6cff;
    --accent-2: #ff5f9e;
    --gold: #feca57;
    --green: #1dd1a1;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding: clamp(16px, 4vw, 40px);
    background:
        radial-gradient(900px 500px at 12% -10%, rgba(124, 108, 255, 0.28), transparent 60%),
        radial-gradient(800px 500px at 100% 0%, rgba(255, 95, 158, 0.18), transparent 55%),
        linear-gradient(160deg, #0b0d1a 0%, #12152a 55%, #0b0d1a 100%);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.bg-glow {
    position: fixed;
    inset: auto -20% -40% -20%;
    height: 60vh;
    background: radial-gradient(circle at 50% 50%, rgba(29, 209, 161, 0.1), transparent 65%);
    pointer-events: none;
}

.hub {
    position: relative;
    width: min(100%, 1080px);
    margin: 0 auto;
}

[hidden] {
    display: none !important;
}

/* ===== Pasek górny / konto ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

/* ===== Modal konta ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(5, 7, 15, 0.74);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    width: min(100%, 400px);
    padding: 26px 22px 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(160deg, #1b1e36, #111326);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
    animation: modalIn 0.18s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.modal-card h2 {
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.modal-sub {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    margin: 18px 0 14px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
}

.auth-tabs button {
    flex: 1;
    padding: 9px 8px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.auth-tabs button.active {
    background: rgba(124, 108, 255, 0.3);
    color: var(--text);
}

.hub-input {
    width: 100%;
    margin-bottom: 9px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
}

.hub-input::placeholder {
    color: rgba(238, 240, 255, 0.38);
}

.hub-input:focus {
    border-color: rgba(124, 108, 255, 0.75);
}

#account-form .btn {
    width: 100%;
    margin-top: 4px;
}

#account-form .btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.auth-error {
    min-height: 1.2em;
    margin-top: 10px;
    color: #ff8f8f;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
}

/* ===== Nagłówek ===== */
.hero {
    padding: clamp(22px, 5vw, 54px) 0 clamp(28px, 5vw, 46px);
    text-align: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid rgba(254, 202, 87, 0.38);
    border-radius: 999px;
    background: rgba(254, 202, 87, 0.1);
    color: var(--gold);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero h1 {
    margin-top: 18px;
    font-size: clamp(2.3rem, 8vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    font-weight: 900;
}

.hero h1 span {
    background: linear-gradient(100deg, #8f7dff 0%, #ff5f9e 55%, #ffb84d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-text {
    width: min(100%, 560px);
    margin: 18px auto 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: clamp(0.95rem, 2.6vw, 1.08rem);
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

/* ===== Przyciski ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 22px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.14s, filter 0.14s, background 0.14s;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn.primary {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 34px rgba(124, 108, 255, 0.35);
}

.btn.primary:hover {
    filter: brightness(1.08);
}

.btn.ghost {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.05);
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn.small {
    padding: 10px 16px;
    font-size: 0.84rem;
}

.btn.tiny {
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 0.76rem;
}

/* ===== Sekcje ===== */
.section {
    margin-top: clamp(28px, 5vw, 44px);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.section-head h2 {
    font-size: clamp(1.15rem, 3.4vw, 1.45rem);
    letter-spacing: -0.015em;
}

.section-sub {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.section-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.muted {
    color: var(--muted);
    font-size: 0.82rem;
}

/* ===== Karty gier ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 14px;
}

.game-card {
    display: flex;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    backdrop-filter: blur(8px);
    transition: transform 0.16s, border-color 0.16s;
}

.game-card:not(.soon):hover {
    transform: translateY(-2px);
    border-color: rgba(124, 108, 255, 0.5);
}

.game-card.soon {
    opacity: 0.78;
}

.game-card.more {
    border-style: dashed;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
}

.game-card.more .game-icon {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.game-card.more p {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

/* ===== Nowy świat / zapowiedź ===== */
.world-card {
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.25fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(62, 207, 255, 0.35);
    border-radius: 24px;
    background:
        radial-gradient(500px 260px at 10% 0%, rgba(62, 207, 255, 0.16), transparent 70%),
        radial-gradient(420px 260px at 100% 100%, rgba(185, 108, 255, 0.14), transparent 70%),
        rgba(255, 255, 255, 0.035);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.world-visual {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border-right: 1px solid rgba(62, 207, 255, 0.2);
    background:
        linear-gradient(180deg, rgba(5, 12, 28, 0.2), rgba(2, 8, 20, 0.86)),
        repeating-linear-gradient(90deg, rgba(62, 207, 255, 0.18) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(0deg, rgba(185, 108, 255, 0.14) 0 1px, transparent 1px 26px),
        #071022;
    perspective: 340px;
}

.world-grid {
    position: absolute;
    inset: 42% -30% -50%;
    background:
        repeating-linear-gradient(90deg, rgba(62, 207, 255, 0.55) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(0deg, rgba(255, 95, 158, 0.32) 0 1px, transparent 1px 34px);
    transform: rotateX(62deg);
    transform-origin: top center;
    opacity: 0.7;
}

.world-core {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border: 2px solid rgba(62, 207, 255, 0.8);
    border-radius: 18px;
    background: radial-gradient(circle, rgba(62, 207, 255, 0.4), transparent 68%);
    box-shadow: 0 0 38px rgba(62, 207, 255, 0.5), inset 0 0 28px rgba(185, 108, 255, 0.35);
    color: #bff4ff;
    font-size: 2.6rem;
    text-shadow: 0 0 18px rgba(62, 207, 255, 0.9);
}

.world-core::after {
    content: '';
    position: absolute;
    inset: -18px;
    border: 1px dashed rgba(185, 108, 255, 0.6);
    border-radius: 26px;
}

.world-body {
    padding: clamp(18px, 3vw, 28px);
}

.world-body h3 {
    margin-top: 8px;
    font-size: clamp(1.35rem, 4vw, 1.9rem);
    letter-spacing: -0.02em;
}

.world-body p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.world-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.roadmap-note {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(254, 202, 87, 0.28);
    border-radius: 18px;
    background:
        radial-gradient(380px 120px at 0% 0%, rgba(254, 202, 87, 0.13), transparent 70%),
        rgba(255, 255, 255, 0.035);
}

.roadmap-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(254, 202, 87, 0.3);
    border-radius: 12px;
    background: rgba(254, 202, 87, 0.1);
    font-size: 1.15rem;
}

.roadmap-note strong {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
}

.roadmap-note p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.game-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(124, 108, 255, 0.32), rgba(255, 95, 158, 0.22));
    font-size: 1.55rem;
}

.game-body {
    flex: 1;
    min-width: 0;
}

.game-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.game-title-row h3,
.game-card.more h3 {
    font-size: 1.12rem;
    letter-spacing: -0.01em;
}

.pill {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pill.live {
    background: rgba(29, 209, 161, 0.16);
    color: var(--green);
    border: 1px solid rgba(29, 209, 161, 0.35);
}

.pill.soon {
    background: rgba(254, 202, 87, 0.13);
    color: var(--gold);
    border: 1px solid rgba(254, 202, 87, 0.32);
}

.game-body p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tags span {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(238, 240, 255, 0.75);
    font-size: 0.68rem;
    font-weight: 700;
}

.game-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.game-waiting {
    color: var(--green);
    font-size: 0.76rem;
    font-weight: 700;
}

.game-waiting.none {
    color: var(--muted);
    font-weight: 600;
}

.soon-note {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ===== Oczekujący gracze ===== */
.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
    transition: background 0.2s;
}

.live-dot.on {
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(29, 209, 161, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(29, 209, 161, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(29, 209, 161, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 209, 161, 0); }
}

.waiting-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.waiting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    animation: fadeIn 0.22s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.waiting-avatar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(124, 108, 255, 0.4), rgba(255, 95, 158, 0.3));
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
}

.waiting-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.waiting-name {
    font-size: 0.94rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.waiting-meta {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.waiting-state {
    padding: 22px 16px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.5;
}

.waiting-empty-actions {
    margin-top: 6px;
}

.waiting-empty-actions a {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}

.waiting-empty-actions a:hover {
    text-decoration: underline;
}

.waiting-hint {
    margin-top: 12px;
    color: rgba(238, 240, 255, 0.42);
    font-size: 0.75rem;
    line-height: 1.45;
}

/* ===== Lista bohaterów ===== */
.hero-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.hero-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.hero-rank {
    flex: 0 0 30px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-align: center;
}

.hero-avatar-small {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(124, 108, 255, 0.5), rgba(255, 95, 158, 0.35));
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hero-row-name {
    font-size: 0.86rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-demo {
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(124, 108, 255, 0.24);
    color: #c9c1ff;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-row-meta {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.hero-row-stats {
    flex: 0 0 auto;
    color: rgba(238, 240, 255, 0.55);
    font-size: 0.68rem;
    text-align: right;
}

.hero-row-best {
    flex: 0 0 auto;
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: 800;
    text-align: right;
}

@media (max-width: 640px) {
    .hero-row-stats {
        display: none;
    }

    .hero-row {
        flex-wrap: wrap;
    }

    .hero-row-best {
        width: 100%;
        padding-left: 74px;
        text-align: left;
    }
}

/* ===== Top 10 statystyk ===== */
.stats-top {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stats-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--card);
}

.stats-rank {
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.stats-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stats-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
}

.stats-meta {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.stats-points {
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.section-more {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

@media (max-width: 560px) {
    .stats-row {
        grid-template-columns: 28px 1fr auto;
        padding: 10px 11px;
    }

    .stats-points {
        font-size: 0.72rem;
    }
}

/* ===== Stopka ===== */
footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: clamp(36px, 6vw, 60px);
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}

footer span {
    font-weight: 800;
    color: rgba(238, 240, 255, 0.8);
}

footer a {
    color: var(--muted);
    text-decoration: none;
}

footer a:hover {
    color: var(--text);
}

@media (max-width: 560px) {
    .game-card {
        padding: 16px;
    }

    .game-icon {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .section-tools .muted {
        display: none;
    }
}

@media (max-width: 640px) {
    .world-card {
        grid-template-columns: 1fr;
    }

    .world-visual {
        min-height: 150px;
        border-right: 0;
        border-bottom: 1px solid rgba(62, 207, 255, 0.2);
    }

    .world-core {
        width: 68px;
        height: 68px;
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .waiting-row, .live-dot.on { animation: none; }
}
