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

html, body {
  height: 100%;
  background: #1a120c;
  overflow: hidden;
  font-family: "Courier New", Courier, monospace;
}

#game-wrap {
  position: relative;
  width: min(100vw, calc(100vh * 4 / 3));
  height: min(100vh, calc(100vw * 3 / 4));
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* ---------- overlays ---------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 18, 10, 0.45);
  backdrop-filter: blur(3px);
}

.overlay.hidden { display: none; }

.panel {
  background: #f6ead6;
  border: 6px solid #26262b;
  border-radius: 10px;
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.35);
  padding: 34px 48px;
  text-align: center;
  min-width: 420px;
}

.title {
  font-size: 44px;
  letter-spacing: 6px;
  color: #26262b;
  text-shadow: 3px 3px 0 #ff8a00;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  letter-spacing: 3px;
  color: #7a5c3e;
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 14px;
  letter-spacing: 2px;
  color: #26262b;
  margin-bottom: 6px;
  font-weight: bold;
}

#player-name {
  font-family: inherit;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  width: 280px;
  padding: 10px 12px;
  border: 4px solid #26262b;
  border-radius: 6px;
  background: #fffdf7;
  color: #26262b;
  outline: none;
  margin-bottom: 18px;
}

#player-name:focus { border-color: #ff8a00; }

.score-lines {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #26262b;
  margin-bottom: 22px;
  line-height: 1.7;
}

.score-lines span { color: #c25e00; }

.big-btn {
  font-family: inherit;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 3px;
  padding: 14px 34px;
  color: #fff;
  background: #d84315;
  border: 4px solid #26262b;
  border-radius: 8px;
  box-shadow: 0 6px 0 #26262b;
  cursor: pointer;
  margin-bottom: 22px;
}

.big-btn:hover { background: #ff5722; }

.big-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #26262b;
}

.controls-hint {
  font-size: 13px;
  letter-spacing: 1px;
  color: #7a5c3e;
  line-height: 1.8;
}

.controls-hint .warn { color: #d84315; font-weight: bold; }

/* ---------- mute button ---------- */

#mute-btn {
  position: fixed;
  left: 14px;
  bottom: 14px;
  width: 52px;
  height: 52px;
  font-size: 24px;
  background: rgba(246, 234, 214, 0.9);
  border: 4px solid #26262b;
  border-radius: 8px;
  cursor: pointer;
}

#mute-btn:hover { background: #fffdf7; }

/* ---------- touch controls ---------- */

#touch-controls.hidden { display: none; }

/* fixed to the viewport: on wide phones the buttons land in the black
   letterbox bars beside the 4:3 game instead of covering the action */
.tc-cluster {
  position: fixed;
  bottom: 16px;
  display: flex;
  gap: 14px;
  z-index: 5;
}

.tc-move { left: 14px; }
.tc-jump { right: 14px; }

.tc-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #26262b;
  background: rgba(246, 234, 214, 0.55);
  color: #26262b;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.tc-btn.active {
  background: rgba(255, 138, 0, 0.75);
  transform: scale(0.94);
}

/* keep the mute button clear of the movement cluster on touch devices */
body.touch #mute-btn { bottom: 112px; }
