:root {
    --bg-0: #1a0b2e;
    --bg-1: #2d1155;
    --bg-2: #4a1a6b;
    --accent: #ff4d94;
    --accent-2: #ffb703;
    --good: #35d07f;
    --bad: #ff5c5c;
    --text: #fdf7ff;
    --muted: #c3aede;
    --card: rgba(255, 255, 255, 0.07);
    --card-border: rgba(255, 255, 255, 0.14);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: radial-gradient(1200px 800px at 20% -10%, var(--bg-2), transparent 60%),
                radial-gradient(900px 700px at 90% 10%, #7b2d8e55, transparent 60%),
                linear-gradient(160deg, var(--bg-0), var(--bg-1));
    background-attachment: fixed;
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    max-width: 780px;
    margin: 0 auto;
    padding: 24px 18px 64px;
    min-height: 100vh;
}

/* ---------------------------------------------------------------- Typo */

h1 {
    font-size: clamp(1.9rem, 6vw, 2.9rem);
    line-height: 1.1;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

/* Kein Fokusrahmen um Überschriften — Blazor setzt dort sonst den Fokus. */
h1:focus,
h2:focus,
h1:focus-visible,
[tabindex="-1"]:focus {
    outline: none;
}

h2 {
    font-size: clamp(1.3rem, 4.5vw, 1.8rem);
    margin: 0 0 10px;
}

.sub {
    color: var(--muted);
    margin: 0 0 24px;
    font-size: 1rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    color: var(--accent-2);
    font-weight: 700;
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------- Karten */

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
    backdrop-filter: blur(6px);
}

.card.highlight {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 18px 50px -20px var(--accent);
}

.game-emoji {
    font-size: clamp(3rem, 14vw, 5rem);
    line-height: 1;
    margin-bottom: 10px;
}

.rules {
    font-size: 1.08rem;
    line-height: 1.55;
    margin: 0;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.86rem;
    color: var(--muted);
}

/* ---------------------------------------------------------------- Buttons */

button {
    font-family: inherit;
}

.btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 18px 20px;
    font-size: 1.12rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.15s ease;
    margin-bottom: 12px;
    text-align: center;
}

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

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent), #ff7ab8);
}

.btn-good {
    background: linear-gradient(120deg, #1fa968, var(--good));
}

.btn-bad {
    background: linear-gradient(120deg, #c93636, var(--bad));
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px;
}

.btn-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.btn-row .btn {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .btn-row {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------- Formular */

.field {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 15px 16px;
    font-size: 1.05rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
}

input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.name-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.name-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 8px 8px 8px 16px;
    font-weight: 600;
}

.name-list button {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.05rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
}

.inline-form {
    display: flex;
    gap: 10px;
}

.inline-form input {
    flex: 1;
}

.inline-form .btn {
    width: auto;
    padding: 15px 22px;
    margin: 0;
}

/* ---------------------------------------------------------------- Gegnerauswahl */

.opponent-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.opponent-btn {
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text);
    border-radius: 16px;
    padding: 22px 12px;
    font-size: 1.12rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.08s ease, border-color 0.15s ease;
}

.opponent-btn:hover {
    border-color: var(--accent);
}

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

.played-list {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.played-list .won::before {
    content: "🏆 ";
}

.played-list .lost::before {
    content: "🥃 ";
}

/* ---------------------------------------------------------------- Duell-Kopf */

.versus {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px 12px;
    margin-bottom: 18px;
}

.versus-side {
    text-align: center;
    min-width: 0;
}

.versus-emoji {
    font-size: 1.7rem;
    line-height: 1;
    margin-bottom: 4px;
}

.versus-name {
    font-weight: 800;
    font-size: clamp(1rem, 4.5vw, 1.35rem);
    overflow-wrap: anywhere;
}

.versus-vs {
    color: var(--accent-2);
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------------------------------------------------------------- Hilfsmittel */

.word-panel {
    margin-top: 4px;
}

.word-panel-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.hint-box {
    background: rgba(255, 183, 3, 0.12);
    border: 1px solid rgba(255, 183, 3, 0.45);
    border-radius: 16px;
    padding: 18px;
    margin-top: 16px;
}

.hint-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-2);
    font-weight: 700;
    margin-bottom: 10px;
}

.big-letter {
    font-size: clamp(3.5rem, 18vw, 6rem);
    font-weight: 800;
    text-align: center;
    line-height: 1;
}

.word-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.word {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-weight: 600;
}

.secret-toggle {
    text-align: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    border: 1px dashed var(--card-border);
}

/* ---------------------------------------------------------------- Timer */

.timer {
    text-align: center;
    margin-top: 16px;
}

.timer-value {
    font-size: clamp(3rem, 16vw, 5rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.timer-value.urgent {
    color: var(--bad);
    animation: pulse 0.6s infinite alternate;
}

@keyframes pulse {
    to {
        transform: scale(1.06);
    }
}

/* ---------------------------------------------------------------- Ergebnis */

.result-hero {
    text-align: center;
    padding: 30px 20px;
}

.result-emoji {
    font-size: clamp(4rem, 22vw, 7rem);
    line-height: 1;
    margin-bottom: 12px;
}

.result-title {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
    font-weight: 800;
    margin: 0 0 8px;
}

.result-sub {
    color: var(--muted);
    font-size: 1.05rem;
    margin: 0;
}

/* ---------------------------------------------------------------- Finale */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.stat {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 18px 10px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

.history {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.95rem;
}

.history li:last-child {
    border-bottom: none;
}

.history .outcome-won {
    color: var(--good);
    font-weight: 700;
    white-space: nowrap;
}

.history .outcome-lost {
    color: var(--bad);
    font-weight: 700;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- Footer / Reset */

.footer {
    margin-top: 34px;
    text-align: center;
}

.footer button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 8px;
}

.error {
    color: var(--bad);
    font-size: 0.9rem;
    margin: 8px 0 0;
}

/* ---------------------------------------------------------------- Boot / Fehler */

.boot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 14px;
}

.boot-cake {
    font-size: 4rem;
    animation: pulse 0.9s infinite alternate;
}

.boot-text {
    color: #c3aede;
    font-family: "Segoe UI", system-ui, sans-serif;
}

#blazor-error-ui {
    background: #ffb703;
    color: #1a0b2e;
    bottom: 0;
    display: none;
    left: 0;
    padding: 14px 18px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: "Segoe UI", system-ui, sans-serif;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 12px;
}
