html, body {
  margin: 0; height: 100%; overflow: hidden; background: #bcd6e2;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

#loading {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #e9f3e0, #a9cf8f 60%, #6fa35a);
  color: #2f4a26; transition: opacity 0.9s ease; z-index: 10;
}
#loading .title { font-size: clamp(34px, 8vw, 64px); font-weight: 800; letter-spacing: 0.02em; text-shadow: 0 3px 0 rgba(255,255,255,0.5); }
#loading .sub { margin-top: 10px; font-size: 16px; opacity: 0.75; }
#loading.done { opacity: 0; pointer-events: none; }

#card {
  position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(255, 252, 244, 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(30, 50, 30, 0.22);
  color: #2b2a26; max-width: calc(100vw - 32px); box-sizing: border-box;
  transition: opacity 0.35s ease, transform 0.35s ease; z-index: 5;
}
#card[hidden] { display: flex; opacity: 0; transform: translate(-50%, -16px); pointer-events: none; }
#card .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18); }
#card .text { min-width: 0; }
#name { font-weight: 800; font-size: 19px; line-height: 1.1; white-space: nowrap; }
#status { font-size: 13px; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#back {
  flex: none; border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: 15px;
  background: #3f7d45; color: #fff; cursor: pointer; box-shadow: 0 2px 0 #2a5a2f;
}
#back:active { transform: translateY(1px); box-shadow: 0 1px 0 #2a5a2f; }

#hint {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px; background: rgba(255, 252, 244, 0.78); color: #2b2a26;
  font-size: 15px; font-weight: 700; box-shadow: 0 4px 16px rgba(30, 50, 30, 0.18);
  transition: opacity 1.2s ease; pointer-events: none; white-space: nowrap; z-index: 5;
}
#hint.gone { opacity: 0; }

#speech {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: min(560px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 10px 16px; border-radius: 16px; background: rgba(255, 252, 244, 0.9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(30, 50, 30, 0.2); color: #2b2a26;
  font-size: 16px; line-height: 1.35; font-style: italic; text-align: center;
  transition: opacity 0.4s ease; z-index: 5; pointer-events: none;
}
#speech[hidden] { display: block; opacity: 0; }

#mute {
  position: fixed; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top));
  width: 40px; height: 40px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 252, 244, 0.78); color: #2b2a26; box-shadow: 0 3px 12px rgba(30, 50, 30, 0.18); z-index: 6;
}
#mute .cross { display: none; }
#mute.off .cross { display: inline; }
#mute.off .wave { display: none; }

#places-btn {
  position: fixed; left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top));
  height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: 20px; cursor: pointer; z-index: 6;
  display: flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; font-size: 14px;
  background: rgba(255, 252, 244, 0.78); color: #2b2a26; box-shadow: 0 3px 12px rgba(30, 50, 30, 0.18);
}
#places-menu {
  position: fixed; left: max(12px, env(safe-area-inset-left)); top: calc(max(12px, env(safe-area-inset-top)) + 48px);
  padding: 6px; border-radius: 16px; z-index: 7; min-width: 200px;
  background: rgba(255, 252, 244, 0.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(30, 50, 30, 0.25);
}
#places-menu[hidden] { display: none; }
#places-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; font: inherit; font-size: 15px; font-weight: 600; color: #2b2a26; text-align: left; cursor: pointer;
}
#places-list button:hover, #places-list button:focus-visible { background: rgba(63, 125, 69, 0.12); outline: none; }
.pdot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18); }
#shot {
  flex: none; border: 0; border-radius: 999px; padding: 9px 12px; font: inherit; font-weight: 700; font-size: 13px;
  background: rgba(63, 125, 69, 0.14); color: #2a5a2f; cursor: pointer;
}
#shot[hidden] { display: none; }
@media (max-width: 520px) {
  #places-btn span { display: none; }
  #places-btn { padding: 0; width: 40px; justify-content: center; }
  #card { left: 50%; max-width: calc(100vw - 112px); }
}
