body, html { margin:0; padding:0; height:100%; font-family:sans-serif; }
/* Full-page overlay */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #222;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: sans-serif;
}
/* New wrapper for the bar and text */
.progress-wrapper {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between the bar frame and the text */
  margin-top: 10%;
  margin-bottom: 15px;
}

/* New container for the bar's appearance */
#loading-bar-frame {
  width: 300px; /* Define the bar's width */
  height: 20px;
  background-color: #444;
  border-radius: 10px;
  overflow: hidden;
}

/* The inner bar (stays mostly the same, but remove width and margin from container) */
#loading-bar {
  width: 0%;
  height: 100%;
  background-color: #fff;
  transition: width 0.2s;
  border-radius: 10px 0 0 10px;
}

/* The text (remove the margin-bottom which is now on the wrapper) */
#loading-text {
  /* You may want to ensure this doesn't shrink or grow */
  flex-shrink: 0; 
  margin: 0; /* Remove default paragraph margin for clean alignment */
}

#map { height:100%; width:100%; z-index:1; }

.leaflet-control-attribution {
  width: auto !important;
  max-width: 50%;
  white-space: normal; 
  word-break: break-word;

  background: rgba(0,0,0,0.65);
  color: #000;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaflet-top.leaflet-left .leaflet-control {
  margin: 8px;
}





/* GPS dot */
.gps-marker { width:14px; height:14px; background:#1e90ff; border:2px solid white; border-radius:50%; box-shadow:0 0 8px rgba(30,144,255,0.8); }
.gps-accuracy { background: rgba(30,144,255,0.2); border:2px solid rgba(30,144,255,0.6); border-radius:50%; }

/* Bottom bar Container */
#bottomBar { 
    position:fixed; bottom:0; left:0; width:100%; height:161px; 
    background:#222; display:flex; justify-content:center; align-items:center; 
    z-index:2000; overflow:hidden; flex-direction:column; 
}
#ticker {
  height: 32px;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.15);
  background: #181818;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  font-size: 14px;
}

/* moving strip */
#tickerTrack {
  display: flex;
  width: max-content;
  animation: ticker-move 60s linear infinite;
}

/* individual copy */
.tickerItem {
  white-space: nowrap;
  color: #fff;
  font-size: 14px;
  padding-right: 48px; /* gap between loops */
}

/* seamless animation */
@keyframes ticker-move {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}


@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Status Text - Centered inside the bar, behind other panels */
#statusText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 14px;
    z-index: 10; /* Lowest layer inside bar */
    text-align: center;
    width: 90%;
    pointer-events: none;
}

/* Main Buttons (Redeem/Powerups) */
#buttonWrapper { 
    display:flex; gap:12px; 
    transition: transform 0.35s ease, opacity 0.35s ease; 
    position: relative;
    z-index: 20; /* Above status text */
    background: #222; /* Cover status text */
    padding: 10px;
}
#bottomBar.open #buttonWrapper { transform: translateY(100%); opacity:0; pointer-events: none; }

.bottomBtn { font-size:16px; background:#0078ff; color:white; border:none; border-radius:10px; cursor:pointer; height:44px; width: 100px;display:flex; justify-content: center; align-items: center; }
.bottomBtn2 { font-size:16px; background:#0078ff; color:white; border:none; border-radius:10px; cursor:pointer; height:44px; width: 212px;display:flex; justify-content: center; align-items: center; }
#redeemText {
    color: white;
    font-size: 12px;
    text-align: center;
    margin-top: 4px;
    height: 15px;
    line-height: 15px;
}
/* Panel Content Container */
#panelContent { 
    margin-top:15px;
    position:absolute; top:0; left:0; width:100%; height:100%;
    display:flex; justify-content:center; align-items:center;
    pointer-events: none; /* Let clicks pass through when hidden */
    z-index: 30; /* Highest layer */
}
#panelContent.open { pointer-events: auto; }

/* Panel Inner - This is what slides up/down */
#panelInner { 
    display:flex; flex-direction:column; align-items:center; gap:4px; 
    width: 90%;
    /* FIX: Added transition so the slide animation works */
    transition: transform 0.35s ease, opacity 0.35s ease;
    transform: translateY(150%); /* Hidden by default */
    opacity: 0;
    background: #222; /* Ensure it covers status text */
    padding: 10px;
}
#panelContent.open #panelInner { transform: translateY(15%); opacity:1; }

#redeemContent { 
    
    position:absolute; top:0; left:0; width:100%; height:100%;
    display:flex; justify-content:center; align-items:center;
    pointer-events: none; /* Let clicks pass through when hidden */
    z-index: 30; /* Highest layer */
}
#redeemContent.open { pointer-events: auto; }

.qrModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.qrModal.hidden {
  display: none;
}

.qrCard {
  background: #111;
  color: white;
  width: 90%;
  max-width: 360px;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes popOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.9); opacity: 0; }
}

.qrCard.closing {
  animation: popOut 0.25s ease forwards;
}


.qrPreview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: black;
  margin: 16px 0;
}

#qrVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qrFrame {
  position: absolute;
  inset: 12%;
  border: 2px solid #00ff88;
  border-radius: 8px;
  pointer-events: none;
}

.qrBackBtn {
  margin-top: 10px;
  padding: 10px;
  width: 100%;
  border-radius: 10px;
  border: none;
  background: #333;
  color: white;
}


#submitContent { 
    position:absolute; top:0; left:0; width:100%; height:100%;
    display:flex; justify-content:center; align-items:center;
    pointer-events: none; /* Let clicks pass through when hidden */
    z-index: 30; /* Highest layer */
}
#submitContent.open { pointer-events: auto; }

/* Panel Inner - This is what slides up/down */
#submitInner { 
    display:flex; flex-direction:column; align-items:center; gap:4px; 
    width: 90%;
    /* FIX: Added transition so the slide animation works */
    transition: transform 0.35s ease, opacity 0.35s ease;
    transform: translateY(150%); /* Hidden by default */
    opacity: 0;
    background: #222; /* Ensure it covers status text */
    padding: 10px;
}
#submitInstructions {
    color: white;
    font-size: 12px;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 15px;
    height: 15px;
    line-height: 15px;
}
#submitContent.open #submitInner { transform: translateY(19%); opacity:1; }
#submitText {
    color: white;
    font-size: 12px;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 4px;
    height: 15px;
    line-height: 15px;
}
/* Redeem row */
#panelRow { display:flex; gap:8px; align-items:center; margin-bottom:4px; flex-wrap:nowrap; width:100%; justify-content: center; }
#panelRow input, #panelRow button { box-sizing:border-box; height:44px; vertical-align:middle; }
#panelRow input { padding:10px; font-size:14px; background:transparent; border:1px solid #fff; color:white; border-radius:6px; outline:none; width: 120px; }
#panelRow button { padding:0 12px; font-size:14px; background:transparent; border:1px solid #fff; color:white; border-radius:6px; cursor:pointer; min-width:44px; }


#submitRow { display:flex; gap:8px; align-items:center; margin-bottom:4px; flex-wrap:nowrap; width:100%; justify-content: center; }
#submitRow input, #submitRow button { box-sizing:border-box; height:44px; vertical-align:middle; }
#submitRow input { padding:10px; font-size:14px; background:transparent; border:1px solid #fff; color:white; border-radius:6px; outline:none; width: 120px; }
#submitRow button { padding:0 12px; font-size:14px; background:transparent; border:1px solid #fff; color:white; border-radius:6px; cursor:pointer; min-width:44px; }

/* Inventory scroll */
#inventoryRow { display:flex; width:100%; align-items:center; margin-bottom:4px; justify-content: center; }
#inventoryScroll { display:flex; overflow-x:auto; gap:8px; max-width: 80%; }
#inventoryScroll::-webkit-scrollbar { height:6px; }
#inventoryScroll::-webkit-scrollbar-thumb { background:#555; border-radius:3px; }
#inventoryText {
    color: white;
    font-size: 12px;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 15px;
    height: 15px;
    line-height: 15px;
}

.powerupBtn { border:1px solid #fff; background:transparent; color:white; border-radius:6px; cursor:pointer; width:65px; height:65px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size: 14px; overflow: hidden; }
.powerupBtn img { width:40px; height:40px; }
#closeInventoryBtn { border:1px solid #fff; background:transparent; border-radius:6px; color:white; height:65px; min-width:65px; margin-left:20px; border-radius:8px; cursor:pointer; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size: 25px}

/* Found coin video */
.foundCoinVideo {
  width: 100%;
  max-height: 240px;
  border-radius: 8px;
  margin: 12px 0;
  background: #000;
}

/* Found by section */
.foundBy {
  text-align: center;
  font-size: 14px;
  color: #ccc;
  margin-top: 8px;
  line-height: 1.4;
}

.foundBy b {
  color: #fff;
}

/* Map marker hover effect */
.leaflet-marker-icon {
  transition: transform 0.15s ease;
}

.leaflet-marker-icon:hover {
  transform: scale(1.1);
  cursor: pointer;
}
.foundCoinVideo {
  aspect-ratio: 9 / 16;
  height: 100%;
  width: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0 auto;
}

/* --- Hints Slide Panel --- */
#hintsPanel {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden offscreen */
    width: 100%;
    height: 100%;
    background: #111;
    color: white;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s ease;
    overflow-y: auto;
    padding-bottom: 20px;
}

#hintsPanel.open {
    right: 0;
}

#hintsHeader {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #222;
    padding: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#hintsTitle {
    order: 1;
    flex-shrink: 0;
    font-weight: bold;
    font-size: 20px;
}

#closeHintsBtn {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
}

#hintsFiltersRow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #222;
    padding: 14px;
    position: sticky;
    top: 60px;
    z-index: 10;
    flex-wrap: wrap;
}

#hintsSearchInput {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px;
    background: #333;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
    font-size: 14px;
}

#hintsSearchInput::placeholder {
    color: #999;
}

#hintsSearchInput:focus {
    outline: none;
    border-color: #777;
    background: #3a3a3a;
}

#hintsRarityFilter {
    padding: 6px 10px;
    background: #333;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

#hintsRarityFilter:focus {
    outline: none;
    border-color: #777;
    background: #3a3a3a;
}

#closeHintsBtn {
    background: #444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 20px;
    cursor: pointer;
}
#hintsFooter {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 28px;
    margin-top: auto; /* push footer to the bottom of the panel */
}

.hintGroup {
    margin: 16px;
    padding: 12px;
    background: #1b1b1b;
    border-radius: 8px;
    border: 1px solid #333;
}

.hintGroupTitle {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #00aaff;
}

.hintEntry {
    background: #222;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #666;
}
.hintRarity {
    font-size: 13px;
    opacity: 0.8;
    flex-shrink: 0;                  /* don't shrink the stars */
    font-size: 20px;
}

.hintText {
    margin-top: 4px;
    font-size: 14px;
}
#coinsPanel {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden offscreen */
    width: 100%;
    height: 100%;
    background: #111;
    color: white;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s ease;
    overflow-y: auto;
    padding-bottom: 20px;
}
#adminPanel {
  position: fixed;
  top: 0;
  right: -100%; /* Hidden offscreen */
  width: 100%;
  height: 100%;
  background: #111;
  color: white;
  z-index: 5100;
  display: flex;
  flex-direction: column;
  transition: right 0.35s ease;
  overflow-y: auto;
  padding-bottom: 20px;
}

#adminPanel.open { right: 0; }

#adminHeader { display:flex; align-items:center; gap:8px; padding:14px; background:#222; position:sticky; top:0; z-index:10; }
#adminHeader h2 { margin:0; font-size:18px; }
#adminContent { padding:16px; display:flex; flex-direction:column; gap:12px; }
.adminSection { background:#1b1b1b; padding:12px; border-radius:8px; border:1px solid #333; }
.adminRow { display:flex; gap:8px; align-items:center; }
.adminBtn { background:#2a7f2a; border: none; color: white; padding:8px 12px; border-radius:6px; cursor:pointer; }
.adminDanger { background:#a33; }
.adminList { max-height:300px; overflow:auto; padding:8px; background:#111; border-radius:6px; border:1px solid #222; }

#coinsPanel.open {
    right: 0;
}
#closeCoinsBtn {
    background: #444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 20px;
    cursor: pointer;
}

#coinsHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    padding: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #444;
}

#coinsTitle {
    font-size: 20px;
    font-weight: bold;
}
.coinVideo {
  aspect-ratio: 9 / 16;
  height: 100%;
  width: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0 auto;
}


#freeHintsBtn {
    /* square button style */
    background: #444;
    color: white;
    border: none;
    border-radius: 8px; /* subtle rounded corners for a square */
    width: 180px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 15px;
    cursor: pointer;
    position: relative;
    margin: 8px auto 0 auto;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease, transform 240ms ease;
    overflow: hidden;
    text-align: center;
}

/* Show the button only when hints panel is open (fade/slide in) */
#hintsPanel.open #freeHintsBtn { opacity: 1; pointer-events: auto; }

.coinsEntry {
    background: #222;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #666;
}
.coinsRarity {
    font-size: 13px;
    opacity: 0.8;
    flex-shrink: 0;                  /* don't shrink the stars */
    font-size: 20px;
}

.coinText {
    margin-top: 4px;
    font-size: 14px;
}
/* Styles for the overlay menu */
.menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.menu-content {
    background: #222;
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    overflow-y: auto;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.menu-overlay.active .menu-content {
    transform: scale(1);
}

.powerupConfirmModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 6000;
}

.powerupConfirmModal.active {
    opacity: 1;
    pointer-events: auto;
}

.powerupConfirmContent {
    background: #222;
    border-radius: 12px;
    padding: 30px;
    max-width: 300px;
    text-align: center;
    color: white;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.powerupConfirmModal.active .powerupConfirmContent {
    transform: scale(1);
}

#powerupConfirmImage {
    margin-bottom: 16px;
}

#powerupConfirmImage img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

#powerupConfirmName {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 8px;
}

#powerupConfirmDesc {
    font-size: 0.9em;
    color: #bbb;
    margin-bottom: 16px;
}

.powerupConfirmButtons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.powerupConfirmBtn {
    padding: 8px 16px;
    border: 1px solid #333;
    background: #333;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.powerupConfirmBtn:hover {
    background: #444;
    border-color: #444;
}

.powerupUseBtn {
    background: #2a7f2a;
    border-color: #2a7f2a;
}

.powerupUseBtn:hover {
    background: #3a9f3a;
    border-color: #3a9f3a;
}

#menuRows div {
    margin: 10px 0;
}
#menuTitle {
    text-align: center;
    margin-bottom: 10px;
}

#menuDescription {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4em;
}
#menuFooter1 {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4em;
}
#menuFooter2 {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4em;
    font-size: 11px;
}
#menuDebugText {
    text-align: left;
    line-height: 1.4em;
    font-size: 11px;
    font-weight: bold;
    color:#555;
}
#menuBackBtn { display:block; margin: 20px auto 0 auto; text-align:center; height:44px; padding:0 12px; font-size:14px; background:transparent; border:1px solid #fff; color:white; border-radius:6px; cursor:pointer; min-width:70px; }
.login-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 14px;
    background: #0078ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    z-index: 2000;
}

.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.hidden {
    display: none !important;
}

.login-content {
    position: relative;
    background: #222;
    padding: 30px 40px;
    border-radius: 12px;
    min-width: 300px;
    text-align: center;
}

/* Logout button inside login modal */
.login-logout {
    margin-top: 10px;
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.help-btn {
    position: fixed;
    top: 50px; /* place below the login button */
    right: 10px;
    padding: 8px 14px;
    background: #0078ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    z-index: 2000;
}
.gpsBtn {
    position: fixed;
    top: 90px; /* place below the login button */
    right: 10px;
    padding: 8px 14px;
    background: #0078ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    z-index: 2000;
}
.gpsBtn img {
  width: 18px;      /* image width */
  height: 18px;     /* image height */
  object-fit: contain;
}

/* Visual state for cooldown buttons (still clickable to show alert) */
.cooldown {
    opacity: 0.6;
    filter: grayscale(40%);
}

/* Alert container + items */
#appAlertContainer {
    position: fixed;
    right: 12px;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10001;
    pointer-events: none; /* allow clicks to pass through unless alert opts in */
}
.appAlertItem {
    pointer-events: auto;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
    font-size: 14px;
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 260ms ease, transform 260ms ease;
    max-width: 320px;
}
.appAlertItem.hide {
    opacity: 0;
    transform: translateY(-8px);
}

.login-close {
    color: white;
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    font-size: 20px;
    border: none;
    cursor: pointer;
}
#signInText {
    font-size: 25px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
}
#signInDesc {
    font-size: 15px;
    color: white;
    margin-top: 10px;
    margin-bottom: 10px;
}

#redeemOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5); /* grey 50% */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 9999;
}

#redeemOverlay.active {
  opacity: 1;
  pointer-events: all;
}

.redeemOverlayText {
  color: white;
  font-size: 18px;
}

