/* Root-Container: füllt den Rail, kein Rand */
.gameRoot {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #1e293b 0%, #0b1324 65%, #020617 100%);
    user-select: none;
    touch-action: manipulation;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
}

/* Ebenen-Reihenfolge (z-index): Sterne < Pipes < Boden < Bird < HUD < Overlay */
.gameStars   { position: absolute; inset: 0; z-index: 0; }
.gamePipe    { position: absolute; z-index: 10; }
.gameGround  { position: absolute; z-index: 15; }
.gameBird    { position: absolute; z-index: 20; }
.gameTip     { position: absolute; z-index: 30; pointer-events: none; }
.gameHud     { position: absolute; inset-inline: 0; top: 8px; display: flex; justify-content: center; pointer-events: none; z-index: 35; }
.gameOverlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 40; }

/* Sterne / Deko */
.gameStars::before,
.gameStars::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
            radial-gradient(#94a3b8 1px, transparent 1px),
            radial-gradient(#64748b 1px, transparent 1px);
    background-size: 40px 40px, 60px 60px;
    background-position: 0 0, 20px 10px;
    opacity: .22;
    pointer-events: none;
}

/* HUD */
.gameChip {
    background: rgba(15,23,42,.6);
    border: 1px solid rgba(255,255,255,.08);
    padding: .35rem .6rem; border-radius: 999px;
    font-weight: 700; letter-spacing: .3px; color: #e2e8f0;
    backdrop-filter: blur(4px);
}
.gameScore { color: #22d3ee; }
.gameBest  { color: #a78bfa; margin-left: .35rem; opacity: .9; }

/* Overlay-Text */
.gameOverlay {
    color: #e2e8f0; text-align: center; font-weight: 800;
    font-size: clamp(20px, 5vw, 34px);
    text-shadow: 0 2px 0 #000, 0 0 20px rgba(0,0,0,.35);
}

/* Boden */
.gameGround { left: 0; right: 0; bottom: 0; height: 20px; background: #0b1222; }

/* Vogel (CSS-only) */
.gameBird {
    width: 32px; height: 32px; border-radius: 50%;
    background: #22d3ee;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), 0 6px 10px rgba(0,0,0,.25);
    transform-origin: 50% 50%;
    will-change: transform; /* sanftere Animation */
}
.gameBird::before {
    content: "";
    position: absolute; left: 6px; top: 8px; width: 18px; height: 18px;
    border-radius: 50%; background: #a78bfa;
    animation: gameWing 400ms ease-in-out infinite;
}
@keyframes gameWing {
    0%,100% { transform: translateY(0) scale(1); }
    50%     { transform: translateY(2px) scale(0.95); }
}
.gameBird::after {
    content: "";
    position: absolute; right: 6px; top: 6px; width: 10px; height: 10px;
    background: radial-gradient(circle at 60% 50%, #000 30%, #fff 31%);
    border-radius: 50%;
}
.gameBeak {
    position: absolute; right: -6px; top: 14px;
    width: 0; height: 0;
    border-left: 8px solid #f59e0b;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* Rohre (CSS-only) */
.gamePipe {
    width: 66px;
    background: linear-gradient(180deg, #10b981, #059669);
    box-shadow: inset 0 -8px 0 rgba(0,0,0,.15);
    border-radius: 8px;
    will-change: transform; /* falls per transform bewegt */
}
.gamePipeTop::after,
.gamePipeBottom::before {
    content: "";
    position: absolute; left: 0; right: 0; height: 10px;
    background: rgba(0,0,0,.15);
}
.gamePipeTop::after { bottom: 0; }
.gamePipeBottom::before { top: 0; }

/* Touch-Hinweis */
.gameTip {
    bottom: 10px; left: 50%; transform: translateX(-50%);
    color: #e2e8f0; opacity: .7; font-size: 12px;
}

/* -------------------------------------------------------------- */
/* Warnung bei zu schmalem Fenster                                */
/* -------------------------------------------------------------- */
#rail-warning-anchor {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 9999;
    pointer-events: none;
}
#rail-warning {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: rgb(24, 88, 149);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px 0 0 8px;
    font-weight: 700;
    white-space: nowrap;
    display: none;
    pointer-events: none;
}
#rail-warning .finger { margin-inline: 0; line-height: 1; }
