@import url("theme.css");

body {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

.game-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 55%, var(--moss));
}

.exit-btn {
  position: fixed;
  top: calc(0.6rem + env(safe-area-inset-top, 0px));
  left: calc(0.6rem + env(safe-area-inset-left, 0px));
  z-index: 25;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(232, 212, 139, 0.45);
  background: rgba(18, 30, 20, 0.82);
  color: #fff8e7;
  font-size: 1.1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.exit-btn:hover,
.exit-btn:active {
  border-color: var(--gold);
  filter: brightness(1.15);
}

.game-hud {
  position: fixed;
  top: calc(0.65rem + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 0.5rem;
  pointer-events: none;
}

.game-hud .stat {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 0.4rem 0.7rem;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  white-space: nowrap;
}

.game-hud .stat.you {
  border-color: var(--accent);
}

.game-hud .stat.opponent {
  border-color: var(--crystal);
}

.ghost-btn {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.6rem;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--parchment);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.ghost-btn:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.stat-line {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-soft);
  margin-bottom: 0.5rem;
}

.touch-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  z-index: 24;
  pointer-events: none;
}

/* Opt-in: pin the first/last pad buttons to the screen edges (thumb reach on tablets). */
.touch-controls.edge-controls {
  justify-content: space-between;
  padding-left: calc(1.1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1.1rem + env(safe-area-inset-right, 0px));
}

.touch-controls .pad-btn {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(232, 212, 139, 0.45);
  background: rgba(18, 30, 20, 0.82);
  color: #fff8e7;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.touch-controls .pad-btn.jump-btn {
  width: 74px;
  height: 74px;
  background: rgba(61, 143, 90, 0.82);
}

.touch-controls .pad-btn.pressed,
.touch-controls .pad-btn:active {
  transform: scale(0.94);
  filter: brightness(1.15);
  border-color: var(--gold);
}
