:root {
  color-scheme: dark;
  --sky-top: #263e67;
  --sky-mid: #4e7fa0;
  --snow: #f5fbff;
  --ink: #172433;
  --panel: rgba(12, 25, 39, 0.72);
  --panel-border: rgba(255, 255, 255, 0.28);
  --gold: #ffd56a;
  --red: #d83935;
  --mint: #93e2c7;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow: hidden;
  background: var(--ink);
  color: white;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-mid) 58%, #cde8f4);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
}

.hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.brand,
.meters {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  width: 18px;
  height: 18px;
  display: inline-block;
  background:
    linear-gradient(var(--red) 0 0) 4px 0 / 10px 5px,
    linear-gradient(white 0 0) 1px 5px / 16px 5px,
    linear-gradient(var(--red) 0 0) 3px 10px / 12px 7px,
    linear-gradient(#222 0 0) 5px 17px / 8px 1px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.meters {
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
}

.meters span {
  white-space: nowrap;
}

.meters strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.drop-button {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 96px;
  height: 96px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, 0.92) 44% 56%, transparent 56%),
    linear-gradient(0deg, transparent 44%, rgba(255, 255, 255, 0.92) 44% 56%, transparent 56%),
    var(--red);
  color: white;
  font-size: 0;
  box-shadow:
    0 12px 0 #8d1f28,
    0 24px 30px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
}

.drop-button:active {
  transform: translateY(8px);
  box-shadow:
    0 4px 0 #8d1f28,
    0 14px 22px rgba(0, 0, 0, 0.28);
}

.drop-button:focus-visible,
.camera-button:focus-visible,
.message button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.camera-controls {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
}

.camera-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  color: white;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 7px 0 rgba(3, 14, 23, 0.72);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.camera-button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(3, 14, 23, 0.72);
}

.message {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(10, 22, 36, 0.28);
  text-align: center;
}

.message.is-visible {
  display: grid;
}

.message h1,
.message p {
  margin: 0;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

.message h1 {
  font-size: clamp(2.4rem, 8vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.message p {
  max-width: 32rem;
  margin-top: 12px;
  color: #eaf7ff;
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  line-height: 1.35;
}

.message button {
  min-width: 148px;
  min-height: 48px;
  margin-top: 22px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: #1f9f81;
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 7px 0 #0f6653;
}

.message button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #0f6653;
}

@media (max-width: 700px) {
  .game-shell {
    min-height: 480px;
  }

  .hud {
    align-items: flex-start;
  }

  .brand {
    max-width: 138px;
    white-space: normal;
    line-height: 1.05;
  }

  .meters {
    max-width: 170px;
  }

  .drop-button {
    width: 82px;
    height: 82px;
  }
}
