*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.container{
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}
.background{
    position: relative;
    width: 550px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.background img{
    width: 100%;
    height: 100%;
    object-fit: fill;
}
.main-content{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;

}
.lineball{
    position: absolute;
    top: 23%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;    
    align-items: center;
}
.lineball img{
    width: 100%;
    height: 100%;
    max-width: 400px;
    object-fit: cover;
}
.middle{
    position: absolute;
    top: 26%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.middle img{
    width: 100%;
    height: 100%;
    max-width: 40px;
    object-fit: cover;
}
.ball{
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.ball img{
    width: 100%;
    height: 100%;
    max-width: 40px;
    object-fit: cover;
}
.pegs1{
    position: absolute;
    top: 35%;
    left: 35%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs1 img{
    width: 100%;
    height: 100%;
    max-width: 70px;
    object-fit: cover;
}
.pegs2{
    position: absolute;
    top: 40%;
    left: 65%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs2 img{
    width: 100%;
    height: 100%;
    max-width: 70px;
    object-fit: cover;
}
.pegs3{
    position: absolute;
    top: 45%;
    left: 22%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs3 img{
    width: 100%;
    height: 100%;
    max-width: 70px;
    object-fit: cover;
}
.pegs4{
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs4 img{
    width: 100%;
    height: 100%;
    max-width: 70px;
    object-fit: cover;
}
.pegs5{
    position: absolute;
    top: 53%;
    left: 75%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs5 img{
    width: 100%;
    height: 100%;
    max-width: 70px;
    object-fit: cover;
}
.pegs6{
    position: absolute;
    top: 58%;
    left: 30%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs6 img{
    width: 100%;
    height: 100%;
    max-width: 70px;
    object-fit: cover;
}
.pegs7{
    position: absolute;
    top: 62%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs7 img{
    width: 100%;
    height: 100%;
    max-width: 70px;
    object-fit: cover;
}
.pegs8{
    position: absolute;
    top: 68%;
    left: 15%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs8 img{
    width: 100%;
    height: 100%;
    max-width: 80px;
    object-fit: cover;
}
.pegs9{
    position: absolute;
    top: 70%;
    left: 85%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.pegs9 img{
    width: 100%;
    height: 100%;
    max-width: 80px;
    object-fit: cover;
}
.reward{
    position: absolute;
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.reward img{
    width: 100%;
    height: 100%;
    max-width: 390px;
    object-fit: cover;
}
.buttonPlay{
    position: absolute;
    top: 95%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.buttonPlay img{
    width: 100%;
    height: 100%;
    max-width: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.1s ease;
}
.buttonPlay img:active {
    transform: scale(0.92);
}
/* Ball renders above pegs (pegs use z-index: 2).
   Squish is driven by JS setting the inline transform. */
.ball {
    transition: transform 0.16s ease;
    z-index: 3;
}
/* Peg flash when the ball physically hits it */
.peg-lit img {
    animation: pegLit 0.35s ease forwards;
}
@keyframes pegLit {
    0%   { filter: brightness(1)   drop-shadow(0 0  0px #fff0); transform: scale(1);    }
    40%  { filter: brightness(2.2) drop-shadow(0 0 12px #ffe87a); transform: scale(1.18); }
    100% { filter: brightness(1)   drop-shadow(0 0  0px #fff0); transform: scale(1);    }
}
/* Win overlay — completely removed from layout until .show is added */
.win-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    z-index: 100;
}
.win-overlay.show {
    display: flex;
}
/* Win image pops in via keyframes — more reliable than transition
   when the parent flips from opacity:0 to opacity:1 */
.win-overlay .win-img {
    width: 80%;
    max-width: 320px;
    object-fit: contain;
    transform: scale(0);
    opacity: 0;
    margin-top: 100px;
}
.win-overlay.show .win-img {
    animation: winPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes winPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.win-overlay .claim-btn {
    width: 55%;
    max-width: 210px;
    object-fit: contain;
    cursor: pointer;
    opacity: 0;
    margin-top: -200px;
}
.win-overlay.show .claim-btn {
    animation: winPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}
@media (max-width: 440px) {
  .reward{
    max-width: 300px;
  }
}
