:root {
  --bg: #4a5248;
  --panel: #f4f0e4;
  --ink: #111;
  --muted: #4a5348;
  --gold: #e8a230;
  --pepe: #6fbf57;
  --shirt: #2b44ff;
  --danger: #e07070;
}

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

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #5a6354;
  color: var(--ink);
  font-family: "VT323", monospace;
  overflow: hidden;
  user-select: none;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}

#frame {
  position: relative;
  width: min(96vw, calc(96dvh * 16 / 9));
  height: min(96dvh, calc(96vw * 9 / 16));
  background: #000;
  border: 5px solid #111;
  box-shadow:
    0 0 0 4px #c9c6d6,
    0 18px 50px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
}

#frame,
#frame * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#frame img {
  -webkit-user-drag: none;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  touch-action: none;
}

#hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 56px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  pointer-events: none;
  z-index: 2;
}

.tendie-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffe14a;
  border: 4px solid #111;
  padding: 6px 10px 6px 6px;
  box-shadow: 3px 3px 0 #111;
}

.tendie-box img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.tendie-box .label {
  font-family: "VT323", monospace;
  font-size: 16px;
  color: #111;
  letter-spacing: 0;
}

.tendie-box #tendie-count {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  color: #111;
  text-shadow: none;
}

.hud-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-block .label {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #111;
  letter-spacing: 1px;
}

.hud-block span:last-child {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  color: #111;
  text-shadow: 2px 2px 0 #fff;
}

.powerup-hud {
  display: contents;
}

.speed-box {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  background: #6fbf57;
  border: 4px solid #111;
  padding: 7px 12px 6px;
  box-shadow: 3px 3px 0 #111;
  z-index: 5;
}

.speed-box #speed-mult {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  color: #111;
  line-height: 1.2;
}

.speed-box .label {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #111;
  letter-spacing: 1px;
}

#combo {
  position: absolute;
  top: 70px;
  left: 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  color: #2b44ff;
  text-shadow: 2px 2px 0 #fff;
  pointer-events: none;
  z-index: 2;
  animation: combo-pop 0.35s ease-out;
}

@keyframes combo-pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(80, 90, 70, 0.28);
  z-index: 3;
}

.panel {
  text-align: center;
  padding: 22px 28px 20px;
  max-width: 520px;
  background: #f4f0e4;
  border: 5px solid #111;
  box-shadow: 6px 6px 0 #111;
}

.title-pepe {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 4px;
}

.kicker {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: var(--shirt);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

h1 {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(22px, 4.2vw, 34px);
  line-height: 1.35;
  color: var(--ink);
  text-shadow: 4px 4px 0 #6fbf57;
  margin-bottom: 16px;
}

.blurb,
.stats {
  font-size: 22px;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.2;
}

.char-label {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 1px;
  color: #111;
  margin: 0 0 10px;
}

.char-select {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 0 16px;
}

.char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 92px;
  padding: 8px 10px 8px;
  background: #efe9d8;
  border: 4px solid #111;
  box-shadow: 3px 3px 0 #111;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #111;
  cursor: pointer;
}

.char-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.char-card.selected {
  background: #6fbf57;
  transform: translateY(1px);
  box-shadow: 2px 2px 0 #111;
}

.char-card[data-char="echo"].selected {
  background: #5aa8e8;
}

.char-card[data-char="chonk"].selected {
  background: #f4a04a;
}

.hint {
  margin-top: 14px;
  font-size: 18px;
  color: #5a6354;
}

.orientation-tip {
  display: none;
}

.noscript-message {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(90vw, 520px);
  padding: 24px;
  translate: -50% -50%;
  color: var(--ink);
  background: var(--panel);
  border: 5px solid #111;
  box-shadow: 6px 6px 0 #111;
  font-size: 22px;
  text-align: center;
}

button {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  color: #fff;
  background: var(--shirt);
  border: 4px solid #111;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #111;
}

button:hover {
  filter: brightness(1.08);
}

button:active {
  transform: translateY(2px);
  box-shadow: 2px 2px 0 #111;
}

.heli-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ff8a9a;
  border: 4px solid #111;
  padding: 6px 10px 6px 6px;
  box-shadow: 3px 3px 0 #111;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #111;
}

.heli-box img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.heli-meter-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 72px;
}

.heli-meter {
  width: 72px;
  height: 8px;
  background: #111;
  border: 2px solid #111;
  overflow: hidden;
}

#heli-meter-fill {
  width: 100%;
  height: 100%;
  background: #ffe14a;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

#heli-meter-fill.wait {
  background: #c9c6d6;
}

.giga-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7931a;
  border: 4px solid #111;
  padding: 6px 10px 6px 6px;
  box-shadow: 3px 3px 0 #111;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #111;
}

.giga-box img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

#mute-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: #111;
  background: #ffe14a;
}

#mute-btn.muted {
  color: #666;
  background: #c8c2b4;
  border-color: #111;
  box-shadow: 4px 4px 0 #111;
}

.hidden {
  display: none !important;
}

.dead-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn-share {
  color: #111;
  background: #ffe14a;
}

.btn-share:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.72;
}

.share-status {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 18px;
  color: #2b44ff;
}

#new-best {
  color: #2b44ff;
  min-height: 1.2em;
}

@media (hover: none) and (pointer: coarse),
  (max-width: 700px),
  (orientation: landscape) and (max-height: 500px) {
  #frame {
    width: min(100vw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100vw * 9 / 16));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background: rgba(63, 72, 58, 0.76);
  }

  .panel {
    width: min(100%, 520px);
    max-width: none;
    padding: 18px 20px 16px;
    border-width: 4px;
    box-shadow: 5px 5px 0 #111;
  }

  .title-pepe {
    width: 80px;
    height: 80px;
  }

  h1 {
    font-size: clamp(22px, 8vw, 30px);
    margin-bottom: 12px;
  }

  .blurb,
  .stats {
    font-size: 19px;
    margin-bottom: 16px;
  }

  .char-select {
    margin-bottom: 14px;
  }

  .char-card {
    min-width: 84px;
  }

  .char-card img {
    width: 52px;
    height: 52px;
  }

  .hint {
    margin-top: 10px;
    font-size: 16px;
  }

  .orientation-tip {
    display: block;
    margin-top: 8px;
    color: var(--shirt);
    font-size: 15px;
  }

  button {
    min-height: 44px;
  }

  #mute-btn {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }

  #hud {
    top: 8px;
    left: 8px;
    right: 52px;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .tendie-box {
    gap: 5px;
    border-width: 3px;
    padding: 4px 7px 4px 4px;
  }

  .tendie-box img {
    width: 28px;
    height: 28px;
  }

  .tendie-box .label,
  .tendie-box #tendie-count {
    font-size: 12px;
  }

  .hud-block .label,
  .giga-box,
  .heli-box {
    font-size: 7px;
  }

  .hud-block span:last-child {
    font-size: 11px;
  }

  .speed-box {
    position: static;
    flex: 0 0 auto;
    margin-left: auto;
    gap: 2px;
    border-width: 3px;
    padding: 4px 6px 3px;
    box-shadow: 2px 2px 0 #111;
  }

  .speed-box #speed-mult {
    font-size: 11px;
  }

  .speed-box .label {
    font-size: 6px;
  }

  .powerup-hud {
    position: absolute;
    top: 42px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .giga-box,
  .heli-box {
    gap: 4px;
    border-width: 3px;
    padding: 3px 5px 3px 3px;
    box-shadow: 2px 2px 0 #111;
    font-size: 6px;
  }

  .giga-box img,
  .heli-box img {
    width: 24px;
    height: 24px;
  }

  .heli-meter-col {
    gap: 3px;
    min-width: 54px;
  }

  .heli-meter {
    width: 54px;
    height: 6px;
    border-width: 1px;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 480px),
  (max-width: 700px) and (orientation: landscape) and (max-height: 480px),
  (orientation: landscape) and (max-height: 480px) {
  .overlay {
    padding:
      max(8px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  .panel {
    width: min(84vw, 600px);
    padding: 10px 18px 9px;
  }

  .title-pepe {
    width: 58px;
    height: 58px;
    margin-bottom: 0;
  }

  .kicker {
    font-size: 7px;
    margin-bottom: 5px;
  }

  h1 {
    font-size: clamp(18px, 4.5vw, 26px);
    line-height: 1.18;
    margin-bottom: 7px;
    text-shadow: 3px 3px 0 #6fbf57;
  }

  .blurb,
  .stats {
    font-size: 16px;
    line-height: 1.05;
    margin-bottom: 8px;
  }

  .char-label {
    font-size: 7px;
    margin-bottom: 6px;
  }

  .char-select {
    gap: 8px;
    margin-bottom: 10px;
  }

  .char-card {
    min-width: 72px;
    padding: 4px 6px 5px;
    font-size: 7px;
  }

  .char-card img {
    width: 40px;
    height: 40px;
  }

  .hint,
  .share-status {
    margin-top: 6px;
    font-size: 14px;
  }

  .orientation-tip {
    display: none;
  }

  button {
    min-height: 40px;
    border-width: 3px;
    padding: 9px 13px;
    font-size: 9px;
    box-shadow: 3px 3px 0 #111;
  }

  .dead-actions {
    gap: 8px;
  }

  #new-best {
    min-height: 0;
  }
}

/* Chonk.me shell; the original canvas world keeps its arcade palette. */
:root { --panel: #fff9f0; --shirt: #c45100; --ink: #17130e; }
html, body { background: #050506; }
body { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 76px 16px 48px; }
.game-header { position: fixed; top: 0; left: 0; right: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); background: #050506; font-family: system-ui, sans-serif; }
.brand { display: flex; align-items: center; color: #fff9f0; text-decoration: none; font-size: 24px; font-weight: 850; letter-spacing: -1px; }
.brand img { width: 36px; height: 36px; object-fit: contain; margin-right: 8px; }
.brand span { color: #a39a90; }
.back-link { color: #e5d9cc; text-decoration: none; font-size: 13px; }
.game-footer { color: #a39a90; font: 12px/1.5 system-ui, sans-serif; text-align: center; }
#frame { flex-shrink: 0; width: min(1100px, 96vw, calc((100dvh - 150px) * 16 / 9)); height: auto; aspect-ratio: 16 / 9; border: 1px solid #5c3921; border-radius: 18px; box-shadow: 0 15px 80px #ff7a0012; }
.panel { background: #fff9f0; border-radius: 18px; border: 2px solid #17130e; box-shadow: 6px 6px 0 #17130e; max-width: 500px; }
h1 { font-family: system-ui, sans-serif; font-weight: 950; letter-spacing: -2px; font-size: clamp(30px, 4vw, 46px); line-height: .98; text-shadow: 3px 3px 0 #ff9b35; margin-bottom: 12px; }
h2 { font: 900 30px/1.2 system-ui, sans-serif; margin-bottom: 14px; }
.kicker { font: 700 11px/1.4 system-ui, sans-serif; color: #9a4300; letter-spacing: 1px; }
.blurb, .stats { font: 16px/1.4 system-ui, sans-serif; margin-bottom: 16px; }
.hint, .orientation-tip, .share-status, #load-status { font: 12px/1.5 system-ui, sans-serif; }
button { font-family: system-ui, sans-serif; font-weight: 800; border: 2px solid #17130e; border-radius: 10px; background: #ff7a00; color: #17130e; min-height: 44px; }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid #ff9b35; outline-offset: 4px; }
.title-pepe { width: 86px; height: 86px; }
.overlay { background: #05050680; }
#pause-btn { position: absolute; top: 10px; right: 58px; z-index: 4; width: 40px; height: 44px; padding: 0; }
#pause-btn:disabled { visibility: hidden; }
#pause-panel { z-index: 5; }
#hud { right: 108px; }
#mute-btn { min-height: 44px; }
#combo, #new-best, .share-status { color: #9a4300; }
@media (max-width: 700px), (max-height: 500px) {
  body { padding: 64px 0 24px; gap: 14px; }
  #frame { width: min(100vw, calc((100dvh - 90px) * 16 / 9)); border: 0; border-radius: 0; }
  .overlay { position: fixed; inset: 64px 0 0; min-height: 0; height: auto; padding: 16px; }
  .panel { width: min(100%, 480px); padding: 18px; }
  #mute-btn, #pause-btn { position: fixed; top: auto; bottom: max(14px, env(safe-area-inset-bottom)); right: 14px; }
  #pause-btn { right: 64px; }
  #hud { right: 8px; }
  .game-footer { max-width: 250px; font-size: 11px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .game-header { padding-top: 6px; padding-bottom: 6px; }
  .brand { font-size: 20px; }
  .brand img { width: 28px; height: 28px; }
  body { padding: 40px 0 0; gap: 0; }
  #frame { width: min(100vw, calc((100dvh - 42px) * 16 / 9)); }
  .overlay { inset: 40px 0 0; padding: 6px; }
  .panel { padding: 10px 18px; }
  .title-pepe { width: 46px; height: 46px; float: left; margin-right: 12px; }
  h1 { font-size: 26px; }
  .blurb { font-size: 13px; margin-bottom: 8px; }
  .game-footer { display: none; }
}
@media (prefers-reduced-motion: reduce) { #combo { animation: none; } }
