/* Friends, the notification bell and the reminder toast (js/social.js, js/pages/friends.js, js/pages/player.js).
   Calm by rule (a friend of the owner, 27 Nov 2026: "lots of things to read or happening on the screen"):
   one toast a visit at most, a short slide in and nothing else that moves, crimson only for the one action,
   no new always-visible block on any page. Every box fits its content; long lists are summed up ("3 more"). */

/* ---------- the reminder toast: a small card at the foot of the window, with a close button ---------- */
.nt-toast { position: fixed; z-index: 140; right: 20px; bottom: 20px; width: min(360px, calc(100vw - 24px)); display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 8px 12px 12px; border-radius: 14px; background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
  animation: nt-in .22s var(--ease) both; }
.nt-toast .nt-pic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-3); color: var(--text-2); overflow: hidden; }
.nt-toast .nt-pic .ico { width: 22px; height: 22px; }
.nt-toast .nt-pic .medal { width: 40px; }
.nt-toast .nt-pic .tile-av { width: 44px; height: 44px; border-radius: 12px; display: block; }
.nt-text { min-width: 0; display: grid; gap: 2px; }
.nt-text b { font-size: 15px; font-weight: var(--w-title); line-height: 1.25; }
.nt-text a, .nt-text span { font-size: 13px; font-weight: var(--w-meta); color: var(--text-3); line-height: 1.3; }
.nt-text a { color: var(--accent-hi); text-decoration: none; font-weight: var(--w-label); }
.nt-text a:hover { text-decoration: underline; }
.nt-x { align-self: start; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer; }
.nt-x:hover { background: var(--panel-3); color: var(--text); }
.nt-x:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 1px; }
.nt-x .ico { width: 18px; height: 18px; }
/* a game asked for now: the one toast with buttons (it is a question, and it waits less than a minute) */
.nt-toast.ask { grid-template-columns: 44px minmax(0, 1fr) auto; }
.nt-toast .nt-acts { grid-column: 2 / -1; display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.nt-toast .nt-acts .nt-time { margin-left: auto; margin-right: 8px; font-size: 12.5px; font-weight: var(--w-meta); color: var(--text-3); font-variant-numeric: tabular-nums; }
.nt-toast.out { opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s; }
@keyframes nt-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 720px) { .nt-toast { left: 12px; right: 12px; bottom: calc(76px + var(--dock-h, 0px) + env(safe-area-inset-bottom)); width: auto; } }   /* (--dock-h: the game's row of controls, js/pages/play.js) */
@media (prefers-reduced-motion: reduce) { .nt-toast, .nt-toast.out { animation: none; transition: none; transform: none; } }

/* ---------- the bell: one place for requests, "your move" and reminders ---------- */
.bell-btn { position: relative; }
.bell-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: var(--w-title); display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
/* on a phone the bell sits at the right of the top bar */
.top-bell { display: none; }
@media (max-width: 720px) {
  .top-bell { display: grid; place-items: center; position: fixed; z-index: 31; top: calc(6px + env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; }
  .top-bell .ico { width: 22px; height: 22px; }
  .top-bell .bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; box-shadow: 0 0 0 2px var(--bg); }
}

/* the bell's panel (a side panel, js/sheet.js) */
.nt-panel { display: grid; gap: 18px; }
.nt-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nt-top h2 { font: var(--w-title) 20px/1.2 var(--font-display); margin: 0; }
.nt-group { display: grid; gap: 8px; }
.nt-group > h3 { margin: 0 0 2px; }
.nt-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px 10px 10px; border-radius: 12px; background: var(--panel-2); }
.nt-item .nt-pic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--text-2); overflow: hidden; }
.nt-item .nt-pic .tile-av { width: 40px; height: 40px; display: block; }
.nt-item .nt-pic .medal { width: 36px; }
.nt-item .nt-pic .ico { width: 20px; height: 20px; }
.nt-item .nt-text b { font-size: 14.5px; }
.nt-item .nt-acts { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.nt-more { justify-self: start; font-size: 13.5px; }
.nt-empty { text-align: center; color: var(--text-3); padding: 28px 0; }

/* ---------- people: a picture, a name, a title and a rating ---------- */
.person { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; color: inherit; text-decoration: none; }
.person .tile-av { width: 48px; height: 48px; border-radius: 12px; display: block; overflow: hidden; }
.person-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.person-name b { font-size: 16px; font-weight: var(--w-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); font-weight: var(--w-meta); margin-top: 2px; }
.person-meta .tag { color: var(--accent-hi); font-weight: var(--w-label); }

/* the friends page */
.fr { max-width: 760px; }
.fr .page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.fr-list { display: grid; gap: 8px; }
.fr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.fr-row .btn-row { flex-wrap: nowrap; }
.fr-row .btn .ico { width: 16px; height: 16px; }
.fr-req { background: color-mix(in srgb, var(--panel-2) 70%, var(--panel)); }
.fr-sec { margin-top: 26px; }
.fr-sec > h2 { margin: 0 0 10px; }
.fr-add { display: grid; gap: 14px; }
.fr-add .field { display: flex; gap: 8px; }
.fr-add input { flex: 1; min-width: 0; height: var(--btn-h); padding: 0 12px; border-radius: var(--btn-r); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: var(--w-body) 15px var(--font); }
.fr-add .or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; }
.fr-add .or::before, .fr-add .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 560px) {
  .fr-row { padding: 10px 6px 10px 10px; gap: 8px; }
  .fr-row:not(.fr-req) .btn.small:not(.icon) { width: var(--btn-h-sm); padding: 0; }      /* Challenge: its icon only (the label stays for screen readers) */
  .fr-row:not(.fr-req) .btn.small:not(.icon) .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fr-req .btn-row { grid-column: 1 / -1; justify-content: flex-end; }
  .fr-req { grid-template-columns: minmax(0, 1fr); }
}

/* a player's page (a friend's, or anyone's by link): picture, name, ratings; garden and medals if they show them */
.pl { max-width: 980px; }
.pl-head { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.pl-head .tile-av { width: 112px; height: 112px; border-radius: 18px; display: block; overflow: hidden; box-shadow: 0 0 0 2px var(--gold); }
.pl-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-name h1 { margin: 0; }
.pl-sub { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-3); font-size: 13.5px; font-weight: var(--w-meta); }
.pl-acts { display: flex; gap: 8px; align-items: center; }
.pl-cards { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-top: 24px; align-items: start; }
.pl-card { padding: 16px; display: grid; gap: 12px; align-content: start; }
.pl-card h2 { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pl-card h2 small { font-size: 13px; font-weight: var(--w-meta); color: var(--text-3); text-transform: none; letter-spacing: 0; }
/* the friend's garden on its own sheet, as on Home's card (garden-highlight.css .gh-sheet): cream by day; at night,
   when the garden is drawn in its night blues, a dark garden green. The drawing's own sheet is not shown. */
.pl-garden { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: #f6ecd4; box-shadow: inset 0 0 0 1px rgba(60, 50, 30, .10); }
.pl-garden[data-phase="night"] { background: linear-gradient(160deg, #27382e, #1b2620); box-shadow: inset 0 0 0 1px rgba(170, 220, 150, .14); }
.pl-garden svg { display: block; width: 100%; height: 100%; max-height: none; border-radius: 0; }
.pl-garden .gd-nextland, .pl-garden .gd-sheet-bg, .pl-garden .gd-hint { display: none; }
.pl-medals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pl-medals .medal-cell { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: var(--panel-2); padding: 8px; }
.pl-medals .medal-more { font: var(--w-title) 18px/1 var(--font-display); color: var(--text-2); }
.pl-private { color: var(--text-3); font-size: 14px; }
@media (max-width: 860px) { .pl-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .pl-head { grid-template-columns: 80px minmax(0, 1fr); gap: 14px; }
  .pl-head .tile-av { width: 80px; height: 80px; border-radius: 14px; }
  .pl-acts { grid-column: 1 / -1; }
  .pl-acts .btn.primary { flex: 1; }
}

/* the "what others see" switches (own profile) */
.pv { display: grid; gap: 16px; }
.pv .toggle { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-size: 15px; }
.pv .toggle small { display: block; font-size: 13px; font-weight: var(--w-meta); color: var(--text-3); margin-top: 2px; }
.pv-list { display: grid; gap: 8px; }

/* a game request: daily or now */
.gr { display: grid; gap: 18px; }
.gr .person { margin-bottom: 2px; }
.gr-field { display: grid; gap: 8px; }
.gr-field > span { font-size: 13px; font-weight: var(--w-label); color: var(--text-2); }
.gr .seg button { padding: 9px 8px; font-size: 14px; }
.gr-note { font-size: 13px; color: var(--text-3); margin: 0; }
.gr-wait { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 18px 0; }

/* ---------- play a friend with a game code (js/pages/friend-game.js) ----------
   The board stays the main content; the panel beside it shows the code, or takes the code typed in. */
.fc { display: grid; gap: 16px; }
.fc-label { font-size: 13px; font-weight: var(--w-label); color: var(--text-2); }
.fc-code { display: flex; gap: 8px; justify-content: center; margin: 2px 0; }
.fc-code b, .fc-code input { width: 52px; height: 64px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1.5px var(--line);
  font: var(--w-display) 34px/1 var(--font-display); color: var(--text); text-align: center; text-transform: uppercase; letter-spacing: 0; }
.fc-code input { border: 0; padding: 0; caret-color: var(--accent-hi); }
.fc-code input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-hi); }
.fc-code.bad input { box-shadow: inset 0 0 0 2px var(--danger); }
.fc-how { margin: 0; text-align: center; font-size: 14px; color: var(--text-2); }
.fc-wait { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; color: var(--text-3); font-weight: var(--w-meta); }
.fc-wait::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.fc-extras { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.fc-qr { justify-self: center; display: grid; gap: 6px; justify-items: center; }
.fc-qr svg { width: 168px; height: 168px; display: block; border-radius: 10px; background: #fff; padding: 10px; }
.fc-qr small { font-size: 12.5px; color: var(--text-3); }
.fc-err { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 14%, var(--panel)); color: var(--text); font-size: 14px; }
.fc-note { margin: 0; font-size: 13px; color: var(--text-3); text-align: center; }
@media (max-width: 400px) { .fc-code { gap: 6px; } .fc-code b, .fc-code input { width: 46px; height: 58px; font-size: 30px; } }
/* on a phone, before the game starts, the code (or the box to type it) comes first and the board waits under it */
@media (max-width: 980px) { .play.fc-pre .play-panel { order: -1; } }

/* the game itself (js/pages/friend.js): the friend's clock above the board, yours below */
.fl .strip .av.fl-empty { opacity: .35; }
.fl-clock { margin-left: auto; min-width: 74px; padding: 6px 10px; border-radius: 10px; background: var(--panel-2); color: var(--text-2); text-align: center;
  font: var(--w-title) 20px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.fl-clock.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.fl-clock.low.on { color: var(--danger); }
/* a guest's "Choose your own name", under "You play as guest48213" once the game is over: a quiet link on its own line,
   its tap area as tall as a finger (44 px) without making the strip taller */
.fl-own { display: block; width: fit-content; padding: 13px 0; margin: -13px 0; font-size: 12.5px; line-height: 18px; }
.fl-title { margin: 0; font: var(--w-title) 18px/1.2 var(--font-display); }
.fl .panel-head { display: flex; align-items: center; gap: 10px; }
.fl .panel-head .ico { width: 20px; height: 20px; color: var(--text-3); }
.fl-offer { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--panel-2); }
.fl-after { flex-wrap: wrap; }
/* the end of the game and the resign question on this page: the same look as a daily game's (css/daily.css, which this
   page does not load: without these the heading ran into the line after it, "You wonBlack resigned.") */
.fl .dl-state { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); }
.fl .dl-state b { font-size: 17px; font-weight: var(--w-title); }
.fl .dl-state span { color: var(--text-2); font-size: 14px; }
.fl .dl-state.good { background: color-mix(in srgb, var(--ok) 20%, var(--panel)); }
.fl .dl-state.bad { background: color-mix(in srgb, var(--red) 20%, var(--panel)); }
.fl .dl-ask { display: flex; flex-direction: column; gap: 8px; }
.fl .dl-rate { font-weight: var(--w-label); }
.fc-qr svg.qr { padding: 0; }

/* the bell's panel: a guest's one line, the switch for reminder cards */
.nt-lock { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px; border-radius: 12px; background: var(--panel-2); color: var(--text-2); font-size: 14px; }
.nt-lock .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--text-3); }
.nt-switch { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-size: 14.5px; }
.nt-switch small { display: block; font-size: 12.5px; font-weight: var(--w-meta); color: var(--text-3); margin-top: 2px; }
.nt-item .nt-text a { color: inherit; text-decoration: none; }
.nt-item .nt-text a:hover b { text-decoration: underline; }

/* a guest's line on Friends and on a player's page; an empty list */
.fr-lock { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px; margin-top: 18px; }
.fr-lock > .ico { width: 24px; height: 24px; color: var(--text-3); margin-top: 2px; }
.fr-lock b { font-size: 16px; font-weight: var(--w-title); }
.fr-lock p { margin: 6px 0 0; color: var(--text-2); font-size: 14.5px; }
.fr-lock .btn-row { margin-top: 12px; }
.fr-empty { padding: 16px 18px; }
.fr-empty p { margin: 0; color: var(--text-2); }
#frMsg.bad { color: var(--danger); }
/* a player's page: one card alone, your page as others see it */
.pl-cards.one { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.pl-as { display: flex; gap: 8px; align-items: center; margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); color: var(--text-2); font-size: 14px; }
.pl-as .ico { width: 18px; height: 18px; }
.pl-private { margin-top: 20px; }
/* what others see: three choices for the garden and the medals */
.pv-row { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); }
.pv-row b { font-size: 15px; font-weight: var(--w-label); }
.pv-row small { display: block; font-size: 13px; font-weight: var(--w-meta); color: var(--text-3); margin-top: 2px; }
.pv-row .seg button { padding: 8px 6px; font-size: 13.5px; }
.pv .pv-list .btn { justify-content: flex-start; }
.rp-text { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: var(--w-body) 15px/1.4 var(--font); resize: vertical; }
.gr-wait .nt-time { font: var(--w-title) 22px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--text-2); }
.gr-wait b { font-size: 17px; }
.gr-wait span { color: var(--text-3); font-size: 14px; }

/* rated or casual (the sender picks): a guest's Rated switched off; the joiner's look before a rated game */
.seg button[disabled] { opacity: .45; cursor: not-allowed; }
.fl-asks { margin: 0; text-align: center; font-size: 17px; }
.fl-facts { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 8px; border-radius: 12px; background: var(--panel-2); }
.fl-facts li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--text-2); }
.fl-facts .ico { width: 16px; height: 16px; color: var(--ok); flex: none; }
.fl-rate { margin: 0; font-size: 14.5px; color: var(--text-2); }
.fl-rate b { font: var(--w-title) 18px/1 var(--font-display); color: var(--text); }
.fl-rate .rdelta.up { color: var(--ok); } .fl-rate .rdelta.down { color: var(--danger); }
.gr-tag { display: inline-flex; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: var(--w-label); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-hi); }
