.game-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: rgba(15, 31, 31, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.game-home-link {
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.85rem;
  font-weight: 600; padding: 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.08); transition: background .2s, color .2s;
}
.game-home-link:hover { background: rgba(255,255,255,0.15); color: #fff; }

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 60px;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--cream);
  background: radial-gradient(circle at 20% 20%, #2b685f 0%, var(--bg-deep) 45%, #071312 100%);
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.35;
}

.bg-shape-a {
  width: 300px;
  height: 300px;
  background: #66efb8;
  top: -70px;
  left: -60px;
  animation: driftA 8s ease-in-out infinite;
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  background: #ffcb77;
  bottom: -110px;
  right: -40px;
  animation: driftB 10s ease-in-out infinite;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.hud-panel,
.game-panel {
  background: var(--panel);
  border: 1px solid rgba(170, 255, 202, 0.25);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
}

.hud-panel {
  padding: 20px;
}

h1 {
  margin: 0;
  font-family: "Bungee", cursive;
  letter-spacing: 0.6px;
  color: var(--lime);
  font-size: 1.6rem;
}

.tagline {
  margin: 10px 0 18px;
  color: #d8f8df;
  line-height: 1.45;
}

.controls-card {
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
}

label {
  font-size: 0.9rem;
  color: #d8fff0;
}

select,
button {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #17312f;
  color: var(--cream);
  font-weight: 700;
  padding: 10px 12px;
  font-family: inherit;
}

button {
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  background: linear-gradient(135deg, #2ecf97, #1b8f75);
  border-color: rgba(144, 255, 225, 0.5);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(20, 117, 96, 0.4);
}

.stats-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-grid article {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px 10px;
}

.stats-grid span {
  font-size: 0.8rem;
  color: #d4fff4;
}

.stats-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

.health-wrap {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px;
}

.health-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.health-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

#healthFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4cff9a, #cbff6d);
  transition: width 180ms linear, background-color 180ms ease;
}

.legend,
.asset-note {
  margin-top: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #e3ffef;
}

.asset-note h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.asset-note ul {
  margin: 0;
  padding-left: 18px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
}

.dot.safe {
  background: var(--safe);
}

.dot.poison {
  background: var(--danger);
}

.game-panel {
  position: relative;
  padding: 14px;
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto;
}

.fullscreen-btn {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 10;
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(10, 23, 23, 0.72);
  border: 1px solid rgba(170, 255, 202, 0.3);
  color: var(--mint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 150ms ease, transform 150ms ease;
}

.fullscreen-btn:hover {
  background: rgba(20, 50, 45, 0.9);
  transform: none;
  box-shadow: none;
}

.fullscreen-btn svg {
  width: 100%;
  height: 100%;
}

/* When game-panel is the fullscreen element */
.game-panel:fullscreen,
.game-panel:-webkit-full-screen {
  padding: 0;
  border-radius: 0;
  background: #0f1f1f;
  grid-template-rows: 1fr auto;
}

.game-panel:fullscreen canvas,
.game-panel:-webkit-full-screen canvas {
  border-radius: 0;
  border: none;
}

.game-panel:fullscreen .fullscreen-btn,
.game-panel:-webkit-full-screen .fullscreen-btn {
  top: 12px;
  right: 12px;
}

.game-panel:fullscreen .overlay,
.game-panel:-webkit-full-screen .overlay {
  inset: 0;
  border-radius: 0;
}

canvas {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(180deg, #9df7e6 0%, #5ad9ba 32%, #397f68 100%);
  border: 1px solid rgba(18, 93, 71, 0.6);
}

.overlay {
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(8, 17, 17, 0.76);
  text-align: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay h2 {
  margin: 0;
  font-size: 2rem;
  color: var(--lime);
  font-family: "Bungee", cursive;
}

.overlay p {
  margin: 0;
  max-width: 42ch;
}

.hint {
  margin: 10px 2px 2px;
  color: #deffef;
  font-size: 0.9rem;
}

@keyframes driftA {
  0%,
  100% { transform: translate(0, 0); }
  50% { transform: translate(45px, 35px); }
}

@keyframes driftB {
  0%,
  100% { transform: translate(0, 0); }
  50% { transform: translate(-35px, -35px); }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hud-panel {
    order: 2;
  }

  .game-panel {
    order: 1;
    min-height: 420px;
  }
}
/*  BLOB_READ_WRITE_TOKEN="vercel_blob_rw_QfgY90hDxIglVu6c_SaplMPM2r2KwwyFEY5zGOFHCnpLxcf" */