/* --------- RESET --------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --------- ROOT / BODY --------- */
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #111 0%, #000 60%);
  color: #eaeaea;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 1.2s ease, filter 1s ease;
  overflow-x: hidden;
}

/* --------- BACKGROUND STATES --------- */
body.trust-high {
  background: radial-gradient(circle at top, #122 0%, #000 60%);
  animation: calmTrust 8s infinite alternate;
}

body.paranoia-high {
  background: radial-gradient(circle at top, #300 0%, #000 60%);
  animation: pulseParanoia 6s infinite;
}

body.paranoia-high::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 10;
}

/* --------- APP CONTAINER --------- */
#app {
  width: 90%;
  max-width: 700px;
  background: rgba(15, 15, 15, 0.96);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.8s ease;
  position: relative;
  z-index: 20;
}

/* --------- HEADER --------- */
header {
  text-align: center;
  margin-bottom: 20px;
}

#game-title {
  font-size: 2rem;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

#subtitle {
  font-size: 0.9rem;
  color: #888;
}

/* --------- STATS --------- */
#stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  flex: 1;
}

.stat span {
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: #aaa;
}

.bar {
  width: 100%;
  height: 8px;
  background: #222;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.fill {
  height: 100%;
  width: 50%;
  transition: width 0.4s ease;
}

#trust-bar {
  background: linear-gradient(90deg, #2ecc71, #27ae60);
}

#paranoia-bar {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* --------- STORY --------- */
#story-container {
  margin: 24px 0;
  min-height: 120px;
  padding: 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

#story-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #ddd;
}

/*----CHOICES-----*/

#choices {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#choices button {
  background: linear-gradient(135deg, #181818, #101010);
  color: #eee;

  border: 1px solid #2a2a2a;
  border-radius: 12px;

  padding: 16px 18px;

  font-size: 1.05rem;   
  text-align: left;     
  line-height: 1.4;

  cursor: pointer;

  transition: all 0.22s ease;
}

#choices button:hover {
  transform: translateY(-3px);
  border-color: #444;
  box-shadow: 0 8px 18px rgba(0,0,0,0.65);
}


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


body.paranoia-high #choices button {
  border-color: #500;
  box-shadow: 0 0 10px rgba(255,0,0,0.12);
}


body.trust-high #choices button {
  border-color: #1d5;
}


/* --------- FOOTER --------- */
footer {
  margin-top: 20px;
  text-align: center;
}



#start-screen {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(circle at top, #111 0%, #000 80%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
  z-index: 1000;
  text-align: center;
  animation: fadeIn 1s ease;
}

.start-title {
  font-size: 2.8rem;
  letter-spacing: 5px;
  font-weight: 600;
  color: #f5f5f5;
  animation: subtleGlow 4s ease-in-out infinite alternate;
}

.start-tagline {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 420px;
  opacity: 0.85;
}

#start-btn {
  background: rgba(25,25,25,0.95);
  border: 1px solid #444;
  color: #eee;

  padding: 14px 44px;
  font-size: 1rem;
  border-radius: 28px;

  cursor: pointer;
  letter-spacing: 1px;

  transition: all 0.25s ease;
}

#start-btn:hover {
  transform: translateY(-3px);
  border-color: #e74c3c;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

#start-btn:active {
  transform: scale(0.97);
}

#restart-btn {
  background: rgba(20,20,20,0.95);
  border: 1px solid #444;
  color: #bbb;

  padding: 10px 22px;
  border-radius: 20px;

  font-size: 0.8rem;
  letter-spacing: 1px;

  cursor: pointer;
  transition: all 0.25s ease;
}

#restart-btn:hover {
  color: #fff;
  border-color: #666;
  transform: translateY(-2px);
}

/* --------- ACHIEVEMENTS LIST --------- */
.achievements {
  list-style: none;
  font-size: 0.7rem;
  color: #aaa;
}

/* ================================================= */
/* 🔥 POPUPS (unchanged but safe layer) */
/* ================================================= */

.achievement-popups {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  pointer-events: none;
  isolation: isolate;
  transform: translateZ(0);

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup {
  background: linear-gradient(135deg, #1b1b1b, #0f0f0f);
  border-left: 4px solid gold;
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.25);
  animation: slideIn 0.35s ease, fadeOut 0.4s ease 3s forwards;
}

/* --------- ANIMATIONS --------- */
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(120%); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes subtleGlow {
  from { text-shadow: 0 0 8px rgba(255,255,255,0.05); }
  to { text-shadow: 0 0 18px rgba(255,255,255,0.15); }
}

@keyframes pulseParanoia {
  0% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(0.85) saturate(1.3); }
  100% { filter: brightness(1) saturate(1); }
}

@keyframes calmTrust {
  from { filter: brightness(1); }
  to { filter: brightness(1.05); }
}


/* MOBILE OPTIMIZATION */


@media (max-width: 600px) {

  #app {
    width: 95%;
    padding: 18px;
  }

  #story-text {
    font-size: 1.12rem;  
    line-height: 1.7;
  }

  #choices button {
    font-size: 1.1rem;
    padding: 18px;        
  }

  #start-btn {
    font-size: 1.1rem;
    padding: 16px 48px;
  }

  #restart-btn {
    padding: 12px 26px;
  }
}

