:root {
  color-scheme: dark;
  --bg: #0b132b;
  --accent: #5bc0be;
  --text: #f1f5f9;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#gameCanvas {
  width: 100vw;
  height: 100dvh;
  display: block;
  touch-action: none;
  background: #0f172a;
}

#installBtn {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 10px;
  z-index: 30;
  border: 0;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  background: var(--accent);
  color: #001017;
  font-weight: 700;
}

.native-name-input-wrap {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 45;
  border: 2px solid rgba(134, 239, 172, 0.9);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 12, 28, 0.9);
  backdrop-filter: blur(2px);
}

.native-name-input-wrap[hidden] {
  display: none !important;
}

.native-name-input-wrap label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #d1fae5;
}

.native-name-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#nativeNameInput {
  flex: 1;
  min-width: 0;
  height: 42px;
  border-radius: 10px;
  border: 2px solid #86efac;
  background: #08111d;
  color: #f8f4ff;
  padding: 0 12px;
  font-size: 18px;
  text-transform: uppercase;
}

#nativeNameOkBtn {
  height: 42px;
  border-radius: 10px;
  border: 0;
  background: #22c55e;
  color: #02110a;
  font-size: 16px;
  font-weight: 800;
  padding: 0 14px;
}

.native-name-input-wrap p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #cbd5ff;
}

/* Mobile keyboard proxy mode:
   keep native input focusable (so keyboard appears) but hide visible bottom panel. */
.native-name-input-wrap.keyboard-proxy {
  left: -9999px;
  right: auto;
  bottom: auto;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.native-name-input-wrap.keyboard-proxy label,
.native-name-input-wrap.keyboard-proxy p,
.native-name-input-wrap.keyboard-proxy #nativeNameOkBtn {
  display: none !important;
}

.native-name-input-wrap.keyboard-proxy .native-name-input-row {
  display: block;
}

.native-name-input-wrap.keyboard-proxy #nativeNameInput {
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  border: 0;
  opacity: 0;
}
