/* ==========================================================================
   Atklāj — spēles (dalībnieku) dizaina sistēma
   Lieto pasakumi/<mape>/index.php, vietas.php, punkts.php, team.php,
   team_play.php, member.php un chat_widget.php.
   Krāsas, fonts, noapaļojums un režīms nāk no func/event_theme.php
   (organizators tos maina admin → Spēles dizains).
   Mobile-first: lielas pogas, augsts kontrasts lietošanai ārā.
   ========================================================================== */

/* ---------- 1. Tokeni ---------- */
:root {
  --accent: #10b981;
  --accent-2: #0b6b4f;
  --on-accent: #0b1d33;
  --on-hero: #ffffff;
  --cover-dim: .45;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: var(--font-body);

  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f4f7f6;
  --surface-3: #e9efed;
  --ink: #0b1d33;
  --ink-2: #33445a;
  --muted: #5b6b7f;
  --line: #e1e8e5;
  --line-strong: #c6d2ce;
  --navy: #0b1d33;
  --lime: #bcf76b;

  --success: #047857;
  --success-soft: #e8f8f1;
  --danger: #b91c1c;
  --danger-soft: #fdeeee;
  --warning: #92400e;
  --warning-soft: #fff7e6;
  --info: #075985;
  --info-soft: #eaf6fd;

  --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 45%, var(--line));
  --accent-ink: color-mix(in srgb, var(--accent) 62%, var(--ink));
  --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);

  --r-sm: .625rem;
  --r: 1rem;
  --r-lg: 1.375rem;
  --r-xl: 1.75rem;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(11, 29, 51, .06);
  --shadow: 0 1px 2px rgba(11, 29, 51, .05), 0 10px 30px rgba(11, 29, 51, .07);
  --shadow-lg: 0 24px 60px rgba(11, 29, 51, .2);

  --topbar-h: 3.75rem;
  --actionbar-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

html[data-radius="soft"] { --r-sm: .4rem; --r: .625rem; --r-lg: .875rem; --r-xl: 1.125rem; }
html[data-radius="sharp"] { --r-sm: .125rem; --r: .25rem; --r-lg: .375rem; --r-xl: .5rem; --r-pill: .375rem; }

/* Tumšais režīms — vakara pasākumiem un mazāk spilgtam ekrānam */
html[data-mode="dark"] {
  --bg: #08121f;
  --surface: #0f1d30;
  --surface-2: #142740;
  --surface-3: #1b3150;
  --ink: #eef3f9;
  --ink-2: #c8d4e2;
  --muted: #9fb0c4;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, .12);
  --danger: #fca5a5;
  --danger-soft: rgba(248, 113, 113, .13);
  --warning: #fcd34d;
  --warning-soft: rgba(251, 191, 36, .12);
  --info: #7dd3fc;
  --info-soft: rgba(56, 189, 248, .12);
  --accent-ink: color-mix(in srgb, var(--accent) 70%, #ffffff);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"] {
    --bg: #08121f; --surface: #0f1d30; --surface-2: #142740; --surface-3: #1b3150;
    --ink: #eef3f9; --ink-2: #c8d4e2; --muted: #9fb0c4;
    --line: rgba(255, 255, 255, .09); --line-strong: rgba(255, 255, 255, .18);
    --success: #4ade80; --success-soft: rgba(74, 222, 128, .12);
    --danger: #fca5a5; --danger-soft: rgba(248, 113, 113, .13);
    --warning: #fcd34d; --warning-soft: rgba(251, 191, 36, .12);
    --info: #7dd3fc; --info-soft: rgba(56, 189, 248, .12);
    --accent-ink: color-mix(in srgb, var(--accent) 70%, #ffffff);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ---------- 2. Bāze ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 1rem);
  background: var(--bg);
  overflow-x: clip;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;           /* 17px — vieglāk lasīt ārā */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
  overflow-x: clip;
  padding-bottom: calc(var(--actionbar-h) + var(--safe-b));
}
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; color: inherit; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden], .hidden { display: none !important; }
.g-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.g-skip { position: absolute; left: 1rem; top: -10rem; z-index: 200; padding: .7rem 1rem; border-radius: var(--r); background: var(--ink); color: var(--bg); font-weight: 800; text-decoration: none; }
.g-skip:focus { top: .75rem; }

.g-wrap { width: min(100% - 2rem, 44rem); margin-inline: auto; }
.g-wrap--wide { width: min(100% - 2rem, 66rem); }
.g-stack > * + * { margin-top: 1rem; }
.g-stack-lg > * + * { margin-top: 1.5rem; }
.g-muted { color: var(--muted); }
.g-small { font-size: .9rem; }
.g-center { text-align: center; }
.g-row { display: flex; align-items: center; gap: .75rem; }
.g-row--between { justify-content: space-between; }
.g-row--wrap { flex-wrap: wrap; }
.g-grid-2 { display: grid; gap: .75rem; }
@media (min-width: 40rem) { .g-grid-2 { grid-template-columns: 1fr 1fr; } }
.g-mt { margin-top: 1rem; }
.g-mt-lg { margin-top: 1.5rem; }
.g-link { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.g-link:hover { text-decoration-color: var(--accent); }

/* ---------- 3. Augšējā josla ---------- */
.g-topbar {
  position: sticky; top: 0; z-index: 40;
  min-height: var(--topbar-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.demo-view-bar ~ .g-topbar { position: relative; }
.g-topbar__inner { width: min(100% - 1.5rem, 66rem); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: .5rem; }
.g-brand { display: flex; align-items: center; gap: .65rem; min-width: 0; text-decoration: none; color: var(--ink); }
.g-brand__mark {
  flex: 0 0 auto; width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  border-radius: calc(var(--r) * .8);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-hero); font-family: var(--font-head); font-weight: 900; font-size: 1.15rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.g-brand__logo { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; object-fit: contain; border-radius: calc(var(--r) * .6); background: #fff; padding: 2px; box-shadow: 0 0 0 1px var(--line); }
.g-brand__text { min-width: 0; line-height: 1.15; }
.g-brand__kicker { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.g-brand__name { display: block; font-family: var(--font-head); font-weight: 800; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.g-topbar__actions { display: flex; align-items: center; gap: .5rem; }
.g-lang { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-3); overflow-x: auto; max-width: 46vw; scrollbar-width: none; }
.g-lang::-webkit-scrollbar { display: none; }
.g-lang a { min-width: 2.4rem; min-height: 2.1rem; display: grid; place-items: center; padding: 0 .55rem; border-radius: var(--r-pill); font-size: .78rem; font-weight: 800; color: var(--muted); text-decoration: none; letter-spacing: .04em; }
.g-lang a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.g-iconbtn { min-width: 2.75rem; min-height: 2.75rem; display: inline-grid; place-items: center; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 700; }
.g-iconbtn svg { width: 1.25rem; height: 1.25rem; }
.g-iconbtn:hover { background: var(--surface-2); }

/* ---------- 4. Galvene (hero) ---------- */
.g-hero {
  position: relative; isolation: isolate; overflow: hidden;
  color: var(--on-hero);
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-2) 100%);
  padding: 2.5rem 0 3.25rem;
}
html[data-hero="solid"] .g-hero { background: var(--accent); }
html[data-hero="photo"] .g-hero {
  background: #0b1d33 var(--cover) center / cover no-repeat;
  color: #fff;
}
html[data-hero="photo"] .g-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(5, 12, 24, calc(var(--cover-dim) * .55)) 0%, rgba(5, 12, 24, var(--cover-dim)) 55%, rgba(5, 12, 24, calc(var(--cover-dim) + .2)) 100%);
}
/* Dekoratīvs raksts: orientēšanās kartes reljefa līnijas, punkti vai režģis */
.g-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: currentColor; opacity: .13;
  -webkit-mask: var(--g-pattern) 0 0 / var(--g-pattern-size, 360px) repeat;
  mask: var(--g-pattern) 0 0 / var(--g-pattern-size, 360px) repeat;
}
html[data-hero="photo"] .g-hero::before { opacity: .08; }
html[data-pattern="topo"] { --g-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M150 34c52 0 96 30 102 74s-26 90-78 100-110-10-122-58 46-116 98-116z'/%3E%3Cpath d='M150 60c36 0 66 21 71 51s-18 63-54 70-77-7-86-40 33-81 69-81z'/%3E%3Cpath d='M151 86c21 0 38 12 41 30s-10 36-31 40-44-4-49-23 18-47 39-47z'/%3E%3Cpath d='M152 110c8 0 15 5 16 12s-4 14-12 16-17-2-19-9 7-19 15-19z'/%3E%3Cpath d='M-10 252c38-24 74-14 112 4s88 30 126 6 52-30 82-16'/%3E%3Cpath d='M-10 280c38-24 74-14 112 4s88 30 126 6 52-30 82-16'/%3E%3Cpath d='M-6 14c26 14 54 6 74-14M232 0c8 22 34 38 72 30'/%3E%3C/svg%3E"); --g-pattern-size: 340px; }
html[data-pattern="dots"] { --g-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='3' cy='3' r='1.8' fill='black'/%3E%3C/svg%3E"); --g-pattern-size: 22px; }
html[data-pattern="grid"] { --g-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' fill='none' stroke='black' stroke-width='1'%3E%3Cpath d='M0 .5h44M.5 0v44'/%3E%3C/svg%3E"); --g-pattern-size: 44px; }
html[data-pattern="none"] .g-hero::before { display: none; }

.g-hero__inner { width: min(100% - 2rem, 66rem); margin-inline: auto; position: relative; }
.g-hero--compact { padding: 1.75rem 0 2.25rem; }
.g-hero__eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .88; }
.g-hero__eyebrow::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.g-hero__title { margin-top: .7rem; font-size: clamp(2.1rem, 9vw, 4rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.02; max-width: 18ch; }
.g-hero--compact .g-hero__title { font-size: clamp(1.7rem, 7vw, 2.6rem); max-width: 24ch; }
.g-hero__lead { margin-top: .9rem; font-size: clamp(1.05rem, 3.6vw, 1.3rem); font-weight: 500; opacity: .92; max-width: 40ch; }
.g-hero__actions { margin-top: 1.6rem; display: grid; gap: .65rem; }
@media (min-width: 36rem) { .g-hero__actions { display: flex; flex-wrap: wrap; } }
.g-hero__meta { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.g-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 2rem; padding: .3rem .8rem; border-radius: var(--r-pill); font-size: .85rem; font-weight: 700; background: color-mix(in srgb, currentColor 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.g-chip svg { width: 1rem; height: 1rem; }

/* Galvene pārklājas ar pirmo kartīti — "lapa" uzbīdās virs krāsas */
.g-overlap { margin-top: -1.75rem; position: relative; z-index: 2; }

/* ---------- 5. Pogas ---------- */
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.25rem; padding: .8rem 1.35rem;
  border-radius: var(--r); border: 1px solid transparent;
  font-family: var(--font-body); font-size: 1.02rem; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none;
  transition: transform .15s ease, filter .15s ease, background-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.g-btn:active { transform: translateY(1px) scale(.99); }
.g-btn svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.g-btn:disabled, .g-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.4); }
.g-btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.g-btn--primary:hover { filter: brightness(.95); }
.g-btn--dark { background: var(--ink); color: var(--bg); }
.g-btn--dark:hover { filter: brightness(1.15); }
.g-btn--light { background: #fff; color: #0b1d33; box-shadow: 0 10px 28px rgba(5, 12, 24, .18); }
.g-btn--glass { background: color-mix(in srgb, currentColor 12%, transparent); color: inherit; border-color: color-mix(in srgb, currentColor 38%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.g-btn--soft { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.g-btn--ghost { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.g-btn--ghost:hover { background: var(--surface-3); }
.g-btn--danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.g-btn--block { width: 100%; }
.g-btn--lg { min-height: 3.75rem; font-size: 1.1rem; border-radius: var(--r-lg); }
.g-btn--sm { min-height: 2.6rem; padding: .5rem .9rem; font-size: .9rem; }
.g-btn--text { min-height: 2.75rem; padding: .4rem .2rem; background: none; color: var(--accent-ink); }

/* ---------- 6. Kartītes un sadaļas ---------- */
.g-card {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}
@media (min-width: 40rem) { .g-card { padding: 2rem; } }
.g-card--flush { padding: 0; overflow: hidden; }
.g-card--accent { border-top: 4px solid var(--accent); }
.g-card__head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.1rem; }
.g-card__icon { flex: 0 0 auto; width: 2.9rem; height: 2.9rem; display: grid; place-items: center; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-ink); }
.g-card__icon svg { width: 1.4rem; height: 1.4rem; }
.g-eyebrow { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--accent-ink); }
.g-title { font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 900; }
.g-title--sm { font-size: 1.25rem; font-weight: 800; }
.g-lead { margin-top: .4rem; color: var(--muted); }
.g-section { padding: 2rem 0; }
.g-section__head { margin-bottom: 1.25rem; }
.g-divider { height: 1px; background: var(--line); border: 0; margin: 1.5rem 0; }

/* Bagātinātais teksts (noteikumi) */
.g-prose { color: var(--ink-2); line-height: 1.7; }
.g-prose > * + * { margin-top: .85rem; }
.g-prose p, .g-prose div { margin: .75rem 0; }
.g-prose ul { list-style: disc; padding-left: 1.4rem; }
.g-prose ol { list-style: decimal; padding-left: 1.4rem; }
.g-prose li { margin: .35rem 0; }
.g-prose li::marker { color: var(--accent-ink); }
.g-prose h3 { font-size: 1.2rem; font-weight: 800; margin: 1.2rem 0 .4rem; color: var(--ink); }
.g-prose strong { color: var(--ink); }
.g-prose blockquote { margin: 1rem 0; padding: .75rem 1rem; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; }

/* Info rinda (atbildīgais, foto) */
.g-note { display: flex; gap: .75rem; padding: .9rem 1rem; border-radius: var(--r); background: var(--surface-2); color: var(--ink-2); font-size: .95rem; }
.g-note svg { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; margin-top: .15rem; color: var(--muted); }

/* ---------- 7. Paziņojumi ---------- */
.g-alert { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: var(--r); font-weight: 600; border: 1px solid transparent; }
.g-alert svg { flex: 0 0 auto; width: 1.35rem; height: 1.35rem; margin-top: .1rem; }
.g-alert--error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.g-alert--success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.g-alert--warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.g-alert--info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.g-alert strong { display: block; font-size: 1.05rem; }
.g-alert p { font-weight: 500; margin-top: .2rem; }

/* Stāvokļa ekrāns (spēle slēgta, punkts nav atrasts, veiksme) */
.g-state { text-align: center; padding: 2rem 1.25rem; }
.g-state__icon { width: 4.5rem; height: 4.5rem; margin: 0 auto 1.1rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.g-state__icon svg { width: 2.1rem; height: 2.1rem; }
.g-state__icon--success { background: var(--success-soft); color: var(--success); }
.g-state__icon--warning { background: var(--warning-soft); color: var(--warning); }
.g-state__icon--danger { background: var(--danger-soft); color: var(--danger); }
.g-state__title { font-size: clamp(1.45rem, 6vw, 2rem); font-weight: 900; }
.g-state__text { margin: .6rem auto 0; max-width: 34ch; color: var(--muted); }
.g-state__actions { margin-top: 1.5rem; display: grid; gap: .6rem; }
.g-state__pill { display: inline-block; margin-top: 1rem; padding: .55rem 1rem; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 700; color: var(--ink-2); }

/* ---------- 8. Formas ---------- */
.g-field { display: grid; gap: .4rem; }
.g-label { font-size: .92rem; font-weight: 700; color: var(--ink); }
.g-label small { font-weight: 500; color: var(--muted); }
.g-input, .g-textarea, .g-select {
  width: 100%; min-height: 3.25rem; padding: .8rem 1rem;
  font-size: 16px;               /* iOS netuvina */
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--r);
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.g-textarea { min-height: 6.5rem; resize: vertical; line-height: 1.5; }
.g-input::placeholder, .g-textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.g-input:focus, .g-textarea:focus, .g-select:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.g-input--code { font-size: 1.35rem; font-weight: 800; letter-spacing: .25em; text-align: center; }
.g-hint { font-size: .86rem; color: var(--muted); }
.g-feedback { font-size: .9rem; font-weight: 600; }
.g-feedback.is-ok { color: var(--success); }
.g-feedback.is-bad { color: var(--danger); }
.g-feedback.is-wait { color: var(--muted); }
.g-suggest { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.g-suggest button { min-height: 2.5rem; padding: .4rem .85rem; border-radius: var(--r-pill); border: 1.5px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.g-check { display: flex; gap: .75rem; align-items: flex-start; padding: .35rem 0; font-size: .95rem; color: var(--ink-2); cursor: pointer; }
.g-check input { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; margin: .1rem 0 0; accent-color: var(--accent); }
.g-form { display: grid; gap: 1.1rem; }
.g-stepper-input { display: grid; grid-template-columns: 3.25rem 1fr 3.25rem; gap: .5rem; }
.g-stepper-input .g-input { text-align: center; font-weight: 800; font-size: 1.2rem; }
.g-stepper-input button { border-radius: var(--r); border: 1.5px solid var(--line-strong); background: var(--surface-2); font-size: 1.4rem; font-weight: 800; color: var(--ink-2); }

/* Segmentētā izvēle (individuāli / komanda) */
.g-segment { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.g-segment button {
  display: grid; gap: .35rem; justify-items: center; padding: 1.1rem .75rem;
  border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface);
  font-weight: 800; color: var(--ink-2); transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.g-segment button svg { width: 1.8rem; height: 1.8rem; color: var(--muted); }
.g-segment button small { font-weight: 600; font-size: .8rem; color: var(--muted); }
.g-segment button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.g-segment button[aria-pressed="true"] svg { color: var(--accent-ink); }

/* ---------- 9. Progress ---------- */
.g-progress { height: .75rem; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.g-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.g-ring {
  --p: 0;
  flex: 0 0 auto; width: 5.25rem; height: 5.25rem; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0);
}
.g-ring > span { width: 4.1rem; height: 4.1rem; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1; }
.g-ring b { display: block; font-family: var(--font-head); font-size: 1.35rem; font-weight: 900; }
.g-ring small { display: block; font-size: .68rem; font-weight: 700; color: var(--muted); margin-top: .15rem; }

/* Spēles panelis */
.g-hub { display: grid; gap: 1.1rem; }
.g-hub__top { display: flex; align-items: center; gap: 1rem; }
.g-hub__hello { font-size: clamp(1.35rem, 5.5vw, 1.75rem); font-weight: 900; }
.g-hub__actions { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.g-hub__actions > :only-child { grid-column: 1 / -1; }
.g-status { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--r); background: var(--surface-2); font-size: .9rem; color: var(--muted); }
.g-status__dot { margin-top: .45rem; flex: 0 0 auto; width: .65rem; height: .65rem; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 20%, transparent); }
.g-status.is-live .g-status__dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); animation: g-pulse 2s infinite; }
@keyframes g-pulse { 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }

/* ---------- 10. Kontrolpunktu saraksts ---------- */
.g-cps { display: grid; gap: .75rem; counter-reset: cp; }
.g-cp {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: .9rem;
  padding: 1.1rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.g-cp__num {
  width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2); font-family: var(--font-head); font-weight: 900; font-size: 1.05rem;
  box-shadow: inset 0 0 0 2px var(--line-strong);
}
.g-cp__body { min-width: 0; }
.g-cp__head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.g-cp__title { font-size: 1.02rem; font-weight: 800; }
.g-cp__text { margin-top: .45rem; color: var(--ink-2); white-space: normal; }
.g-cp.is-found { background: color-mix(in srgb, var(--success-soft) 70%, var(--surface)); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.g-cp.is-found .g-cp__num { background: var(--success); color: #fff; box-shadow: none; }
html[data-mode="dark"] .g-cp.is-found .g-cp__num { color: #052e16; }
.g-cp.is-found .g-cp__text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.g-hintbox { margin-top: .8rem; padding: .85rem 1rem; border-radius: var(--r); background: var(--info-soft); color: var(--info); font-size: .95rem; }
.g-hintbox strong { margin-right: .25rem; }

.g-badge { display: inline-flex; align-items: center; gap: .3rem; min-height: 1.6rem; padding: .15rem .6rem; border-radius: var(--r-pill); font-size: .74rem; font-weight: 800; letter-spacing: .02em; background: var(--surface-3); color: var(--ink-2); }
.g-badge svg { width: .85rem; height: .85rem; }
.g-badge--found { background: var(--success-soft); color: var(--success); }
.g-badge--gps { background: var(--info-soft); color: var(--info); }
.g-badge--accent { background: var(--accent-soft); color: var(--accent-ink); }
.g-badge--warn { background: var(--warning-soft); color: var(--warning); }

.g-map { height: 22rem; border-top: 1px solid var(--line); }
@media (max-width: 40rem) { .g-map { height: 17rem; } }

/* ---------- 11. Atbilžu varianti (punkts.php) ---------- */
.g-question { font-family: var(--font-head); font-size: clamp(1.3rem, 5.2vw, 1.65rem); font-weight: 800; line-height: 1.25; }
.g-options { display: grid; gap: .65rem; margin-top: 1.1rem; }
.g-option { position: relative; display: block; cursor: pointer; }
.g-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.g-option__box {
  display: flex; align-items: center; gap: .9rem; min-height: 4rem; padding: .9rem 1rem;
  border-radius: var(--r-lg); border: 2px solid var(--line-strong); background: var(--surface);
  font-size: 1.05rem; font-weight: 600; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.g-option__key { flex: 0 0 auto; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: calc(var(--r) * .7); background: var(--surface-2); color: var(--ink-2); font-weight: 900; font-size: .95rem; transition: inherit; }
.g-option__check { margin-left: auto; flex: 0 0 auto; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; }
.g-option__check svg { width: .95rem; height: .95rem; opacity: 0; color: var(--on-accent); }
.g-option:hover .g-option__box { border-color: var(--accent-line); }
.g-option input:focus-visible + .g-option__box { box-shadow: var(--ring); }
.g-option input:checked + .g-option__box { border-color: var(--accent); background: var(--accent-soft); }
.g-option input:checked + .g-option__box .g-option__key { background: var(--accent); color: var(--on-accent); }
.g-option input:checked + .g-option__box .g-option__check { background: var(--accent); border-color: var(--accent); }
.g-option input:checked + .g-option__box .g-option__check svg { opacity: 1; }
.g-option:active .g-option__box { transform: scale(.99); }

/* Uzdevums + foto */
.g-task { padding: 1.1rem; border-radius: var(--r-lg); background: var(--info-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 18%, transparent); }
.g-task .g-eyebrow { color: var(--info); }
.g-upload { position: relative; display: flex; align-items: center; gap: .9rem; padding: 1rem; border-radius: var(--r-lg); border: 2px dashed var(--line-strong); background: var(--surface-2); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.g-upload:hover { border-color: var(--accent-line); }
.g-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.g-upload__icon { flex: 0 0 auto; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: var(--r); background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.g-upload__icon svg { width: 1.5rem; height: 1.5rem; }
.g-upload__text strong { display: block; }
.g-upload__text span { display: block; font-size: .88rem; color: var(--muted); }
.g-upload.has-file { border-style: solid; border-color: var(--success); background: var(--success-soft); }
.g-upload__preview { flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: var(--r); object-fit: cover; }
.g-upload.is-nudged { border-color: var(--accent-line); animation: g-nudge .45s ease; }
@keyframes g-nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .g-upload.is-nudged { animation: none; } }

.g-gps { display: grid; gap: .8rem; padding: 1rem; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.g-gps__row { display: flex; gap: .8rem; align-items: flex-start; }
.g-gps__icon { flex: 0 0 auto; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--info-soft); color: var(--info); }
.g-gps__icon svg { width: 1.3rem; height: 1.3rem; }
.g-gps.is-ready { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.g-gps.is-ready .g-gps__icon { background: var(--success); color: #fff; }

/* ---------- 12. Apakšējā darbību josla (īkšķa zonā) ---------- */
.g-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: .75rem 1rem calc(.75rem + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(11, 29, 51, .08);
}
.g-actionbar__inner { width: min(100%, 44rem); margin-inline: auto; display: flex; gap: .6rem; }
.g-actionbar__inner > .g-btn { flex: 1; }
body.has-actionbar { --actionbar-h: 5.25rem; }

/* ---------- 13. Modāļi ---------- */
.g-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 0; background: rgba(5, 12, 24, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: g-fade .2s ease; }
@media (min-width: 40rem) { .g-modal { align-items: center; padding: 1rem; } }
.g-modal__sheet { width: 100%; max-width: 30rem; max-height: 92dvh; overflow: auto; background: var(--surface); color: var(--ink); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 1.1rem 1.1rem calc(1.25rem + var(--safe-b)); box-shadow: var(--shadow-lg); animation: g-sheet .28s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 40rem) { .g-modal__sheet { border-radius: var(--r-xl); padding: 1.5rem; } }
.g-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.g-modal__title { font-size: 1.2rem; font-weight: 800; }
.g-modal__grab { width: 2.75rem; height: .3rem; border-radius: 9px; background: var(--line-strong); margin: -.3rem auto .8rem; }
@media (min-width: 40rem) { .g-modal__grab { display: none; } }
.g-scanner { position: relative; overflow: hidden; border-radius: var(--r-lg); background: #000; min-height: 16rem; }
.g-scanner video { width: 100% !important; height: auto !important; display: block; }
.g-scanner__frame { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.g-scanner__frame span { width: 62%; aspect-ratio: 1; border-radius: 1.25rem; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); outline: 3px solid var(--accent); outline-offset: -3px; }
.g-spinner { width: 3.25rem; height: 3.25rem; margin: .5rem auto 0; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--accent); animation: g-spin .8s linear infinite; }
@keyframes g-spin { to { transform: rotate(360deg); } }
@keyframes g-fade { from { opacity: 0; } }
@keyframes g-sheet { from { transform: translateY(40px); opacity: 0; } }

/* ---------- 14. Līderu saraksts ---------- */
.g-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: .5rem; margin-bottom: 1rem; }
.g-podium__item { display: grid; justify-items: center; gap: .35rem; text-align: center; min-width: 0; }
.g-podium__avatar { width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--surface); box-shadow: var(--shadow); border: 3px solid var(--line); }
.g-podium__name { font-weight: 800; font-size: .92rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-podium__pts { font-size: .8rem; font-weight: 700; color: var(--muted); }
.g-podium__bar { width: 100%; border-radius: var(--r) var(--r) 0 0; background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--on-hero); font-family: var(--font-head); font-weight: 900; font-size: 1.4rem; display: grid; place-items: center; }
.g-podium__item--1 { order: 2; } .g-podium__item--1 .g-podium__bar { height: 6.5rem; } .g-podium__item--1 .g-podium__avatar { border-color: #facc15; width: 4rem; height: 4rem; }
.g-podium__item--2 { order: 1; } .g-podium__item--2 .g-podium__bar { height: 4.75rem; opacity: .85; } .g-podium__item--2 .g-podium__avatar { border-color: #cbd5e1; }
.g-podium__item--3 { order: 3; } .g-podium__item--3 .g-podium__bar { height: 3.5rem; opacity: .72; } .g-podium__item--3 .g-podium__avatar { border-color: #d6a26b; }
.g-ranks { display: grid; gap: .5rem; }
.g-rank { display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: .75rem; padding: .75rem .9rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.g-rank__pos { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 900; color: var(--ink-2); font-size: .95rem; }
.g-rank__name { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-rank__meta { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); }
.g-rank__pts { text-align: right; font-family: var(--font-head); font-weight: 900; font-size: 1.15rem; }
.g-rank__pts small { display: block; font-family: var(--font-body); font-size: .72rem; font-weight: 700; color: var(--muted); }

/* ---------- 15. Laiki ---------- */
.g-slots { display: grid; gap: .55rem; }
@media (min-width: 40rem) { .g-slots { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } }
.g-slot { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-line); font-weight: 700; color: var(--ink); }
.g-slot svg { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; color: var(--accent-ink); }

/* Soļi "Kā spēlēt" */
.g-steps { display: grid; gap: .65rem; counter-reset: step; }
@media (min-width: 48rem) { .g-steps { grid-template-columns: repeat(3, 1fr); } }
.g-step { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.g-step__num { flex: 0 0 auto; counter-increment: step; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 900; }
.g-step strong { display: block; font-size: 1rem; }
.g-step div > span { display: block; font-size: .9rem; color: var(--muted); margin-top: .15rem; }

/* ---------- 16. Vērtējums ---------- */
.g-stars { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; max-width: 26rem; }
.g-star { position: relative; }
.g-star input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.g-star span { display: grid; justify-items: center; gap: .1rem; min-height: 3.75rem; padding: .5rem 0; border-radius: var(--r); background: var(--surface-2); border: 2px solid var(--line); color: var(--muted); font-size: 1.45rem; line-height: 1; cursor: pointer; transition: all .15s ease; }
.g-star span small { font-size: .75rem; font-weight: 800; }
.g-star input:checked + span { background: #fef3c7; border-color: #f59e0b; color: #b45309; transform: translateY(-2px); }
html[data-mode="dark"] .g-star input:checked + span { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.g-star input:focus-visible + span { box-shadow: var(--ring); }
.g-stars__legend { display: flex; justify-content: space-between; max-width: 26rem; margin-top: .4rem; font-size: .78rem; font-weight: 700; color: var(--muted); }

/* ---------- 17. Komandas lapas ---------- */
.g-member { padding: 1.1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.g-member__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.g-member__avatar { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 900; }
.g-member__actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .45rem; margin-top: .9rem; }
.g-member__actions .g-btn { min-height: 2.75rem; padding: .5rem; font-size: .86rem; }
.g-dark-card { background: var(--navy); color: #fff; border-radius: var(--r-xl); padding: 1.35rem; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; isolation: isolate; }
.g-dark-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 40%, transparent), transparent 55%); }
@media (min-width: 40rem) { .g-dark-card { padding: 2rem; } }
.g-dark-card .g-eyebrow { color: var(--lime); }
.g-dark-card .g-muted { color: rgba(255, 255, 255, .72); }
.g-counter { min-width: 6.5rem; padding: .9rem; border-radius: var(--r-lg); text-align: center; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.g-counter b { display: block; font-family: var(--font-head); font-size: 2rem; font-weight: 900; line-height: 1; }
.g-counter small { display: block; margin-top: .3rem; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }

/* Lomas kartīte */
.g-rolecard { overflow: hidden; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.g-rolecard__head { position: relative; isolation: isolate; overflow: hidden; padding: 1.5rem 1.4rem 1.6rem; color: var(--on-hero); background: linear-gradient(140deg, var(--accent), var(--accent-2)); }
html[data-hero="solid"] .g-rolecard__head { background: var(--accent); }
.g-rolecard__head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: .12; -webkit-mask: var(--g-pattern) 0 0 / var(--g-pattern-size, 360px) repeat; mask: var(--g-pattern) 0 0 / var(--g-pattern-size, 360px) repeat; }
html[data-pattern="none"] .g-rolecard__head::before { display: none; }
.g-rolecard__body { padding: 1.4rem; display: grid; gap: 1rem; }
.g-rolecard__role { font-family: var(--font-head); font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 900; line-height: 1.05; }
.g-clue { padding: 1.1rem; border-radius: var(--r-lg); border: 2px solid var(--accent); background: var(--accent-soft); }
.g-clue__text { margin-top: .5rem; font-size: 1.15rem; line-height: 1.6; white-space: pre-line; }
.g-secret { display: flex; gap: .7rem; padding: .9rem 1rem; border-radius: var(--r); background: var(--warning-soft); color: var(--warning); font-size: .92rem; font-weight: 600; }
.g-secret svg { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; }
.g-toast-inline { padding: .85rem; border-radius: var(--r); text-align: center; font-weight: 900; background: var(--success); color: #fff; animation: g-pop .35s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes g-pop { from { transform: scale(.9); opacity: 0; } }
.g-cover { min-height: 70dvh; display: grid; align-content: center; justify-items: center; gap: 1rem; text-align: center; padding: 2rem 1.4rem; border-radius: var(--r-xl); background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; isolation: isolate; }
.g-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; opacity: .06; -webkit-mask: var(--g-pattern) 0 0 / var(--g-pattern-size, 360px) repeat; mask: var(--g-pattern) 0 0 / var(--g-pattern-size, 360px) repeat; }
.g-cover__icon { width: 4.5rem; height: 4.5rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.g-cover__icon svg { width: 2.2rem; height: 2.2rem; }

/* ---------- 18. Kājene ---------- */
.g-footer { margin-top: 3rem; background: var(--surface); border-top: 1px solid var(--line); }
.g-footer__accent { height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.g-footer__inner { width: min(100% - 2rem, 66rem); margin-inline: auto; padding: 1.75rem 0 calc(1.75rem + var(--safe-b)); display: grid; gap: 1rem; text-align: center; }
@media (min-width: 40rem) { .g-footer__inner { grid-template-columns: 1fr auto; text-align: left; align-items: center; } }
.g-footer__links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: center; font-size: .9rem; font-weight: 700; }
.g-footer__links a { color: var(--muted); text-decoration: none; min-height: 2.75rem; display: inline-flex; align-items: center; }
.g-footer__links a:hover { color: var(--ink); }
.g-powered { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }

/* ---------- 19. Čats ar organizatoriem ---------- */
.g-chat { position: fixed; right: 1rem; bottom: calc(1rem + var(--actionbar-h) + var(--safe-b)); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .75rem; pointer-events: none; }
.g-chat > * { pointer-events: auto; }
.g-chat__fab { position: relative; display: inline-flex; align-items: center; gap: .55rem; min-height: 3.5rem; padding: 0 1.1rem 0 .95rem; border-radius: var(--r-pill); border: 0; background: var(--ink); color: var(--bg); font-weight: 800; box-shadow: var(--shadow-lg); }
.g-chat__fab svg { width: 1.35rem; height: 1.35rem; }
.g-chat__dot { width: .6rem; height: .6rem; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 3px var(--ink); }
.g-chat__dot.is-online { background: #22c55e; }
.g-chat__label { font-size: .95rem; }
@media (max-width: 26rem) { .g-chat__label { display: none; } .g-chat__fab { width: 3.5rem; justify-content: center; padding: 0; } .g-chat__fab .g-chat__dot { position: absolute; top: .55rem; right: .55rem; } }
.g-chat__panel { width: min(calc(100vw - 2rem), 24rem); max-height: min(70dvh, 34rem); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: g-sheet .25s cubic-bezier(.2, .8, .2, 1); }
.g-chat__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.g-chat__head h2 { font-size: 1.02rem; font-weight: 800; }
.g-chat__status { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .1rem; }
.g-chat__status .g-chat__dot { box-shadow: none; }
.g-chat__messages { flex: 1; min-height: 10rem; overflow-y: auto; padding: 1rem; display: grid; align-content: start; gap: .55rem; background: var(--surface-2); }
.g-chat__empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 1.5rem .5rem; }
.g-msg { max-width: 85%; padding: .6rem .85rem; border-radius: 1.1rem; font-size: .95rem; line-height: 1.4; white-space: pre-wrap; }
.g-msg time { display: block; margin-top: .25rem; font-size: .7rem; opacity: .65; }
.g-msg--own { justify-self: end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: .35rem; }
.g-msg--them { justify-self: start; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: .35rem; }
.g-chat__form { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem; border-top: 1px solid var(--line); background: var(--surface); }
.g-chat__form textarea { flex: 1; min-height: 2.9rem; max-height: 7rem; padding: .65rem .85rem; border-radius: 1.2rem; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); resize: none; font-size: 16px; }
.g-chat__form textarea:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.g-chat__send { flex: 0 0 auto; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.g-chat__send svg { width: 1.2rem; height: 1.2rem; }

/* ---------- 20. Kustība ---------- */
.g-reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .75, .25, 1); }
.g-reveal.is-visible { opacity: 1; transform: none; }
.g-enter { animation: g-enter .6s cubic-bezier(.2, .75, .25, 1) both; }
@keyframes g-enter { from { opacity: 0; transform: translateY(16px); } }
.g-celebrate { position: relative; }
.g-celebrate .g-state__icon--success { animation: g-pop .5s cubic-bezier(.2, .9, .3, 1.5) both; }
.g-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.g-confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; opacity: 0; animation: g-confetti 2.4s ease-out forwards; }
@keyframes g-confetti { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(320px) rotate(540deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .g-reveal { opacity: 1; transform: none; }
  .g-confetti { display: none; }
}

/* Leaflet karte tumšajā režīmā — mazāk spilgta */
html[data-mode="dark"] .leaflet-tile-pane { filter: brightness(.82) contrast(1.05) saturate(.9); }

/* html5-qrcode bibliotēkas iekšējie elementi */
#qr-reader { border: 0 !important; }
#qr-reader img[alt="Info icon"], #qr-reader__dashboard_section_csr span { display: none !important; }
#qr-reader__scan_region { background: #000; }

/* Ārējā vietnes izvēlne (punkts.php), ja tā ir ielādēta (vairs netiek izmantota) */
body.has-site-menu { padding-top: 5rem; }
body.has-site-menu .g-topbar { position: relative; }
details > summary::-webkit-details-marker { display: none; }
/* Vieta peldošajai čata pogai, lai tā neaizsedz pēdējo saturu */
body:has(.g-chat) { padding-bottom: calc(var(--actionbar-h) + 5rem + var(--safe-b)); }

/* ---------- 20. Papildu dizaina iespējas (admin → Spēles dizains) ---------- */

/* Jauni galvenes raksti */
html[data-pattern="waves"] { --g-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M0 20c15-14 30-14 45 0s30 14 45 0 30-14 30 0'/%3E%3Cpath d='M0 36c15-14 30-14 45 0s30 14 45 0 30-14 30 0'/%3E%3C/svg%3E"); --g-pattern-size: 120px 40px; }
html[data-pattern="stars"] { --g-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' fill='black'%3E%3Cpath d='m20 8 2.6 5.4 5.9.9-4.3 4.1 1 5.8L20 21.5 14.8 24.2l1-5.8-4.3-4.1 5.9-.9z'/%3E%3Cpath d='m64 46 1.9 3.9 4.2.6-3.1 3 .8 4.2-3.8-2-3.8 2 .8-4.2-3.1-3 4.2-.6z'/%3E%3Ccircle cx='74' cy='16' r='2.4'/%3E%3Ccircle cx='40' cy='68' r='2'/%3E%3Ccircle cx='8' cy='52' r='1.8'/%3E%3C/svg%3E"); --g-pattern-size: 90px; }
html[data-pattern="hex"] { --g-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='96' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M28 1 54 16v32L28 63 2 48V16z'/%3E%3Cpath d='M0 49l2-1v32l-2 1zM56 49l-2-1v32l2 1z'/%3E%3Cpath d='M28 97 54 82V50M28 97 2 82V50'/%3E%3C/svg%3E"); --g-pattern-size: 56px 96px; }

/* Galvenes augstums */
html[data-hero-size="compact"] .g-hero:not(.g-hero--compact) { padding: 1.9rem 0 2.4rem; }
html[data-hero-size="compact"] .g-hero:not(.g-hero--compact) .g-hero__title { font-size: clamp(1.8rem, 7.5vw, 3rem); }
html[data-hero-size="tall"] .g-hero:not(.g-hero--compact) { padding: 4rem 0 5rem; }
html[data-hero-size="tall"] .g-hero:not(.g-hero--compact) .g-hero__title { font-size: clamp(2.3rem, 10vw, 4.6rem); }

/* Lapas fona tonis: neatkarīgs no gaišā/tumšā režīma, tāpēc nekad nesabojā kontrastu */
html[data-surface="tinted"] body { background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent) 0%, transparent 38rem); background-repeat: no-repeat; }
html[data-surface="warm"] body { background-image: linear-gradient(180deg, color-mix(in srgb, #f59e0b 12%, transparent) 0%, transparent 38rem); background-repeat: no-repeat; }

/* Kartīšu stils */
html[data-cards="outline"] .g-card { box-shadow: none; border-width: 2px; border-color: color-mix(in srgb, var(--ink) 16%, transparent); }
html[data-cards="flat"] .g-card { box-shadow: none; border-color: transparent; background: var(--surface-2); }

/* Pogu stils (tikai galvenā poga, pārējās paliek nemainīgas) */
html[data-buttons="gradient"] .g-btn--primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: var(--on-accent); }
html[data-buttons="outline"] .g-btn--primary { background: transparent; color: var(--accent-ink); border-color: var(--accent); box-shadow: none; }
html[data-buttons="outline"] .g-btn--primary:hover { background: var(--accent-soft); filter: none; }
