/* Face Off — the hub page and the online lobby. Light and minimal: off-white page, white cards, one accent. */
body.hub { overflow: visible; overscroll-behavior: auto; touch-action: auto; user-select: auto; -webkit-user-select: auto; height: auto; min-height: 100%; background: var(--bg); }
html:has(body.hub) { overflow-y: auto; overflow-x: hidden; height: auto; overscroll-behavior-y: auto; background: var(--bg); }
.hub-wrap { max-width: 1080px; margin: 0 auto; padding: calc(20px + var(--safe-t)) calc(20px + var(--safe-r)) calc(32px + var(--safe-b)) calc(20px + var(--safe-l)); }
.hub-head { display: flex; align-items: center; gap: 10px; }
.hub-head .icon-btn, .hub-head .pill { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.logo { margin: 0; flex: 1; display: flex; align-items: center; gap: 8px; font: 800 clamp(24px, 4.4vw, 30px)/1 system-ui, sans-serif; letter-spacing: -.8px; color: var(--text); }
.logo .mark { width: .95em; height: .95em; border-radius: 30%; background: var(--accent); position: relative; flex: none; }
.logo .mark::before, .logo .mark::after { content: ''; position: absolute; top: 36%; width: 14%; height: 20%; border-radius: 50%; background: #fff; }
.logo .mark::before { left: 28%; } .logo .mark::after { right: 28%; }
.logo span:last-child { color: var(--accent); margin-left: -2px; }
.tagline { margin: 10px 0 22px; color: var(--muted); font-size: 16px; }

/* segmented controls */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { appearance: none; border: 0; background: none; color: var(--muted); font: 600 13px system-ui, sans-serif; padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px rgba(24, 24, 27, .04); }

/* who you're playing against */
.target-card, .vs-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow-sm); }
.target-card { display: flex; gap: 24px; align-items: center; }
.face-col { position: relative; flex: none; }
#face-preview { width: 140px; height: 140px; border-radius: 50%; display: block; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line), var(--shadow); cursor: pointer; transition: transform .15s; }
#face-preview:hover { transform: scale(1.02); }
.face-badge { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); background: var(--text); color: #fff; font: 700 11px system-ui; padding: 3px 10px; border-radius: 999px; letter-spacing: .5px; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.target-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.lbl-sm { font-size: 13px; font-weight: 600; color: var(--muted); }
#name { width: 100%; font: 600 17px system-ui, sans-serif; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
#name::placeholder, .vs-slot input::placeholder, .join-row input::placeholder { color: #a8a7ad; }
#name:focus, .vs-slot input:focus, .join-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row.btns .btn { padding: 10px 12px; font-size: 15px; }
.voice-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.tiny { min-height: 0; padding: 7px 11px; font-size: 13px; margin-left: auto; border-radius: 9px; }
.recents { display: flex; flex-direction: column; gap: 6px; }
.recents-strip { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px; scrollbar-width: none; }
.recents-strip::-webkit-scrollbar { display: none; }
.recents-strip img { width: 42px; height: 42px; border-radius: 50%; flex: none; cursor: pointer; box-shadow: 0 0 0 1px var(--line); object-fit: cover; transition: transform .12s; }
.recents-strip img:hover { transform: scale(1.06); }
.recents-strip img.on { box-shadow: 0 0 0 2px var(--accent); }

/* game tiles */
.sec { margin: 36px 0 14px; font: 700 20px system-ui, sans-serif; letter-spacing: -.3px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mode { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--text); border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); transition: transform .18s, box-shadow .18s, border-color .18s; }
.mode:hover, .mode:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); outline: none; }
.mode:focus-visible { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.mode:active { transform: scale(.985); }
.mode .art { position: relative; height: 150px; overflow: hidden; background: var(--tint, var(--surface-2)); margin: 6px 6px 0; border-radius: 13px; }
.mode .art .shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.mode:hover .art .shot { transform: scale(1.05); }
.mode .art .face { position: absolute; left: 10px; bottom: 10px; width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(24, 24, 27, .22); object-fit: cover; transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); }
.mode:hover .art .face { transform: scale(1.08) rotate(-4deg); }
.mode .art .emo { position: absolute; right: 12px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-size: 20px; box-shadow: var(--shadow-sm); }
.mode .info { padding: 12px 14px 15px; display: flex; flex-direction: column; gap: 4px; }
.mode h3 { margin: 0; font: 700 16px system-ui, sans-serif; letter-spacing: -.2px; }
.mode p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.mode .tag { position: absolute; top: 14px; left: 14px; background: rgba(255, 255, 255, .92); color: var(--text); font: 700 11px system-ui; padding: 3px 8px; border-radius: 999px; letter-spacing: .2px; }
.mode .tag.new { background: var(--accent); color: #fff; }
.mode .best { position: absolute; top: 14px; right: 14px; background: rgba(255, 255, 255, .92); color: var(--text); font: 600 11px system-ui; padding: 3px 8px; border-radius: 999px; }

.hub-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.hub-foot p { margin: 0; }

/* face crop */
#crop-canvas { width: min(280px, 72vw); height: min(280px, 72vw); border-radius: 50%; background: #1c1c1f; touch-action: none; cursor: grab; margin: 0 auto; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
#crop-zoom { width: 100%; accent-color: var(--accent); }
.cut-toggle { display: flex; align-items: center; gap: 8px; justify-content: center; font-weight: 600; font-size: 14px; cursor: pointer; }
.cut-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.cut-toggle small { color: var(--muted); font-weight: 500; }
.mode .art .face.cut { border-radius: 0; box-shadow: none; object-fit: contain;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 6px 8px rgba(24, 24, 27, .2)); }

@media (max-width: 560px) {
  .hub-wrap { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
  .target-card { flex-direction: column; align-items: stretch; gap: 20px; padding: 18px 16px; }
  .face-col { align-self: center; }
  #face-preview { width: 124px; height: 124px; }
  .mode-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mode { border-radius: 16px; }
  .mode .art { height: 118px; margin: 5px 5px 0; border-radius: 12px; }
  .mode .art .face { width: 36px; height: 36px; left: 8px; bottom: 8px; }
  .mode .art .emo { width: 30px; height: 30px; font-size: 16px; right: 8px; bottom: 8px; }
  .mode .info { padding: 10px 11px 12px; }
  .mode h3 { font-size: 15px; }
  .mode p { font-size: 12.5px; }
  .mode .tag, .mode .best { top: 10px; font-size: 10px; padding: 2px 7px; }
  .mode .tag { left: 10px; } .mode .best { right: 10px; }
  .sec { margin-top: 28px; }
}

/* solo / same device / online */
.seg.play-tabs { display: flex; width: 100%; max-width: 480px; margin: 0 0 14px; }
.seg.play-tabs button { flex: 1; padding: 9px 6px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
@media (max-width: 380px) { .seg.play-tabs button { font-size: 13px; padding: 9px 2px; gap: 4px; } }

/* first visit */
.welcome { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px 24px 22px; margin: 18px 0; box-shadow: var(--shadow); overflow: hidden; }
.welcome::before { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 30%; background: var(--accent-soft); transform: rotate(18deg); }
.welcome > * { position: relative; }
.welcome-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; }
.welcome-kicker { margin: 0 0 6px; font: 700 12px system-ui; letter-spacing: .6px; text-transform: uppercase; color: var(--accent-ink); }
.welcome h2 { margin: 0 44px 18px 0; font: 800 clamp(22px, 4vw, 30px)/1.15 system-ui, sans-serif; letter-spacing: -.6px; }
.steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: step; }
.steps li { display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border-radius: 14px; padding: 14px; counter-increment: step; }
.steps li b { font-size: 15px; }
.steps li b::before { content: counter(step) '. '; color: var(--accent); }
.steps li span:last-child { color: var(--muted); font-size: 13px; line-height: 1.4; }
.step-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; font-size: 18px; color: var(--accent); box-shadow: var(--shadow-sm); margin-bottom: 4px; }
.welcome-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-btns .btn { flex: 0 1 auto; }
@media (max-width: 560px) {
  .welcome { padding: 22px 16px 16px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; row-gap: 2px; padding: 10px 12px; }
  .step-ic { grid-row: span 2; margin: 0; align-self: center; }
  .welcome-btns .btn { flex: 1 1 100%; }
}

/* online tab */
.online-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: auto 1fr; gap: 18px 26px; align-items: center; }
.on-me { display: flex; align-items: center; gap: 16px; }
#on-face { width: 104px; height: 104px; border-radius: 50%; background: var(--surface-2); box-shadow: 0 0 0 3px var(--cyan), var(--shadow); cursor: pointer; flex: none; }
.on-me-body { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; width: 170px; }
.on-me-body .btn.tiny { margin-left: 0; }
#on-name { width: 100%; font: 600 16px system-ui, sans-serif; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; outline: none; }
#on-name:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.on-actions { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.on-actions .btn.primary { text-decoration: none; }
.on-actions .join-row input { font-size: 18px; letter-spacing: 5px; padding: 8px; }
.on-actions .fine { margin: 0; font-size: 12px; color: var(--muted); }
.invite { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; }
.invite-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--accent); font-size: 18px; flex: none; }
.invite-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.invite-body b { font-size: 14px; }
.invite-body span { font-size: 12.5px; color: var(--muted); }
.invite .btn.tiny { margin-left: 0; background: var(--surface); flex: none; }
@media (max-width: 640px) {
  .online-card { grid-template-columns: 1fr; padding: 18px 16px; }
  .on-me { justify-content: center; }
  .invite { flex-wrap: wrap; }
  .invite .btn.tiny { flex: 1 1 100%; justify-content: center; }
}

/* jump back in */
.continue { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: -2px 0 14px; font-size: 14px; transition: border-color .15s, transform .15s; max-width: 420px; }
.continue:hover { border-color: var(--line-2); transform: translateY(-1px); }
.continue-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.continue > span:nth-child(2) { flex: 1; color: var(--muted); } .continue b { color: var(--text); }
.continue.hidden, .welcome.hidden, .online-card.hidden { display: none; }
.vs-card { display: flex; flex-direction: column; gap: 14px; }
.vs-slots { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 28px); }
.vs-slot { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(190px, 38vw); }
.vs-slot .btn.tiny { margin-left: 0; }
.vs-slot canvas { width: min(112px, 28vw); height: min(112px, 28vw); border-radius: 50%; background: var(--surface-2); cursor: pointer; }
.vs-slot[data-i="0"] canvas { box-shadow: 0 0 0 3px var(--cyan), var(--shadow); }
.vs-slot[data-i="1"] canvas { box-shadow: 0 0 0 3px var(--pink), var(--shadow); }
.vs-slot input { width: 100%; text-align: center; font: 600 15px system-ui, sans-serif; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; outline: none; }
.vs-x { font: 700 14px/1 system-ui; color: var(--muted); letter-spacing: 1.5px; }
.vs-hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }

/* online lobby (party.html) */
.lobby-logo { font-size: clamp(22px, 5vw, 28px); }
.lobby .vs-card { margin-top: 18px; }
.lobby .vs-slot img { width: min(104px, 26vw); height: min(104px, 26vw); border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.lobby .vs-slot b { font-size: 15px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby .vs-slot.me img { box-shadow: 0 0 0 3px var(--cyan), var(--shadow); }
.lobby .vs-slot.them img { box-shadow: 0 0 0 1px var(--line); opacity: .4; transition: opacity .3s, box-shadow .3s; }
.lobby .vs-slot.them.here img { opacity: 1; box-shadow: 0 0 0 3px var(--pink), var(--shadow); }
.lobby-step { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.lobby-step.hidden { display: none; }
.lobby-step .fine { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.lobby-step .sec { margin: 8px 0 4px; font-size: 17px; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; min-width: 0; text-align: center; font: 700 22px ui-monospace, Consolas, monospace; letter-spacing: 6px; text-transform: uppercase; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; outline: none; }
.room-code { text-align: center; font: 700 clamp(40px, 12vw, 60px)/1.1 ui-monospace, Consolas, monospace; letter-spacing: 10px; color: var(--text); background: var(--surface-2); border-radius: 14px; padding: 14px 0; user-select: all; }
.mode-grid.mini { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mini-mode { appearance: none; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; color: var(--text); font: 600 14px system-ui; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.mini-mode span { font-size: 20px; }
.mini-mode:hover { background: var(--surface-2); }
.mini-mode.want { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
#game { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); z-index: 40; }
#game.hidden { display: none; }
.lobby #lobby.hidden { display: none; }

/* page transitions (src/shared/shell.js adds the classes) */
body.fo-enter > * { animation: hub-in .35s ease-out both; }
@keyframes hub-in { from { opacity: 0; transform: translateY(6px); } }
body.fo-leave > * { transition: opacity .16s ease-in, transform .16s ease-in; opacity: 0; transform: scale(.99); }
@media (prefers-reduced-motion: reduce) { body.fo-enter > *, body.fo-leave > * { animation: none; transition: none; } }

/* voice actor line under the picker */
.voice-credit { margin: -2px 0 0; font-size: 13px; color: var(--muted); }

/* icons in place of emoji */
.mode .art .emo { color: var(--text); }
.mode .art .emo .ic { width: 20px; height: 20px; }
@media (max-width: 520px) { .mode .art .emo .ic { width: 16px; height: 16px; } }
.mini-mode span .ic { width: 22px; height: 22px; color: var(--accent-ink); }
.mode .best .ic { color: var(--gold-ink); }
.seg button .ic { margin-right: 4px; }

/* in-match chat (src/shared/chat.js): floats above the lobby and the game frame */
.chat { position: fixed; left: calc(12px + var(--safe-l)); top: 50%; z-index: 60; }
.chat.hidden { display: none; }
.chat-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; transform: translateY(-50%); }
.chat-btn .ic { width: 22px; height: 22px; }
.chat.open .chat-btn { background: var(--text); color: #fff; }
.chat-dot { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.chat-dot.hidden, .chat-bubble.hidden, .chat-panel.hidden { display: none; }
.chat-bubble { position: fixed; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); max-width: min(420px, 86vw); background: var(--text); color: #fff; font: 500 14px/1.35 system-ui, sans-serif; padding: 9px 14px; border-radius: 14px; box-shadow: var(--shadow-lg); animation: hub-in .25s ease-out both; pointer-events: none; }
.chat-bubble b { color: #ffd9cd; }
.chat-panel { position: fixed; left: calc(12px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); width: min(340px, calc(100vw - 24px)); max-height: min(440px, 62vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.chat-panel header { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.chat-title { flex: 1; font: 700 14px system-ui; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-mute, .chat-close { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: 600 12px system-ui; border-radius: 8px; padding: 5px 9px; cursor: pointer; display: grid; place-items: center; }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.chat-log p { margin: 0; max-width: 85%; padding: 7px 10px; border-radius: 12px; font-size: 14px; line-height: 1.3; background: var(--surface-2); align-self: flex-start; overflow-wrap: anywhere; }
.chat-log p b { display: block; font-size: 11px; color: var(--muted); margin-bottom: 1px; }
.chat-log p.me { align-self: flex-end; background: var(--accent-soft); }
.chat-log p.me b { display: none; }
.chat-log p.note { align-self: center; background: none; color: var(--muted); font-size: 12px; text-align: center; padding: 2px; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); border-top: 1px solid var(--line); scrollbar-width: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick button { flex: none; appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 12px system-ui; border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.chat-quick button:hover { border-color: var(--accent); }
.chat-form { display: flex; gap: 6px; padding: 0 10px 10px; }
.chat-form input { flex: 1; min-width: 0; font: 500 14px system-ui; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 10px; outline: none; color: var(--text); background: var(--surface); }
.chat-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-form .btn { min-height: 0; padding: 8px 14px; font-size: 14px; }
body.hub:has(.welcome:not(.hidden)) .tagline { display: none; }

/* chat bubble styles (src/shared/cosmetics.js): yours on your messages, theirs on theirs */
.chat-log p[data-s="mint"] { background: #d9f7ea; color: #0b5a3c; }
.chat-log p[data-s="sunset"] { background: linear-gradient(135deg, #ffb36b, #ff5f7e); color: #fff; }
.chat-log p[data-s="ocean"] { background: linear-gradient(135deg, #3aa7ff, #1f5fd1); color: #fff; }
.chat-log p[data-s="grape"] { background: linear-gradient(135deg, #b887ff, #7a3cf0); color: #fff; }
.chat-log p[data-s="ink"] { background: #18181b; color: #f4f4f5; }
.chat-log p[data-s="gold"] { background: linear-gradient(135deg, #ffe69a, #f2b01e 55%, #d08a00); color: #4a3000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.chat-log p[data-s="neon"] { background: #120a2a; color: #9ff6ff; box-shadow: 0 0 0 1px #ff4fd8, 0 0 12px rgba(255, 79, 216, .55); text-shadow: 0 0 6px rgba(34, 230, 255, .8); }
.chat-log p[data-s] b { color: inherit; opacity: .75; }

/* the locker: chat bubbles for coins */
.locker { margin-top: 36px; }
.locker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.locker-item { appearance: none; text-align: left; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, transform .15s; }
.locker-item:hover { border-color: var(--line-2); transform: translateY(-1px); }
.locker-item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.locker-item .chat-log { padding: 0; min-height: 0; overflow: visible; }
.locker-item .chat-log p { max-width: 100%; align-self: flex-start; }
.locker-item .li-foot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.locker-item .li-foot b { font-weight: 700; }
.locker-item .li-price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold-ink); }
.locker-item .li-price.owned { color: var(--muted); font-weight: 600; }
.locker-item.poor { opacity: .6; }

/* ---------- sections behind a bottom tab bar: Play · Friends · Ranks · Shop · Me (one thumb on a phone) ---------- */
.hub-wrap { padding-bottom: calc(100px + var(--safe-b)); }
.hub-head .pill.coins { appearance: none; font: inherit; font-weight: 700; cursor: pointer; }
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding: 6px calc(6px + var(--safe-r)) calc(6px + var(--safe-b)) calc(6px + var(--safe-l)); }
.tabbar button { appearance: none; border: 0; background: none; flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0 2px; font: 600 11.5px system-ui, sans-serif; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tabbar button i { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background .18s, color .18s; }
.tabbar button .ic { width: 23px; height: 23px; }
.tabbar button:hover { color: var(--text); }
.tabbar button[aria-current] { color: var(--accent-ink); }
.tabbar button[aria-current] i { background: var(--accent-soft); color: var(--accent); }
.tabbar button:focus-visible { outline: none; } .tabbar button:focus-visible i { box-shadow: 0 0 0 2px var(--accent); }
/* a computer: the same bar, floating */
@media (min-width: 760px) {
  .tabbar { left: 0; right: 0; margin: 0 auto; bottom: calc(14px + var(--safe-b)); width: 500px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 6px; }
}

.view .fine { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.view .fine.center { text-align: center; margin-top: 16px; }
.view > .sec:first-child { margin-top: 22px; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-sm); margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.panel-card h3 { margin: 0; font: 700 17px system-ui, sans-serif; letter-spacing: -.2px; }
.panel-card .row { display: flex; gap: 10px; flex-wrap: wrap; }
.panel-card .row .btn { flex: 1 1 160px; text-decoration: none; justify-content: center; }
.panel-card.empty { align-items: center; text-align: center; border-style: dashed; box-shadow: none; background: transparent; padding: 26px 18px; }
.empty-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-size: 22px; }
#view-friends .invite { margin-top: 4px; }

/* ranks: your bests */
.ranks { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.rank { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; color: var(--text); border-top: 1px solid var(--line); transition: background .15s; }
.rank:first-child { border-top: 0; }
.rank:hover { background: var(--surface-2); }
.rank-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--tint, var(--surface-2)); display: grid; place-items: center; font-size: 19px; flex: none; }
.rank-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.rank b { font: 700 15px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.rank.none b { color: var(--muted); font-weight: 500; font-size: 13px; }
.rank > .ic:last-child { color: var(--line-2); }

/* shop */
.wallet-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; margin-top: 18px; background: linear-gradient(135deg, #fff8e4, #ffe9ad); border: 1px solid #f6dd94; border-radius: 20px; padding: 18px 20px; }
.wallet-ic { grid-row: span 2; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--gold-ink); display: grid; place-items: center; font-size: 28px; box-shadow: var(--shadow-sm); }
.wallet-card div b { font: 800 30px/1 system-ui, sans-serif; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.wallet-card div span { margin-left: 6px; color: var(--gold-ink); font-weight: 700; }
.view .wallet-card .fine { color: #7a5600; }
#view-shop .locker { margin-top: 0; }

/* me: the guest profile */
.me-card { display: flex; align-items: center; gap: 16px; margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-sm); }
#me-face { width: 84px; height: 84px; border-radius: 50%; background: var(--surface-2); box-shadow: 0 0 0 3px var(--cyan), var(--shadow); cursor: pointer; flex: none; }
.me-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.me-tag { align-self: flex-start; font: 700 10.5px system-ui; letter-spacing: .6px; text-transform: uppercase; background: var(--surface-2); color: var(--muted); padding: 2px 8px; border-radius: 999px; }
#me-name { font: 800 22px/1.1 system-ui, sans-serif; letter-spacing: -.4px; overflow-wrap: anywhere; }
.me-code { font-size: 13px; color: var(--muted); }
.me-code code { font: 600 13px ui-monospace, Consolas, monospace; color: var(--text); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; cursor: copy; }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.me-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.me-stats b { font: 800 22px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.me-stats span { font-size: 12px; color: var(--muted); }
.me-save { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: 14px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.me-save .ic { flex: none; margin-top: 2px; color: var(--accent); }
.panel-card.settings { padding: 6px; gap: 0; }
.set-row { appearance: none; border: 0; background: none; width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 12px; font: 600 15px system-ui, sans-serif; color: var(--text); cursor: pointer; border-radius: 14px; text-align: left; }
.set-row + .set-row { box-shadow: 0 -1px 0 var(--line); }
.set-row span { flex: 1; }
.set-row b { color: var(--muted); font-weight: 600; font-size: 14px; }
.set-row:hover { background: var(--surface-2); }
.set-row > .ic:first-child { color: var(--muted); font-size: 18px; }
.set-row > .ic:last-child { color: var(--line-2); }
#view-me .hub-foot { margin-top: 28px; }

/* a phone: the face card goes compact, so the games show sooner */
@media (max-width: 560px) {
  .tagline { margin: 8px 0 16px; font-size: 15px; }
  .target-card { display: grid; grid-template-columns: 92px 1fr; column-gap: 16px; row-gap: 10px; align-items: center; padding: 16px; }
  .face-col { grid-row: 1 / span 2; align-self: center; }
  #face-preview { width: 92px; height: 92px; }
  .target-body { display: contents; }
  .target-body > label { grid-column: 2; align-self: end; }
  .target-body > #name { grid-column: 2; align-self: start; }
  .target-body > :not(label):not(#name) { grid-column: 1 / -1; }
  .me-card { padding: 16px; }
  #me-face { width: 72px; height: 72px; }
}
.tabbar .ic { color: inherit; } /* not the gold trophy and coin used elsewhere */
@media (min-width: 760px) { #view-friends, #view-ranks, #view-me { max-width: 640px; margin: 0 auto; } }

/* a phone: framing the face is a bottom sheet, in reach of a thumb (and above the tab bar) */
#scr-crop { z-index: 45; }
@media (max-width: 560px) {
  #scr-crop { align-items: flex-end; padding: 0; }
  #scr-crop .card { width: 100%; border-radius: 24px 24px 0 0; border-bottom: 0; padding: 14px 18px calc(18px + var(--safe-b)); animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1) both; }
  #scr-crop .card::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 10px; }
  #scr-crop .card h2 { margin-top: 0; }
}
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { #scr-crop .card { animation: none; } }

.hub-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.hub-foot .foot-links { margin-top: 10px; }

/* privacy and terms: plain reading pages */
body.doc-page .hub-wrap { max-width: 720px; padding-bottom: calc(40px + var(--safe-b)); }
.doc .hub-head .logo { text-decoration: none; font-size: 24px; }
.doc .hub-head .btn.tiny { margin-left: auto; text-decoration: none; }
.doc h1 { margin: 28px 0 4px; font: 800 clamp(28px, 6vw, 36px)/1.1 system-ui, sans-serif; letter-spacing: -.8px; }
.doc .doc-date { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.doc .doc-lead { font-size: 17px; line-height: 1.5; background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; }
.doc h2 { margin: 30px 0 8px; font: 700 20px system-ui, sans-serif; letter-spacing: -.3px; }
.doc h3 { margin: 20px 0 6px; font: 700 16px system-ui, sans-serif; }
.doc p, .doc li { font-size: 15.5px; line-height: 1.6; color: var(--text); }
.doc ul { padding-left: 22px; margin: 8px 0; }
.doc li { margin: 4px 0; }
.doc a { color: var(--accent-ink); }
.doc .fill { background: #fff2b8; border-radius: 4px; padding: 0 4px; font-weight: 600; }
.doc .hub-head .logo, .doc .hub-head .btn { color: var(--text); }
