/* ==========================================================================
   Views: Start, Rangliste, Account, Chat
   ========================================================================== */

/* --- Hero ---------------------------------------------------------------- */
.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr);
    gap: 26px;
    align-items: stretch;
    margin-bottom: 34px;
}

.hero__main {
    position: relative;
    padding: 42px 44px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255, 90, 31, .17), transparent 55%),
        radial-gradient(90% 120% at 100% 100%, rgba(34, 224, 161, .1), transparent 55%),
        linear-gradient(180deg, var(--surface-1), var(--bg-1));
    overflow: hidden;
}

.hero__main::after {
    content: '🦙';
    position: absolute;
    right: -30px;
    bottom: -70px;
    font-size: 260px;
    line-height: 1;
    opacity: .05;
    pointer-events: none;
    animation: llama-float 9s ease-in-out infinite;
}

@keyframes llama-float {
    50% { transform: translateY(-16px) rotate(3deg); }
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    margin-bottom: 20px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(255, 90, 31, .3);
    background: rgba(255, 90, 31, .1);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ember-soft);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ember);
    box-shadow: 0 0 0 0 rgba(255, 90, 31, .7);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    70% { box-shadow: 0 0 0 9px rgba(255, 90, 31, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); }
}

.hero__title {
    font-size: clamp(38px, 6vw, 68px);
    line-height: .95;
    letter-spacing: -.045em;
    margin-bottom: 16px;
}

.hero__title em {
    font-style: normal;
    background: linear-gradient(100deg, var(--ember) 10%, var(--gold) 45%, var(--mint) 90%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-pan 7s linear infinite;
}

@keyframes gradient-pan {
    to { background-position: 220% 0; }
}

.hero__lead {
    max-width: 48ch;
    font-size: 16.5px;
    color: var(--text-dim);
    margin-bottom: 28px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --- Spielerkarte -------------------------------------------------------- */
.player-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    box-shadow: var(--shadow-md);
}

.player-card__top { display: flex; align-items: center; gap: 15px; }

.level-ring {
    position: relative;
    flex: none;
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
}

.level-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.level-ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.level-ring .track { stroke: rgba(255, 255, 255, .08); }
.level-ring .bar { stroke: url(#lvlGrad); transition: stroke-dashoffset .9s var(--ease-out); }

.level-ring__num {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.level-ring__lbl { font-size: 9px; letter-spacing: .12em; color: var(--text-faint); text-transform: uppercase; }

.player-card__name { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.player-card__tag { font-size: 12.5px; color: var(--text-faint); }

.xp-bar {
    height: 7px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
}

.xp-bar__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ember), var(--gold));
    box-shadow: 0 0 12px rgba(255, 201, 60, .5);
    transition: width .9s var(--ease-out);
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.stat {
    padding: 12px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
    text-align: center;
}

.stat__val {
    display: block;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat__lbl { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }

/* --- Sektionen ----------------------------------------------------------- */
.section { margin-bottom: 38px; }

.section__head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 18px;
}

.section__title {
    font-size: 22px;
    letter-spacing: -.025em;
}

.section__hint { font-size: 13px; color: var(--text-faint); }
.section__more { margin-left: auto; font-size: 13px; }

/* --- Spielkarten --------------------------------------------------------- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 18px;
}

.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 232px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface-1);
    text-align: left;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
    will-change: transform;
}

.game-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-lg);
}

.game-card__art {
    position: relative;
    flex: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--art, linear-gradient(140deg, #2a2f3a, #171a21));
}

.game-card__art::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .045) 0 2px, transparent 2px 11px);
    opacity: .7;
}

.game-card__glyph {
    position: relative;
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45));
    transition: transform .45s var(--ease-spring);
    transform: translateZ(34px);
}

.game-card:hover .game-card__glyph { transform: translateZ(48px) scale(1.16) rotate(-7deg); }

.game-card__shine {
    position: absolute;
    inset: 0;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .17), transparent 60%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.game-card:hover .game-card__shine { opacity: 1; }

.game-card__body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    border-top: 1px solid var(--line);
    background: rgba(10, 11, 15, .55);
}

.game-card__name {
    font-family: var(--font-display);
    font-size: 16.5px;
    font-weight: 700;
}

.game-card__desc { font-size: 12.5px; color: var(--text-faint); }

.game-card__best {
    margin-left: auto;
    flex: none;
    text-align: right;
}

.game-card__best-val {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.game-card__best-lbl { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }

.game-card__play {
    position: absolute;
    top: 13px;
    right: 13px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(8, 9, 12, .6);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(8px);
    font-size: 14px;
    opacity: 0;
    transform: translateY(-6px) scale(.85);
    transition: all .3s var(--ease-spring);
}

.game-card:hover .game-card__play { opacity: 1; transform: translateY(0) scale(1); }

/* --- Zwei-Spalten-Bereich ------------------------------------------------ */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

/* --- Rangliste ----------------------------------------------------------- */
.lb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.lb-tab {
    padding: 9px 17px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .03);
    color: var(--text-dim);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    transition: all .22s var(--ease);
}

.lb-tab:hover { color: var(--text); border-color: var(--line-strong); }

.lb-tab.is-active {
    color: #14100c;
    background: linear-gradient(135deg, var(--ember), #ff9a3c);
    border-color: transparent;
    box-shadow: var(--glow-ember);
}

.lb-list { display: flex; flex-direction: column; gap: 8px; }

.lb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 17px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .025);
    animation: row-in .4s var(--ease-out) both;
    transition: border-color .2s, background .2s, transform .2s var(--ease);
}

.lb-row:hover { background: rgba(255, 255, 255, .05); transform: translateX(3px); }
.lb-row.is-me { border-color: rgba(255, 90, 31, .45); background: rgba(255, 90, 31, .07); }

@keyframes row-in {
    from { opacity: 0; transform: translateY(10px); }
}

.lb-rank {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .05);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dim);
}

.lb-row--1 .lb-rank { background: linear-gradient(140deg, #ffd76a, #d99b1a); color: #2b1e00; }
.lb-row--2 .lb-rank { background: linear-gradient(140deg, #e2e8f0, #94a3b8); color: #1c2430; }
.lb-row--3 .lb-rank { background: linear-gradient(140deg, #e0a06a, #a8622c); color: #2b1400; }

.lb-name { font-weight: 600; font-size: 14.5px; }
.lb-sub { font-size: 11.5px; color: var(--text-faint); }

.lb-score {
    margin-left: auto;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
    color: var(--gold);
}

.empty-state {
    padding: 46px 20px;
    text-align: center;
    color: var(--text-faint);
}

.empty-state__icon { font-size: 40px; opacity: .5; display: block; margin-bottom: 10px; }

/* --- Account ------------------------------------------------------------- */
.auth-wrap {
    width: min(460px, 100%);
    margin: 0 auto;
}

.auth-card {
    padding: 32px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-1), var(--bg-1));
    box-shadow: var(--shadow-lg);
}

.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 26px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
}

.auth-switch button {
    padding: 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    transition: all .25s var(--ease);
}

.auth-switch button.is-active {
    background: var(--surface-3);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-msg {
    padding: 11px 14px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    border: 1px solid transparent;
    animation: toast-in .3s var(--ease-spring) both;
}

.auth-msg--err { background: rgba(255, 77, 94, .1); border-color: rgba(255, 77, 94, .3); color: #ff9aa4; }
.auth-msg--ok { background: rgba(34, 224, 161, .1); border-color: rgba(34, 224, 161, .3); color: #71f0c6; }
.auth-msg--info { background: rgba(89, 194, 255, .1); border-color: rgba(89, 194, 255, .28); color: #9ad8ff; }

.pw-meter { display: flex; gap: 4px; margin-top: 2px; }
.pw-meter i {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .09);
    transition: background .3s;
}
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: #ff9f43; }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: var(--gold); }
.pw-meter[data-score="4"] i { background: var(--mint); }

.verify-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    margin-bottom: 20px;
    border-radius: var(--r-md);
    border: 1px solid rgba(255, 201, 60, .32);
    background: rgba(255, 201, 60, .09);
    font-size: 13.5px;
}

.verify-banner__icon { font-size: 20px; }
.verify-banner.is-ok { border-color: rgba(34, 224, 161, .3); background: rgba(34, 224, 161, .08); }

.account-grid { display: grid; gap: 18px; }

.kv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row__k { color: var(--text-faint); min-width: 130px; }
.kv-row__v { font-weight: 600; margin-left: auto; text-align: right; word-break: break-all; }

.status-led {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-faint);
}
.status-led.online { background: var(--mint); box-shadow: 0 0 10px var(--mint); animation: pulse-led 2.4s infinite; }

@keyframes pulse-led { 50% { opacity: .45; } }

/* --- Chat ---------------------------------------------------------------- */
.chat-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: min(880px, 100%);
    margin: 0 auto;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: rgba(13, 15, 20, .4);
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 74%;
    padding: 10px 15px;
    border-radius: 16px 16px 16px 5px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 14.5px;
    animation: msg-in .34s var(--ease-spring) both;
    word-break: break-word;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(10px) scale(.96); }
}

.chat-msg__who {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ember-soft);
    margin-bottom: 3px;
}

.chat-msg--mine {
    align-self: flex-end;
    border-radius: 16px 16px 5px 16px;
    background: linear-gradient(135deg, rgba(255, 90, 31, .9), rgba(255, 128, 56, .8));
    color: #14100c;
    border-color: transparent;
}
.chat-msg--mine .chat-msg__who { color: rgba(20, 16, 12, .65); }

.chat-msg--system {
    align-self: center;
    background: transparent;
    border: 1px dashed var(--line-strong);
    color: var(--text-faint);
    font-size: 13px;
    border-radius: var(--r-pill);
}

.chat-compose {
    flex: none;
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--line);
    background: rgba(20, 23, 30, .7);
}

.chat-compose .input { border-radius: var(--r-pill); }

/* --- Changelog ----------------------------------------------------------- */
.changelog { display: flex; flex-direction: column; }

.change {
    display: flex;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}
.change:last-child { border-bottom: 0; }

.tag {
    flex: none;
    padding: 3px 9px;
    height: fit-content;
    border-radius: var(--r-xs);
    background: rgba(255, 255, 255, .07);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.tag--new { background: rgba(255, 90, 31, .18); color: var(--ember-soft); }
.tag--fix { background: rgba(89, 194, 255, .15); color: var(--ice); }
.tag--gone { background: rgba(255, 77, 94, .14); color: #ff8a95; }

/* --- Zufalls-Tools ------------------------------------------------------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }

.coin-stage { perspective: 900px; width: 170px; height: 170px; margin: 8px auto 20px; cursor: pointer; }

.coin3d {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 2.6s var(--ease-out);
}

.coin3d__face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    backface-visibility: hidden;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: #43310a;
    background: radial-gradient(circle at 32% 28%, #ffe89b, #ffc93c 45%, #b8860b);
    box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .22), 0 18px 34px -12px rgba(0, 0, 0, .8);
}

.coin3d__face--b {
    transform: rotateY(180deg);
    color: #22303f;
    background: radial-gradient(circle at 32% 28%, #f4f7fb, #c7d0dc 45%, #7c8798);
}

.rng-display {
    font-family: var(--font-display);
    font-size: 60px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.04em;
    background: linear-gradient(120deg, var(--mint), var(--ice));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 14px 0;
}

.rng-inputs { display: flex; align-items: center; justify-content: center; gap: 10px; }
.rng-inputs .input { width: 96px; text-align: center; }

@media (max-width: 1000px) {
    .hero { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
    .hero__main { padding: 30px 24px; }
}

/* Lange Spielbeschreibungen dürfen den Bestwert nicht verdrängen */
.game-card__body > div:first-child { min-width: 0; }
.game-card__name,
.game-card__desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
