:root {
  --bg: #070b10;
  --glass: rgba(12, 18, 28, 0.74);
  --glass-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef3f7;
  --muted: #98a6b3;
  --amber: #ffb547;
  --orange: #ff7a3d;
  --green: #3ddc97;
  --red: #ff5d5d;
  --blue: #5cc8ff;
  --radius: 18px;
  --font: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.35;
  overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}
input, select { -webkit-user-select: text; user-select: text; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#app { position: fixed; inset: 0; pointer-events: none; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative; border: 0; border-radius: 14px;
  padding: 11px 18px; font-size: 16px; font-weight: 800; letter-spacing: 0.3px;
  color: #2a1503;
  background: linear-gradient(180deg, #ffd06a, #ff8f3d);
  box-shadow: 0 5px 0 #b4541f, 0 10px 22px rgba(255, 138, 61, 0.3);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b4541f, 0 4px 10px rgba(255, 138, 61, 0.3); }
.btn:disabled { filter: grayscale(0.8) brightness(0.7); cursor: default; transform: none; }
.btn.big { width: 100%; padding: 14px 18px; font-size: 18px; }
.btn.green { color: #052b1a; background: linear-gradient(180deg, #6ff5bb, #20b878); box-shadow: 0 5px 0 #137a4f, 0 10px 22px rgba(32, 184, 120, 0.3); }
.btn.green:active { box-shadow: 0 1px 0 #137a4f; }
.btn.small { white-space: nowrap; padding: 6px 12px; font-size: 14px; border-radius: 11px; box-shadow: 0 3px 0 #b4541f; }
.btn.small:active { transform: translateY(2px); box-shadow: 0 1px 0 #b4541f; }
.btn.ghost { color: var(--text); background: rgba(255, 255, 255, 0.08); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.btn.ghost:active { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }

.icon-btn {
  pointer-events: auto;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  font-size: 17px; display: grid; place-items: center;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.icon-btn:active { transform: scale(0.94); }

/* ---------------------------------------------------------------- loader */
.loader {
  position: fixed; inset: 0; z-index: 100; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 40%, #13202a, var(--bg));
}
.loader p { color: var(--muted); font-weight: 600; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1); border-top-color: var(--amber);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- home */
.screen {
  position: fixed; inset: 0; z-index: 20; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--st)) 16px calc(16px + var(--sb));
  overflow-y: auto; touch-action: pan-y;
  background: radial-gradient(ellipse at center, rgba(5, 8, 12, 0.1), rgba(5, 8, 12, 0.7));
}
.home-card { width: min(420px, 100%); padding: 26px 24px 20px; margin: auto; }
.logo { text-align: center; margin-bottom: 18px; }
.logo-emoji { font-size: 54px; line-height: 1; animation: peek 3.2s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5)); }
@keyframes peek { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
.logo h1 {
  margin: 4px 0 0; font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(180deg, #fff7df, #ffc65c 60%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(120, 50, 10, 0.5));
}
.logo h1 span { margin-left: 8px; background: linear-gradient(180deg, #e6fff3, #6ff5bb 60%, #20b878); -webkit-background-clip: text; background-clip: text; }
.tag { margin: 6px 0 0; color: var(--muted); font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; font-size: 12px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin: 0 0 6px 2px; }
input, select {
  width: 100%; font: 700 17px var(--font); color: var(--text);
  background: rgba(0, 0, 0, 0.35); border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.18); }
input::placeholder { color: rgba(255, 255, 255, 0.3); font-weight: 600; }

.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--c);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s;
}
.swatch.on { transform: scale(1.18); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }

.or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: 4px; text-align: center; font-size: 19px; }
.join-row .btn { flex: 0 0 auto; padding: 0 22px; }
.error { min-height: 20px; margin: 10px 0 0; color: #ff8a8a; font-weight: 700; font-size: 14px; text-align: center; }

.howto { margin-top: 6px; background: var(--glass-2); border-radius: 12px; padding: 10px 14px; }
.howto summary { cursor: pointer; font-weight: 700; color: var(--amber); }
.howto ol { margin: 10px 0 2px; padding-left: 20px; color: #cfd8e0; font-size: 14px; }
.howto li { margin-bottom: 6px; }

/* ---------------------------------------------------------------- HUD */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud-left { position: absolute; top: calc(12px + var(--st)); left: calc(12px + var(--sl)); display: flex; flex-direction: column; gap: 8px; max-width: 230px; }
.hud-right { position: absolute; top: calc(12px + var(--st)); right: calc(12px + var(--sr)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hud-actions { display: flex; gap: 6px; }
.chip {
  align-self: flex-start; padding: 6px 12px; border-radius: 12px; font-weight: 700; font-size: 13px; color: var(--muted);
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.chip b { color: var(--amber); letter-spacing: 2px; margin-left: 4px; font-size: 15px; }

.roster { display: flex; flex-direction: column; gap: 4px; }
.roster-count { font-size: 12px; color: var(--muted); font-weight: 700; padding-left: 4px; }
.roster-count b { color: var(--green); font-size: 14px; }
.rchip {
  display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 6px; border-radius: 10px;
  background: rgba(8, 12, 20, 0.62); border: 1px solid transparent; font-size: 13px; font-weight: 700;
  max-width: 100%; transition: opacity 0.3s;
}
.rchip i { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
.rchip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rchip em { font-style: normal; margin-left: auto; padding-left: 6px; display: flex; align-items: center; gap: 4px; }
.rchip small { font-size: 10px; color: #1b1405; background: var(--amber); border-radius: 6px; padding: 0 5px; }
.rchip.seeker { border-color: rgba(255, 93, 93, 0.6); background: rgba(90, 14, 18, 0.65); }
.rchip.found { opacity: 0.6; }
.rchip.found span { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.4); }
.rchip.me { border-color: rgba(255, 181, 71, 0.5); }
.rchip.off { opacity: 0.4; }

.phase {
  position: absolute; top: calc(10px + var(--st)); left: 50%; transform: translateX(-50%);
  min-width: 190px; padding: 6px 22px 8px; text-align: center; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
#phase-title { font-size: 13px; font-weight: 800; letter-spacing: 2px; color: var(--muted); }
#phase-timer { font-size: 38px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0; }
#phase-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.phase.ph-hiding { border-color: rgba(61, 220, 151, 0.4); }
.phase.ph-hiding #phase-title { color: var(--green); }
.phase.ph-seeking { border-color: rgba(255, 93, 93, 0.45); }
.phase.ph-seeking #phase-title { color: var(--red); }
.phase.ph-lobby #phase-title, .phase.ph-results #phase-title { color: var(--amber); }

.minimap {
  width: 176px; height: auto; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); opacity: 0.92; image-rendering: auto;
}

.find-btn {
  pointer-events: auto; position: absolute;
  right: calc(24px + var(--sr)); bottom: calc(28px + var(--sb));
  width: 108px; height: 108px; border-radius: 50%; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 19px; letter-spacing: 1.5px;
  background: radial-gradient(circle at 35% 30%, #ff9a8a, #e8303a 55%, #8f1420);
  box-shadow: 0 7px 0 #6d0f18, 0 0 0 6px rgba(255, 70, 70, 0.18), 0 16px 34px rgba(232, 48, 58, 0.45);
  touch-action: none; transition: transform 0.08s, filter 0.2s;
}
.find-btn:active { transform: translateY(5px) scale(0.97); box-shadow: 0 2px 0 #6d0f18, 0 0 0 6px rgba(255, 70, 70, 0.18); }
.find-btn .find-ico { font-size: 28px; line-height: 1; }
.find-btn svg { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.find-btn .cd { fill: none; stroke: #ffe27a; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: calc(289 * (1 - var(--cd, 0))); opacity: 0; transition: opacity 0.2s; }
.find-btn.cooling { filter: saturate(0.6) brightness(0.8); }
.find-btn.cooling .cd { opacity: 1; }

.hint {
  position: absolute; left: 50%; bottom: calc(14px + var(--sb)); transform: translateX(-50%);
  width: max-content; padding: 6px 14px; border-radius: 12px; background: rgba(5, 8, 14, 0.55); color: #cfd8e0;
  font-size: 13px; font-weight: 600; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}
.net {
  position: absolute; top: calc(96px + var(--st)); left: 50%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 12px; background: rgba(160, 30, 40, 0.85); font-weight: 700; font-size: 13px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.6; } }

.joy { position: fixed; left: 0; top: 0; z-index: 12; pointer-events: none; width: 0; height: 0; }
.joy::before {
  content: ''; position: absolute; width: 124px; height: 124px; left: -62px; top: -62px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12));
  border: 2px solid rgba(255, 255, 255, 0.22);
}
.joy-knob {
  position: absolute; left: 0; top: 0; width: 56px; height: 56px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #fff, #d7dee6 60%, #9aa6b2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  opacity: 0.85;
}

/* ---------------------------------------------------------------- lobby */
.lobby {
  position: fixed; z-index: 20; pointer-events: auto;
  left: calc(14px + var(--sl)); top: calc(62px + var(--st));
  width: 350px; max-height: calc(100% - 90px - var(--st) - var(--sb));
  display: flex; flex-direction: column; overflow: hidden;
  animation: rise 0.35s ease-out;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.lobby-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.lobby-head small { color: var(--muted); font-weight: 700; font-size: 12px; }
.code { font-size: 32px; font-weight: 800; letter-spacing: 6px; line-height: 1; color: var(--amber); text-shadow: 0 2px 0 rgba(120, 50, 10, 0.6); }
.lobby-btns { margin-left: auto; display: flex; flex-direction: column; gap: 6px; }
.collapse { display: none; border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text); width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.lobby-body { padding: 10px 16px 16px; overflow-y: auto; touch-action: pan-y; }
.lobby-sub { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.plist { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plist li { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; background: var(--glass-2); font-weight: 700; }
.plist li.off { opacity: 0.5; }
.plist .dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.plist .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .pname small { color: var(--amber); }
.plist .badge { font-size: 11px; padding: 1px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); color: var(--muted); white-space: nowrap; }
.plist .badge.host { background: rgba(255, 207, 74, 0.16); color: #ffd56a; }
.plist .score { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.plist .kick { border: 0; background: rgba(255, 93, 93, 0.15); color: #ff8a8a; width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; }
.settings { display: flex; gap: 10px; margin-bottom: 12px; }
.settings label { flex: 1; font-size: 12px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.settings select { padding: 8px 10px; font-size: 15px; }
.settings select:disabled { opacity: 0.7; }
.next { font-size: 14px; color: #cfd8e0; margin-bottom: 12px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 93, 93, 0.08); border: 1px dashed rgba(255, 93, 93, 0.3); }
.next b { color: #ff8a8a; }
.next small { color: var(--muted); }
#lobby-wait { margin: 4px 0 0; font-weight: 700; }

/* ---------------------------------------------------------------- overlays */
.blind {
  position: fixed; inset: 0; z-index: 9; pointer-events: auto;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle at 50% 46%, rgba(40, 10, 14, 0.94), rgba(0, 0, 0, 0.99) 70%);
}
.blind-inner { padding: 20px; }
.hands { font-size: 86px; line-height: 1; animation: peek 2.4s ease-in-out infinite; }
.blind h2 { margin: 10px 0 0; font-size: 28px; letter-spacing: 1px; color: #ffd2d2; }
.count { font-size: 120px; line-height: 1; font-weight: 800; color: #fff; text-shadow: 0 0 40px rgba(255, 80, 80, 0.55); font-variant-numeric: tabular-nums; margin: 6px 0; }
.blind p { color: #c9b6b6; font-size: 16px; max-width: 360px; margin: 0 auto; }
.blind b { color: #ff8a8a; }

.banner {
  position: fixed; left: 50%; top: 30%; z-index: 30; pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7); opacity: 0;
  text-align: center; padding: 16px 30px; border-radius: 22px; width: max-content; max-width: calc(100vw - 32px);
  background: rgba(8, 12, 20, 0.72); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.3s;
}
.banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.b-title { font-size: 40px; font-weight: 800; line-height: 1.05; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
.b-sub { font-size: 16px; color: #d7dee6; font-weight: 600; margin-top: 6px; }
.banner.red .b-title { color: #ff7b7b; }
.banner.green .b-title { color: #6ff5bb; }
.banner.amber .b-title { color: #ffc65c; }

.toasts { position: fixed; top: calc(100px + var(--st)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  padding: 8px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; white-space: nowrap;
  background: rgba(10, 16, 26, 0.86); border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-10px); opacity: 0; transition: transform 0.3s, opacity 0.3s;
}
.toast.in { transform: none; opacity: 1; }
.toast.ok { border-color: rgba(61, 220, 151, 0.5); }
.toast.warn { border-color: rgba(255, 93, 93, 0.6); }
.toast.muted { color: var(--muted); }
.toast small { color: var(--amber); }

.modal {
  position: fixed; inset: 0; z-index: 50; pointer-events: auto;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(2, 4, 8, 0.45);
}
.modal-card { width: min(560px, 100%); max-height: 100%; overflow-y: auto; padding: 22px; animation: rise 0.35s ease-out; touch-action: pan-y; }
.res-head { text-align: center; }
.res-emoji { font-size: 48px; line-height: 1; }
.res-head h2 { margin: 6px 0 2px; font-size: 32px; line-height: 1.1; }
.res-head.seeker h2 { color: #ff8a8a; }
.res-head.hiders h2 { color: #6ff5bb; }
.res-head p { margin: 0; color: var(--muted); font-weight: 600; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 12px; }
.res-col { background: var(--glass-2); border-radius: 14px; padding: 10px 12px; }
.res-col h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.res-col ol, .res-col ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.res-col li { display: flex; align-items: center; gap: 7px; font-weight: 700; flex-wrap: wrap; }
.res-col li i, .srow i { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.res-col li small { color: var(--muted); margin-left: auto; }
.res-col .first { font-size: 10px; color: #2a1503; background: var(--amber); padding: 0 6px; border-radius: 6px; }
.res-col p { margin: 0; }
.res-next { text-align: center; padding: 10px; border-radius: 12px; background: rgba(255, 93, 93, 0.1); margin-bottom: 12px; font-weight: 600; }
.res-next b { color: #ff8a8a; font-size: 18px; }
.res-next small { color: var(--muted); }
.res-scores { display: flex; flex-direction: column; gap: 4px; }
.srow { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; background: var(--glass-2); font-weight: 700; }
.srow .sn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow b { color: var(--amber); }
.srow.me { outline: 1px solid rgba(255, 181, 71, 0.5); }
.res-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 720px) {
  .phase { min-width: 0; padding: 4px 14px 6px; top: calc(8px + var(--st)); }
  #phase-title { font-size: 11px; letter-spacing: 1px; }
  #phase-timer { font-size: 28px; }
  #phase-sub { font-size: 11px; }
  .hud-left { top: calc(8px + var(--st)); left: calc(8px + var(--sl)); max-width: 30vw; }
  .hud-right { top: calc(8px + var(--st)); right: calc(8px + var(--sr)); }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
  .minimap { width: 112px; }
  .chip { font-size: 11px; padding: 4px 8px; }
  .chip b { font-size: 13px; letter-spacing: 1px; }
  .rchip { font-size: 11.5px; padding: 2px 7px 2px 5px; }
  .find-btn { width: 96px; height: 96px; right: calc(18px + var(--sr)); bottom: calc(22px + var(--sb)); font-size: 17px; }
  .hint { font-size: 11.5px; bottom: calc(8px + var(--sb)); }
  .lobby {
    left: calc(8px + var(--sl)); right: calc(8px + var(--sr)); top: auto; bottom: calc(8px + var(--sb));
    width: auto; max-height: 52%;
  }
  .lobby-head { padding: 10px 12px 8px; }
  .lobby-btns { flex-direction: row; }
  .lobby-body { padding: 8px 12px 12px; }
  .plist li { padding: 6px 10px; }
  .next { padding: 7px 10px; margin-bottom: 10px; font-size: 13px; }
  .lobby.collapsed .lobby-body { display: none; }
  .lobby.collapsed .collapse { transform: rotate(180deg); }
  .collapse { display: block; }
  .code { font-size: 26px; letter-spacing: 4px; }
  .b-title { font-size: 30px; }
  .b-sub { font-size: 14px; }
  .count { font-size: 96px; }
  .res-grid { grid-template-columns: 1fr; }
  .toasts { top: calc(78px + var(--st)); }
  .toast { font-size: 13px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .lobby { top: calc(54px + var(--st)); bottom: calc(8px + var(--sb)); left: auto; right: calc(8px + var(--sr)); width: 320px; max-height: none; }
  .lobby.collapsed { bottom: auto; }
  .lobby-head { padding: 8px 12px 6px; }
  .lobby-btns { flex-direction: row; }
  .code { font-size: 24px; letter-spacing: 3px; }
  .collapse { display: block; }
  .lobby.collapsed .lobby-body { display: none; }
  .lobby.collapsed .collapse { transform: rotate(180deg); }
  .phase { min-width: 0; padding: 3px 14px 5px; top: calc(6px + var(--st)); }
  #phase-title { font-size: 11px; letter-spacing: 1px; }
  #phase-timer { font-size: 26px; }
  #phase-sub { font-size: 11px; }
  .hud-left { top: calc(6px + var(--st)); }
  .hud-right { top: calc(6px + var(--st)); }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
  .rchip { font-size: 11.5px; padding: 2px 7px 2px 5px; }
  .find-btn { width: 92px; height: 92px; }
  .hint { font-size: 11.5px; bottom: calc(6px + var(--sb)); }
  .banner { top: 40%; }
  .b-title { font-size: 28px; }
  .toasts { top: calc(64px + var(--st)); }
  .hud-right .minimap { width: 96px; }
  .count { font-size: 72px; }
  .hands { font-size: 56px; }
}
