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

:root {
  --hot: #ff7a3c;
  --cyan: #59d9ff;
  --bad: #ff5470;
  --dim: #6b7398;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0a09;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #f2ede4;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 26px;
  pointer-events: none;
  z-index: 3;
}

.hud-left, .hud-right { display: flex; flex-direction: column; gap: 3px; }
.hud-right { text-align: right; }

.hud-label { font-size: 10px; letter-spacing: 3px; color: var(--dim); }

.hud-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--hot);
  text-shadow: 0 0 12px rgba(255,122,60,.45);
  font-variant-numeric: tabular-nums;
}

.small-v { font-size: 16px; }

.bar {
  width: 170px;
  height: 14px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.45);
  overflow: hidden;
  margin-bottom: 5px;
}

.bar.slim { height: 9px; width: 130px; }

.bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width .12s linear;
}

.bar-fill.hp {
  background: linear-gradient(90deg, #ff5470, #ffb347);
  box-shadow: 0 0 10px rgba(255,120,80,.6);
  width: 100%;
}

.bar-fill.nitro {
  background: linear-gradient(90deg, #59d9ff, #7cff6b);
  box-shadow: 0 0 10px rgba(89,217,255,.6);
  width: 100%;
}

.lvl-name {
  font-size: clamp(13px, 2vw, 17px);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #d8cdb8;
}

.mini-btn {
  margin-top: 5px;
  padding: 4px 13px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: inherit;
  color: #d8b48f;
  background: rgba(255,122,60,.07);
  border: 1px solid rgba(255,122,60,.4);
  border-radius: 12px;
  cursor: pointer;
  pointer-events: auto;
}

.mini-btn:hover { background: rgba(255,122,60,.18); }

#hintbar {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--dim);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

/* ---------- Táctil ---------- */
#touchui {
  position: fixed;
  inset: auto 0 0 0;
  height: 150px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 18px 18px;
  z-index: 4;
  pointer-events: none;
}

.tzone { display: flex; gap: 12px; align-items: flex-end; pointer-events: auto; }

.tbtn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(20,18,16,.55);
  color: #f2ede4;
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
}

.tbtn.big { width: 76px; height: 76px; }
.tbtn.small { width: 50px; height: 50px; opacity: .85; }

.tbtn.nitro {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(10,30,40,.55);
}

.tbtn:active { transform: scale(.93); filter: brightness(1.4); }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(14,11,8,.88) 0%, rgba(8,7,5,.97) 100%);
  z-index: 10;
  padding: 24px;
}

.hidden { display: none !important; }

.game-title {
  font-size: clamp(50px, 10vw, 98px);
  font-weight: 800;
  letter-spacing: 16px;
  line-height: 1;
  color: #f7f2e8;
  margin-left: 16px;
}

.game-title span { color: var(--hot); text-shadow: 0 0 28px var(--hot), 0 0 70px rgba(255,122,60,.35); }

.tagline {
  font-size: clamp(13px, 2.1vw, 18px);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #c9b691;
}

.rules p { margin: 4px 0; color: #cdc4b2; font-size: clamp(12.5px, 1.7vw, 15px); }
.rules strong { color: var(--hot); }
.rules p:nth-child(3) strong { color: var(--cyan); }
.rules p:nth-child(5) strong { color: #7cff6b; }

.btn {
  margin-top: 6px;
  padding: 15px 40px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  font-family: inherit;
  color: var(--hot);
  background: transparent;
  border: 2px solid var(--hot);
  border-radius: 40px;
  cursor: pointer;
  transition: all .18s;
  box-shadow: 0 0 18px rgba(255,122,60,.2), inset 0 0 14px rgba(255,122,60,.06);
}

.btn:hover {
  background: rgba(255,122,60,.12);
  box-shadow: 0 0 30px rgba(255,122,60,.42), inset 0 0 18px rgba(255,122,60,.1);
}

.btn.secondary {
  color: #b7ad99;
  border-color: rgba(200,180,140,.45);
  box-shadow: none;
}

.btn.secondary:hover { background: rgba(200,180,140,.1); box-shadow: none; }

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.clear-title, .win-title {
  font-size: clamp(26px, 5.5vw, 44px);
  letter-spacing: 8px;
  color: var(--hot);
  text-shadow: 0 0 26px rgba(255,122,60,.4);
}

.win-title { color: var(--bad); text-shadow: 0 0 28px rgba(255,84,112,.5); }

.final-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.final-label { font-size: 11px; letter-spacing: 4px; color: var(--dim); }

.final-score {
  font-size: clamp(40px, 8vw, 66px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 24px rgba(255,255,255,.35);
  font-variant-numeric: tabular-nums;
}

.dim { color: #9a917d; font-size: 13.5px; letter-spacing: 1.5px; }

.best {
  min-height: 20px;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: #ffd97a;
}

.up-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 900px; }

.up-card {
  width: 210px;
  padding: 18px 16px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(255,122,60,.45);
  background: rgba(22,17,12,.8);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: all .16s;
  text-align: center;
}

.up-card:hover {
  transform: translateY(-5px);
  border-color: var(--hot);
  box-shadow: 0 14px 34px rgba(255,122,60,.25);
}

.up-name { font-size: 15px; font-weight: 800; letter-spacing: 3px; color: var(--hot); margin-bottom: 8px; }
.up-desc { font-size: 12px; line-height: 1.5; color: #bdb29c; }
.up-lvl { display: inline-block; margin-top: 10px; font-size: 10px; letter-spacing: 2px; color: #7cff6b; border: 1px solid rgba(124,255,107,.4); border-radius: 10px; padding: 2px 9px; }
