:root {
    --text: #f4f1e8;
    --muted: rgba(244, 241, 232, 0.78);
    --panel: rgba(11, 21, 39, 0.72);
    --panel-border: rgba(255, 255, 255, 0.12);
    --accent: #ffd35f;
    --background-offset: 0px;
    --ground-offset: 0px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background: #0f1f39;
}

body {
    user-select: none;
}

.game {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    isolation: isolate;
    background: #0f1f39;
}

.background-layer {
    position: absolute;
    inset: 0;
    background-image: url("Assets/Background/Background4.png");
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position: var(--background-offset) center;
}

.background-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 19, 37, 0.08), rgba(9, 19, 37, 0.18));
}

.pipes-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.pipe {
    position: absolute;
    width: 96px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pipe.top {
    transform: scaleY(-1);
    transform-origin: center;
}

.pipe-cap {
    width: 100%;
    height: 48px;
    flex: 0 0 auto;
    background-image: url("Assets/Tiles/Style 1/PipeStyle1.png");
    background-repeat: no-repeat;
    background-size: 384px 480px;
    background-position: 0 0;
}

.pipe-body {
    width: 100%;
    flex: 1 1 auto;
    background-image: url("Assets/Tiles/Style 1/PipeStyle1.png");
    background-repeat: repeat-y;
    background-size: 384px 480px;
    background-position: 0 -48px;
}

.bird {
    position: absolute;
    width: 48px;
    height: 48px;
    left: 18vw;
    top: 40vh;
    z-index: 3;
    background-image: url("Assets/Player/StyleBird1/Bird1-1.png");
    background-repeat: no-repeat;
    background-size: 192px 48px;
    background-position: 0 0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    will-change: transform, background-position;
}

.ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 96px;
    z-index: 4;
    background-image: url("Assets/Tiles/Style 1/SimpleStyle1.png");
    background-repeat: repeat-x;
    background-size: 384px 336px;
    background-position: var(--ground-offset) -240px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.hud {
    position: absolute;
    top: 28px;
    left: 28px;
    right: 28px;
    z-index: 6;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.score-box {
    min-width: 120px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(8px);
}

.score-box span {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.score-box strong {
    display: block;
    margin-top: 4px;
    font-size: 2rem;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
    padding: 32px;
    background: linear-gradient(180deg, rgba(11, 21, 39, 0.22), rgba(11, 21, 39, 0.72));
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.overlay h1 {
    margin: 0;
    font-size: clamp(4rem, 9vw, 7rem);
    line-height: 0.95;
}

.overlay p {
    margin: 0;
    max-width: 28ch;
    font-size: clamp(1.15rem, 2.1vw, 2rem);
}

button {
    border: 0;
    border-radius: 14px;
    padding: 14px 26px;
    font: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    color: #2b1f00;
    background: linear-gradient(180deg, var(--accent), #f39d35);
    cursor: pointer;
}

.hint {
    color: var(--muted);
    font-size: 1rem;
}
