/* Round Box — mobile-first shell */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0c12;
  color: #e6ebf5;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, #1a2030 0%, #0a0c12 70%);
}

#stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100vw, calc(100dvh * 420 / 780));
  height: min(100dvh, calc(100vw * 780 / 420));
  max-width: 100%;
  max-height: 100%;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #12141c;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(90, 200, 250, 0.12),
    0 20px 60px rgba(0, 0, 0, 0.55);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
  touch-action: none;
}

#chrome {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.chip {
  pointer-events: auto;
  border: 1px solid rgba(140, 160, 190, 0.35);
  background: rgba(12, 14, 20, 0.72);
  color: #c8d0e0;
  font: 600 13px/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  min-width: 44px;
  min-height: 36px;
}

.chip:active {
  transform: scale(0.96);
}

.chip.on {
  color: #5ac8fa;
  border-color: rgba(90, 200, 250, 0.55);
  box-shadow: 0 0 12px rgba(90, 200, 250, 0.25);
}

.side-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6a7388;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Phone: hide PC hint, keep chrome */
@media (pointer: coarse), (max-width: 640px) {
  .side-hint {
    display: none;
  }
  #game {
    border-radius: 0;
    box-shadow: none;
  }
  #stage {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }
  #chrome {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }
}

/* Wide desktop: roomy frame */
@media (min-width: 900px) and (pointer: fine) {
  #stage {
    width: min(480px, calc(100dvh * 420 / 780));
    height: min(calc(100dvh - 48px), calc(480px * 780 / 420));
  }
}
