/* =========================================================
   GRIND LAB — HURRICANE RUNNER / HOME INTRO
   Updated overlay layout:
   - UI moved below fixed navbar
   - translucent glass panels
   - green research/lab accents
   - pink action buttons
========================================================= */

:root {
  --runner-accent: #8bd63c;
  --runner-accent-soft: rgba(139, 214, 60, 0.18);

  --runner-green: #8bd63c;
  --runner-green-soft: rgba(139, 214, 60, 0.14);

  --runner-dark: #101820;

  /* More transparent so street scene remains visible */
  --runner-panel: rgba(10, 18, 22, 0.48);
  --runner-panel-strong: rgba(10, 18, 22, 0.60);

  --runner-border: rgba(255, 255, 255, 0.12);
}


/* =========================================================
   GAME HERO
========================================================= */

.game-strip-hero {
  position: relative;

  min-height: auto !important;

  padding: 0 !important;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 86% 16%,
      rgba(85, 120, 43, 0.18),
      transparent 31%
    ),
    radial-gradient(
      circle at 12% 82%,
      rgba(126, 34, 69, 0.14),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      #241f1b 0%,
      #1a2119 52%,
      #0d1b2a 100%
    );
}


.game-strip-hero .hero-bg-glow {
  pointer-events: none;
}


.game-strip-inner {
  position: relative;
  z-index: 2;

  width: min(100%, 1800px);

  margin: 0 auto;

  padding: 0;
}


/* =========================================================
   GAME CANVAS CONTAINER
========================================================= */

.game-strip {
  position: relative;

  width: 100%;

  height: clamp(
    350px,
    45vh,
    450px
  );

  overflow: hidden;

  border: 1px solid var(--runner-border);

  border-radius: 0 0 28px 28px;

  background: #60717c;

  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.28);

  isolation: isolate;
}


.game-canvas-window {
  position: absolute;

  inset: 0;

  z-index: 1;

  overflow: hidden;
}


#disaster-runner {
  display: block;

  width: 100% !important;
  height: 100% !important;

  max-width: none !important;
  max-height: none !important;

  touch-action: manipulation;
}


/* =========================================================
   START / FINISH SCREEN
========================================================= */

.runner-start-screen {
  position: absolute;

  z-index: 12;

  inset: 0;

  display: grid;

  place-content: center;
  justify-items: center;

  gap: 12px;

  padding: 72px 26px 26px;

  background:
    radial-gradient(
      circle at 50% 36%,
      rgba(232, 49, 122, 0.12),
      transparent 25%
    ),
    rgba(7, 13, 19, 0.62);

  color: #fff;

  text-align: center;

  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  transition:
    opacity 0.24s ease,
    visibility 0.24s ease;
}


.runner-start-screen.is-hidden {
  opacity: 0;

  visibility: hidden;

  pointer-events: none;
}


.runner-start-screen > i {
  display: grid;

  place-items: center;

  width: 54px;
  height: 54px;

  border-radius: 50%;

  background: var(--runner-accent-soft);

  color: var(--runner-accent);

  font-size: 25px;
}


.runner-start-screen h3 {
  margin: 0;

  font-size: clamp(
    28px,
    3vw,
    42px
  );

  line-height: 1.05;
}


.runner-start-screen p {
  max-width: 610px;

  margin: 0;

  color: rgba(255, 255, 255, 0.78);

  font-size: 15px;

  line-height: 1.65;
}


#runner-start-btn {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  margin-top: 4px;

  padding: 12px 20px;

  border: 0;

  border-radius: 999px;

  background: var(--runner-accent);

  color: #fff;

  font: inherit;

  font-size: 13px;

  font-weight: 850;

  cursor: pointer;

  box-shadow:
    0 12px 28px rgba(232, 49, 122, 0.28);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}


#runner-start-btn:hover {
  transform: translateY(-2px);

  box-shadow:
    0 16px 34px rgba(232, 49, 122, 0.38);
}


/* =========================================================
   GLASS UI
========================================================= */

.game-ui-card,
.game-metric,
.game-status-card,
.game-control-cluster {
  border:
    1px solid rgba(255, 255, 255, 0.09);

  background:
    var(--runner-panel);

  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.16);

  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}


/* =========================================================
   LEFT TITLE PANEL
========================================================= */

.game-ui-card {
  position: absolute;

  z-index: 8;

  /*
     IMPORTANT:
     moved down because navbar overlays top of hero
  */
  top: 82px;

  left: 32px;

  width: min(
    315px,
    28vw
  );

  padding:
    16px
    18px
    18px;

  border-radius: 18px;

  color: #fff;
}


.game-ui-card .runner-kicker {
  display: block;

  margin-bottom: 8px;

  /* Green tab/accent */
  color: var(--runner-green);

  font-size: 11px;

  font-weight: 900;

  letter-spacing: 0.14em;

  text-transform: uppercase;
}


.game-ui-card h2 {
  margin: 0;

  color: #fff;

  font-size: clamp(
    23px,
    2.2vw,
    37px
  );

  line-height: 1.05;

  letter-spacing: -0.025em;
}


/* =========================================================
   TOP-RIGHT METRICS
========================================================= */

.game-metrics {
  position: absolute;

  z-index: 8;

  /*
     moved below navbar
  */
  top: 82px;

  right: 32px;

  display: flex;

  gap: 9px;
}


.game-metric {
  min-width: 104px;

  padding:
    10px
    13px;

  border-radius: 14px;

  text-align: center;

  color: #fff;
}


.game-metric span {
  display: block;

  margin-bottom: 5px;

  color:
    rgba(255, 255, 255, 0.63);

  font-size: 9px;

  font-weight: 900;

  letter-spacing: 0.12em;

  text-transform: uppercase;
}


.game-metric strong {
  display: block;

  color: #fff;

  font-size: 20px;

  font-weight: 800;

  line-height: 1;
}


/* =========================================================
   LOWER-LEFT STATUS
========================================================= */

.game-status-card {
  position: absolute;

  z-index: 8;

  left: 32px;

  bottom: 22px;

  max-width: min(
    520px,
    46vw
  );

  padding:
    10px
    14px;

  border-radius: 13px;

  color:
    rgba(255, 255, 255, 0.90);

  font-size: 13px;

  line-height: 1.45;
}


/* =========================================================
   LOWER-RIGHT GAME CONTROLS
========================================================= */

.game-control-cluster {
  position: absolute;

  z-index: 8;

  right: 32px;

  bottom: 22px;

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 7px;

  border-radius: 15px;
}


.runner-control-btn {
  min-width: 48px;

  min-height: 44px;

  padding:
    8px
    12px;

  border:
    1px solid rgba(255, 255, 255, 0.11);

  border-radius: 11px;

  background:
    rgba(255, 255, 255, 0.08);

  color: #fff;

  font: inherit;

  font-size: 14px;

  font-weight: 800;

  cursor: pointer;

  transition:
    background 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}


.runner-control-btn:hover {
  border-color:
    rgba(139, 214, 60, 0.35);

  background:
    var(--runner-green-soft);

  transform:
    translateY(-1px);
}


.runner-control-btn.jump {
  min-width: 94px;

  border-color: transparent;

  /* Keep main interaction button pink */
  background:
    var(--runner-accent);

  color: #fff;

  box-shadow:
    0 8px 20px
    rgba(232, 49, 122, 0.20);
}


.runner-control-btn.jump:hover {
  background:
    #f13e84;

  border-color: transparent;

  box-shadow:
    0 10px 24px
    rgba(232, 49, 122, 0.30);
}


/* =========================================================
   DARK LAB INTRODUCTION
========================================================= */

.lab-intro-section {
  padding:
    78px
    0
    72px;

  color: #fff;

  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(96, 128, 54, 0.11),
      transparent 30%
    ),
    radial-gradient(
      circle at 8% 84%,
      rgba(139, 214, 60, 0.07),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      #241f1b 0%,
      #1a2119 52%,
      #0d1b2a 100%
    );
}


.lab-intro-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.25fr)
    minmax(300px, 0.75fr);

  gap: 54px;

  align-items: center;
}


/* =========================================================
   GREEN ABOUT-THE-LAB TAB
========================================================= */

.lab-intro-copy .section-tag {
  display: inline-flex;

  align-items: center;

  margin-bottom: 16px;

  padding:
    8px
    14px;

  border:
    1px solid rgba(139, 214, 60, 0.38);

  border-radius: 999px;

  background:
    rgba(139, 214, 60, 0.09);

  color:
    var(--runner-green);

  font-weight: 800;

  letter-spacing: 0.12em;
}


.lab-intro-copy h1 {
  margin:
    0
    0
    12px;

  color: #fff;

  font-size: clamp(
    44px,
    6vw,
    76px
  );

  font-weight: 800;

  line-height: 0.98;

  letter-spacing: -0.05em;
}


/* Lab full name: green */

.lab-intro-copy .lab-name {
  display: block;

  margin-bottom: 21px;

  color:
    var(--runner-green);

  font-size: 16px;

  font-weight: 850;

  letter-spacing: 0.01em;
}


.lab-intro-copy > p {
  max-width: 780px;

  margin: 0;

  color:
    rgba(255, 255, 255, 0.73);

  font-size: 18px;

  line-height: 1.78;
}


/* =========================================================
   LAB BUTTONS
========================================================= */

.lab-intro-actions {
  display: flex;

  flex-wrap: wrap;

  gap: 12px;

  margin-top: 28px;
}


/*
   Research/lab navigation uses GREEN.
   Pink remains the site's high-attention action color.
*/

.lab-intro-section .btn-primary {
  border-color:
    var(--runner-green) !important;

  background:
    var(--runner-green) !important;

  color:
    #142015 !important;
}


.lab-intro-section .btn-primary:hover {
  border-color:
    #9ce84d !important;

  background:
    #9ce84d !important;
}


.lab-intro-section .btn-outline {
  border-color:
    rgba(255, 255, 255, 0.24) !important;

  color:
    #fff !important;
}


.lab-intro-section .btn-outline:hover {
  border-color:
    var(--runner-green) !important;

  background:
    var(--runner-green-soft) !important;

  color:
    #fff !important;
}


/* =========================================================
   LAB RESEARCH CARDS
========================================================= */

.lab-intro-points {
  display: grid;

  gap: 14px;
}


.lab-intro-point {
  padding:
    20px
    21px;

  border:
    1px solid rgba(255, 255, 255, 0.09);

  border-radius: 18px;

  background:
    rgba(255, 255, 255, 0.045);

  box-shadow:
    inset
    0
    1px
    0
    rgba(255, 255, 255, 0.03);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}


.lab-intro-point:hover {
  transform:
    translateY(-2px);

  border-color:
    rgba(139, 214, 60, 0.24);

  background:
    rgba(255, 255, 255, 0.06);
}


/* Green icons */

.lab-intro-point i {
  margin-bottom: 10px;

  color:
    var(--runner-green);

  font-size: 20px;
}


.lab-intro-point h3 {
  margin:
    0
    0
    7px;

  color:
    #fff;

  font-size: 17px;
}


.lab-intro-point p {
  margin: 0;

  color:
    rgba(255, 255, 255, 0.63);

  font-size: 14px;

  line-height: 1.58;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 980px) {

  .game-strip-inner {
    width:
      min(
        100%,
        980px
      );
  }


  .game-strip {
    height: 400px;
  }


  .game-ui-card {
    top: 74px;

    left: 20px;

    width: 245px;
  }


  .game-metrics {
    top: 74px;

    right: 20px;

    gap: 6px;
  }


  .game-metric {
    min-width: 86px;

    padding:
      9px
      10px;
  }


  .game-metric strong {
    font-size: 18px;
  }


  .game-status-card {
    left: 20px;

    bottom: 18px;
  }


  .game-control-cluster {
    right: 20px;

    bottom: 18px;
  }


  .lab-intro-grid {
    grid-template-columns: 1fr;

    gap: 36px;
  }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 720px) {

  .game-strip {
    height: 350px;

    border-radius:
      0
      0
      20px
      20px;
  }


  .game-ui-card {
    top: 62px;

    left: 12px;

    width: 202px;

    padding:
      12px
      13px;
  }


  .game-ui-card .runner-kicker {
    font-size: 9px;
  }


  .game-ui-card h2 {
    font-size: 22px;
  }


  .game-metrics {
    top: 62px;

    right: 12px;

    gap: 5px;
  }


  .game-metric {
    min-width: 63px;

    padding: 8px;
  }


  .game-metric span {
    font-size: 7px;
  }


  .game-metric strong {
    font-size: 14px;
  }


  .game-status-card {
    left: 12px;

    bottom: 12px;

    max-width:
      calc(
        100% - 188px
      );

    font-size: 11px;
  }


  .game-control-cluster {
    right: 12px;

    bottom: 12px;
  }


  .runner-control-btn {
    min-width: 40px;

    min-height: 40px;

    padding:
      6px
      9px;
  }


  .runner-control-btn.jump {
    min-width: 70px;
  }


  .lab-intro-section {
    padding:
      58px
      0;
  }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 520px) {

  .game-strip {
    height: 320px;
  }


  .game-ui-card {
    top: 56px;

    width: 170px;
  }


  .game-ui-card h2 {
    font-size: 18px;
  }


  /*
     Preserve Distance and Shelter.
     Hide middle Impacts card on very small screens
     to avoid overlap.
  */

  .game-metrics
  .game-metric:nth-child(2) {
    display: none;
  }


  .game-metric {
    min-width: 60px;
  }


  .game-status-card {
    display: none;
  }


  .runner-control-btn.jump {
    min-width: 58px;

    font-size: 0;
  }


  .runner-control-btn.jump i {
    font-size: 14px;
  }


  .lab-intro-copy > p {
    font-size: 16px;
  }
}
/* =========================================================
   MOBILE GAME UI FIX
========================================================= */

@media (max-width: 520px) {

  /* 手机端游戏里不再显示左上角标题卡
     Start / Result screen 已经有标题，不需要重复 */
  .game-ui-card {
    display: none !important;
  }

  /* Start screen / Result screen 出现时，
     隐藏 metrics 和方向控制键，避免和 Start / Run Again 重叠 */
  .game-strip:has(.runner-start-screen:not(.is-hidden)) .game-metrics,
  .game-strip:has(.runner-start-screen:not(.is-hidden)) .game-control-cluster {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* 游戏真正开始后自动恢复 */
  .game-metrics,
  .game-control-cluster {
    transition: opacity 0.2s ease;
  }

  /* Result / Start 内容稍微收紧 */
  .runner-start-screen {
    padding: 24px 20px !important;
  }

  .runner-start-screen h3 {
    font-size: 30px !important;
  }

  .runner-start-screen p {
    max-width: 330px;
    font-size: 14px !important;
    line-height: 1.55 !important;
  }

  #runner-start-btn {
    margin-top: 10px;
  }
}