:root {
  --accent: #ff3b5c;
  --gold: #ffcc33;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #140f3a;
  color: #fff;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

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

.hidden { display: none !important; }

/* HUD */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 18px 22px;
  pointer-events: none;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.score { font-size: 44px; line-height: 1; }
.mult {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--accent);
  font-size: 20px;
}
.coins {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 32px;
}
.coin-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6b0, #ffcc33 45%, #c98a00);
  box-shadow: inset 0 0 0 3px #e0a400;
}
.powerups { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-top: 10px; }
.pu {
  width: 150px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .35);
  font-size: 13px;
  color: var(--c);
}
.pu .bar { height: 5px; margin-top: 3px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.pu .bar i { display: block; height: 100%; background: var(--c); }

/* vyskakovacie texty */
#popups { position: fixed; top: 20%; left: 0; right: 0; pointer-events: none; text-align: center; }
.popup {
  position: absolute;
  left: 0; right: 0;
  font-size: 40px;
  color: var(--gold);
  text-shadow: 0 4px 0 #b4302a, 0 0 18px rgba(255, 120, 60, .6);
  animation: pop 1.1s ease-out forwards;
}
.popup.small { top: 56px; font-size: 24px; }
.popup.warn { color: #fff; text-shadow: 0 4px 0 #c0182f; }
.popup.power { color: #7ff7ff; text-shadow: 0 4px 0 #1b5f8f; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.4); }
  15% { opacity: 1; transform: scale(1.15); }
  30% { transform: scale(1); }
  75% { opacity: 1; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* nastavenia */
button.secondary {
  padding: 10px 34px;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  font-size: 18px;
}
button.secondary:active { box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.set-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(460px, 100%);
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .45);
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 4px 6px 4px 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.set-row.sel { border-color: var(--gold); background: rgba(255, 204, 51, .12); }
.set-row.action { justify-content: center; }
.set-row.armed { color: #ff8a9a; }
.set-ctrl { display: flex; align-items: center; gap: 6px; }
.set-value { min-width: 92px; color: var(--gold); text-align: center; font-weight: 800; }
.chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
}
.chev svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chev:active { transform: none; box-shadow: none; }
.fps {
  position: fixed;
  top: 8px;
  left: 50%;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .45);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  pointer-events: none;
  transform: translateX(-50%);
}

/* bublina s textom nad Elonom */
.bubble {
  position: fixed;
  left: 0; top: 0;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  color: #111;
  font-size: 18px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}
.bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  margin-left: -9px;
  border: 9px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

/* obrazovky */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(20, 15, 58, .3), rgba(20, 15, 58, .8));
  overflow-y: auto;
}
h1 {
  font-size: clamp(44px, 9vw, 110px);
  font-style: italic;
  line-height: .95;
  letter-spacing: 2px;
  text-shadow: 0 6px 0 var(--accent), 0 0 40px rgba(255, 59, 92, .6);
}
h1 span {
  display: block;
  color: var(--gold);
  text-shadow: 0 6px 0 #c0392b, 0 0 40px rgba(255, 204, 51, .5);
}
h2 {
  font-size: clamp(40px, 7vw, 80px);
  font-style: italic;
  text-shadow: 0 6px 0 var(--accent);
}
.sub {
  font-family: system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  opacity: .9;
}
.keys {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px 16px;
  padding: 16px 22px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .35);
  font-family: system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  margin-right: 4px;
  padding: 0 8px;
  border-radius: 8px;
  background: linear-gradient(#fff, #d9d9e3);
  box-shadow: 0 4px 0 #8a8aa0;
  color: #222;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
}
kbd svg { width: 18px; height: 18px; fill: #222; }
.rot-l svg { transform: rotate(-90deg); }
.rot-r svg { transform: rotate(90deg); }
.rot-d svg { transform: rotate(180deg); }

button {
  padding: 14px 54px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(#ff5a75, #e0203f);
  box-shadow: 0 6px 0 #8f1026;
  color: #fff;
  font-family: inherit;
  font-size: 28px;
  letter-spacing: 2px;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(3px); box-shadow: 0 3px 0 #8f1026; }

.hint { font-family: system-ui, sans-serif; font-size: 13px; opacity: .75; }
.powers { font-family: system-ui, sans-serif; font-size: 14px; font-weight: 600; color: #7ff7ff; }
.best { font-size: 18px; color: var(--gold); }
.badge {
  padding: 6px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: #3a1d00;
  font-size: 20px;
  animation: pulse .8s ease-in-out infinite alternate;
}
@keyframes pulse { to { transform: scale(1.08); } }
.stats {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px 30px;
  padding: 16px 26px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .35);
  font-size: 22px;
  text-align: left;
}
.stats div:nth-child(odd) { font-family: system-ui, sans-serif; font-weight: 600; opacity: .8; }
.stats div:nth-child(even) { text-align: right; color: var(--gold); }

#mute {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .45);
  box-shadow: none;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

@media (max-height: 800px) {
  .screen { gap: 10px; }
  h1 { font-size: clamp(36px, 7vw, 76px); }
  h2 { font-size: clamp(34px, 6vw, 60px); }
  .keys { gap: 6px 14px; padding: 10px 18px; }
  kbd { min-width: 32px; height: 32px; }
  button { padding: 10px 44px; font-size: 24px; }
  .stats { padding: 10px 22px; font-size: 19px; }
  .set-row { min-height: 38px; }
  .chev { width: 30px; height: 30px; }
}

@media (max-width: 600px) {
  .score { font-size: 32px; }
  .coins { font-size: 24px; }
  .popup { font-size: 30px; }
  button { padding: 12px 40px; font-size: 24px; }
}
