/* Ziyo design tokens and shared components (v1, 2026-11-09).
   Load after every other stylesheet on a page that adopts the system.
   Adopted site-wide on 2026-11-10 (Full pages; Lite game detail). See docs/design-system-v1.md. */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,700;0,800;1,800&display=swap");

:root{
  /* Colour: brand */
  --z-brand:#075438;          /* deep green: headings, links, dark panels */
  --z-brand-strong:#053f2a;   /* hover / pressed on brand */
  --z-lime:#c4f32b;           /* primary action */
  --z-lime-strong:#b3e31a;    /* primary hover */
  --z-ink:#123a2c;            /* body text, text on lime */
  --z-muted:#52685d;          /* secondary text (5.6:1 on white) */
  --z-bg:#f4f7f5;             /* page background */
  --z-surface:#ffffff;        /* cards, inputs */
  --z-surface-alt:#eef6e7;    /* tinted panels */
  --z-line:#d6e0da;           /* borders, dividers */
  --z-line-strong:#b9cbc1;    /* secondary-button border */
  --z-focus:#7fb39a;          /* focus ring */

  /* Colour: status (text / tint) */
  --z-success:#1f6b35;  --z-success-tint:#e5f4e9;
  --z-warning:#7a5200;  --z-warning-tint:#fff2d1;
  --z-danger:#9d2f2f;   --z-danger-tint:#fbe9e9;
  --z-info:#1d4f7a;     --z-info-tint:#e6eff8;
  --z-level:#2f5a12;    --z-level-tint:#eef6d9;
  --z-neutral:#3f5349;  --z-neutral-tint:#edf2ef;

  /* Type scale (px) */
  --z-text-xs:12px;  /* labels, tags */
  --z-text-sm:14px;  /* meta, secondary text */
  --z-text-md:16px;  /* body */
  --z-text-lg:18px;  /* card titles */
  --z-text-xl:22px;  /* section titles */
  --z-text-2xl:28px; /* page titles */
  --z-text-3xl:34px; /* hero */
  --z-weight-regular:400; --z-weight-medium:600; --z-weight-bold:700; --z-weight-heavy:800;
  --z-leading-tight:1.25; --z-leading-normal:1.5;
  /* Display face for sporty headings and big numbers (Latin only; CJK falls back to the system font). */
  --z-font-display:'Barlow Condensed','Arial Narrow','Roboto Condensed',sans-serif;

  /* Radius */
  --z-radius-sm:8px; --z-radius-md:12px; --z-radius-lg:16px; --z-radius-xl:24px; --z-radius-pill:999px;

  /* Spacing (4px base) */
  --z-space-1:4px; --z-space-2:8px; --z-space-3:12px; --z-space-4:16px;
  --z-space-5:20px; --z-space-6:24px; --z-space-8:32px; --z-space-10:40px;

  /* Elevation */
  --z-shadow-sm:0 1px 2px rgba(18,58,44,.06);
  --z-shadow-md:0 4px 18px rgba(18,58,44,.08);

  /* Control sizes */
  --z-control-md:44px; /* minimum touch target */
  --z-control-sm:36px;

  /* Legacy variable names used across existing stylesheets */
  --bg:var(--z-bg); --text:var(--z-ink); --muted:var(--z-muted); --line:var(--z-line);
  --accent:var(--z-lime); --card:var(--z-surface); --danger:var(--z-danger);
}

/* ---------- Z tail (from the logo): a stroke that runs flat, narrows and flicks up to a sharp point ----------
   One shape, three uses: .z-tail (divider, full width), .z-tail--short (heading underline), .z-tail-heading (adds
   the short tail under a heading). Colour = currentColor; --z-tail-h sets the size (line thickness = h / 4).
   Kept low (7–12px) so a tail adds little vertical space. */
:root{--z-tail-tip:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 12' preserveAspectRatio='none'%3E%3Cpath d='M0 9C10 8.7 18 7.2 26 0C21 7.4 13 11.5 0 12Z'/%3E%3C/svg%3E")}
.z-tail,.z-tail-heading::after{
  --z-tail-h:7px;
  display:block;height:var(--z-tail-h);background:currentColor;
  -webkit-mask:var(--z-tail-tip) right bottom/calc(var(--z-tail-h)*2.17) var(--z-tail-h) no-repeat,linear-gradient(#000 0 0) left bottom/calc(100% - var(--z-tail-h)*2.1) calc(var(--z-tail-h)/4) no-repeat;
          mask:var(--z-tail-tip) right bottom/calc(var(--z-tail-h)*2.17) var(--z-tail-h) no-repeat,linear-gradient(#000 0 0) left bottom/calc(100% - var(--z-tail-h)*2.1) calc(var(--z-tail-h)/4) no-repeat;
}
.z-tail{color:var(--z-line-strong)}
.z-tail--short,.z-tail-heading::after{--z-tail-h:9px;width:48px;color:var(--z-brand)}
.z-tail-heading::after{content:"";margin-top:4px}
.z-tail--lime{color:var(--z-lime)}

/* ---------- Page language (Court Line, site-wide) ---------- */
/* Page header: dark green with faint court lines, sporty title and a lime Z tail. Existing page headers opt in by
   class name here (.hero home, .courts-hero, .points-hero, .help-heading) or with .z-hero. */
:root{--z-court-lines:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 220'%3E%3Cg fill='none' stroke='%23c4f32b' stroke-opacity='.22' stroke-width='2'%3E%3Crect x='1' y='10' width='298' height='200'/%3E%3Cline x1='150' y1='2' x2='150' y2='218' stroke-width='4'/%3E%3Cline x1='102' y1='10' x2='102' y2='210'/%3E%3Cline x1='198' y1='10' x2='198' y2='210'/%3E%3Cline x1='1' y1='110' x2='102' y2='110'/%3E%3Cline x1='198' y1='110' x2='299' y2='110'/%3E%3C/g%3E%3C/svg%3E")}
.z-hero,.hero,.courts-hero,.points-hero,.help-heading,.zr-hero,.community-heading,.game-heading:not(.zc-hero){
  background:var(--z-court-lines) right -90px top 18px/330px 240px no-repeat,var(--z-brand);
  color:#fff;border-radius:var(--z-radius-xl);
}
.courts-hero,.help-heading,.z-hero,.community-heading{padding:22px 22px 24px;margin-bottom:var(--z-space-4)}
.community-heading{align-items:flex-end}
.z-hero h1,.hero h1,.courts-hero h1,.points-hero h1,.help-heading h1,.zr-hero h1,.community-heading h1,.game-heading:not(.zc-hero) h1{
  color:#fff;font-family:var(--z-font-display);font-style:italic;font-weight:800;text-transform:uppercase;
  font-size:clamp(34px,7vw,54px);line-height:.98;letter-spacing:.5px;overflow-wrap:anywhere;
}
/* city-selector.css pins the home title small with !important for the old wide face; the condensed face fits more. */
html:not([lang^="zh"]) .hero h1{font-size:clamp(34px,9vw,52px)!important;line-height:.98}
.z-hero h1::after,.hero h1::after,.courts-hero h1::after,.points-hero h1::after,.help-heading h1::after,.zr-hero h1::after,.community-heading h1::after,.game-heading:not(.zc-hero) h1::after{color:var(--z-lime);width:min(70%,320px);--z-tail-h:11px}
.z-hero p,.hero p,.courts-hero p,.help-heading p,.zr-hero p,.z-hero .eyebrow,.hero .eyebrow,.courts-hero .eyebrow,.help-heading .eyebrow,.zr-hero .eyebrow{color:rgba(255,255,255,.84)}
.z-hero .eyebrow,.hero .eyebrow,.courts-hero .eyebrow,.help-heading .eyebrow,.zr-hero .eyebrow{letter-spacing:1.2px}
.z-hero a:not([class*="btn"]),.courts-hero a:not([class*="btn"]),.help-heading a:not([class*="btn"]),.community-heading a:not([class*="btn"]){color:#fff}
.community-heading .community-jump{color:var(--z-lime)!important;font-weight:700}
.z-hero .ghost-btn,.z-hero .secondary-btn,.courts-hero .ghost-btn,.courts-hero .secondary-btn,.help-heading .ghost-btn,.points-hero .ghost-btn{background:transparent;border-color:rgba(255,255,255,.55);color:#fff}

/* Page titles everywhere use the display face and end with a short Z tail. */
main h1{font-family:var(--z-font-display);font-style:italic;font-weight:800;text-transform:uppercase;letter-spacing:.3px;line-height:1.02}
main h1::after{content:"";display:block;margin-top:6px;--z-tail-h:9px;width:56px;height:var(--z-tail-h);background:currentColor;color:var(--z-brand);
  -webkit-mask:var(--z-tail-tip) right bottom/calc(var(--z-tail-h)*2.17) var(--z-tail-h) no-repeat,linear-gradient(#000 0 0) left bottom/calc(100% - var(--z-tail-h)*2.1) calc(var(--z-tail-h)/4) no-repeat;
          mask:var(--z-tail-tip) right bottom/calc(var(--z-tail-h)*2.17) var(--z-tail-h) no-repeat,linear-gradient(#000 0 0) left bottom/calc(100% - var(--z-tail-h)*2.1) calc(var(--z-tail-h)/4) no-repeat}
/* The game detail hero draws its own tail element. */
main .zc-hero h1::after{content:none}

/* Panel section titles: same face, short Z tail (as "About this game" on the detail page). */
main .panel>h2,main .game-panel>h2,.z-section-title{font-family:var(--z-font-display);font-style:italic;font-weight:800;text-transform:uppercase;letter-spacing:.3px;font-size:clamp(21px,4.5vw,25px);line-height:1.05}
main .panel>h2::after,main .game-panel>h2::after,.z-section-title::after{content:"";display:block;margin-top:4px;--z-tail-h:9px;width:48px;height:var(--z-tail-h);background:var(--z-brand);
  -webkit-mask:var(--z-tail-tip) right bottom/calc(var(--z-tail-h)*2.17) var(--z-tail-h) no-repeat,linear-gradient(#000 0 0) left bottom/calc(100% - var(--z-tail-h)*2.1) calc(var(--z-tail-h)/4) no-repeat;
          mask:var(--z-tail-tip) right bottom/calc(var(--z-tail-h)*2.17) var(--z-tail-h) no-repeat,linear-gradient(#000 0 0) left bottom/calc(100% - var(--z-tail-h)*2.1) calc(var(--z-tail-h)/4) no-repeat}

/* The hidden attribute always wins over component display rules (e.g. a hidden Retry button). */
[hidden]{display:none!important}

/* ---------- Buttons: primary / secondary / text (+ danger) ---------- */
.z-btn,.primary-btn,.ghost-btn,.secondary-btn,.text-btn,.danger-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:var(--z-space-2);
  /* Vertical padding (not only min-height) keeps text centred when a page sets display:block. */
  min-height:var(--z-control-md);padding:12px var(--z-space-5);
  border:1px solid transparent;border-radius:var(--z-radius-pill);
  font:inherit;font-size:15px;font-weight:var(--z-weight-bold);line-height:1.2;
  text-align:center;text-decoration:none;cursor:pointer;
  transition:background-color .15s,border-color .15s,color .15s;
}
.z-btn--primary,.primary-btn{background:var(--z-lime);border-color:var(--z-lime);color:var(--z-ink)}
.z-btn--primary:hover,.primary-btn:hover{background:var(--z-lime-strong);border-color:var(--z-lime-strong);filter:none}
.z-btn--secondary,.ghost-btn,.secondary-btn{background:var(--z-surface);border-color:var(--z-line-strong);color:var(--z-brand)}
.z-btn--secondary:hover,.ghost-btn:hover,.secondary-btn:hover{border-color:var(--z-brand)}
.z-btn--text,.text-btn{background:transparent;border-color:transparent;color:var(--z-brand);padding:12px var(--z-space-2);text-decoration:underline;text-underline-offset:3px}
.z-btn--text:hover,.text-btn:hover{color:var(--z-brand-strong)}
.z-btn--danger,.danger-btn{background:var(--z-surface);border-color:#e2b8b8;color:var(--z-danger)}
.z-btn--danger:hover,.danger-btn:hover{background:var(--z-danger);border-color:var(--z-danger);color:#fff}
.z-btn--sm{min-height:var(--z-control-sm);padding:8px var(--z-space-4);font-size:var(--z-text-sm)}
.z-btn--block{display:flex;width:100%}
.z-btn:disabled,.primary-btn:disabled,.ghost-btn:disabled,.secondary-btn:disabled,.text-btn:disabled,.danger-btn:disabled{opacity:.5;cursor:not-allowed}
.z-btn:focus-visible,.primary-btn:focus-visible,.ghost-btn:focus-visible,.secondary-btn:focus-visible,.text-btn:focus-visible,.danger-btn:focus-visible{outline:3px solid var(--z-focus);outline-offset:2px}
/* On dark brand panels the secondary button turns outline-on-dark. */
.z-on-dark .z-btn--secondary,.z-on-dark .ghost-btn,.z-on-dark .secondary-btn,.hero .secondary-btn{background:transparent;border-color:rgba(255,255,255,.55);color:#fff}
.z-on-dark .z-btn--secondary:hover,.z-on-dark .ghost-btn:hover,.hero .secondary-btn:hover{border-color:#fff}

/* ---------- Status tag (one shape, semantic colours) ---------- */
/* .pill (game detail statuses) and .badge (level ranges) share the tag shape. */
.z-tag,.pill,.badge{
  display:inline-flex;align-items:center;gap:var(--z-space-1);
  min-height:24px;padding:2px 10px;border-radius:var(--z-radius-pill);
  font-size:var(--z-text-xs);font-weight:var(--z-weight-bold);line-height:1.3;white-space:nowrap;
  background:var(--z-neutral-tint);color:var(--z-neutral);
}
.z-tag--level,.badge{background:var(--z-level-tint);color:var(--z-level)}
.z-tag--success{background:var(--z-success-tint);color:var(--z-success)}
.z-tag--warning{background:var(--z-warning-tint);color:var(--z-warning)}
.z-tag--danger{background:var(--z-danger-tint);color:var(--z-danger)}
.z-tag--info{background:var(--z-info-tint);color:var(--z-info)}

/* ---------- Game card (home, Games list) ---------- */
.z-game-card{
  display:flex;flex-direction:column;gap:var(--z-space-2);min-width:0;
  background:var(--z-surface);border:1px solid var(--z-line);border-radius:var(--z-radius-lg);
  padding:var(--z-space-4);box-shadow:var(--z-shadow-sm);color:var(--z-ink);text-align:start;
  position:relative;
}
/* The whole card is one tap target: the title link is stretched over it. */
.z-game-card__title a::after{content:"";position:absolute;inset:0;border-radius:inherit}
.z-game-card:focus-within{outline:2px solid var(--z-brand);outline-offset:2px}
.z-game-card__title a:focus-visible{outline:none}
.z-game-card:active{background:var(--z-surface-alt)}
@media (max-width:719px){
  .z-game-card{padding:var(--z-space-3) var(--z-space-4);gap:6px}
  .z-game-card__title{margin-top:2px}
}

/* ---------- First-visit language bar (i18n.js): replaces the blocking language dialog ---------- */
.language-hint{
  position:fixed;z-index:40;left:var(--z-space-3);right:var(--z-space-3);bottom:calc(var(--mobile-tab-height,0px) + var(--z-space-3));
  display:flex;align-items:center;gap:var(--z-space-1);max-width:420px;margin-inline:auto;padding:var(--z-space-1);
  background:var(--z-brand);color:#fff;border-radius:var(--z-radius-pill);box-shadow:var(--z-shadow-sm);
}
.language-hint button{min-height:44px;border:0;background:transparent;color:inherit;font:inherit;font-size:var(--z-text-sm);cursor:pointer}
.language-hint__change{flex:1;min-width:0;padding:0 var(--z-space-4);text-align:start;font-weight:var(--z-weight-bold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.language-hint__close{flex:0 0 44px;font-size:var(--z-text-xl);line-height:1}
.language-hint button:focus-visible{outline:2px solid var(--z-lime);outline-offset:-2px;border-radius:var(--z-radius-pill)}

/* ---------- Small fixes found in the 2026-11-10 mobile review ---------- */
footer a:not([class*="btn"]){color:var(--z-brand)}
.home-dashboard-actions a:not([class*="btn"]){color:var(--z-brand);font-weight:var(--z-weight-bold)}
.install-app-icon{object-fit:contain}
@media (max-width:430px){
  header.nav.compact-brand-header{--logo-height:40px;min-height:60px;padding-block:8px!important}
}
.z-game-card__tags{display:flex;flex-wrap:wrap;gap:var(--z-space-2)}
.z-game-card__title{margin:var(--z-space-1) 0 0;font-size:var(--z-text-lg);font-weight:var(--z-weight-bold);line-height:var(--z-leading-tight);overflow-wrap:anywhere}
.z-game-card__title a{color:inherit;text-decoration:none}
.z-game-card__title a:hover{text-decoration:underline;text-underline-offset:3px}
.z-game-card__meta{margin:0;font-size:var(--z-text-sm);color:var(--z-muted);line-height:var(--z-leading-normal);overflow-wrap:anywhere}
.z-game-card__when{color:var(--z-ink);font-weight:var(--z-weight-medium)}
/* Time on the left, venue right-aligned on the same row (a long venue wraps inside its own column). */
.z-game-card__row{display:flex;align-items:baseline;justify-content:space-between;gap:var(--z-space-3)}
.z-game-card__row .z-game-card__when{flex-shrink:0;white-space:nowrap}
.z-game-card__venue{min-width:0;text-align:right}
.z-game-card__price{font-weight:var(--z-weight-bold);color:var(--z-ink)}
.z-game-card .z-btn{margin-top:var(--z-space-2)}
.z-game-card .z-tail{margin-top:var(--z-space-1)}
.z-game-list{display:grid;gap:var(--z-space-3)}
@media (min-width:720px){.z-game-list{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:var(--z-space-4)}}

/* Shortcuts from the Find games tab to the other directories (navigation v2). */
.z-explore-links{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}
.z-explore-links a{display:inline-flex;align-items:center;min-height:40px;padding:6px 11px;border:1px solid var(--z-line,#d5dfda);border-radius:999px;background:#fff;color:var(--z-brand,#075438);font-size:13px;font-weight:600;text-decoration:none}
.z-explore-links a:focus-visible{outline:2px solid #075438;outline-offset:2px}
