/* YOU vs YOU — global shell styles. The game itself is canvas-rendered. */

:root {
  --bg: #0b0d14;
  --ink: #e8ecf8;
  --accent: #2ef2ff;
  color-scheme: dark;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  /* Actual CSS size is set by the resize handler to keep a fixed 960x576 aspect. */
  background: var(--bg);
}

/* ---- Touch controls (shown only when a coarse pointer is detected) ---- */

#touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none; /* children re-enable */
}

.tc-side {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: flex;
  gap: 12px;
  pointer-events: none;
}

.tc-side-right {
  left: auto;
  right: max(14px, env(safe-area-inset-right));
}

.tc-btn {
  pointer-events: auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid rgba(46, 242, 255, 0.35);
  background: rgba(13, 16, 26, 0.55);
  color: var(--ink);
  font: bold 26px ui-monospace, Menlo, Consolas, monospace;
  touch-action: none;
  opacity: 0.85;
}

.tc-btn:active {
  background: rgba(46, 242, 255, 0.25);
  border-color: var(--accent);
}

.tc-btn.tc-jump {
  border-color: rgba(255, 92, 178, 0.45);
}

.tc-btn.tc-jump:active {
  background: rgba(255, 92, 178, 0.3);
  border-color: #ff5cb2;
}

.tc-btn.tc-small {
  width: 54px;
  height: 54px;
  font-size: 20px;
  align-self: flex-end;
}

/* ---- 3D phase (WebGL canvas + transparent HUD canvas + touch pads) ---- */

/* Visible when their `hidden` attribute is toggled by showMode() — an author
   display:none here would override the attribute and blank the 3D phase. */
#game3d,
#hud3d {
  position: absolute;
  inset: 0;
  margin: auto;
}

#game3d {
  background: var(--bg);
  display: none;
}

#game3d:not([hidden]) {
  display: block;
}

#hud3d {
  pointer-events: none;
}

#touch-3d {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tc3-stick {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  width: 132px;
  height: 76px;
  border-radius: 16px;
  border: 2px solid rgba(46, 242, 255, 0.35);
  background: rgba(10, 14, 22, 0.55);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc3-knob {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(46, 242, 255, 0.22);
  border: 2px solid var(--accent);
  transition: transform 120ms ease-out;
}

.tc3-use {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(18px, env(safe-area-inset-right));
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(46, 242, 255, 0.14);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  pointer-events: auto;
}
