/**
 * @file        sg-rewards.css
 * @description Styles of the rewards module: unlock list, storage bar, pin styles, avatar markers, avatar frames, celebration effects, year awards
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         e0a2a2f1-c07f-4724-adb6-0dab089fab2a
 * @version     0.1.0.1
 * @created     2026-12-02
 * @updated     2026-12-02
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* Y7-01 unlock list: one row per item, wraps at 360 px. */
.sg-rw-list, .sg-rw-grid, .sg-rw-award-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sg-rw-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 44px; }
.sg-rw-item__text { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.sg-rw-item__name { font-weight: 600; }
.sg-rw-item--locked .sg-rw-item__name, .sg-rw-item--locked .sg-rw-sample { opacity: 0.6; }
.sg-rw-item--in_use .sg-rw-state { border-color: var(--orange); }
.sg-rw-sample { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; }
.sg-rw-sample svg { width: 24px; height: 24px; }
.sg-rw-sample .sg-pin { width: 26px; height: 26px; cursor: default; }
.sg-rw-mini, .sg-rw-sample .sg-avatar-img { width: 32px; height: 32px; font-size: 1rem; }

/* Storage from unlocks (FR-742); widths in steps of 10 % because the CSP allows no inline styles. */
.sg-rw-bar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 6px 0; }
.sg-rw-bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--ink-muted); }
.sg-rw-w0 { width: 0%; }
.sg-rw-w10 { width: 10%; }
.sg-rw-w20 { width: 20%; }
.sg-rw-w30 { width: 30%; }
.sg-rw-w40 { width: 40%; }
.sg-rw-w50 { width: 50%; }
.sg-rw-w60 { width: 60%; }
.sg-rw-w70 { width: 70%; }
.sg-rw-w80 { width: 80%; }
.sg-rw-w90 { width: 90%; }
.sg-rw-w100 { width: 100%; }

/* Y7-02 grid with live preview (CSS :has, no script). */
.sg-rw-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sg-rw-choice { position: relative; }
.sg-rw-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sg-rw-choice label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; text-align: center; }
.sg-rw-choice input:checked + label { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.sg-rw-choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.sg-rw-choice--locked label { cursor: not-allowed; opacity: 0.65; }
.sg-rw-preview { position: relative; height: 120px; margin: 0 0 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--beige); overflow: hidden; }
.sg-rw-preview__route { position: absolute; left: 20%; right: 20%; top: 50%; border-top: 2px dashed var(--navy); }
.sg-rw-preview .sg-pin { position: absolute; top: calc(50% - 15px); cursor: default; }
.sg-rw-preview .sg-pin:nth-of-type(2) { left: calc(20% - 15px); }
.sg-rw-preview .sg-pin:nth-of-type(3) { left: calc(55% - 15px); }
.sg-rw-preview .sg-here { position: absolute; top: calc(50% - 9px); left: calc(80% - 9px); }

/* Pin styles (FR-743): the map element gets sg-rw-pins--<style> from sg-rewards.js. */
.sg-rw-pins--square .sg-pin { border-radius: 6px; }
/* WHY: MapLibre positions a marker with an inline transform on the pin element itself, so a pin style may never
        set transform; shapes come from clip-path and border-radius. Map pins keep fixed colors on map tiles (dark mode too). */
.sg-rw-pins--diamond .sg-pin { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); width: 34px; height: 34px; }
.sg-rw-pins--ring .sg-pin { background: #fff; color: #1C2C37; border: 3px solid #1C2C37; }
.sg-rw-pins--drop .sg-pin { border-radius: 50% 50% 50% 0; }
.sg-rw-style:has(input[name="pin_style"][value="square"]:checked) .sg-rw-preview .sg-pin { border-radius: 6px; }
.sg-rw-style:has(input[name="pin_style"][value="diamond"]:checked) .sg-rw-preview .sg-pin { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); width: 34px; height: 34px; }
.sg-rw-style:has(input[name="pin_style"][value="ring"]:checked) .sg-rw-preview .sg-pin { background: #fff; color: #1C2C37; border: 3px solid #1C2C37; }
.sg-rw-style:has(input[name="pin_style"][value="drop"]:checked) .sg-rw-preview .sg-pin { border-radius: 50% 50% 50% 0; }

/* Avatar markers (FR-743): the "currently here" marker keeps the one orange point of the map. */
.sg-rw-marker--halo .sg-here { box-shadow: 0 0 0 6px rgba(250, 88, 0, 0.25), 0 0 0 1px var(--navy); }
.sg-rw-marker--square .sg-here { border-radius: 4px; }
.sg-rw-marker--star .sg-here { border-radius: 0; border: 0; width: 22px; height: 22px; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.sg-rw-style:has(input[name="avatar_marker"][value="halo"]:checked) .sg-rw-preview .sg-here { box-shadow: 0 0 0 6px rgba(250, 88, 0, 0.25), 0 0 0 1px var(--navy); }
.sg-rw-style:has(input[name="avatar_marker"][value="square"]:checked) .sg-rw-preview .sg-here { border-radius: 4px; }
.sg-rw-style:has(input[name="avatar_marker"][value="star"]:checked) .sg-rw-preview .sg-here { border-radius: 0; border: 0; width: 22px; height: 22px; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

/* Avatar frames (FR-744, Y7-03): a ring drawn with box-shadow, so no avatar layout changes; 2 px at 24 px and below. */
.sg-rw-frame { --sg-rw-ring: var(--border-strong); box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--sg-rw-ring); }
.sg-rw-frame--thin { box-shadow: 0 0 0 2px var(--sg-rw-ring); }
.sg-rw-frame--l1 { --sg-rw-ring: var(--border-strong); }
.sg-rw-frame--l2 { --sg-rw-ring: var(--ink-muted); }
.sg-rw-frame--l3 { --sg-rw-ring: var(--navy); }
.sg-rw-frame--l4 { --sg-rw-ring: var(--accent); }
.sg-rw-frame--l5 { --sg-rw-ring: var(--mahogany); }
.sg-rw-frame--l6 { --sg-rw-ring: #8C6239; }
.sg-rw-frame--l7 { --sg-rw-ring: #8A9BA8; }
.sg-rw-frame--l8 { --sg-rw-ring: #B8860B; }
.sg-rw-frame--l9 { --sg-rw-ring: var(--orange); }
.sg-rw-frame--l10 { --sg-rw-ring: var(--orange); box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--orange), 0 0 0 7px var(--navy); }
.sg-rw-frame--thin.sg-rw-frame--l10 { box-shadow: 0 0 0 2px var(--orange); }
.sg-rw-frame--bronze { --sg-rw-ring: #8C6239; }
.sg-rw-frame--silver { --sg-rw-ring: #8A9BA8; }
.sg-rw-frame--gold { --sg-rw-ring: #B8860B; }
.sg-rw-frame--ocean { --sg-rw-ring: #1F6F8B; }
.sg-rw-frame--forest { --sg-rw-ring: #2F6B3B; }
.sg-rw-frame--ember { --sg-rw-ring: var(--mahogany); }
.sg-rw-frame--night { --sg-rw-ring: var(--navy); }

/* Celebration effects (FR-747): variants of the confetti of points.php; points hides them under reduced motion. */
.sg-celebrate--stars .sg-celebrate__confetti::before, .sg-celebrate--stars .sg-celebrate__confetti::after,
.sg-rw-effect--stars { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); width: 16px; height: 16px; border-radius: 0; }
.sg-celebrate--ink .sg-celebrate__confetti::before, .sg-celebrate--ink .sg-celebrate__confetti::after,
.sg-rw-effect--ink { width: 18px; height: 18px; border-radius: 50%; background: transparent; border: 3px solid var(--mahogany); }
.sg-celebrate--globe .sg-celebrate__confetti::before, .sg-celebrate--globe .sg-celebrate__confetti::after,
.sg-rw-effect--globe { width: 20px; height: 20px; border-radius: 50%; background: transparent; border: 2px dashed var(--navy); }
.sg-rw-effect { display: inline-block; }
.sg-rw-effect--confetti { width: 10px; height: 16px; border-radius: 2px; background: var(--orange); }
.sg-rw-effect--stars { background: var(--orange); }

/* Y7-08 year awards. */
.sg-rw-award-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sg-rw-award { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); overflow-wrap: anywhere; }
.sg-rw-award__title { color: var(--ink-muted); font-size: 0.9rem; }
.sg-rw-award__figure { font-family: var(--font-mono); font-size: 1.4rem; }
.sg-rw-award__subject { font-family: var(--font-head); font-weight: 600; }

.sg-rw-admin-form { display: grid; gap: 8px; max-width: 560px; }

