/* --------------------------------------------------
   GLOBAL
-------------------------------------------------- */
* {
  box-sizing: border-box;
}

#game-wrapper {
  /* was max-width: 480px; which locked desktop to phone width */
  width: 100%;
  max-width: 1200px;     /* optional: gives you a nice centered column on big screens */
  margin: 0 auto;
  overflow-x: hidden;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;      /* kill horizontal scroll */
}

body {
  margin: 0;
  background: #000;
  background-image: url("img/background-arctic.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  color: #d4e4e2;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}


* {
  box-sizing: border-box;
}

/* --------------------------------------------------
   GAME CONTAINER
-------------------------------------------------- */
#game-container {
  max-width: 1200px;   
  margin: 10px auto;      /* was 20px auto */
  padding: 12px 14px;     /* slightly tighter padding */
  background: #050910;
  border: 1px solid #1b2333;
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden; /* Prevent sideways drag */
}


/* --------------------------------------------------
   SCENE ART
-------------------------------------------------- */
#scene-art {
  height: 300px;              /* was 260px */
  border-radius: 6px;
  background: radial-gradient(circle at top, #1f2b3f 0, #050910 55%);
  border: 1px solid #222;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------
   TEXT BOX
-------------------------------------------------- */
#text-box {
  min-height: 150px;
  max-height: 210px;
  padding: 8px 4px;
  background: rgba(5, 9, 16, 0.9);
  border-radius: 6px;
  border: 1px solid #20293b;
  overflow-y: auto;
  line-height: 1.4;
  font-size: 0.98rem;
}

/* --------------------------------------------------
   CHOICES
-------------------------------------------------- */
#choices {
  min-height: 100px;
  padding: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#choices button {
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #2b3750;
  background: #0b1220;
  color: #e4ecff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

#choices button:hover {
  background: #121a2c;
  border-color: #4cd3ff;
  transform: translateY(-1px);
}

/* --------------------------------------------------
   DICE AREA
-------------------------------------------------- */
#dice-area {
  min-height: 32px;
  font-size: 0.9rem;
  color: #9fb3ff;
  text-align: center;
}

/* --------------------------------------------------
   STATUS BAR HUD (BOTTOM) — INLINE CAPSULES
-------------------------------------------------- */
#status-bar {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #20293b;

  text-align: right;
  white-space: nowrap;

  /* scanlines + gradient */
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.12) 0px,
      rgba(255, 255, 255, 0.12) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(to right, #050910, #0d1829);
}

.stat-pill {
  display: inline-block;
  padding: 4px 10px;
  margin-left: 6px;

  border-radius: 999px;
  background: rgba(10, 18, 32, 0.9);
  border: 1px solid #26324a;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #c6d4ff;
}

/* Highlight color variants (on the pill shells) */
.stat-pill-intel {
  border-color: #7d9cff;
}
.stat-pill-exposure {
  border-color: #ff7979;
}
.stat-pill-alert {
  border-color: #ff5454;
}
.stat-pill-resolve {
  border-color: #65e088;
}


/* --------------------------------------------------
   STAT ANIMATIONS
-------------------------------------------------- */
.stat-flicker {
  animation: hud-flicker 0.35s ease-out;
}

@keyframes hud-flicker {
  0%   { transform: scale(1);   color: #ffffff; text-shadow: 0 0 4px #ffffff; }
  40%  { transform: scale(1.3); color: #00ffff; text-shadow: 0 0 10px #00ffff; }
  100% { transform: scale(1);   color: inherit; text-shadow: none; }
}

/* Critical flashing */
.stat-critical {
  animation: hud-critical 0.8s ease-in-out infinite alternate !important;
}

@keyframes hud-critical {
  0%   { color: #ffaaaa; text-shadow: 0 0 4px rgba(255, 60, 60, 0.6); transform: scale(1); }
  100% { color: #ff4444; text-shadow: 0 0 10px rgba(255, 100, 100, 1); transform: scale(1.12); }
}

@media (max-width: 700px) {
  #scene-art {
    height: 240px;   /* smaller on narrow screens */
  }

  #text-box {
    max-height: 190px;
  }
}

/* --------------------------------------------------
   RANK DISPLAY PILL
-------------------------------------------------- */
.rank-pill {
  margin-top: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.25);
  text-transform: uppercase;
  opacity: 0.85;
  transition: border 0.3s, box-shadow 0.3s;
}

.rank-up {
  animation: hud-flicker 0.4s ease-out;
}

/* Rank outlines */
.rank-rookie        { border-color: #555; }
.rank-recon         { border-color: #3ca9ff; box-shadow: 0 0 6px #3ca9ff55; }
.rank-field         { border-color: #7cff3c; box-shadow: 0 0 6px #7cff3c55; }
.rank-operative     { border-color: #ffeb3c; box-shadow: 0 0 6px #ffeb3c55; }
.rank-shadowbreaker { border-color: #ff3cc7; box-shadow: 0 0 10px #ff3cc788; }

/* --------------------------------------------------
   INTEL SUMMARY SECTION (END OF GAME)
-------------------------------------------------- */
#intel-summary {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
  opacity: 0.95;
}

#intel-summary p {
  margin: 0.25rem 0;
}

#intel-summary .rank-note {
  font-style: italic;
  opacity: 0.85;
}

/* --------------------------------------------------
   DONATION BUTTON (GI JOE TACTICAL STYLE)
-------------------------------------------------- */
.donate-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 0.85rem 2.6rem;

  border: none;
  border-radius: 999px;
  cursor: pointer;

  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  background: radial-gradient(circle at 20% 0, #4cf7c7 0, #008d6a 32%, #003a2a 100%);
  color: #051714;

  box-shadow:
    0 0 0 2px #0ef0b1,
    0 0 16px rgba(14, 240, 177, 0.4);

  position: relative;
  overflow: hidden;

  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

.donate-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    135deg,
    rgba(255,255,255,0.08) 0,
    transparent 40%,
    transparent 60%,
    rgba(255,255,255,0.04) 100%
  );
  opacity: 0.7;
  pointer-events: none;
}

.donate-btn::after {
  content: "▶";
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  opacity: 0.9;
}

.donate-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 2px #19ffbf,
    0 0 22px rgba(25, 255, 191, 0.7);
  filter: brightness(1.05);
}

.donate-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 0 0 2px #0bb285,
    0 0 12px rgba(11, 178, 133, 0.6);
  filter: brightness(0.97);
}

/* --------------------------------------------------
   MUSIC TOGGLE BUTTON
-------------------------------------------------- */
#music-controls {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.bgm-btn {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid #26324a;
  background: #0b1220;
  color: #c6d4ff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bgm-btn:hover {
  background: #121a2c;
}

/* Mobile: center the button */
@media (max-width: 768px) {
  #music-controls {
    justify-content: center;
  }
}

/* --------------------------------------------------
   FIXED RANK BADGE STRIP
-------------------------------------------------- */

#rank-badges {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
  margin-top: 10px;
  padding: 6px 14px;

  max-width: 520px;
  margin-left: auto;
  margin-right: auto;

  border-radius: 999px;
  border: 1px solid rgba(80, 104, 150, 0.7);

  background: linear-gradient(to right, #050910, #101827, #050910);
  box-shadow: 0 0 10px rgba(0,0,0,0.65);
}

.rank-badge {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  opacity: 0.25;
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.rank-badge.badge-active {
  opacity: 1;
  transform: scale(1.05);
  filter: drop-shadow(0 0 6px rgba(120,200,255,0.6));
}

.badge-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: 999px;

  background: radial-gradient(circle at 30% 0, #26334a 0, #0b1220 55%, #050910 100%);
  border: 1px solid #3b4a60;

  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-icon {
  font-size: 15px;
  color: #9fd4ff;
  text-shadow: 0 0 6px rgba(130,180,255,0.7);
}

.badge-label {
  font-size: 0.68rem;
  color: #c8d6ff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------
   RANK UP ANIMATIONS
-------------------------------------------------- */

/* Rank pill spark pulse */
.rank-pill-spark {
  animation: rank-pill-spark 0.7s ease-out;
}

@keyframes rank-pill-spark {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255,255,255,0);
  }
  30% {
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(120, 220, 255, 0.9);
  }
  60% {
    transform: scale(1.03);
    box-shadow: 0 0 10px rgba(120, 220, 255, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

/* HUD flicker strip when rank up */
#status-bar.hud-rank-flash {
  animation: hud-rank-flash 0.5s ease-out;
}

@keyframes hud-rank-flash {
  0% {
    background:
      linear-gradient(to right, #16324a, #234566, #16324a);
    box-shadow: 0 0 16px rgba(120, 220, 255, 0.7);
  }
  100% {
    background:
      repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.12) 0px,
        rgba(255, 255, 255, 0.12) 1px,
        transparent 1px,
        transparent 4px
      ),
      linear-gradient(to right, #050910, #0d1829);
    box-shadow: none;
  }
}

/* Badge flash for newly unlocked ranks */
.badge-flash {
  animation: badge-flash 0.6s ease-out;
}

@keyframes badge-flash {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(160, 230, 255, 0));
    opacity: 0.5;
  }
  40% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 14px rgba(160, 230, 255, 1));
    opacity: 1;
  }
  100% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 6px rgba(120, 200, 255, 0.6));
    opacity: 1;
  }
}

/* --------------------------------------------------
   RANK BADGE COLOR ACCENTS (per unlocked rank)
-------------------------------------------------- */

/* Rookie (index 0) */
.rank-badge:nth-child(1).badge-active .badge-icon {
  color: #cccccc;
  text-shadow: 0 0 6px rgba(200,200,200,0.45);
}
.rank-badge:nth-child(1).badge-active .badge-icon-wrap {
  border-color: #aaa;
}

/* Recon Specialist (index 1) */
.rank-badge:nth-child(2).badge-active .badge-icon {
  color: #6fc5ff;
  text-shadow: 0 0 8px rgba(100,180,255,0.7);
}
.rank-badge:nth-child(2).badge-active .badge-icon-wrap {
  border-color: #6fc5ff;
}

/* Field Analyst (index 2) */
.rank-badge:nth-child(3).badge-active .badge-icon {
  color: #7cff3c;
  text-shadow: 0 0 8px rgba(124,255,60,0.7);
}
.rank-badge:nth-child(3).badge-active .badge-icon-wrap {
  border-color: #7cff3c;
}

/* Operative Prime (index 3) */
.rank-badge:nth-child(4).badge-active .badge-icon {
  color: #ffeb3c;
  text-shadow: 0 0 8px rgba(255,235,60,0.75);
}
.rank-badge:nth-child(4).badge-active .badge-icon-wrap {
  border-color: #ffeb3c;
}

/* Shadowbreaker (index 4) */
.rank-badge:nth-child(5).badge-active .badge-icon {
  color: #ff3cc7;
  text-shadow: 0 0 10px rgba(255,60,199,0.85);
}
.rank-badge:nth-child(5).badge-active .badge-icon-wrap {
  border-color: #ff3cc7;
}

/* --------------------------------------------------
   TOGGLE BUTTONS
-------------------------------------------------- */

.view-toggle {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 10px;
}

.view-btn {
  border: 1px solid #3a3a3a;
  background: radial-gradient(circle at top, #1a1a1a 0%, #050507 70%);
  color: #e5e5e5;
  font-size: 0.75rem;
  padding: 3px 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.7);
  transition: background 0.2s ease, border-color 0.2s ease,
              transform 0.1s ease, box-shadow 0.2s ease;
}

.view-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.9);
}

.view-btn.view-active {
  background: linear-gradient(135deg, #1b7c8a 0%, #0b3540 90%);
  border-color: #1b7c8a;
  color: #f5f5f5;
}

/* --------------------------------------------------
   HIDDEN CLASS
-------------------------------------------------- */

.hidden {
  display: none;
}

/* --------------------------------------------------
   FULL INTEL PAGE
-------------------------------------------------- */

.intel-page {
  background: rgba(0,0,0,0.75);
  padding: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
}

.intel-page-inner p strong {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.intel-page-list {
  list-style: none;
  padding-left: 0;
  margin: 6px 0 0;
}

.intel-page-list li {
  margin-bottom: 4px;
}
/* ============================
   INTEL HUB LAYOUT
   ============================ */

.intel-page {
  background: rgba(3, 8, 16, 0.92);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(111, 197, 255, 0.4);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
}

/* Header strip */
.intel-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.intel-title-main {
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8fd5ff;
}

.intel-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  color: #9aa6c3;
}

.intel-summary-row span strong {
  color: #e5f3ff;
}

/* Card grid */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

/* Single intel card */
.intel-card {
  background: radial-gradient(circle at top, #101827 0%, #050910 70%);
  border-radius: 6px;
  border: 1px solid rgba(111, 197, 255, 0.25);
  padding: 8px 9px;
  position: relative;
  overflow: hidden;
}

.intel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.4;
  pointer-events: none;
}

.intel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.intel-tag {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7fbfff;
  border: 1px solid rgba(127, 191, 255, 0.5);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(5, 10, 18, 0.9);
}

.intel-card-title {
  font-size: 0.78rem;
  margin: 0 0 0 6px;
  color: #e5f3ff;
}

.intel-card-body {
  position: relative;
  z-index: 1;
  margin: 2px 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #c4d0ea;
}

/* New this run highlight */
.intel-card.intel-new {
  border-color: #1bffb0;
  box-shadow: 0 0 8px rgba(27, 255, 176, 0.4);
}

.intel-card.intel-new .intel-tag {
  border-color: #1bffb0;
  color: #1bffb0;
}

/* Locked / not yet found (if you use it later) */
.intel-card.locked {
  border-color: rgba(180, 180, 180, 0.25);
  color: #767d8d;
}

.intel-card.locked .intel-card-body {
  filter: blur(3px);
}

/* --------------------------------------------------
   SMALL INLINE LOG PANEL (legacy, not used for toast)
-------------------------------------------------- */

.intel-log-panel {
  margin-top: 6px;
  font-size: 0.7rem;
  opacity: 0.9;
}

/* --------------------------------------------------
   POPUP "INTEL ADDED" TOAST
-------------------------------------------------- */

#game-container {
  position: relative;
}

/* ======================================================
   INTEL TOAST – centered popup like the old style
   ====================================================== */
/* ======================================================
   INTEL TOAST – compact centered popup
   ====================================================== */
#intel-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);

  padding: 3px 8px;
  max-width: 180px;
  height: auto;
  max-height: 22px;               /* HARD CAP ON HEIGHT */
  overflow: hidden;               /* Prevents vertical growth */
  white-space: nowrap;            /* Prevents wrapping */
  text-overflow: ellipsis;        /* Clean cut-off if text is long */

  background: rgba(0, 0, 0, 0.85);
  color: #dff6ff;
  font-size: 0.65rem;
  line-height: 1;                 /* Forces minimum vertical size */
  border: 1px solid rgba(0, 180, 255, 0.45);
  border-radius: 3px;
  box-shadow: 0 0 4px rgba(0, 180, 255, 0.3);

  opacity: 0;
  pointer-events: none;
  z-index: 9999;

  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
}

#intel-toast.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}





.code-entry {
  margin-top: 6px;
  font-size: 0.75rem;
}

.code-entry-label {
  margin: 0 0 4px;
}

.code-input {
  background: #050609;
  border: 1px solid #333;
  color: #e5e5e5;
  padding: 3px 6px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: none;
  width: 90px;
}

.code-submit {
  margin-left: 4px;
  border: 1px solid #555;
  background: radial-gradient(circle at top, #1a1a1a 0%, #050507 70%);
  color: #e5e5e5;
  font-size: 0.7rem;
  padding: 2px 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-submit:hover {
  border-color: #1b7c8a;
}

.code-msg {
  margin-top: 4px;
  font-size: 0.65rem;
  opacity: 0.9;
}

/* ============================================================
   HACK MINI-GAME POPUP
   ============================================================ */

#hack-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#hack-popup {
  background: #0c1220;
  border: 1px solid #1f2a40;
  padding: 24px;
  width: 260px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
  text-align: center;
}

/* Title and subtitle */
.hack-title {
  font-size: 14px;
  margin-bottom: 4px;
  color: #d6e6ff;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.hack-subtitle {
  font-size: 11px;
  margin-bottom: 10px;
  opacity: 0.8;
  color: #9fb3d9;
}

/* Timer */
.hack-timer-label {
  font-size: 11px;
  margin-bottom: 4px;
  color: #d6e6ff;
}
.hack-timer-bar {
  width: 100%;
  height: 5px;
  background: #1b2638;
  margin-bottom: 12px;
  border-radius: 3px;
  overflow: hidden;
}
.hack-timer-fill {
  width: 100%;
  height: 100%;
  background: #2bf7ff;
  transform-origin: left center;
  transform: scaleX(1);
}

/* GRID PANEL */
.hack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 6px;
  margin-bottom: 12px;
}

.hack-cell {
  width: 60px;
  height: 60px;
  border: 1px solid #3a4a63;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  color: #d6e6ff;
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
  background: #111a2d;
}

.hack-cell.locked {
  background: #182437;
  border-color: #4f6484;
  cursor: default;
  opacity: 0.8;
}

.hack-cell.error {
  border-color: #ff5b5b;
  color: #ff8a8a;
}

/* Footer + messages */
.hack-footer {
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.7;
  color: #9fb3d9;
}

.hack-message {
  margin-top: 6px;
  font-size: 12px;
  color: #d6e6ff;
}

.hack-message.success {
  color: #2bff88;
}

.hack-message.fail {
  color: #ff6868;
}

.intel-link {
  color: #6fc5ff;
  cursor: pointer;
  text-decoration: underline;
}

.intel-link:hover {
  color: #a7e0ff;
}

.intel-doc-wrapper {
  max-width: 100%;
}

.intel-doc-note {
  font-size: 0.9rem;
  color: var(--text-muted, #9aa0b3);
  margin-bottom: 0.75rem;
}

.intel-doc-frame {
  width: 100%;
  height: 70vh;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: #05060b;
}

.version-tag {
  font-size: 12px;
  opacity: 0.6;
  text-align: right;
  margin-top: 4px;
}

.teaser-error {
  display: none;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: #3b0b0b;
  border: 1px solid #ff7961;
  color: #ffcdd2;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.teaser-error.visible {
  display: block;
}

.replyall-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------------------------------------------------
   MOBILE: Keep Reply All button above browser chrome
--------------------------------------------------- */
@media (max-width: 700px) {

  .thread-container {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* The email list area */
  .thread-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 110px; /* prevents last email from hiding behind footer */
  }

  /* The fixed footer */
  .thread-footer-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;

    padding: 10px 16px calc(env(safe-area-inset-bottom, 16px) + 12px);

    background: rgba(5, 6, 11, 0.96);
    border-top: 1px solid #202437;

    display: flex;
    justify-content: center;
    z-index: 999;
  }

  .thread-replyall-btn {
    width: 100%;
    max-width: 420px;
    padding: 14px 18px;
    font-size: 1rem;
  }
}

/* Sidebar Reply All placement */
.cobra-sidebar-reply {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.cobra-replyall-sidebar {
  width: 100%;
  max-width: 180px;
  font-size: 13px;
  padding: 9px 14px;
}

.replay-btn {
  margin-bottom: 6px;
  width: 100%;
}

.replay-btn {
  margin-top: 6px;
  width: 100%;
  position: relative;
  border: 1px solid #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
  animation: replay-pulse 1.2s ease-in-out infinite;
}

/* Subtle glow / flash */
@keyframes replay-pulse {
  0% {
    box-shadow: 0 0 4px rgba(0, 229, 255, 0.4);
    transform: translateY(0);
    opacity: 0.85;
  }
  50% {
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.95);
    transform: translateY(-1px);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 4px rgba(0, 229, 255, 0.4);
    transform: translateY(0);
    opacity: 0.85;
  }
}

html, body {
  height: 100%;
  margin: 0;
  overflow-y: scroll;     /* still scrollable */
  scrollbar-width: none;  /* Firefox */
}

/* Chrome / Edge / Safari */
body::-webkit-scrollbar {
  display: none;
}

.intel-toast {
  position: fixed;
  right: 12px;
  bottom: 70px;
  font-size: 11px;
  padding: 6px 10px;
  background: rgba(5, 10, 20, 0.95);
  border: 1px solid #00e5ff;
  color: #e5f3ff;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  z-index: 9999;
}

.intel-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

#thermocline-mail-frame {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
  #game-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 14px;
  }
}

/* MOBILE HUD FIX */
@media (max-width: 600px) {

  #hud {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }

  #hud .stat-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
  }

  #hud .stat-chip {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 6px 4px;
  }

  #rank-wrapper {
    font-size: 12px;
    text-align: center;
    padding: 6px 0;
  }

  #rank-buttons {
    transform: scale(0.9);
    transform-origin: center;
  }
}

/* MOBILE HUD LAYOUT */
@media (max-width: 600px) {

  /* outer HUD wrapper – adjust id if yours is different */
  #hud,
  #hud-bar,
  #status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    justify-content: space-between;
  }

  /* the three stat chips */
  #hud .stat-chip,
  #hud-bar .stat-chip,
  #status-bar .stat-chip {
    flex: 1 1 0;
    min-width: 0;
    font-size: 12px;
    padding: 6px 4px;
    text-align: center;
  }

  /* current rank text */
  .current-rank {
    flex: 1 1 100%;
    text-align: center;
    font-size: 12px;
    margin-top: 4px;
  }

  /* rank buttons row */
  #rank-buttons {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
    transform: scale(0.9);
    transform-origin: center;
    margin-top: 4px;
  }

  /* music toggle button */
  #music-toggle {
    flex: 1 1 100%;
    margin-top: 4px;
    font-size: 12px;
  }
}
/* --------------------------------------------------
   Intel view header + links
-------------------------------------------------- */

.intel-page-inner {
  padding: 12px 14px;
}

.intel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.intel-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.intel-header-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9ad6ff;
}

.intel-header-sub {
  font-size: 11px;
  color: #8c9bb5;
}

.intel-header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intel-link-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(111,197,255,0.5);
  background: linear-gradient(135deg, #0b1020, #05070f);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #dfeaff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0,0,0,0.7);
  white-space: nowrap;
}

.intel-link-pill:hover {
  border-color: rgba(160,210,255,0.9);
  box-shadow: 0 0 18px rgba(111,197,255,0.45);
}

/* List / empty states */

.intel-page-list {
  list-style: none;
  padding-left: 0;
  margin: 6px 0 0;
  font-size: 13px;
}

.intel-page-list li {
  margin-bottom: 4px;
}

.intel-empty {
  margin-top: 6px;
  font-size: 13px;
}

.intel-empty-note {
  font-size: 11px;
  color: #8c9bb5;
}

/* Mobile stacking */
@media (max-width: 600px) {
  .intel-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .intel-header-links {
    justify-content: flex-start;
  }
}
/* --------------------------------------------------
   Badge toast popup (badge unlock)
-------------------------------------------------- */

.badge-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 30px) scale(0.9);
  padding: 10px 16px;
  background: rgba(5, 10, 20, 0.98);
  border: 1px solid #ff3b7c;
  border-radius: 10px;
  color: #fce9ff;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: none;
  text-align: left;
  box-shadow: 0 0 24px rgba(255, 59, 124, 0.7);
  pointer-events: none;
  z-index: 9999999;
  max-width: 320px;
  white-space: normal;

  opacity: 0;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.badge-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.badge-toast-heading {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 2px;
}

.badge-toast-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.badge-toast-body {
  font-size: 11px;
  opacity: 0.85;
}

/* --------------------------------------------------
   Rank badge states (HUD strip)
-------------------------------------------------- */

/* When a badge is “active” (rank reached) */
.rank-badge.badge-active {
  border-color: rgba(111, 197, 255, 0.85);
  box-shadow:
    0 0 10px rgba(111, 197, 255, 0.6),
    0 0 20px rgba(2, 8, 20, 1) inset;
  opacity: 1;
}

/* Flash when a new rank is unlocked */
.rank-badge.badge-flash {
  animation: badgeFlash 0.7s ease-out;
}

@keyframes badgeFlash {
  0% {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  40% {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 22px rgba(111, 197, 255, 0.9);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 10px rgba(111, 197, 255, 0.4);
  }
}

/* Status bar flash when ranking up */
.hud-rank-flash {
  animation: hudRankFlash 0.6s ease-out;
}

@keyframes hudRankFlash {
  0% {
    box-shadow: 0 0 0 rgba(111, 197, 255, 0);
  }
  35% {
    box-shadow: 0 0 26px rgba(111, 197, 255, 0.9);
  }
  100% {
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  }
}

/* Rank pill variants if/when you add #rank-display */
.rank-rookie       { border-color: rgba(145, 160, 190, 0.6); }
.rank-recon        { border-color: rgba(111, 197, 255, 0.7); }
.rank-field        { border-color: rgba(147, 227, 177, 0.7); }
.rank-operative    { border-color: rgba(255, 196, 112, 0.8); }
.rank-shadowbreaker{ border-color: rgba(255, 111, 149, 0.9); }

/* Optional spark effect on the rank pill */
.rank-pill-spark {
  animation: rankSpark 0.5s ease-out;
}

@keyframes rankSpark {
  0%   { text-shadow: 0 0 0 rgba(255,255,255,0); }
  40%  { text-shadow: 0 0 18px rgba(255,255,255,0.9); }
  100% { text-shadow: 0 0 0 rgba(255,255,255,0); }
}
.bgm-off {
  opacity: 0.6;
}
#build-marker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.report-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(180, 200, 230, 0.6);
  background: rgba(4, 10, 20, 0.9);
  color: #e5f3ff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-btn:hover {
  border-color: rgba(255, 255, 255, 0.9);
}
.stat-helper {
  display: block;
  font-size: 9px;
  margin-top: 2px;
  opacity: 0.65;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #c8d4e8;
  pointer-events: none;
}

@media (max-width: 540px) {
  .stat-helper {
    font-size: 8px;
    margin-top: 1px;
  }
}
