body{
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: url('assests/background1.png')no-repeat center center/cover;
    background-size: cover;
    color: white;
     text-shadow:
    -1px -1px 1px black,
    1px -1px 1px black,
    -1px  1px 1px black,
    1px  1px 1px black;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

.screen{
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100vh;
    transition: opacity 0.4s ease;
}

.screen:not(.active){
    opacity: 0;
    pointer-events: none;
}

.screen.active{
    display: flex;
    opacity: 1;
}

#gameScreen{
    position: relative;
    padding: 0;
    margin: 0;
    overflow: hidden;
    /* cursor: none; */
}

#gameScreen canvas{
    position: absolute;
    display: block;
    width: 100vw !important;
    height: 100vh !important;
    object-fit: cover;
    z-index: 1;  
}

#gameBGvideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;         /* behind canvas + HUD */
    pointer-events: none;
}

input{
    padding-top: 18px;
    padding-right: 20px;
    padding-bottom: 18px;
    padding-left: 20px;
    margin: 8px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    width: 220px;
}


.inputDetails{
    font-size:20px;
    margin: 10px 0 5px 0;
}

button{
    background: rgb(25, 59, 29);
    border: 1px solid rgb(25, 59, 29);
    font-weight: 400px;
    color: white;
    padding: 10px 50px;
    margin: 10px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

button:hover{
    background: rgba(200, 5 , 21, 1);
    border: 1px solid red;
    transform: scale(1.05);
}

button:active{
    transform: scale(0.98);
}

.glass-card{
    background: rgba(255, 255,255,0.15);
    border-radius: 20px;
    padding: 25px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0, 0.37);
    backdrop-filter: blur(10px);
    max-width: 90%;
    width: 400px;
}

table{
    border-collapse: collapse;
    width: 100%;
    margin-top: 15px;
    color: white;
}

th, td{
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 12px;
    text-align: left;
}

th{
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
}

tr:hover{
    background: rgba(255, 255, 255, 0.1);
}

#winScreen{
    background-image: url('assests/winScreen.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#hud {
    background: url('assests/background.png')no-repeat center center/cover; 
    position:absolute;
    width: 60%;
    top: 43px;
    left:34%;
    transform: translateY(-50%);
    display:flex;
    gap: 30px;
    font-size: 30px;
    font-weight: 600;
    color: white;
    z-index: 10;
    background: rgba(0,0,0,0.4);
    padding: 10px 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    justify-content: space-between;
    align-items: center;
}

#targetScoreDesign {
  display: flex;              /* put children in a row */
  align-items: center;        /* vertically center text + image */
  gap: 0.5rem;                /* space between score and image */
}

#hudBottle {
  width: 60px;                /* scale image */
  height: auto;
}

@media (max-width: 768px) {
  #hud {
    font-size: 16px;
    gap: 10px;
    padding: 8px 14px;
    flex-wrap: wrap;
    justify-content: center;
  }
      input {
        font-size: 14px;
        padding: 14px 16px;
        max-width: 240px;
    }

    .inputDetails {
        font-size: 18px;
    }

    button {
        padding: 10px 40px;
        font-size: 14px;
    }

  .glass-card{
    padding: 20px 25px;
    width: 85%;
    max-width: 350px;
  }
   table {
        font-size: 14px;
    }

    th, td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 15px 20px;
        width: 90%;
    }

    input {
        font-size: 13px;
        padding: 12px 14px;
    }

    button {
        padding: 8px 30px;
        font-size: 13px;
    }

    #hud {
        font-size: 12px;
        gap: 8px;
        padding: 6px 10px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 6px 4px;
    }
}

/* Landscape mode for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .glass-card {
        padding: 15px 25px;
        max-height: 90vh;
        overflow-y: auto;
    }

    #hud {
        font-size: 12px;
        gap: 10px;
        padding: 5px 10px;
        top: 5px;
    }
}

/* For 2K screens (≥2560px wide) */
@media (min-width: 2560px) {
  #hud {
    font-size: 28px;
    gap: 40px;
    padding: 16px 32px;
  }

  .glass-card {
    width: 600px;
    padding: 40px 60px;
    font-size: 20px;
  }

  button {
    font-size: 20px;
    padding: 14px 60px;
  }
}

/* For 4K screens (≥3840px wide) */
@media (min-width: 3840px) {
  #hud {
    font-size: 32px;
    gap: 50px;
    padding: 20px 40px;
  }

  .glass-card {
    width: 800px;
    padding: 50px 80px;
    font-size: 22px;
  }

  button {
    font-size: 22px;
    padding: 16px 70px;
  }

  table {
    font-size: 18px;
  }
}


/* Admin Screen Layout */
#adminScreen .glass-card {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* two equal columns */
    gap: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;                 /* scroll if content exceeds */
}

/* Left column: settings */
.admin-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Right column: rewards */
.admin-rewards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;                 /* scroll gift list if too long */
    max-height: 80vh;
}

/* Inputs */
#adminScreen input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
}

/* Gift item container */
.gift-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(255,255,255,0.15);
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 8px;
}

/* Points + Name side by side */
.gift-item .giftPoints,
.gift-item .giftName {
    flex: 1 1 45%;
    min-width: 100px;
}

/* File input */
.gift-item .giftImg {
    flex: 1 1 100%;
}

/* Image preview */
.gift-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

/* Responsive: stack columns on small screens */
@media (max-width: 768px) {
    #adminScreen .glass-card {
        grid-template-columns: 1fr;   /* single column */
    }
    .admin-rewards {
        max-height: none;
    }
}
/* Base state
#winScreen {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#winScreen.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}


#winScreen .glass-card {
    opacity: 0;
    transform: translateY(40px);
}

#winScreen.active .glass-card {
    animation: cardEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} */

/* Gift reveal */
/* Base state */
#wonGiftName {
    opacity: 1; /* keep visible */
    display: inline-block; /* needed for transform */
}

#winScreen.active #wonGiftName {
    animation: pulseText 1.5s ease-in-out infinite;
}

/* Keyframes for pulsing size */
@keyframes pulseText {
    0% {
        transform: scale(1);
        text-shadow: 0 0 6px rgba(255,255,255,0.6), 0 0 12px red;
    }
    50% {
        transform: scale(1.2);
        text-shadow: 0 0 12px rgba(255,255,255,0.9), 0 0 25px red;
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 6px rgba(255,255,255,0.6), 0 0 12px red;
    }
}

/* ---------- Coca-Cola Loading Screen Styles ---------- */
#loadingScreen {
  position: fixed; /* Ensure it overlays the whole screen */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* Keep it above other content */
  background-color: rgba(0, 0, 0, 0.6); /* Optional: dim background */
}

#loadingScreen.show {
    display: flex !important;
}
.loading-card { width: 420px; max-width: 90%; text-align: center; padding: 22px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 8px 24px rgba(0,0,0,0.45); color: #fff; }
.brand-row { display:flex; align-items:center; gap:12px; justify-content:center; margin-bottom:8px; }
.coke-logo { width:48px; height:auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.loading-card h2 { font-size:1.35rem; margin:0; color:#fff; }

/* Bottle + lights */
.bottle-wrap { margin:18px 0; display:flex; flex-direction:column; align-items:center; gap:10px; }
.bottle { width:60px; height:120px; border-radius:18px; background: linear-gradient(#e53935,#b71c1c); position:relative; box-shadow: 0 6px 18px rgba(0,0,0,0.4); transform-origin:center bottom; animation: bob 1.8s ease-in-out infinite; }
.bottle:before { content:""; position:absolute; left:50%; transform:translateX(-50%); top:-8px; width:28px; height:10px; background:#c62828; border-radius:6px; }
.bottle-label { position:absolute; left:50%; transform:translateX(-50%); bottom:18px; width:72%; height:18px; background: #fff; border-radius: 8px; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.06); }
@keyframes bob { 0% { transform: translateY(0) } 50% { transform: translateY(-8px) rotate(-2deg);} 100% { transform: translateY(0) } }

/* blinking lights */
.lights { display:flex; gap:8px; }
.light { width:8px; height:8px; border-radius:50%; background:#fff; box-shadow:0 0 8px rgba(255,255,255,0.6); opacity:0.18; animation: blink 1.2s infinite; }
.light:nth-child(1){ animation-delay:0s; }
.light:nth-child(2){ animation-delay:0.25s; }
.light:nth-child(3){ animation-delay:0.5s; }
@keyframes blink { 0%{ opacity:0.18; transform:scale(1);} 50%{ opacity:1; transform:scale(1.5);} 100%{ opacity:0.18; transform:scale(1);} }

/* progress */
.progress { display:flex; align-items:center; gap:10px; margin:10px 0 6px; }
.progress-bar { width:70%; height:12px; border-radius:10px; background: rgba(255,255,255,0.08); overflow:hidden; border:1px solid rgba(255,255,255,0.06); }
.progress-fill { height:100%; width:0%; background: linear-gradient(90deg,#ffec5c,#fff); transition: width 240ms linear; box-shadow: 0 2px 8px rgba(0,0,0,0.3) inset; }
.progress-text { width:60px; font-weight:600; color:#fff; }

/* small descriptive text */
.loading-sub { margin-top:10px; color: rgba(255,255,255,0.85); font-size:0.95rem; }

/* ensure when active we center correctly */
.screen.active.loading-screen,
.screen.loading-screen.active { display:flex; }

/* reduce card padding on small screens */
@media (max-width:420px){ .loading-card{ padding:14px } .bottle{ width:48px;height:96px } }
