/* The social layer (wave 2 "client <-> server", docs/PLAN.md item 5): account,
 * cloud sync, friends, invites, visits, gifts, boards. Same pixel frames and
 * palette as index.html; everything here is drawn by web/a/social.js. */
.soc-in { width: 100%; min-height: 52px; padding: 0 14px; background: var(--panel); color: var(--fg); border: 0; outline: none;
  font: 16px/1.3 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; user-select: text; -webkit-user-select: text; touch-action: manipulation;
  box-shadow: 0 -2px 0 0 var(--edge), 0 2px 0 0 var(--edge), -2px 0 0 0 var(--edge), 2px 0 0 0 var(--edge); }
.soc-in:focus { box-shadow: 0 -2px 0 0 var(--teal), 0 2px 0 0 var(--teal), -2px 0 0 0 var(--teal), 2px 0 0 0 var(--teal); }
.soc-in::placeholder { color: #4f6a74; }
.soc-lbl { color: var(--muted); font-size: 13px; padding: 2px 2px 0; }
.soc-btn { min-height: 52px; width: 100%; padding: 8px 14px; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: var(--teal); color: #05141a; transition: transform .08s, opacity .15s;
  box-shadow: 0 -2px 0 0 #5fb8aa, 0 2px 0 0 #5fb8aa, -2px 0 0 0 #5fb8aa, 2px 0 0 0 #5fb8aa, 0 6px 0 -2px var(--depth); }
.soc-btn:active { transform: translateY(2px); }
.soc-btn.alt { background: var(--panel2); color: var(--fg);
  box-shadow: 0 -2px 0 0 var(--edge2), 0 2px 0 0 var(--edge2), -2px 0 0 0 var(--edge2), 2px 0 0 0 var(--edge2), 0 6px 0 -2px var(--depth); }
.soc-btn.tg { background: #2aa3d9; color: #fff; box-shadow: 0 -2px 0 0 #1d7fae, 0 2px 0 0 #1d7fae, -2px 0 0 0 #1d7fae, 2px 0 0 0 #1d7fae, 0 6px 0 -2px var(--depth); }
.soc-btn.danger { background: #3a1614; color: var(--red); box-shadow: 0 -2px 0 0 #6b2a25, 0 2px 0 0 #6b2a25, -2px 0 0 0 #6b2a25, 2px 0 0 0 #6b2a25; }
.soc-btn[disabled] { opacity: .45; pointer-events: none; }
.soc-btn svg.i { color: inherit; }
.soc-seg { display: flex; gap: 8px; }
.soc-seg button { flex: 1; min-height: 48px; padding: 6px 8px; background: var(--panel); color: var(--muted);
  box-shadow: 0 -2px 0 0 var(--edge), 0 2px 0 0 var(--edge), -2px 0 0 0 var(--edge), 2px 0 0 0 var(--edge); }
.soc-seg button.on { color: #05141a; background: var(--teal); box-shadow: 0 -2px 0 0 #5fb8aa, 0 2px 0 0 #5fb8aa, -2px 0 0 0 #5fb8aa, 2px 0 0 0 #5fb8aa; }
.soc-err { color: var(--red); font-size: 14px; min-height: 0; padding: 0 2px; }
.soc-err:empty { display: none; }
.soc-ok { color: var(--teal); font-size: 14px; padding: 0 2px; }
.soc-ok:empty { display: none; }
.soc-form { display: flex; flex-direction: column; gap: 10px; }
.soc-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--panel);
  box-shadow: 0 -2px 0 0 var(--edge), 0 2px 0 0 var(--edge), -2px 0 0 0 var(--edge), 2px 0 0 0 var(--edge); }
.soc-card .big { color: var(--fg); font-size: 18px; }
.soc-card .sub { color: var(--muted); font-size: 13px; line-height: 1.35; }
.row .val.ok { color: var(--teal); }
.row.picked { background: #12303c; box-shadow: 0 -2px 0 0 var(--teal), 0 2px 0 0 var(--teal), -2px 0 0 0 var(--teal), 2px 0 0 0 var(--teal); }
.row.dim { opacity: .55; }

/* friends */
.soc-fr { display: flex; flex-direction: column; gap: 0; }
.soc-fr > .row { gap: 12px; }
.soc-fr .av { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; color: #05141a; font-family: 'Pixel', monospace; font-size: 16px; line-height: 16px; }
.soc-fr .acts { display: none; gap: 8px; padding: 10px 0 4px; flex-wrap: wrap; }
.soc-fr.open .acts { display: flex; }
.soc-fr .acts .soc-btn { flex: 1 1 120px; width: auto; min-height: 48px; font-size: 14px; }
.soc-badge { color: var(--amber); font-size: 12px; }

/* the sync chip in the status bar */
#soc-sync { color: var(--muted); }
#soc-sync[data-s="guest"] { color: var(--fg); }
#soc-sync[data-s="ok"] { color: var(--teal); }
#soc-sync[data-s="saving"], #soc-sync[data-s="pending"] { color: var(--amber); }
#soc-sync[data-s="saving"] svg { animation: soc-blink .8s steps(2) infinite; }
#soc-sync[data-s="error"], #soc-sync[data-s="conflict"] { color: var(--red); }
#soc-sync[data-s="offline"] { color: #4f6a74; }
@keyframes soc-blink { 50% { opacity: .35; } }

/* the invite: link, share, QR */
.soc-link { font-size: 13px; color: var(--muted); word-break: break-all; padding: 8px 10px; background: #08141b; user-select: text; -webkit-user-select: text; }
.soc-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: var(--panel); }
.soc-qr canvas { image-rendering: pixelated; image-rendering: crisp-edges; width: 200px; height: 200px; background: #fff; }

/* boards */
.soc-lb .row { min-height: 52px; }
.soc-lb .rk { width: 32px; flex: none; text-align: center; color: var(--amber); }
.soc-lb .row.me { background: #12303c; box-shadow: 0 -2px 0 0 var(--teal), 0 2px 0 0 var(--teal), -2px 0 0 0 var(--teal), 2px 0 0 0 var(--teal); }
.soc-lb .sc { color: var(--teal); }

/* the dialog: above sheets and above the loading screen (a choice before the tank starts) */
#soc-dlg { position: fixed; inset: 0; z-index: 45; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(2, 6, 10, .72); }
#soc-dlg.on { display: flex; }
#soc-dlg .box { width: min(440px, 100%); max-height: 100%; overflow-y: auto; touch-action: pan-y; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 16px; background: var(--bg2);
  box-shadow: 0 -2px 0 0 var(--edge2), 0 2px 0 0 var(--edge2), -2px 0 0 0 var(--edge2), 2px 0 0 0 var(--edge2), 0 20px 60px rgba(0,0,0,.6); }
#soc-dlg h2 { margin: 0; font-weight: 400; color: var(--teal); }
#soc-dlg .bd { color: var(--fg); }
#soc-dlg .btns { display: flex; flex-direction: column; gap: 12px; }
#soc-dlg .btns .soc-btn { flex-direction: column; gap: 2px; }
#soc-dlg .btns .soc-btn small { font-size: 12px; opacity: .8; }
#soc-dlg .note { color: var(--muted); font-size: 13px; }
#soc-dlg .note:empty { display: none; }

/* visit mode: a friend's tank, read-only */
body.visit #coins, body.visit #light, body.visit #care, body.visit #menu, body.visit #soc-sync, body.visit #lang { display: none !important; }
#home { display: none; }
body.visit #home { display: flex; }
body.visit #feed { color: #05141a; background: var(--amber); }
body.visit #hint { color: var(--amber); }
body.visit #hint svg.i { color: var(--amber); }
#soc-visit { display: none; }
body.visit #soc-visit { display: flex; align-items: center; gap: 8px; color: var(--amber); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#load .soc-btn { width: auto; min-width: 160px; }

/* a guest's soft prompt to save the tank: a card at the bottom, the game goes on under it */
#soc-nudge { position: fixed; z-index: 24; left: 50%; bottom: calc(var(--sab) + 12px); width: min(460px, calc(100vw - 24px)); display: grid;
  grid-template-columns: 40px 1fr; gap: 10px 12px; padding: 14px; background: var(--bg2); opacity: 0; pointer-events: none; visibility: hidden;
  transform: translate(-50%, 24px); transition: opacity .25s, transform .3s var(--ease), visibility 0s linear .3s;
  box-shadow: 0 -2px 0 0 var(--teal), 0 2px 0 0 var(--teal), -2px 0 0 0 var(--teal), 2px 0 0 0 var(--teal), 0 16px 40px rgba(0,0,0,.55); }
#soc-nudge.on { opacity: 1; pointer-events: auto; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .3s var(--ease), visibility 0s; }
#soc-nudge .ic { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: #0e2531; color: var(--teal); }
#soc-nudge .tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#soc-nudge .tx b { font-weight: 400; color: var(--teal); }
#soc-nudge .tx .bd { font-size: 14px; line-height: 1.4; }
#soc-nudge .tx small { color: var(--muted); font-size: 12px; }
#soc-nudge .bt { grid-column: 1 / 3; display: flex; gap: 10px; }
#soc-nudge .bt .soc-btn { flex: 1; min-height: 48px; }
body.visit #soc-nudge { display: none; }
