/* === Global Styles === */

body {
  font-family: 'Arial', sans-serif;
  text-align: center;
  background-color: #f0f8ff;
  color: #333;
  margin: 0;
  padding: 0;
}

@keyframes borderShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.game-container {
  margin: 50px auto 8em auto;
  width: 80%;
  max-width: 1200px;

  position: relative;
  border-radius: 12px; /* match style */
  overflow: hidden;

  padding: 20px 20px 10px 20px; /* original padding restored */
  background: #111; /* dark background, consistent with game aesthetic */
}

.game-container.completed::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px; /* border thickness */
  border-radius: inherit;
  background: linear-gradient(to right,
    #1976d2, #007acc, #7b61ff, #d473d4, #9c27b0,
    #e26d5c, #ff9800, #ffa600, #ffae42, #92b25a,
    #2e7d32, #3aa76d, #1976d2
  );
  background-size: 400% 400%;
  animation: borderShift 10s ease infinite;

  /* create "border only" effect with mask */
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude; 
  -webkit-mask-composite: xor;

  pointer-events: none; /* let clicks pass through */
}



.animated-background {
  position: fixed;
  top: -10%;
  left: 0;
  width: 100vw;
  height: 110%;
  background: url('../images/background.jpg') no-repeat center center;
  background-size: cover;
  z-index: -1;
  animation: slideBackground 60s infinite alternate ease-in-out;
}

@keyframes slideBackground {
  0% { background-position: 0% center; }
  100% { background-position: 100% center; }
}

/* === Resource Containers === */

.resource-container {
  margin-bottom: 1em;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  color: white;
  transition: background-image 0.5s ease-in-out;
}

.resource-container.locked {
  filter: grayscale(100%);
  pointer-events: none;
  opacity: 0.8;
}

.resource-container.locked .gather-button,
.resource-container.locked .upgrade-button {
  opacity: 0.5;
  pointer-events: none;
}

.resource-container.unlocked {
  filter: none;
  opacity: 1;
  pointer-events: all;
}

.resource-container h3 {
  font-size: 18px;
  font-weight: bold;
  color: #000;
}

.resource-container.locked h3 {
  color: #888;
}

.resource-details {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  margin-top: 60px;
}

.detail-item {
  flex: 1;
  text-align: center;
  color: white;
}

/* === Buttons === */

.button-container {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
}

.gather-button,
.upgrade-button,
.achievements-toggle-btn,
.close-overlay-btn {
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.gather-button {
  background-color: #61dbfb;
  color: white;
}

.gather-button:hover {
  background-color: #47a5cf;
  transform: scale(1.05);
}

.upgrade-button {
  background-color: #f0ad4e;
  color: white;
}

.upgrade-button:disabled {
  background-color: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.5;
}

.upgrade-button:hover:enabled {
  background-color: #d48a3a;
  transform: scale(1.05);
}

.disabled-upgrade-button {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.button-bounce {
  animation: bounce 0.2s ease-in-out;
}

@keyframes bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* === Progress Bar === */

.progress-container {
  width: 100%;
  height: 12px;
  background-color: #e0e0e0;
  border-radius: 6px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #ccc;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: #4caf50;
  transition: width 0.4s ease-in-out;
  border-radius: 6px;
}

/* === Achievements Section === */

#achievement-icons-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #b0b0b0;
  padding: 20px 15px;
  border-top: 2px solid #61dbfb;
  box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.achievement-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: white;
}

#achievement-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}

.achievement-icon {
  font-size: 32px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  /* border: 2px solid #61dbfb;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); */
  cursor: default;
  position: relative;
  transition: transform 0.2s ease-in-out;
}

.achievement-icon:hover {
  background-color: #f0f8ff;
  transform: scale(1.1);
}

.laurel-wreath {
  position: absolute;
  width: 100px;
  height: 100px;
      width: 153px;
    height: 153px;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

.laurel-wreath.green { background-image: url('../images/green-laurel-wreath.png'); }
.laurel-wreath.red { background-image: url('../images/red-laurel-wreath.png'); }
.laurel-wreath.blue { background-image: url('../images/blue-laurel-wreath.png'); }
.laurel-wreath.yellow { background-image: url('../images/yellow-laurel-wreath.png'); }

/* === Achievements Overlay === */

.achievements-toggle-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #61dbfb;
  color: white;
  z-index: 1000;
  font-size: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.achievements-toggle-btn:hover {
  background-color: #47a5cf;
}

.achievements-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.achievements-overlay-content {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  width: 80%;
  max-width: 800px;
  text-align: center;
  color: black;
}

.close-overlay-btn {
  background-color: #f44336;
  color: white;
}

.close-overlay-btn:hover {
  background-color: #d32f2f;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.resource-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 20px;
  gap: 20px;
}

.resource-row h3 {
  width: 120px;
  text-align: left;
  font-size: 1.2rem;
}

.achievement-slot {
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;
  background-color: rgba(240, 248, 255, 0.2);
  border: 2px solid #61dbfb;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #999;
  font-size: 16px;
  border: 2px solid #ccc;
  position: relative;
}
.achievement-slot:has(.achievement-icon .laurel-wreath) {
    border: none;
}



/* === Miscellaneous === */

.notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background-color: red;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 0 6px rgba(255, 0, 0, 0.6);
}

.hidden {
  display: none;
}

button, input, select, textarea {
  font-size: 16px;
  touch-action: manipulation;
}

/* === Map Overlay Specific === */

#map-level-buttons button {
    padding: 12px 18px;
    font-size: 18px;
    background-color: #61dbfb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#map-level-buttons button:hover {
    background-color: #47a5cf;
    transform: scale(1.05);
}

#map-level-buttons button.locked {
    background-color: #999;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}
/* === Map Path === */

#map-path {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px;
    margin: 40px;
    position: relative;
}

.map-node {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, border-color 0.3s ease-in-out, opacity 0.3s;
    position: relative;
    text-align: center;
}

.map-node .map-icon {
    font-size: 24px;
    font-weight: bold;
}

.map-node .map-label {
    font-size: 14px;
    margin-top: 5px;
}

/* Rarity colors */
.map-node.rarity-common { border-color: #61dbfb; }
.map-node.rarity-industrial { border-color: #888; }
.map-node.rarity-advanced { border-color: silver; }
.map-node.rarity-exotic { border-color: purple; }
.map-node.rarity-legendary { border-color: gold; }

/* State colors */
.map-node.unlocked { opacity: 1; }
.map-node.locked { opacity: 0.4; cursor: not-allowed; }

.map-node.unlocked:hover {
    transform: scale(1.1);
}

/* Player icon */
#player-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    font-size: 32px;
    transition: left 0.5s ease-in-out, top 0.5s ease-in-out;
    z-index: 10;
}
/* === Map Connector Lines === */

.map-connector {
    width: 60px;
    height: 4px;
    background-color: #999;
    align-self: center;
    flex-shrink: 0;
    transition: background-color 0.3s ease-in-out, opacity 0.3s;
}

.map-node.unlocked + .map-connector {
    background-color: #61dbfb;
    opacity: 1;
}

.map-node.locked + .map-connector {
    background-color: #999;
    opacity: 0.4;
}


























/* === Candy Crush Style World Map === */
#journey-map {
    position: relative;
    width: 600px;
    height: 3000px; /* MATCH your background image height exactly! */
    margin: 0 auto;
    overflow-y: auto;
    background: url('../images/world-map-background.png') no-repeat center top;
    background-size: contain; /* or cover — depends on your image! */
    scroll-behavior: smooth;
}


/* Level nodes (dots) */
.map-level-node {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.9);
    border: 5px solid #61dbfb;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.3s ease-in-out;
}

.map-level-node.unlocked:hover {
    transform: scale(1.1);
}

.map-level-node.locked {
    border-color: #999;
    background-color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

/* Player icon */
#player-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    font-size: 36px;
    transition: left 0.5s ease-in-out, top 0.5s ease-in-out;
    z-index: 10;
}



/* Connector between levels */
.map-connector {
    width: 6px;
    height: 80px;
    background-color: #61dbfb;
    border-radius: 3px;
    opacity: 0.8;
    transition: background-color 0.3s ease-in-out;
}


































.map-level-section.level-1 {
    background-image: url('../images/lvl1.png');
}

.map-level-section.level-2 {
    background-image: url('../images/level-2-bg.jpg');
}

.map-level-section.level-3 {
    background-image: url('../images/level-3-bg.jpg');
}

.map-level-section.level-4 {
    background-image: url('../images/level-4-bg.jpg');
}

.map-level-section.level-5 {
    background-image: url('../images/level-5-bg.jpg');
}

.map-level-section.level-6 {
    background-image: url('../images/level-6-bg.jpg');
}

.map-level-section.level-7 {
    background-image: url('../images/level-7-bg.jpg');
}

.map-level-section.level-8 {
    background-image: url('../images/level-8-bg.jpg');
}

.map-level-section.level-9 {
    background-image: url('../images/level-9-bg.jpg');
}

.map-level-section.level-10 {
    background-image: url('../images/level-10-bg.jpg');
}
































/* reusable mask class ------------------------------------------*/
.i-brick {
  width: 1.3em;
  height: 1.3em;
  display: inline-block;
  background: var(--brick-colour, #d34c24);      /* default red */
  mask: url('https://twemoji.maxcdn.com/v/latest/svg/1f9f1.svg') center / contain no-repeat;
  -webkit-mask: url('https://twemoji.maxcdn.com/v/latest/svg/1f9f1.svg') center / contain no-repeat;
}

/* colour presets */
.i-brick--copper { --brick-colour:#b87333; }  /* copper */
.i-brick--iron   { --brick-colour:#555;     }  /* iron   */
/* ─── brick recolours ───────────────────────────────────────── */
.brick        { display:inline-block; }

/* copper ≈ warm orange                                      */
.brick--copper{ filter:hue-rotate(-25deg) brightness(1.15) saturate(1.4); }

/* iron  ≈ cold, dark grey                                   */
.brick--iron  { filter:grayscale(1) brightness(0.6); }

/* plain red default brick needs no filter                   */
/* ─── coal recolour ────────────────────────────────────────── */
.coal {
  display:inline-block;
  filter: grayscale(1) brightness(0.25);   /* deep, matte black */
}
/* ─── themed bricks 2.0 ───────────────────────────────────────────── */

/* neutral greys */
.brick--steel     { filter: grayscale(1) brightness(0.80); } /* darker */
.brick--titanium  { filter: grayscale(1) brightness(1.00); } /* mid */

/* precious metals */
.brick--silver    { filter: grayscale(1) brightness(1.25); }                 /* light grey */
.brick--gold      { filter: grayscale(1) sepia(1) hue-rotate(-10deg)
                           saturate(6) brightness(1.1); }                    /* warm gold */

/* rainbow alloy – cycles hues forever */
@keyframes hyperHue {
  from { filter: hue-rotate(0deg)   saturate(7) brightness(1.3); }
  to   { filter: hue-rotate(360deg) saturate(7) brightness(1.3); }
}
.brick--hyperalloys {
  animation: hyperHue 4s linear infinite;
}
/* ─── new metal / glass bricks ───────────────────────────────── */

/* Aluminum – very light, cool grey */
.brick--aluminum {
  filter: grayscale(1) brightness(1.35) hue-rotate(-10deg);
}

/* Obsidian – glossy black with subtle purple tint */
.brick--obsidian {
  filter: grayscale(1) brightness(0.30) hue-rotate(270deg) saturate(3);
}
/* ─── salt mound ─────────────────────────────────────────────── */
.salt {
  display:inline-block;
  filter: grayscale(1) brightness(2.4);   /* crisp white */
}
/* ─── sulfur mound ──────────────────────────────────────────── */
.sulfur {
  display:inline-block;
  /* turn the grey mountain into bright yellow crystal */
  filter: hue-rotate(-60deg) saturate(6) brightness(1.4);
}
/* ─── resin test-tube: vivid yellow ───────────────────────────── */
.resin {
  display:inline-block;

  /* 1) drain colour → grey       */
  /* 2) add warm tone via sepia   */
  /* 3) nudge hue toward yellow   */
  /* 4) crank saturation & light  */
  filter: grayscale(1)
          sepia(1)
          hue-rotate(-20deg)   /* tweak ±5deg to taste */
          saturate(12)
          brightness(1.4);
}
/* ─── circuit board tint ───────────────────────────────────── */
.circuit {
  display:inline-block;
  /* Turn the pager’s grey body into bright PCB green            */
  filter: hue-rotate(95deg) saturate(6) brightness(1.2);
}
/* ─── superconducting magnet (icy blue) ───────────────────────── */
.superconductor {
  display:inline-block;

  /* drain stock colours → grey, then freeze to cyan-blue         */
  filter: grayscale(1)
          hue-rotate(170deg)   /* tweak ±10° for greener / bluer */
          saturate(5)
          brightness(1.3);
}
/* ─── rare-earth: swap land & sea colours ───────────────────── */
/* ─── rare-earth: swap ocean ↔ land colours ─────────────────── */
.rareearth {
  display:inline-block;

  /* 1) hue-rotate(130deg) pushes blue oceans → green,
        green continents → blue-teal                         */
  /* 2) crank saturation + a touch of brightness              */
  filter: hue-rotate(130deg) saturate(6) brightness(1.15);
}
/* ─── quantumchips: rainbow-floppy ─────────────────────────── */
.quantumchips {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}
/* ─── rainbow techs ────────────────────────────────────────── */

.quantumchips {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}

.fluxcapacitors {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}

.singularitycore {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}

.stardust {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}

.antimatter {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}

.voidessence {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}

.syntheticdiamonds {
  display:inline-block;
  animation: hyperHue 4s linear infinite;
}
.etherium {
  display:inline-block;
  animation: glow 2s ease-in-out infinite;
}
.chronoparticles {
  display:inline-block;
  animation: spin 4s linear infinite, hyperHue 4s linear infinite, glow 2s ease-in-out infinite;
}

.singularitycore {
  display:inline-block;
  animation: hyperHue 4s linear infinite, glow 2s ease-in-out infinite;
}

.realityshards {
  display:inline-block;
  animation:  hyperHue 4s linear infinite, glow 2s ease-in-out infinite;
}

.cosmicstrings {
  display:inline-block;
  animation: spin 4s linear infinite, hyperHue 4s linear infinite, glow 2s ease-in-out infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
