/*
 * Apple HIG-ish dark theme for proto-battleroyale.
 *
 * Palette mirrors iOS/macOS dark mode system colors so the browser
 * chrome (body bg, letterbox bars), the game canvas clear color, the
 * native HTML nickname input, and the Cocos-drawn UI all read as one
 * continuous surface.
 */

:root {
  --pbr-bg:          #0A0A0C;  /* page + canvas fill */
  --pbr-surface:     #1C1C1E;  /* cards, panels */
  --pbr-elevated:    #2C2C2E;  /* raised controls (input bg) */
  --pbr-border:      rgba(255,255,255,0.10);
  --pbr-text:        #FFFFFF;
  --pbr-text-2:      #EBEBF599; /* 60% white, iOS secondary label */
  --pbr-text-3:      #EBEBF54D; /* 30% white, iOS tertiary label */
  --pbr-blue:        #0A84FF;   /* iOS dark mode system blue */
  --pbr-blue-hover:  #3395FF;
  --safe-top:    env(safe-area-inset-top);
  --safe-right:  env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left:   env(safe-area-inset-left);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  -ms-touch-action: none;
}

body, canvas, div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

body {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 0;
  cursor: default;
  color: var(--pbr-text);
  background-color: var(--pbr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", system-ui, "Segoe UI", Roboto, sans-serif;
  text-align: center;
  display: flex;
  flex-direction: column;
}

canvas { background-color: var(--pbr-bg); }

#GameDiv, #Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
  background-color: var(--pbr-bg);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Lobby nickname input — HIG dark mode text field. */
#pbr-nick-input {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 48px;
  padding: 0 16px;
  box-sizing: border-box;
  font: 500 17px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", system-ui, sans-serif;
  color: var(--pbr-text);
  background: var(--pbr-elevated);
  border: 1px solid var(--pbr-border);
  border-radius: 12px;
  outline: none;
  caret-color: var(--pbr-blue);
  z-index: 10;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
#pbr-nick-input::placeholder { color: var(--pbr-text-3); }
#pbr-nick-input:focus {
  border-color: var(--pbr-blue);
  background: #3A3A3C;
}
#pbr-nick-input:disabled { opacity: 0.5; }
