/* styles.css — responsive layout, loading overlay, reset/test buttons and status */

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

html, body {
  height: 100%;
  background: #f7f7fb;
  color: #111;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 16px;
}

/* top-left controls group */
.top-controls {
  position: fixed;
  left: 12px;
  top: 12px;
  display: flex;
  gap: 8px;
  z-index: 70;
}

/* small generic control button */
.control-btn {
  background: #ffffff;
  border: 1px solid rgba(16,24,40,0.08);
  color: #111827;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(2,6,23,0.06);
  user-select: none;
}
.control-btn:active { transform: translateY(1px); }
.control-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* canvas area */
.canvas {
  width: min(85vmin, 640px);
  height: min(85vmin, 640px);
  display: grid;
  place-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  background: transparent;
  border-radius: 8px;
}

/* avatar image fills the canvas while preserving aspect */
.canvas img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-drag: none;
  -webkit-user-drag: none;
  pointer-events: none;
  -webkit-touch-callout: none;
}

/* small HUD counter bottom-right */
.hud {
  position: fixed;
  right: 12px;
  bottom: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  pointer-events: none;
}

/* audio status below the HUD (left of HUD) */
.audio-status {
  position: fixed;
  left: 12px;
  bottom: 12px;
  background: rgba(255,255,255,0.95);
  color: #111;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid rgba(16,24,40,0.06);
  z-index: 60;
  pointer-events: none;
}

/* focus style */
.canvas:focus { box-shadow: 0 0 0 4px rgba(34,99,246,0.12); }

/* bonk pop */
.bonk-pop { transform: scale(0.996); transition: transform 120ms linear; }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.88);
  z-index: 100;
}

.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.85);
  padding: 18px 22px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(2,6,23,0.08);
}

/* simple CSS spinner */
.loader-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 5px solid rgba(34,34,34,0.08);
  border-top-color: rgba(34,99,246,0.9);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { font-size: 14px; color: #0b1220; }

/* responsive tweaks */
@media (max-width: 420px) {
  .hud { font-size: 12px; padding: 5px 8px; right: 8px; bottom: 8px; }
  .control-btn { padding: 7px 8px; font-size: 12px; }
  .audio-status { font-size: 12px; padding: 5px 8px; left: 8px; bottom: 8px; }
}
