:root {
  --pink: #FF00C8;
  --pink2: #FE00C8;
  --sky: #4DA4FF;
  --lime: #00CD16;
  --lime2: #CCFF00;
  --ink: #0a0a0a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #1a0014;
  color: var(--ink);
  font-family: "Arial Black", "Arial Bold", Arial, Helvetica, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
#cabinet {
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--pink);
  padding:
    calc(6px + env(safe-area-inset-top))
    10px
    calc(8px + env(safe-area-inset-bottom));
  border-left: 6px solid var(--pink2);
  border-right: 6px solid var(--pink2);
}
#hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 8px;
  flex-shrink: 0;
}
#lives {
  display: flex;
  gap: 2px;
  justify-self: start;
}
.heart {
  color: #000;
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,.15);
}
.heart.lost { opacity: 0.18; }
.brand {
  justify-self: center;
  color: #000;
  text-decoration: none;
  font-size: 28px;
  letter-spacing: 0.02em;
  font-weight: 900;
  line-height: 1;
}
.brand .reg, .win95-logo .reg { font-size: 0.45em; vertical-align: super; }
#scorewrap {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
}
.slabel {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#scorepill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 12px;
  background: var(--lime2);
  border: 2px solid #000;
  border-radius: 999px;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
}
#playwrap {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--sky);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.12);
}
#c {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.help {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(0,0,0,.45);
  font-family: "Segoe UI", system-ui, sans-serif;
  pointer-events: none;
  transition: opacity .4s;
}
.help.hide { opacity: 0; }

#levelup, #over {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 0, 30, 0.35);
  padding: 16px;
  z-index: 5;
}
#levelup.gone, #levelup[hidden],
#over.gone, #over[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}
.win95 {
  width: min(300px, 92%);
  background: #fff;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 #000;
  font-family: "MS Sans Serif", "Segoe UI", Tahoma, sans-serif;
}
.win95-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--lime);
  color: #000;
  padding: 4px 6px;
  font-weight: 800;
  font-size: 13px;
}
.win95-btns { display: flex; gap: 3px; align-items: center; }
.win95-btns i {
  display: inline-block;
  width: 14px; height: 14px;
  border: 1.5px solid #000;
  background: #ff9ad8;
}
.win95-btns i:first-child { background: #ddd; }
.win95-btns button {
  width: 18px; height: 18px;
  border: 1.5px solid #000;
  background: #ff5a9a;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.win95-body {
  padding: 14px 14px 12px;
  text-align: center;
  color: #000;
}
.win95-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.win95-logo {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  font-family: "Arial Black", Arial, sans-serif;
  letter-spacing: 0.02em;
}
.win95-sub { margin: 2px 0 12px; font-size: 14px; }
.win95-link {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
}
.win95-link a {
  color: #0000ee;
  text-decoration: underline;
}
.win95-ok {
  border: 2px solid #000;
  background: #e8e8e8;
  padding: 6px 28px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset -1px -1px 0 #888, inset 1px 1px 0 #fff;
}
#over .kicker {
  margin: 0;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 2px 0 #000;
}
#over h2 {
  margin: 6px 0 14px;
  font-size: 48px;
  color: #fff;
  text-shadow: 3px 3px 0 #000;
}
#otro {
  border: 3px solid #000;
  background: var(--lime2);
  color: #000;
  padding: 12px 28px;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.12em;
  border-radius: 10px;
  cursor: pointer;
}

#controls {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1.4fr;
  align-items: end;
  gap: 8px;
  padding: 10px 4px 4px;
  min-height: 96px;
}
.btn-col {
  display: grid;
  gap: 6px;
  justify-items: center;
}
.btn-col.left { grid-template-columns: 1fr; }
.btn-col.right {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 5px 8px;
}
.abtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #111;
  background: var(--lime);
  box-shadow: 0 3px 0 #0a7a12, inset 0 2px 0 rgba(255,255,255,.45);
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.abtn.white { background: #f4f4f4; box-shadow: 0 3px 0 #888, inset 0 2px 0 #fff; }
.abtn.smile::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #111;
}
.abtn.smile::after {
  content: "☺";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #111;
  z-index: 1;
}
.abtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a7a12; }

.stick {
  position: relative;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
}
.stick-base {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid #111;
  box-shadow: inset 0 0 0 8px #0a9a14, 0 3px 0 #086a0e;
}
.stick-shaft {
  position: absolute;
  width: 14px;
  height: 28px;
  background: #f5f5f5;
  border: 2px solid #222;
  border-radius: 4px;
  bottom: 28px;
  z-index: 1;
}
.stick-ball {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dff7a, var(--lime) 55%, #009a12);
  border: 3px solid #111;
  top: 2px;
  z-index: 2;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.4);
}

@media (min-width: 500px) {
  #cabinet { border-radius: 12px; margin-top: 8px; height: calc(100dvh - 16px); }
}
