* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* Nothing in this game is selectable: long-pressing anywhere must never
   pop the iOS/Android copy-paste menu while playing. */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body {
  font-family: ui-monospace, Menlo, Consolas, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(900px 500px at 50% -10%, #2b2b4d 0%, #12121f 60%);
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 22px 12px 34px; color: #fff;
}
.machine {
  width: 392px; max-width: 96vw; position: relative; border-radius: 40px;
  padding: 16px 16px 14px; overflow: hidden; color: #fff;
  background: linear-gradient(165deg, #ff7a5c 0%, #e8452c 38%, #c92f1f 72%, #a81f14 100%);
  box-shadow: 0 22px 40px rgba(0,0,0,.45), inset 0 3px 2px rgba(255,255,255,.65),
    inset 0 -8px 14px rgba(0,0,0,.28), inset 3px 0 8px rgba(255,255,255,.18);
}
.rainbow { position: absolute; left: 0; right: 0; top: 0; height: 7px; opacity: .92;
  background: repeating-linear-gradient(90deg, #ffd93d 0 28px, #ff8c42 28px 56px, #118ab2 56px 84px, #06d6a0 84px 112px); }
.grain { position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: radial-gradient(rgba(60,10,0,.7) 1px, transparent 1.3px), radial-gradient(rgba(255,255,255,.85) .8px, transparent 1.2px);
  background-size: 5px 5px, 6px 6px; background-position: 0 0, 2px 3px; }
.screw { position: absolute; top: 15px; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #9ca3af 55%, #4b5563);
  color: #374151; font-size: 12px; line-height: 16px; text-align: center; font-weight: 900;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4); z-index: 3; }
.screw.tl { left: 15px; } .screw.tr { right: 15px; }

.plate-wrap { position: relative; text-align: center; padding-top: 6px; z-index: 2; }
.plate { display: inline-block; background: linear-gradient(180deg, #fff7cc, #ffd93d);
  color: #8a2b00; border: 2px solid rgba(120,30,0,.35); border-radius: 8px; padding: 6px 16px 7px;
  box-shadow: 0 3px 0 rgba(90,20,0,.45), inset 0 1px 0 #fff; transform: rotate(-1.2deg); }
.plate-title { font-weight: 900; letter-spacing: 2.5px; font-size: 20px; line-height: 1; text-shadow: 1px 1px 0 rgba(255,255,255,.7); }
.plate-sub { font-size: 10px; letter-spacing: 5px; margin-top: 3px; font-weight: 700; }
.hud { display: flex; justify-content: center; gap: 7px; margin: 10px 0 9px; flex-wrap: wrap; }
.lcd { background: linear-gradient(180deg, #2b3a2b, #162416); color: #8dff57; border: 2px solid #0b120b;
  border-radius: 7px; padding: 5px 10px; font-size: 14px; letter-spacing: 2px;
  box-shadow: inset 0 2px 7px #000, 0 1px 0 rgba(255,255,255,.35); min-width: 86px; }
.lcd.gold { color: #ffd93d; letter-spacing: 1px; }
.lcd.warn { color: #ff5a4e; }
.bgm-btn { background: linear-gradient(180deg, #4b5563, #1f2937); color: #e5e7eb; border: 1px solid rgba(255,255,255,.4);
  border-radius: 7px; padding: 5px 9px; font-size: 12px; cursor: pointer; font-family: inherit; }
.bgm-btn.off { opacity: .55; }
.sound-btn { background: linear-gradient(180deg, #fde047, #f59e0b); color: #451a03; border: 2px solid #fff7cc;
  border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: bold; cursor: pointer; font-family: inherit;
  animation: soundPulse 1.2s ease-in-out infinite; }
@keyframes soundPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.tank-bezel { position: relative; z-index: 2; background: linear-gradient(180deg, #dbeafe, #93c5fd 55%, #64748b);
  border-radius: 22px; padding: 7px;
  box-shadow: inset 0 2px 4px rgba(255,255,255,.9), inset 0 -3px 6px rgba(0,0,0,.35), 0 2px 0 rgba(255,255,255,.25); }
.tank-wrap { position: relative; border-radius: 16px; overflow: hidden; box-shadow: inset 0 4px 14px rgba(0,60,110,.35); }
canvas { display: block; width: 100%; height: auto; touch-action: none; }

.overlay { position: absolute; inset: 0; background: rgba(8, 35, 58, .78);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 13px; text-align: center; padding: 22px; z-index: 5; }
.overlay.hidden { display: none; }
.overlay h2 { font-size: 28px; letter-spacing: 3px; text-shadow: 2px 2px 0 rgba(0,0,0,.4); }
.overlay p { font-size: 13.5px; line-height: 1.75; color: #dbeafe; }
.overlay .ov-small { font-size: 11.5px; color: #93c5fd; }
.overlay button { background: linear-gradient(180deg, #ffe066, #f59e0b); color: #7a2b00; border: none;
  border-radius: 999px; padding: 13px 26px; font-size: 16px; font-weight: 900; cursor: pointer;
  box-shadow: 0 5px 0 #92400e, 0 10px 18px rgba(0,0,0,.35); font-family: inherit; }
.overlay button:active { transform: translateY(3px); box-shadow: 0 2px 0 #92400e; }

.pump-panel { position: relative; z-index: 2; margin-top: 13px;
  background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(255,255,255,.07));
  border: 1.5px solid rgba(255,255,255,.22); border-radius: 20px; padding: 12px 12px 10px;
  box-shadow: inset 0 2px 7px rgba(0,0,0,.28); display: flex; justify-content: space-between; align-items: flex-start; }
.pump-side { text-align: center; }
.pump { width: 80px; height: 80px; border-radius: 50%; cursor: pointer; position: relative;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.pump::after { content: ""; position: absolute; left: 15px; top: 10px; width: 21px; height: 13px;
  border-radius: 50%; background: rgba(255,255,255,.65); transform: rotate(-24deg); }
.pump .needle { position: absolute; left: 50%; top: 7px; width: 6px; height: 31px; margin-left: -3px;
  border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transform-origin: 50% 33px; transform: rotate(35deg); pointer-events: none; z-index: 2;
  transition: transform 70ms linear; }
.pump .hub { position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #9ca3af 60%, #4b5563);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.4); pointer-events: none; z-index: 3; }
.pump-label b { color: #ffd93d; }
.pump.blue { background: radial-gradient(circle, #e0f2fe 0 24%, #7dd3fc 25% 42%, #0284c7 43% 68%, #075985 69%);
  box-shadow: 0 7px 0 #7f1d1d, 0 12px 16px rgba(0,0,0,.35), inset 0 4px 8px rgba(255,255,255,.65), inset 0 -6px 10px rgba(0,0,0,.35);
  border: 4px solid #dbeafe; }
.pump.yellow { background: radial-gradient(circle, #fef9c3 0 24%, #fde047 25% 42%, #facc15 43% 68%, #a16207 69%);
  box-shadow: 0 7px 0 #7f1d1d, 0 12px 16px rgba(0,0,0,.35), inset 0 4px 8px rgba(255,255,255,.7), inset 0 -6px 10px rgba(0,0,0,.3);
  border: 4px solid #fef3c7; }
.pump.pressed { transform: translateY(5px); }
.pump.blue.pressed { box-shadow: 0 2px 0 #7f1d1d, inset 0 4px 8px rgba(255,255,255,.65); }
.pump.yellow.pressed { box-shadow: 0 2px 0 #7f1d1d, inset 0 4px 8px rgba(255,255,255,.7); }
.pump-label { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: 1.5px; margin-top: 9px;
  background: rgba(90,20,0,.35); padding: 3px 9px; border-radius: 999px; }
.pump-mid { text-align: center; font-size: 12px; font-weight: 800; line-height: 1.65; padding-top: 6px; }
.pump-mid small { font-weight: 600; opacity: .9; font-size: 11px; }
.pump-mid .dots { letter-spacing: 3px; font-size: 9px; opacity: .85; }

.foot { position: relative; z-index: 2; text-align: center; margin-top: 10px; font-size: 9px; letter-spacing: 3px; opacity: .85; }
.hint { max-width: 392px; margin-top: 16px; font-size: 12.5px; line-height: 1.8; color: #a5b4cf; text-align: center; }

.mode-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.overlay .mode-btn { background: rgba(255,255,255,.12); color: #dbeafe; border: 2px solid rgba(255,255,255,.4);
  border-radius: 12px; padding: 8px 13px; font-size: 14px; font-weight: 900; cursor: pointer; font-family: inherit;
  line-height: 1.35; box-shadow: none; }
.overlay .mode-btn small { display: block; font-size: 10.5px; font-weight: 600; opacity: .85; margin-top: 2px; }
.overlay .mode-btn.selected { background: linear-gradient(180deg, #ffe066, #f59e0b); color: #7a2b00; border-color: #fff7cc; }
.overlay .mode-btn:active { transform: translateY(0); }
