/* Gamification tab of the account dialog (2026-11-25, second wave 2026-11-26). Built from the dialog's own components (.community-tabs, .community-profile, .community-post-item,
   .community-notice, .composer-add, .account-change), so every UI style that restyles them restyles this tab too. Colours only from the page's variables;
   the one exception is the tier colour that the server sends (--gam-tier), used for the badge ring and the tier edge, never for text. */
.gam{display:grid;gap:14px;min-width:0}
.gam [hidden]{display:none}
.gam-summary{margin-bottom:0}
.gam-tier-badge{border:2px solid var(--gam-tier,var(--line));font-weight:700;font-size:15px;box-sizing:border-box}
.gam-subtabs{margin:0}
.gam-subtabs button{flex:1 1 auto;min-width:0}
.gam-panel{display:grid;gap:12px;min-width:0}
.gam-panel .field-hint{margin:0}
.gam-heading{margin:8px 0 0;font-size:11px;letter-spacing:.04em;color:var(--ink)}
.gam-empty p{margin:6px 0 0}
.gam-empty .composer-add{margin-top:10px}
.gam-error{color:var(--danger,var(--ink))}

/* tiers */
.gam-current,.gam-next{border-inline-start:4px solid var(--gam-tier,var(--accent-text))}
.gam-current small,.gam-next>small{margin-top:0}
.gam-current-name{font-size:18px;margin-top:4px}
.gam-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:9px}
.gam-stat{min-width:0}
.gam-stat strong{font-size:20px;font-variant-numeric:tabular-nums;color:var(--ink)}
.gam-stat small{margin-top:2px}
.gam-reqs{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:10px}
.gam-req-line{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;font-size:11px;color:var(--ink)}
.gam-req-count{margin-inline-start:auto;font-variant-numeric:tabular-nums;color:var(--muted)}
.gam-req-state{font-size:10px;color:var(--muted)}
.gam-req[data-met="1"] .gam-req-state{color:var(--accent-text);font-weight:700}
.gam-bar{height:6px;margin-top:5px;border-radius:99px;background:var(--line);overflow:hidden}
.gam-bar>i{display:block;height:100%;width:var(--p,0%);background:var(--accent-text);border-radius:inherit}
.gam-bonus{margin-top:10px}

/* stats and the quest streak */
.gam-stat-group{display:grid;gap:8px;min-width:0}
.gam-stat-group .gam-heading{margin-top:2px}
.gam-quest-streak{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}

/* marketplace */
.gam-market-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:11px;color:var(--muted)}
.gam-market-head b{color:var(--ink);font-variant-numeric:tabular-nums}
.gam-balance{margin-inline-start:auto;color:var(--muted)}
.gam-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:9px}
.gam-card{display:flex;flex-direction:column;gap:6px;min-width:0}
.gam-card[data-owned="1"]{border-color:var(--accent-text)}
.gam-card strong{margin-top:2px}
.gam-card small{margin-top:0}
.gam-portrait{position:relative;aspect-ratio:1;border-radius:min(var(--r-ctl,8px),10px);background:var(--tint);color:var(--accent-text);display:grid;place-items:center;overflow:hidden;font-size:34px;font-weight:700}
.gam-portrait>span{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted)}
.gam-portrait>span svg{width:52%;height:52%;opacity:.45}
/* 2026-11-26: invisible until it has loaded, so neither a half-loaded picture nor its alternative text is painted */
.gam-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;opacity:0;color:transparent;font-size:0}
.gam-portrait[data-loaded] img{opacity:1}
/* the pictures are transparent around the head: the initial gives way once the picture is there */
.gam-portrait[data-loaded]>span{visibility:hidden}
.gam-price{font-size:11px;color:var(--ink);font-variant-numeric:tabular-nums}
.gam-action{margin-top:auto;display:grid;gap:6px;font-size:10px}
.gam-action .composer-add{width:100%;min-height:36px;padding:6px 10px;font-size:11px}
.gam-owned{font-weight:700;color:var(--accent-text)}
.gam-hint{color:var(--muted)}
.gam-sure{color:var(--ink)}
.gam-sure-actions{display:grid;gap:6px}

/* quests */
.gam-quest{display:flex;align-items:flex-start;gap:12px}
.gam-quest-icon{flex:none;width:38px;height:38px;border-radius:min(var(--r-ctl,50%),50%);background:var(--tint);color:var(--accent-text);display:grid;place-items:center}
.gam-quest-icon svg{width:20px;height:20px}
.gam-quest-body{min-width:0}
.gam-quest-body strong{margin:2px 0 0}
.gam-quest[data-done="1"] .gam-quest-state{color:var(--accent-text);font-weight:700}
.gam-history{list-style:none;margin:0;padding:0;display:grid;gap:7px}
.gam-history li{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:9px 12px;font-size:11px;color:var(--ink)}
.gam-history-date{color:var(--muted);font-variant-numeric:tabular-nums}
.gam-history-state{margin-inline-start:auto;font-size:10px;color:var(--muted)}
.gam-history li[data-done="1"] .gam-history-state{color:var(--accent-text);font-weight:700}

/* switch (account tab and foot of the Gamification tab) */
.gam-switch-section{margin-top:4px}
.gam-switch-section h3{margin-bottom:8px}
.gam-switch-section .field-hint{margin:6px 0 0}
/* the reader lays out .check-line only inside .community-form; the switch stands outside a form and brings its own row, otherwise box and text stick together */
.gam-switch{display:flex;align-items:center;gap:9px;font-size:12px;line-height:1.7;cursor:pointer}
.gam-switch input{flex:none;margin:0;accent-color:var(--accent-text)}

/* account card: the review row holds profile state, newsletter and the gamification status side by side, each as one unit */
.profile-review-line{display:flex;flex-wrap:wrap;align-items:baseline;gap:5px 16px;min-width:0}
.profile-review-line .profile-review-time{margin-left:-8px}
.profile-review-line .profile-newsletter{margin-left:0;white-space:nowrap}
.gam-status-slot{display:contents}
.gam-status-line{margin-top:8px}
.gam-status-line:not(:has(.gam-status)){margin-top:0}
/* same look as the neighbours "Profile approved" and "Newsletter": green dot, bold word, quiet detail; no pill, no tier colour (the dot's green is theirs) */
.community-profile .gam-status{display:inline-flex;align-items:center;gap:6px;margin:0;padding:0;border:0;border-radius:3px;background:none;box-shadow:none;font:inherit;font-size:12px;font-weight:700;letter-spacing:normal;text-transform:none;color:var(--ink);line-height:inherit;white-space:nowrap;cursor:pointer;vertical-align:baseline;min-height:0;transform:none}
.community-profile .gam-status:hover .gam-status-tier{text-decoration:underline;text-underline-offset:3px}
.community-profile .gam-status:focus-visible{outline:2px solid var(--focus-ring,var(--accent-text));outline-offset:3px}
.gam-status-dot{width:9px;height:9px;border-radius:50%;background:#2e9e5b;flex:none}
.gam-status-points{font-weight:400;color:var(--muted)}

@media(max-width:560px){
 .gam-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .gam-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .gam-portrait{font-size:28px}
 .gam-quest-streak{grid-template-columns:repeat(2,minmax(0,1fr))}
 /* one unit per line, the dots below one another (the review dot sits left of the row's column: 9px dot + 9px gap) */
 .profile-review-line{flex-direction:column;align-items:flex-start}
 .profile-review-line .profile-review-time{margin-left:0}
 .profile-review-line .profile-newsletter,.profile-review-line .gam-status{margin-left:-18px;gap:9px}
 .gam-subtabs button{padding:8px 6px}
}
@media(forced-colors:active){.gam-bar>i{background:Highlight}.gam-card[data-owned="1"]{border-color:Highlight}}
