/* vanner.css — the Vänner tab: the code card, the weekly ranking, a friend's page.
   Load AFTER app.css. No colour is hardcoded: every one is a token from app.css,
   so the whole tab flips with prefers-color-scheme like the rest of the app. */

/* ============================================================ 1. head */
.vanh { margin: 14px 0 2px; }
.vanp { margin: 0 0 14px; }

/* Your own code. The code itself is the largest thing in the card — it is what
   gets read out loud to someone sitting next to you. */
.vankod { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px 13px; background: var(--card, var(--paper)); }
.vankod .etikett { display: block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--granite); }
.vankod b { display: block; font-size: 1.75rem; letter-spacing: .16em; line-height: 1.1; font-weight: 500; }
.vankod .knappar { display: flex; flex-direction: column; gap: 6px; flex: none; }
.vankod .knappar button { white-space: nowrap; }

/* Add a friend. The field is wide; the button never wraps under it. */
.vanadd { display: flex; gap: 8px; margin: 12px 0 4px; }
.vanadd input { flex: 1; min-width: 0; }
.vanadd button { flex: none; }
.vanmsg { min-height: 1.2em; margin: 4px 0 16px; font-size: .86rem; }
.vanmsg.fel { color: var(--bad-ink, var(--bad)); }
.vanmsg.ok { color: var(--ok-ink, var(--ok)); }

.vanvecka { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 8px; }
.vanvecka h2 { margin: 0; }

/* ============================================================ 2. the ranking */
.vanlista { display: grid; gap: 6px; }
.vanrad { display: grid; grid-template-columns: 22px 46px 1fr auto; align-items: center; gap: 10px;
  width: 100%; text-align: left; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 9px 12px 9px 9px; background: var(--card, var(--paper)); color: var(--ink); }
.vanrad:hover { border-color: var(--blue); }
.vanrad:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.vanrad.jag { border-color: var(--blue); }
.vanplats { text-align: center; font-size: 1.05rem; color: var(--granite); }
.vanavatar { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.vanavatar svg { width: 100%; height: 100%; display: block; }
.vanavatar .bokstav { font-size: 1.1rem; font-weight: 600; color: var(--granite); }
.vannamn { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.vannamn b { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vandu { font-style: normal; font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue-ink, var(--blue)); background: var(--blue-soft); border-radius: 6px; padding: 1px 6px; flex: none; }
.vanbar { display: block; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; }
.vanbar i { display: block; height: 100%; border-radius: 4px; background: var(--leaf, var(--ok)); }
.vanrad.jag .vanbar i { background: var(--blue); }
.vanpoang { display: grid; justify-items: end; gap: 1px; }
.vanpoang b { font-size: 1.3rem; font-weight: 500; line-height: 1; }
.vanpoang small { font-size: .7rem; color: var(--granite); }
.vanrad.osynkad { opacity: .78; }

/* Nobody added yet: the invitation comes first, the code under it. */
.vantom { border: 1.5px dashed var(--blue); background: var(--blue-soft); border-radius: 14px;
  padding: 14px 15px; display: grid; gap: 4px; margin-bottom: 12px; }
.vantom b { font-size: 1.15rem; font-weight: 500; }
.vantom span { color: var(--granite); line-height: 1.45; }

/* ============================================================ 3. a friend's page */
.vanhead { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.vanhead .vanavatar { width: 62px; height: 62px; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.vanhead h1 { margin: 0; font-size: 1.6rem; }
.vanhead .muted { font-size: .85rem; }

/* The three pictures. Each box's height is the aspect ratio of the renderer that
   fills it — they are NOT the same height, and must not be made so:
     husdjur  sceneSVG is ~400×250 with the pet standing on the ground line
     trädgård miniSVG is W×58; W is measured from the box, as paintBanner does
     Ordskär  ritaVarld is 1000×330
   Overriding a height here crops a scene that was composed to fit. */
.vanvarld { display: grid; gap: 12px; }
.vanbild { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card, var(--paper)); }
.vanbild .ram { position: relative; overflow: hidden; }
.vanbild .ram > svg, .vanbild .scen > svg { width: 100%; height: 100%; display: block; }
.vanbild .scen { position: absolute; inset: 0; }
.vanbild .djur { position: absolute; left: 50%; transform: translateX(-50%); }
.vanbild .djur svg { width: 100%; height: 100%; display: block; }
.vanbild .ram.husdjur { height: 170px; }
.vanbild .ram.tradgard { height: 100px; }
.vanbild .ram.ordskar { height: 126px; }
.vanbildtext { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 12px 10px; }
.vanbildtext b { font-size: 1.05rem; font-weight: 500; }
.vanbildtext span { font-size: .85rem; color: var(--granite); }
.vanbild .saknas { display: grid; place-items: center; height: 100%; color: var(--granite); font-size: .88rem; }

.vanborttag { width: 100%; margin-top: 18px; color: var(--bad-ink, var(--bad)); }

/* A friend whose card has not arrived yet: the shape of the page, no numbers. */
.vanskelett { border: 1px solid var(--line); border-radius: 14px; height: 76px; background: var(--line); opacity: .35; }
