/* NateBox — host (big screen) chrome: lobby, picker, intro, podium, topbar. */

.view-host { height: 100dvh; overflow: hidden; position: relative; }
.host-bg3d { position: absolute; inset: 0; z-index: 0; opacity: 0.55; }
.host-bg3d canvas { display: block; }
.host-topbar { position: relative; z-index: 2; }
.host-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }

.host-connecting {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  font-size: clamp(30px, 6vw, 54px);
}
.host-connecting .nb-logo { font-size: clamp(38px, 8vw, 64px); }
.host-connecting-msg { font-size: 18px; color: var(--ink-dim); font-weight: 700; animation: fadePulse 1.6s ease-in-out infinite; }
.host-connecting-msg.is-error { color: var(--red); animation: none; }
@keyframes fadePulse { 50% { opacity: 0.45; } }

.host-topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px;
  background: rgba(18, 4, 31, 0.85);
  border-bottom: 2px solid var(--card2);
  z-index: 5;
}
.host-topbar.is-hidden { display: none; }
.host-topbar-title { font-family: var(--display); font-size: 18px; }
.host-topbar-code { color: var(--ink-dim); font-weight: 900; letter-spacing: 0.2em; flex: 1; }
.host-topbar-end { font-size: 13px; padding: 8px 14px; }

/* ---------- lobby ---------- */
.lobby {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 18px;
  padding: 22px;
}
.lobby-left { display: flex; flex-direction: column; align-items: center; gap: 18px; min-height: 0; }
.logo-lobby { font-size: clamp(30px, 4.4vw, 46px); }

.lobby-join {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px;
  width: 100%;
  text-align: center;
  border: 2px solid var(--card2);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.lobby-join-label, .lobby-join-label2 { color: var(--ink-dim); font-weight: 700; font-size: 14px; }
.lobby-join-url { font-weight: 900; font-size: clamp(16px, 1.8vw, 21px); color: var(--cyan); word-break: break-all; }
.lobby-code { display: flex; gap: 8px; margin: 8px 0 4px; }
.lobby-code-ch {
  font-family: var(--display);
  font-size: clamp(40px, 5.4vw, 72px);
  background: linear-gradient(160deg, var(--card2), var(--bg2));
  border: 2px solid var(--purple);
  border-radius: var(--r-md);
  padding: 4px 12px;
  color: var(--yellow);
  animation: codePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  text-shadow: 0 0 22px rgba(255, 213, 30, 0.5);
}
@keyframes codePop { from { opacity: 0; transform: scale(0.4) rotate(-8deg); } }
.lobby-qr-wrap { margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.qr { border-radius: 10px; border: 4px solid #fff; }
.lobby-qr-label { color: var(--ink-dim); font-size: 12px; font-weight: 700; }
.lobby-localwarn { color: var(--orange); font-size: 12px; font-weight: 700; margin-top: 8px; }

.lobby-main { display: flex; flex-direction: column; min-height: 0; gap: 14px; }
.lobby-players-head { font-family: var(--display); color: var(--ink-dim); letter-spacing: 0.3em; font-size: 14px; }
.lobby-tiles { display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; min-height: 118px; }
.lobby-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card);
  border: 2px solid hsl(var(--hue, 280) 70% 55%);
  border-radius: var(--r-md);
  padding: 14px 12px 10px;
  width: 118px;
  cursor: pointer;
  animation: tilePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  transition: transform 0.14s ease;
}
.lobby-tile:hover { transform: translateY(-3px); }
@keyframes tilePop { from { opacity: 0; transform: scale(0.3) rotate(9deg); } }
.lobby-tile-name { font-weight: 900; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-tile-vip {
  position: absolute; top: -10px; right: -8px;
  background: var(--yellow); color: #3c2c00;
  font-size: 10px; font-weight: 900;
  border-radius: 999px; padding: 3px 8px;
  transform: rotate(8deg);
}
.lobby-tile-gone { position: absolute; top: -8px; left: -6px; font-size: 14px; opacity: 0.8; }
.lobby-tile.is-gone { opacity: 0.45; filter: grayscale(0.8); }
.lobby-tile.is-empty {
  border: 2px dashed rgba(185, 168, 216, 0.35);
  background: transparent;
  cursor: default;
  justify-content: center;
  min-height: 118px;
}
.lobby-tile-waiting { color: rgba(185, 168, 216, 0.5); font-size: 30px; animation: fadePulse 1.4s infinite; }

.lobby-hint { color: var(--ink-dim); font-weight: 700; }

.lobby-picker { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px; }
.picker-card {
  flex: 0 0 220px;
  background: var(--card);
  border: 3px solid transparent;
  border-top: 6px solid var(--gcolor, var(--purple));
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.picker-card:hover { transform: translateY(-4px); }
.picker-card.is-sel {
  border-color: var(--gcolor, var(--purple));
  box-shadow: 0 0 26px color-mix(in srgb, var(--gcolor, #8e5bff) 45%, transparent);
  transform: translateY(-4px) scale(1.02);
}
.picker-emoji { font-size: 34px; }
.picker-title { font-family: var(--display); font-size: 19px; margin: 4px 0 2px; color: var(--gcolor, var(--ink)); }
.picker-tag { color: var(--ink-dim); font-size: 12.5px; line-height: 1.3; min-height: 32px; }
.picker-count { margin-top: 6px; font-size: 12px; font-weight: 900; color: var(--ink-dim); }

.lobby-startrow { display: flex; justify-content: center; padding-bottom: 6px; }
.lobby-startrow .btn { min-width: 320px; }

/* ---------- tutorial (how to play) ---------- */
.tut {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; padding: 30px; text-align: center;
  background: radial-gradient(800px 560px at 50% 42%, color-mix(in srgb, var(--gcolor, #8e5bff) 18%, transparent), transparent 70%);
}
.tut-head { display: flex; align-items: center; gap: 16px; }
.tut-badge {
  background: var(--gcolor, var(--purple)); color: #14041f;
  font-weight: 900; letter-spacing: 0.22em; font-size: 13px;
  border-radius: 999px; padding: 6px 18px;
}
.tut-game { font-family: var(--display); font-size: 24px; }
.tut-slide {
  width: min(88vw, 760px);
  background: var(--card);
  border: 3px solid var(--gcolor, var(--purple));
  border-radius: var(--r-lg);
  box-shadow: 0 0 50px color-mix(in srgb, var(--gcolor, #8e5bff) 30%, transparent), 0 18px 40px rgba(0, 0, 0, 0.5);
  padding: 38px 44px;
  animation: tutIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tutIn { from { opacity: 0; transform: translateX(90px) rotate(1.5deg) scale(0.94); } }
.tut-emoji { font-size: 84px; margin-bottom: 8px; animation: introEmoji 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tut-title { font-family: var(--display); font-size: clamp(26px, 4.4vw, 42px); color: var(--gcolor, var(--yellow)); margin-bottom: 12px; }
.tut-text { font-size: clamp(17px, 2.2vw, 23px); font-weight: 700; line-height: 1.5; color: var(--ink); }
.tut-dots { display: flex; gap: 10px; }
.tut-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--card2); transition: all 0.3s ease;
}
.tut-dot.is-on { background: var(--gcolor, var(--yellow)); transform: scale(1.4); box-shadow: 0 0 12px var(--gcolor, var(--yellow)); }
.tut-dot.is-done { background: rgba(255, 255, 255, 0.35); }
.tut-foot { display: flex; align-items: center; gap: 14px; }
.tut-foot-hint { color: var(--ink-dim); font-size: 13px; font-weight: 700; }

/* ---------- game intro ---------- */
.gintro {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center;
  background: radial-gradient(700px 500px at 50% 40%, color-mix(in srgb, var(--gcolor, #8e5bff) 26%, transparent), transparent 70%);
}
.gintro-emoji { font-size: 90px; animation: introEmoji 1.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes introEmoji { from { transform: scale(0) rotate(-30deg); } }
.gintro-title {
  font-family: var(--display);
  font-size: clamp(44px, 9vw, 96px);
  color: var(--gcolor, var(--ink));
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 60px color-mix(in srgb, var(--gcolor, #8e5bff) 60%, transparent);
  animation: introTitle 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes introTitle { from { opacity: 0; transform: translateY(60px) scale(0.8); } }
.gintro-tag { font-size: clamp(18px, 3vw, 28px); font-weight: 900; color: var(--yellow); font-style: italic; }
.gintro-blurb { max-width: 640px; color: var(--ink-dim); font-size: 17px; line-height: 1.45; margin-top: 14px; }

/* ---------- podium ---------- */
.podium {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 30px;
}
.podium-head { font-family: var(--display); font-size: clamp(30px, 5vw, 52px); letter-spacing: 0.1em; color: var(--yellow); }
.podium-hero { display: flex; align-items: center; gap: 8px; }
.podium-3d { width: 240px; height: 250px; }
.podium-3d canvas { display: block; }
.podium-winner { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: winnerPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes winnerPop { from { transform: scale(0.2); opacity: 0; } }
.podium-winner-name { font-family: var(--display); font-size: clamp(24px, 4vw, 40px); }
.podium-note { color: var(--ink-dim); font-weight: 700; }

/* game root fills the stage */
.game-root { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
