/* style.css — arcade console language */
:root {
  --bg:     #0a0a12;
  --panel:  #12121e;
  --line:   #232338;
  --text:   #e8e8f0;
  --dim:    #8888a0;
  --accent: #ffd34d;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', Courier, 'Lucida Console', monospace;
  overscroll-behavior: none;
}

/* ---------- layout ---------- */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 12px;
  padding: 16px;
}

/* ---------- canvas ---------- */
#game {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06060f;
  image-rendering: pixelated;
  /* prevent browser pan/zoom interfering with canvas touches */
  touch-action: none;
}

/* ---------- touch bar ---------- */
#touch {
  display: none; /* hidden on desktop */
  width: 100%;
  max-width: 800px;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  /* two clusters: movement left, actions right */
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* left cluster: ◀ ▶ */
#touch-left {
  display: flex;
  gap: 6px;
}

/* right cluster: JMP  ATK  DGE */
#touch-right {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* base button */
#touch button {
  position: relative;
  top: 0;
  min-height: 56px;
  min-width: 56px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  box-shadow: 0 3px 0 #06060c;
  transition: color 0.08s, background 0.08s;
}

#touch button:active,
#touch button.pressed {
  top: 3px;
  box-shadow: none;
  color: var(--accent);
}

/* ATK — primary: gold-filled, largest */
#btn-atk {
  min-height: 64px;
  min-width: 68px;
  background: var(--accent);
  color: #0a0a12;
  border-color: var(--accent);
  font-size: 15px;
  box-shadow: 0 4px 0 #b89400;
}
#btn-atk:active,
#btn-atk.pressed {
  top: 4px;
  box-shadow: none;
  background: #ffe580;
  color: #0a0a12;
}

/* DGE — gold outline */
#btn-dodge {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
#btn-dodge:active,
#btn-dodge.pressed {
  background: rgba(255,211,77,0.15);
  color: var(--accent);
}

/* ---------- mobile ---------- */
@media (max-width: 768px) {
  body {
    justify-content: flex-start;
    padding: 8px 0 0;
  }

  #game {
    width: 100%;
    height: auto;
    aspect-ratio: 800 / 450;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  #touch {
    display: flex;
  }
}
