/* Accounts, chat, people panel, parental controls */
#social { position: fixed; inset: 0; pointer-events: none; z-index: 40; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; color: var(--fg); }
#social > * { pointer-events: auto; }
#social input, #social select, #social textarea { font: inherit; color: #111; background: #f4f6f9; border: 1px solid #b9c3cf; border-radius: 8px; padding: 6px 8px; min-width: 0; }
#social button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 6px 10px; background: var(--bg2); color: var(--fg); }
#social button:hover { filter: brightness(1.15); }
#social button.primary { background: var(--accent); color: #1b1b1b; font-weight: 600; }
#social button.warn { background: #7a2a2a; }
#social button.small { padding: 3px 8px; font-size: 12px; }
#social button.link { background: none; padding: 0; color: #9fd0ff; text-decoration: underline; }
#social .hint, #social .muted { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
#social .error { color: #ff8f8f; min-height: 1.2em; }
#social .note { color: #ffd479; font-size: 13px; }
#social .ok { color: #8be08b; }
#social .safety { font-size: 12px; color: var(--muted); border-top: 1px solid rgba(255,255,255,.12); padding-top: 8px; }
#social label { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
#social label.check { flex-direction: row; align-items: center; gap: 8px; }
#social .row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
#social .row input { flex: 1; }
#social .tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
#social .tabs button.active { background: var(--accent2); }

/* sign-in screen: fully opaque so nothing of the world is visible before you spawn */
#auth { position: fixed; inset: 0; display: grid; place-items: center; padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); background: radial-gradient(circle at 30% 20%, #1d3557, #0b1220 70%); z-index: 60; overflow: auto; }
#auth[hidden] { display: none; }
#auth .auth-box { width: min(420px, 100%); background: rgba(14, 20, 30, .92); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#auth h1 { margin: 0 0 4px; font-size: 24px; } #auth .sub { color: var(--muted); margin: 0 0 14px; }
#auth form button[type=submit] { width: 100%; margin-top: 10px; padding: 10px; }

/* in-game */
#socialHud[hidden] { display: none; }
#socialHud .chat { position: fixed; left: calc(12px + var(--sal)); bottom: calc(130px + var(--sab)); width: min(340px, calc(100vw - 24px)); background: var(--bg); border-radius: 12px; padding: 8px; }
#social .chat-title { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
#social .chat-log { max-height: 150px; overflow-y: auto; font-size: 13px; overflow-wrap: anywhere; }
#social .chat-row b { color: #9fd0ff; } #social .chat-row b.staff { color: #ffd479; }
#social .chat-row.mine { text-align: end; color: #cfe6ff; }
#social .chat-form { display: flex; gap: 6px; margin-top: 6px; }
#social .chat-form input, #social .chat-form select { flex: 1; }
#social .chat-note { font-size: 12px; color: #ffd479; margin: 6px 0 0; }
#social.offline #socialHud .chat::before { content: "⚠ reconnecting…"; color: #ff8f8f; font-size: 12px; }
#socialHud .hud-buttons { position: fixed; top: calc(244px + var(--sat)); right: calc(12px + var(--sar)); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
#socialHud .chat-toggle { display: none; position: relative; }
#socialHud .chat-toggle.unread::after { content: ""; position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a5a; }
#socialHud .hud-btn { background: var(--bg); padding: 8px 12px; border-radius: 10px; }
#socialHud .hud-btn.on { background: #1f7a3a; }
#peoplePanel { position: fixed; top: calc(64px + var(--sat)); right: calc(12px + var(--sar)); width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 170px); max-height: calc(100dvh - 90px - var(--sat) - var(--sab)); z-index: 2; overflow-y: auto; background: var(--bg); border-radius: 12px; padding: 10px; }
#peoplePanel[hidden] { display: none; }
#peoplePanel .close { position: absolute; top: 6px; inset-inline-end: 6px; }
#social ul.people { list-style: none; margin: 0 0 8px; padding: 0; }
#social ul.people li { display: flex; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
#social ul.people li > span:first-child, #social ul.people li > button.link { flex: 1; }
#social ul.people small.on { color: #8be08b; }
#social h4, #social h5, #social h6 { margin: 10px 0 4px; } #social h6 { color: var(--muted); font-weight: 600; }
#social .child-card { border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
#social .player-menu, #social .dialog { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: rgba(14, 20, 30, .96); border-radius: 12px; padding: 14px; width: min(320px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); z-index: 70; }
#social .player-menu h4, #social .dialog h4 { margin: 0 0 6px; }
#social .pm-box { position: fixed; left: 364px; bottom: 210px; width: min(300px, calc(100vw - 24px)); background: var(--bg); border-radius: 12px; padding: 8px; }
@media (max-width: 760px) { #social .pm-box { left: 12px; bottom: 380px; } }
/* touch play: the chat folds away behind 💬 so it doesn't cover the controls; HUD buttons are icons next to / under the minimap */
body.touch #socialHud .chat-toggle { display: block; }
body.touch #socialHud .hud-btn .lbl { display: none; }
body.touch #socialHud .hud-btn { min-width: 44px; min-height: 44px; font-size: 18px; padding: 6px 10px; }
body.touch #socialHud .chat { display: none; bottom: auto; top: calc(120px + var(--sat)); left: calc(12px + var(--sal)); width: min(340px, calc(100vw - 160px)); }
body.touch #social.chat-open #socialHud .chat { display: block; }
/* buttons in a column under the minimap; only a phone held sideways (little height) puts them in a row beside it */
@media (max-width: 700px), (max-height: 500px) { #socialHud .hud-buttons { top: calc(180px + var(--sat)); } }
@media (max-height: 500px) and (orientation: landscape) { body.touch #socialHud .hud-buttons { top: calc(58px + var(--sat)); right: calc(132px + var(--sar)); flex-direction: row; } }
#social .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; flex: none; }
#social .swatch.big { width: 26px; height: 26px; }
#social .pid { color: var(--muted); font-variant-numeric: tabular-nums; } #social .pid.big { color: var(--fg); font-weight: 700; font-size: 16px; }
#social .id-card { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px; }
#social .id-line { display: flex; gap: 8px; align-items: baseline; } #social .id-line b { color: var(--muted); font-weight: 600; min-width: 98px; font-size: 12px; }
#social .row select { flex: 1; }

/* nameplates above other players (styles in style.css) */
#nameTags { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
#social .chat-policy { font-size: 11px; color: var(--muted, #9fb0c4); margin: 4px 0 0; opacity: 0.85; }
