* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow: hidden; height: 100%; background: #0a0e14;
  font-family: Georgia, 'Times New Roman', serif; color: #e8e0d0; }
#app canvas { display: block; }
.hidden { display: none !important; }

/* ---------- lobby: sunny card over the live 3D valley ---------- */
#enter { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: transparent; z-index: 50; pointer-events: none; }
.enter-card { pointer-events: auto; text-align: center; padding: 36px 44px;
  border-radius: 20px; background: rgba(255, 253, 245, 0.92);
  box-shadow: 0 14px 44px rgba(30, 70, 130, 0.28); max-width: 420px;
  border: 3px solid rgba(255, 255, 255, 0.9); }
.enter-card h1 { letter-spacing: 0.3em; font-size: 30px; margin: 0 0 4px; color: #1f5fa8; }
.enter-card .sub { color: #6a8aaa; font-style: italic; margin: 0 0 22px; font-size: 14px; }
.enter-card input { display: block; width: 100%; margin: 8px 0; padding: 10px; font-size: 16px;
  text-align: center; background: #ffffff; border: 2px solid #bcd6ee; color: #2a3a55; border-radius: 10px;
  font-family: inherit; text-transform: uppercase; }
.enter-card input:focus { outline: none; border-color: #4d94dd; }
.enter-card .row { display: flex; gap: 8px; }
.enter-card .row input { margin: 0; }
.enter-card button { flex: 1; padding: 11px; font-size: 15px; cursor: pointer; font-family: inherit;
  font-weight: bold; background: #2f7fd0; color: #fff; border: none; border-radius: 10px;
  box-shadow: 0 3px 0 #1f5fa8; }
.enter-card button:hover { background: #3b8dde; }
.enter-card button:active { transform: translateY(2px); box-shadow: none; }
.enter-card button:disabled { opacity: 0.6; }
#enter-err { color: #d05050; min-height: 20px; font-size: 13px; }
.enter-card .hint { color: #7a94aa; font-size: 12px; margin: 14px 0 0; }

/* ---------- HUD ---------- */
#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
  align-items: center; padding: 10px 16px; z-index: 20; pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7); font-size: 14px; }
#hud-left, #hud-right { display: flex; gap: 12px; align-items: center; }
#roomcode { font-weight: bold; letter-spacing: 0.2em; color: #fff; }
#roster span { margin-right: 8px; }
#objective { font-style: italic; color: #fff; background: rgba(0,0,0,0.35);
  padding: 6px 18px; border-radius: 20px; }
.pill { background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.25);
  padding: 4px 12px; border-radius: 20px; font-size: 12px; }
.pill.linked { border-color: #7bed6f; color: #7bed6f; }
#ver { color: rgba(255,255,255,0.5); font-size: 12px; }

/* ---------- pairing overlay ---------- */
#pair-overlay { position: fixed; inset: 0; background: rgba(5,8,12,0.82); z-index: 40;
  display: flex; align-items: center; justify-content: center; }
.pair-card { text-align: center; background: #101724; border: 1px solid #4a5f83; border-radius: 10px;
  padding: 32px 40px; max-width: 400px; }
.pair-card h2 { margin: 0 0 10px; letter-spacing: 0.1em; }
.pair-card p { color: #aeb9cf; font-size: 14px; line-height: 1.6; }
#qr { display: flex; justify-content: center; margin: 14px 0; }
#qr img { border: 8px solid #fff; border-radius: 4px; }
.pair-code { font-size: 18px !important; }
#pair-status { color: #7bed6f !important; min-height: 20px; }
.pair-card button { margin-top: 8px; padding: 8px 22px; font-family: inherit; cursor: pointer;
  background: #2a3a55; color: #f0e6cf; border: 1px solid #4a5f83; border-radius: 4px; }

/* ---------- fade + end ---------- */
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none;
  transition: opacity 2.5s ease; z-index: 30; }
#fade.on { opacity: 1; }
#endcard { position: fixed; inset: 0; z-index: 31; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; }
#endcard h1 { font-size: 42px; letter-spacing: 0.08em; color: #f0e6cf; margin: 0 0 10px;
  text-shadow: 0 2px 12px #000; }
#endcard p { color: #8fa3c4; font-style: italic; }

/* ---------- phone ---------- */
body.phone { background: #0d1420; display: flex; align-items: center; justify-content: center; }
#phone-root { text-align: center; padding: 24px; max-width: 340px; }
#phone-root h1 { letter-spacing: 0.3em; font-size: 22px; color: #f0e6cf; }
#phone-root p { color: #8fa3c4; font-size: 15px; line-height: 1.7; }
#phone-manual input, #phone-manual button { font-size: 18px; padding: 10px; margin: 6px 0;
  width: 100%; text-align: center; border-radius: 6px; border: 1px solid #3a4a63;
  background: #141b28; color: #e8e0d0; font-family: inherit; }
#phone-manual button { background: #2a3a55; cursor: pointer; }
#phone-err { color: #ff8a8a; min-height: 20px; }
#phone-linked h1 { color: #7bed6f; }
