/* Gemeinsame Styles für die Spiele (Snake, Jump and Run, Reflex-Test, Glücksrad, Münze) */

.gm-inner {
    max-width: 560px;
}

/* Kennzahlen als kleine Karten nebeneinander */
.gm-stats {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.gm-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.6rem 0.8rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    box-shadow: var(--mp-card-shadow);
}

.gm-stat span {
    color: var(--mp-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.gm-stat strong {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.gm-stat-accent strong {
    color: var(--mp-accent);
}

.gm-stat.bump strong {
    animation: gmBump 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gmBump {
    50% { transform: scale(1.18); }
}

/* Spielfeld */
.gm-board {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 12px 32px rgba(236, 72, 153, 0.12);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.gm-board canvas {
    display: block;
    width: 100%;
    height: auto;
}

.gm-board-square {
    aspect-ratio: 1;
}

.gm-board-square canvas {
    height: 100%;
}

/* Start und Ende: Glas-Karte über dem Spielfeld */
.gm-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 245, 250, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.gm-overlay.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s;
}

.gm-card {
    width: min(100%, 300px);
    padding: 1.3rem 1.2rem 1.1rem;
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 1px #fff, 0 18px 40px rgba(17, 24, 39, 0.16);
    transform: scale(0.94) translateY(8px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gm-overlay.show .gm-card {
    transform: none;
}

.gm-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 0.6rem;
    border-radius: 17px;
    color: #fff;
    font-size: 1.4rem;
    background: var(--tint, var(--mp-accent));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--tint, #ec4899) 35%, transparent);
}

.gm-card h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--mp-text);
}

.gm-card p {
    margin: 0.35rem 0 0;
    color: var(--mp-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.gm-card .gm-big {
    margin: 0.4rem 0 0;
    color: var(--mp-text);
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.gm-record {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.8rem;
    font-weight: 700;
}

.gm-card .mp-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Kleiner Knopf oben rechts im Spielfeld */
.gm-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--mp-text);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.1);
    cursor: pointer;
}

.gm-hint {
    margin: 0.7rem 0 0;
    color: var(--mp-muted);
    font-size: 0.84rem;
    text-align: center;
}

/* Steuerkreuz unter dem Spielfeld (nur Touch) */
.gm-pad {
    display: none;
    grid-template-columns: repeat(3, 62px);
    grid-template-rows: repeat(2, 54px);
    justify-content: center;
    gap: 8px;
    margin-top: 0.9rem;
}

.gm-pad button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mp-soft-2);
    border-radius: 18px;
    background: #fff;
    color: var(--mp-accent);
    font-size: 1.15rem;
    box-shadow: var(--mp-card-shadow);
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, background 0.12s ease;
}

.gm-pad button:active,
.gm-pad button.hit {
    transform: scale(0.92);
    background: var(--mp-soft);
}

.gm-pad .up {
    grid-column: 2;
}

.gm-pad .left {
    grid-column: 1;
    grid-row: 2;
}

.gm-pad .down {
    grid-column: 2;
    grid-row: 2;
}

.gm-pad .right {
    grid-column: 3;
    grid-row: 2;
}

@media (hover: none) and (pointer: coarse) {
    .gm-pad {
        display: grid;
    }

    .gm-only-desktop {
        display: none;
    }
}

@media (hover: hover) {
    .gm-only-touch {
        display: none;
    }
}

/* Rangliste */
.gm-rank-row {
    cursor: default;
}

.gm-rank-row:hover,
.gm-rank-row:active {
    background: none;
}

.gm-medal {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--mp-muted);
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.gm-medal-1 {
    background: linear-gradient(145deg, #fde68a, #f59e0b);
    color: #fff;
}

.gm-medal-2 {
    background: linear-gradient(145deg, #e5e7eb, #9ca3af);
    color: #fff;
}

.gm-medal-3 {
    background: linear-gradient(145deg, #fed7aa, #c2410c);
    color: #fff;
}

.gm-score {
    flex: none;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.gm-me {
    background: var(--mp-soft);
}

.gm-me:hover,
.gm-me:active {
    background: var(--mp-soft);
}

.gm-you {
    margin-left: 0.35rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--mp-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: 2px;
}

.gm-empty {
    padding: 1.1rem 1rem;
    color: var(--mp-muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (min-width: 900px) {
    .gm-inner.gm-wide {
        max-width: 1040px;
    }

    .gm-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 1.6rem;
        align-items: start;
    }

    .gm-layout .set-section:first-child {
        margin-top: 0;
    }
}

/* ---------- Fragen für Leni ---------- */

.lv-card {
    position: relative;
    overflow: hidden;
    padding: 2.2rem 1.4rem 1.6rem;
    border-radius: 30px;
    text-align: center;
    color: #fff;
    background: radial-gradient(circle at 20% 10%, #f9a8d4 0%, transparent 45%),
        radial-gradient(circle at 90% 90%, #a78bfa 0%, transparent 50%),
        linear-gradient(160deg, #f472b6, #db2777);
    box-shadow: 0 20px 44px rgba(219, 39, 119, 0.3);
}

.lv-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.25), transparent 60%);
    pointer-events: none;
}

.lv-heart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
    font-size: 3.4rem;
    animation: lvBeat 1.3s ease-in-out infinite;
}

@keyframes lvBeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.12); }
    30% { transform: scale(1); }
    45% { transform: scale(1.08); }
}

.lv-question {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(1.7rem, 7vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
}

.lv-sub {
    position: relative;
    z-index: 1;
    margin: 0.6rem auto 0;
    max-width: 320px;
    font-size: 0.98rem;
    opacity: 0.92;
}

.lv-btn {
    position: relative;
    z-index: 2;
    min-height: 54px;
    padding: 0 1.6rem;
    border: 0;
    border-radius: 18px;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lv-yes {
    background: #fff;
    color: #db2777;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
}

.lv-no {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6);
}

.lv-done {
    position: relative;
    z-index: 1;
    animation: cnPopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cnPopIn {
    from { transform: scale(0.7); opacity: 0; }
}

.lv-done h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.lv-done p {
    margin: 0.4rem 0 0;
    font-size: 1.05rem;
    opacity: 0.95;
}

.gm-corner[hidden] {
    display: none;
}

.gm-stat strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 400px) {
    .gm-stat strong {
        font-size: 1.15rem;
    }
}

@media (min-width: 769px) {
    /* Auf dem Computer passt das ganze Spielfeld in den Bildschirm */
    .gm-board-square {
        max-width: max(320px, calc(100vh - 290px));
        margin: 0 auto;
    }
}

.gm-record[hidden] {
    display: none;
}
