
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
    --background: #100d19;
    --surface: #1b1629;
    --surface-light: #241d35;
    --purple: #a78bfa;
    --purple-light: #c4b5fd;
    --text: #f5f0ff;
    --muted: #a69bbd;
    --border: rgba(196, 181, 253, 0.12);
}

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

body {
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    width: 650px;
    height: 650px;
    top: -300px;
    left: 50%;
    transform: translateX(-50%);
    background: #7046bd;
    filter: blur(180px);
    opacity: 0.19;
    pointer-events: none;
}

.header {
    width: 100%;
    max-width: 1250px;
    margin: auto;
    padding: 25px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo {
    color: var(--text);
    text-decoration: none;
    font-size: 23px;
    font-weight: 900;
}

.logo span {
    color: var(--purple);
}

.header-label {
    color: var(--muted);
    font-size: 13px;
}

.main-container {
    width: 100%;
    max-width: 1250px;
    margin: auto;
    padding: 45px 24px 25px;
    position: relative;
    z-index: 1;
}

.hero {
    text-align: center;
}

.eyebrow {
    color: var(--purple);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

h1 {
    font-size: clamp(38px, 6vw, 58px);
    line-height: 1.08;
    font-weight: 900;
}

h1 span {
    color: var(--purple-light);
}

.intro {
    color: var(--muted);
    max-width: 420px;
    margin: 17px auto 35px;
    font-size: 15px;
    line-height: 1.7;
}

/* Hauptlayout */

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 35px;
    align-items: start;
    text-align: left;
}

.game-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Rundes Fylamorn-Bild */

.character-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 5px auto 25px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character-glow {
    position: absolute;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: #a78bfa;
    filter: blur(65px);
    opacity: 0.65;
    animation: glow-pulse 3s ease-in-out infinite;
}

.character {
    position: relative;
    z-index: 1;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 4px solid rgba(196, 181, 253, 0.65);
    box-shadow:
        0 0 15px rgba(167, 139, 250, 0.7),
        0 0 35px rgba(167, 139, 250, 0.5),
        0 0 75px rgba(167, 139, 250, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.character:hover {
    transform: scale(1.04);
    box-shadow:
        0 0 20px rgba(167, 139, 250, 0.9),
        0 0 45px rgba(167, 139, 250, 0.7),
        0 0 90px rgba(167, 139, 250, 0.4);
}

.floating-heart {
    position: absolute;
    z-index: 3;
    top: 20px;
    right: 10px;
    opacity: 0;
    font-size: 35px;
}

/* Zähler */

.counter-card {
    width: min(100%, 380px);
    padding: 22px;
    background: linear-gradient(145deg, #241d35, #191425);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-align: center;
}

.counter-label {
    color: var(--muted);
    font-size: 13px;
}

.counter-number {
    font-size: 43px;
    line-height: 1.4;
    font-weight: 900;
    color: var(--purple-light);
}

.counter-caption {
    color: var(--muted);
    font-size: 12px;
}

/* Headpat Eingabe */

.pat-box {
    width: min(100%, 380px);
    margin: 25px auto 0;
    text-align: left;
}

.pat-box label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 9px;
}

.pat-box input {
    width: 100%;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
}

.pat-box input:focus {
    border-color: var(--purple);
}

.pat-box input::placeholder {
    color: #766c89;
}

.pat-button {
    width: 100%;
    padding: 17px;
    margin-top: 12px;
    border: none;
    border-radius: 13px;
    background: linear-gradient(135deg, #a78bfa, #8055d9);
    color: white;
    font-family: inherit;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(130, 85, 217, 0.22);
    transition: transform 0.2s, filter 0.2s;
}

.pat-button:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

.pat-button:active {
    transform: scale(0.97);
}

.pat-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.message {
    min-height: 24px;
    margin-top: 12px;
    text-align: center;
    color: var(--purple-light);
    font-size: 13px;
}

/* Bestenliste */

.leaderboard-section {
    padding: 27px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-align: left;
    min-width: 0;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

h2 {
    font-size: 21px;
    font-weight: 900;
}

.live-label {
    color: #9ee6bd;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.live-label span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7ce0a7;
    box-shadow: 0 0 10px #7ce0a7;
}

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

.leader-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    border-radius: 12px;
    background: var(--surface-light);
}

.rank {
    min-width: 30px;
    font-size: 17px;
    font-weight: 900;
}

.leader-name {
    flex: 1;
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.leader-pats {
    font-size: 14px;
    font-weight: 900;
    color: var(--purple-light);
    white-space: nowrap;
}

.leader-pats span {
    margin-left: 3px;
}

.empty-state,
.loading {
    padding: 25px 10px;
    color: var(--muted);
    text-align: center;
    line-height: 1.8;
}

.leaderboard-note {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

/* Footer */

.footer {
    padding: 65px 10px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 2;
}

/* Animationen */

.pat-animation {
    animation: pat 0.55s ease;
}

.heart-animation {
    animation: heart 0.8s ease forwards;
}

@keyframes pat {
    0% { transform: translateY(0) rotate(0); }
    30% { transform: translateY(8px) rotate(-4deg); }
    60% { transform: translateY(-5px) rotate(3deg); }
    100% { transform: translateY(0) rotate(0); }
}

@keyframes heart {
    0% { opacity: 0; transform: translateY(10px) scale(0.5); }
    30% { opacity: 1; transform: translateY(-5px) scale(1.2); }
    100% { opacity: 0; transform: translateY(-65px) scale(1); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.45; transform: scale(0.95); }
    50% { opacity: 0.75; transform: scale(1.08); }
}

/* Responsive */

@media (max-width: 800px) {
    .game-layout {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin: auto;
    }

    .leaderboard-section {
        width: 100%;
    }

    .main-container {
        padding-top: 35px;
    }
}

@media (max-width: 550px) {
    .header {
        padding: 20px 17px;
    }

    .header-label {
        font-size: 10px;
    }

    .main-container {
        padding-left: 17px;
        padding-right: 17px;
    }

    .character-container {
        width: 220px;
        height: 220px;
    }

    .character {
        width: 195px;
        height: 195px;
    }

    .leaderboard-section {
        padding: 19px;
    }

    h2 {
        font-size: 19px;
    }
}