/* ============================================================
   VILLAVERSE: shared responsive layer. Loaded LAST on every public page, so it refines css/style.css and the page stylesheets.
   Desktop and laptop keep the existing design (this file only trims spacing on short or small screens).
   Phones (html.m-app, set by js/mobile-shell.js) get a native-app shell: fixed header + permanent bottom navigation, tiles that fill the
   screen, and panels that scroll inside a stationary frame. New features inherit this by using the same page shell (.screen > main).
   Tokens: --m-head, --m-nav (safe-area aware), --app-h (visible height, follows address bars and the keyboard).
   ============================================================ */

/* ---------- everywhere ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; overscroll-behavior: none; }
img, video, canvas, svg { max-width: 100%; }
.screen { min-height: 0; }
dialog { max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); }

/* ---------- laptops and short desktop windows (browser zoom and Windows scaling shrink the viewport the same way) ---------- */
@media (min-width: 761px) and (max-width: 1100px) {            /* tablets and small windows: keep the account box clear of the tabs (the only narrow-window menu rule) */
  .tabs--top .tab { padding: 0.5625rem 0.6875rem; font-size: 0.8125rem; letter-spacing: .08em; }
  .tabs--top { margin-right: 13.75rem; }
}
/* very short desktop windows (high browser zoom, tiny windows): keep the layout's minimum height and let the page scroll rather than hide anything */
html:not(.m-app) { --min-screen: 520px; }
@media (min-width: 761px) and (max-height: 520px) {
  html:not(.m-app), html:not(.m-app) body { overflow-y: auto; height: auto; }
  html:not(.m-app) .screen { height: var(--min-screen); }
}
/* ============================================================
   FLUID ROOT: the one scale the whole interface is sized from
   ------------------------------------------------------------
   Every size in the public stylesheets is in rem (only 1-2px hairlines and
   media-query breakpoints stay in px), so this one value scales text, buttons,
   the menu, spacing and panels together, in step with the vw/vh-sized boxes.
   Reference: a 1920x945 desktop viewport (a 1080p screen at 100%) = 16px, the
   size the layout was designed at, so the PC look is unchanged.
   Smaller viewports scale down with the smaller of width and height. That covers
   laptops and Windows display scaling: at 125% / 150% a 1920x1080 screen gives a
   1536x730 / 1280x610 CSS viewport. The scale is mostly fluid (3px fixed + 13px
   fluid), so a laptop keeps close to the PC's proportions (about 81% at 1536x730)
   while text stays readable; it never drops below 11.5px. Very large screens grow
   up to 20px (this replaces the old jump to 20px at 2200px wide).
   ============================================================ */
html { font-size: clamp(11.5px, calc(3px + min(0.6771vw, 1.3757vh)), 20px); }
/* Desktop pages leave a little room at the bottom, so a taskbar or a window that
   sits slightly below the screen edge never covers the last row of the page. */
html:not(.m-app) .screen { box-sizing: border-box; padding-bottom: clamp(0.75rem, 3.5vh, 2.25rem); }
/* The app shell (phones, portrait tablets, narrow or short windows) has its own scale. It follows the
   smaller of width and height, so a short landscape window (a narrowed laptop window, a phone held
   sideways) is not crowded: about 14px on a 390x844 phone, 13.3px in a 654x486 window, 15px max. */
html.m-app { font-size: clamp(12px, min(calc(11px + 0.8vw), calc(7px + 1.3vh)), 15px); }

/* ============================================================
   PHONE APP SHELL
   ============================================================ */
html:not(.m-app) .m-head, html:not(.m-app) .m-nav, html:not(.m-app) .m-sheet { display: none !important; }

html.m-app {
  --m-head: calc(3rem + env(safe-area-inset-top, 0px));
  --m-nav: calc(3.75rem + env(safe-area-inset-bottom, 0px));
  --m-pad: 0.5rem;
}
html.m-app, html.m-app body { height: var(--app-h, 100dvh); overflow: hidden; position: fixed; top: var(--app-top, 0px); left: 0; right: 0; bottom: auto; width: 100%; }
/* The page canvas has its own dark colour. The shell is sized to the visible area, and iOS Safari paints the canvas wherever the
   page does not reach: behind its floating address pill above the keyboard, and during the keyboard animation. Without a colour
   of its own that canvas was white (the dark gradient is on body, which only covers the shell). */
html.m-app { background-color: #14030c; }
html.m-app .top-bar,
html.m-app .tabs--top,
html.m-app .menu-col > .tabs,
html.m-app .account-box { display: none !important; }
html.m-app .screen {
  height: var(--app-h, 100dvh); box-sizing: border-box;
  padding: var(--m-head) 0 var(--m-nav);
  overflow: hidden;
}
html.m-app.m-kb .screen { padding-bottom: 0; }
html.m-app.m-kb .m-nav { display: none; }
html.m-app input, html.m-app select, html.m-app textarea { font-size: 1rem; }          /* stops iOS zooming into a focused field */
html.m-app a, html.m-app button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* header */
.m-head {
  position: fixed; top: var(--app-top, 0px); left: 0; right: 0; z-index: 90;
  height: var(--m-head); padding: env(safe-area-inset-top, 0px) max(0.625rem, env(safe-area-inset-right, 0px)) 0 max(0.625rem, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: linear-gradient(180deg, rgba(22,4,13,.98), rgba(14,3,9,.97));
  border-bottom: 1px solid rgba(148,190,229,.28);
}
.m-icon-btn {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; cursor: pointer; color: #fff; text-decoration: none;
  background: none; border: 0; border-radius: 0;
}
.m-icon-btn:active { background: rgba(148,190,229,.18); }
.m-profile.is-in .m-initial { display: grid; place-items: center; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--sky); color: var(--claret); font: 400 1.0625rem var(--ff-display), sans-serif; }
.m-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: #fff; }
.m-brand img { height: 1.625rem; width: auto; }
.m-brand span { font: 400 1.375rem/1 var(--ff-display), sans-serif; padding-top: 2px; letter-spacing: .02em; }
.m-brand b { color: var(--sky); font-weight: 400; }

/* bottom navigation */
.m-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  height: var(--m-nav); padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(180deg, rgba(16,3,10,.98), rgba(10,2,6,.99));
  border-top: 1px solid rgba(148,190,229,.3);
}
.m-nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1875rem; min-width: 0; padding: 0.25rem 2px 0;
  color: rgba(255,255,255,.58); text-decoration: none; font: 600 0.5938rem/1.1 var(--ff-ui), sans-serif; letter-spacing: .05em; text-transform: uppercase; text-align: center;
}
.m-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-nav a.is-active { color: #fff; background: linear-gradient(180deg, rgba(148,190,229,.2), rgba(148,190,229,.04)); }
.m-nav a.is-active::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 0.1875rem; background: var(--sky); box-shadow: 0 0 0.625rem rgba(148,190,229,.6); }
.m-nav a.is-active svg { color: var(--sky); }
.m-nav a:active { background: rgba(148,190,229,.18); }

/* settings sheet */
.m-sheet { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; background: rgba(4,1,3,.66); }
.m-sheet[hidden] { display: none; }
.m-sheet-panel { width: 100%; max-height: 80%; overflow-y: auto; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #2a0818, #14030c); border-top: 2px solid var(--sky); }
.m-sheet-title { margin: 0 0 0.5rem; font: 400 1.5rem var(--ff-display), sans-serif; letter-spacing: .05em; color: var(--sky); }
.m-sheet-link, .m-sheet-close { display: block; width: 100%; min-height: 3rem; padding: 0.75rem 0.375rem; text-align: left; font: 500 1rem var(--ff-ui), sans-serif; letter-spacing: .06em;
  color: #fff; text-decoration: none; background: none; border: 0; border-bottom: 1px solid rgba(148,190,229,.2); cursor: pointer; }
.m-sheet-close { margin-top: 0.625rem; text-align: center; background: rgba(148,190,229,.14); border: 1px solid rgba(148,190,229,.4); }
.m-sheet-out { color: #f2caca; }
body.m-sheet-open { overflow: hidden; }

/* landscape phones: slimmer bars */
@media (max-height: 500px) {
  html.m-app { --m-head: calc(2.375rem + env(safe-area-inset-top, 0px)); --m-nav: calc(2.75rem + env(safe-area-inset-bottom, 0px)); }
  .m-icon-btn { height: 2.375rem; }
  .m-nav a { flex-direction: row; gap: 0.375rem; font-size: 0.625rem; }
  .m-nav a svg { width: 1.25rem; height: 1.25rem; }
}
@media (max-width: 340px) { .m-nav a { font-size: 0.5312rem; letter-spacing: .02em; } }

/* ---------- stage: every page's main area fills the space between the bars and never scrolls itself ---------- */
html.m-app .deck-stage, html.m-app .stage, html.m-app main { min-height: 0; }
html.m-app .deck-stage { flex: 1 1 0; overflow: hidden; }
html.m-app .deck-head { padding: 0.375rem var(--m-pad) 0; }
html.m-app .deck-title { font-size: clamp(1.35rem, 6.2vw, 1.8rem); line-height: 1; }
html.m-app .head-rule { margin-top: 0.375rem; --lead: 4.375rem; }
html.m-app .deck-head--row { gap: 0.5rem; align-items: center; }
html.m-app .deck-sub, html.m-app .pc-tag { display: none; }
html.m-app :is(.back-btn, .help-btn) { min-height: 2.25rem; padding: 0 0.625rem; font-size: 0.6875rem; letter-spacing: .08em; }

/* panels that hold lists scroll inside the frame */
html.m-app .vg-scroll, html.m-app .mem-wrap, html.m-app .page-body { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-left: var(--m-pad); padding-right: var(--m-pad); padding-bottom: 1rem; }

/* backdrop: stationary, lighter on phones */
html.m-app .band { display: none; }
html.m-app .bg-photo { background-position: 60% center; }

/* ---------- home: rectangular tiles that fill the visible screen ---------- */
html.m-app body:not(.subpage) .screen { padding-left: 0; padding-right: 0; }
html.m-app .stage { grid-template-columns: 1fr; padding: var(--m-pad); height: 100%; }
html.m-app .player-wrap { display: none; }
html.m-app .menu-col { height: 100%; padding: 0; align-self: stretch; }
html.m-app .menu-fit { height: 100%; container-type: normal; }
html.m-app .menu {
  width: 100%; height: 100%; gap: 0.375rem; --menu-ar: auto;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr));
  grid-template-areas: "top top" "clips s1" "clips s2";
}
/* phone home: the most recently visited of News / Fan Shop / Villa Games runs across the top; Villa Videos sits beside the other two */
html.m-app .menu > .panel--clips { grid-area: clips; }
html.m-app .menu > .panel[data-slot="big"] { grid-area: top; }
html.m-app .menu > .panel[data-slot="s1"] { grid-area: s1; }
html.m-app .menu > .panel[data-slot="s2"] { grid-area: s2; }
html.m-app .panel--shop .panel-img { background-position: 50% 35%; }
html.m-app .panel, html.m-app .panel-inner { clip-path: none; border-radius: 0; }
html.m-app .panel { min-height: 0; animation: none; }
html.m-app .panel::before { display: none; }
html.m-app .panel:hover { transform: none; }
html.m-app .panel .label { font-size: clamp(1.1rem, 5vw, 1.45rem); }
html.m-app .panel--clips .label { font-size: clamp(1.6rem, 8vw, 2.25rem); }
html.m-app .panel--clips .panel-img { background-position: 50% 20%; }
html.m-app .panel:not(.panel--clips) .label,
html.m-app .panel[data-slot="s1"] .label, html.m-app .panel[data-slot="s2"] .label { font-size: clamp(1.1rem, 5vw, 1.45rem); }
html.m-app .panel-copy { padding: 0.625rem 0.75rem; }
html.m-app .panel:not(.panel--clips) .panel-copy,
html.m-app .panel[data-slot="s1"] .panel-copy, html.m-app .panel[data-slot="s2"] .panel-copy { padding: 0.625rem 0.75rem; }
@media (max-height: 500px) {                                    /* phone held sideways: one row of four */
  html.m-app .menu { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; grid-template-areas: "top clips s1 s2"; }
}

/* ---------- pop-ups, forms and payment screens ---------- */
html.m-app dialog { width: calc(100vw - 1rem); max-height: calc(var(--app-h, 100dvh) - 1rem); overflow-y: auto; }
html.m-app .vv-dialog-body { max-height: calc(var(--app-h, 100dvh) - 2rem); overflow-y: auto; }
/* video pop-up (compilations): the video runs edge to edge across the top, so there is no gap above it; the close button sits on it */
html.m-app .vv-dialog-body { --vv-pad: 0.875rem; padding: var(--vv-pad); }
html.m-app .vv-dialog-body > video:first-of-type:is(#vp-video, video) { display: block; width: calc(100% + 2 * var(--vv-pad)); max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: contain; margin: calc(-1 * var(--vv-pad)) calc(-1 * var(--vv-pad)) 0.25rem; background: #000; }
html.m-app .vv-dialog-body > .vv-close { top: 0.25rem; right: 0.25rem; z-index: 6; background: rgba(8, 2, 5, .55); }
html.m-app .mem-plans { grid-template-columns: 1fr; gap: 0.625rem; }
html.m-app .mem-card { padding: 0.875rem; }
html.m-app .g-panel { padding: 0.875rem; clip-path: none; }
html.m-app .g-btn, html.m-app .buy-btn, html.m-app .vg-more { min-height: 2.75rem; }

/* Compilations: the picture sits inside the card's outline with room above it; on phones a tap plays the video in the picture */
html.m-app .vg-card { padding: 0.5rem 0.5rem 0; }
html.m-app .vg-card--inline .vg-thumb { cursor: pointer; }
html.m-app .vg-thumb.is-playing { background: #000; }
html.m-app .vg-thumb.is-playing > :not(.vg-inline) { display: none; }
html.m-app .vg-inline { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
html.m-app .vg-inline.is-wait { opacity: 0; }          /* until its first frame (js/community-videos.js) */
html.m-app .vg-body-btn { appearance: none; width: 100%; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }

/* ---------- Fan Shop: the stage is the scroll frame (featured item, filters, rail, details) ---------- */
html.m-app .shop-stage { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 0.75rem; }
html.m-app .shop-layout { flex: none; padding-left: var(--m-pad); padding-right: var(--m-pad); }
html.m-app .market { min-height: 0; }
html.m-app .market-rail-wrap { min-height: 13.125rem; }
html.m-app .vv-fab { bottom: calc(var(--m-nav) + 0.75rem); right: 0.75rem; }

/* ---------- Villa Games: one shared shell for all six games ---------- */
html.m-app .pyr-stage { overflow: hidden; }
html.m-app .pyr-head { padding: 0.375rem var(--m-pad) 0; }
html.m-app .pyr-head .deck-title { font-size: clamp(1.2rem, 5.6vw, 1.6rem); }
html.m-app .pyr-layout {
  flex: 1 1 0; min-height: 0; padding: 0.375rem var(--m-pad) 0.5rem; gap: 0.375rem;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, var(--m-board, 50%)) minmax(0, 1fr);
}
html.m-app .pyr-layout > :first-child { min-height: 0; min-width: 0; overflow: hidden; }
html.m-app .pyr-board-col { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; gap: 0.25rem; }
html.m-app .pyr-board { height: 100%; }
/* Pyramid: the board was sized by "fit the artwork" while the artwork was sized by "fit the board"; iOS Safari resolved that
   loop to a small pyramid pushed to the left (until a scroll or the keyboard closing forced a fresh layout). On phones a frame
   fills the board's area and is a size container, and the (square) board takes the largest square that fits it, centred: in
   every state (choosing, playing, finished, answers revealed). Desktop: the frame is not a box at all (display: contents). */
.pyr-board-frame { display: contents; }
html.m-app .pyr-board-frame { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; min-width: 0; container-type: size; }
html.m-app .pyr-board-frame > .pyr-board { width: min(100cqw, 100cqh); height: auto; aspect-ratio: 1 / 1; max-width: none; }
html.m-app .pyr-board-frame .pyr-image { width: 100%; height: 100%; max-width: none; }
html.m-app .pyr-qbox { padding: 0.25rem 0.5rem; }
html.m-app .pyr-panel { min-height: 0; padding: 0.5rem 0.625rem 0.625rem; clip-path: none; }
html.m-app .pyr-panel-head { margin-bottom: 0.375rem; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
html.m-app .pyr-panel-title { font-size: 1.1rem; }
html.m-app .pyr-panel-sub { margin: 0; }
html.m-app .pyr-mode { padding: 0.5rem 0.75rem; }
html.m-app .pyr-mode-name { font-size: 1.15rem; }
html.m-app .pyr-mode-copy { margin: 0.25rem 0 0.375rem; font-size: 0.75rem; }
html.m-app .pyr-input, html.m-app .pyr-answer input { min-height: 2.5rem; padding-top: 0.375rem; padding-bottom: 0.375rem; }
html.m-app .pyr-submit { min-height: 2.5rem; }

/* each game's board fits its region exactly (never cropped, never stretched); the panel below holds the controls and scrolls inside itself */
/* each game's own share: the square boards (Bingo, Villa XI) need the most height, the tower and path a little less */
html.m-app .bingo-layout { --m-board: 56%; }
html.m-app .obs-layout { --m-board: 48%; }
html.m-app .mxi-layout { --m-board: 58%; }
html.m-app .cp-layout { --m-board: 50%; }
html.m-app .wd-layout { --m-board: 52%; }
html.m-app .bingo-board-col, html.m-app .obs-tower-col, html.m-app .cp-path-col, html.m-app .wd-board-col, html.m-app .mxi-pitch-col {
  min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 2px;
}
html.m-app .bingo-board, html.m-app .obs-tower, html.m-app .pitch-wrap { height: 100%; width: auto; max-width: 100%; }
/* Villa Career Path: each club is one line (years | club | state), and the rows share the height available, so a short career
   gets taller rows and a long one compact rows. Text is never squeezed below a readable size: past that, the timeline scrolls
   inside itself. The connectors between rows are left out on phones (the order already reads top to bottom). */
html.m-app .cp-path-col { justify-items: stretch; }
html.m-app .cp-path { height: 100%; max-width: 100%; justify-content: flex-start; gap: 0.1875rem; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
html.m-app .cp-link { display: none; }
html.m-app .cp-stage { flex: 1 1 0; min-height: 1.875rem; max-height: 3.25rem; flex-direction: row; align-items: stretch;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.5rem), calc(100% - 0.5rem) 100%, 0 100%); }
html.m-app .cp-years { flex: 0 0 auto; width: 6.5rem; display: flex; align-items: center; padding: 0 0.5rem; border-bottom: 0; border-right: 1px solid rgba(148,190,229,.22);
  font-size: 0.5625rem; letter-spacing: .08em; line-height: 1.1; white-space: nowrap; }
html.m-app .cp-club { flex: 1 1 auto; min-width: 0; padding: 0 3.75rem 0 0.625rem; font-size: clamp(0.875rem, 4.2vw, 1.1rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m-app .cp-mark { top: 50%; bottom: auto; right: 0.5rem; transform: translateY(-50%); font-size: 0.5rem; letter-spacing: .12em; }
html.m-app .cp-villa-stint { padding: 0.3125rem 0.5rem; gap: 0.125rem 0.5rem; }
html.m-app .pyr-block:has(> .cp-guesses) { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding: 0.3125rem 0.5rem; }
html.m-app .pyr-block:has(> .cp-guesses) > * { margin: 0; }
html.m-app .cp-guesses { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0; list-style: none; }
html.m-app .cp-guesses li { display: inline-flex; gap: 0.375rem; align-items: center; padding: 0.125rem 0.4375rem; font-size: 0.6875rem; min-height: 0; }
html.m-app.m-kb .cp-years { width: 5.25rem; padding: 0 0.375rem; font-size: 0.5rem; letter-spacing: .04em; }
html.m-app.m-kb .cp-club { padding-right: 0.375rem; font-size: 0.875rem; }
html.m-app.m-kb .cp-mark { display: none; }
html.m-app .wd-board { height: 100%; max-width: none; grid-template-rows: auto repeat(6, minmax(0, 1fr)); }
/* Villa Reveal: all nine columns fit the phone width (no sideways scrolling, nothing cut off at the right); long values wrap */
html.m-app .wd-board-col { overflow: hidden; }
html.m-app .wd-board { min-width: 0; width: 100%; gap: 2px; }
html.m-app .wd-head { padding: 0 1px 0.125rem; font-size: 0.4375rem; letter-spacing: .03em; overflow: hidden; }
html.m-app .wd-cell { min-width: 0; padding: 0.125rem 1px; font-size: 0.5625rem; line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.3125rem), calc(100% - 0.3125rem) 100%, 0 100%); }
html.m-app .wd-cell[data-state="higher"]::after, html.m-app .wd-cell[data-state="lower"]::after { margin-left: 1px; }
html.m-app .bingo-note, html.m-app .obs-note, html.m-app .cp-note, html.m-app .wd-note { font-size: 0.5625rem; line-height: 1.2; }

/* wide, short app-shell windows (a narrowed laptop window, a phone held sideways): keep the desktop's
   side-by-side arrangement instead of stacking into a tall column with a tiny board */
@media (min-aspect-ratio: 4/3) {
  html.m-app .pyr-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  html.m-app .shop-layout { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); grid-template-rows: auto; align-items: start; }
  html.m-app .feature-panel { flex-direction: column; align-items: stretch; min-height: 0; padding-top: 1.375rem; }
  html.m-app .mem-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.m-app .cl-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
}

/* ============================================================
   PHONE LAYOUT (mobile redesign): components that had no phone rules
   ============================================================ */
/* Inputs: 16px text on phones. Anything smaller makes iOS Safari zoom the whole page when a field is focused
   (the "layout breaks when I type" glitch); 16px is also Android Chrome's comfortable minimum. */
html.m-app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), textarea, select) { font-size: max(16px, 1rem) !important; }
/* the game answer boxes and their buttons: smaller, lighter text (it was oversized on phones) */
html.m-app .pyr-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]) { font-size: 0.875rem !important; letter-spacing: .02em; }
html.m-app .pyr-layout input::placeholder { font-size: 0.875rem; letter-spacing: .02em; }
html.m-app .pyr-answer .pyr-submit { font-size: 0.6875rem; letter-spacing: .1em; padding: 0 0.75rem; }
/* typing suggestions stay inside the visible area above the keyboard */
/* the answer field sits low on a phone (above the keyboard), so its suggestions open upward, over the board, never under the keyboard */
html.m-app .psearch-list { top: auto; bottom: calc(100% + 0.25rem); max-height: min(14rem, calc(var(--app-h, 100dvh) * .35)); overflow-y: auto; }

/* Header rows: the title and its buttons share a line when they fit, otherwise the buttons take their own line;
   buttons never touch, never overflow the screen and share the row evenly */
html.m-app .deck-head--row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; }
html.m-app .deck-head--row > :first-child { flex: 1 1 auto; min-width: 0; }
html.m-app :is(.deck-head-actions, .vault-views, .vv-sections) { display: flex; flex: 1 1 auto; flex-wrap: nowrap; justify-content: flex-end; gap: 0.375rem; min-width: 0; margin: 0; }
html.m-app :is(.deck-head-actions, .vault-views, .vv-sections) > * { flex: 1 1 auto; min-height: 2.25rem; padding: 0 0.625rem; font-size: 0.6875rem; letter-spacing: .06em; white-space: nowrap; }

/* Villa Games hub: the title on the left, the leaderboard link beside it; titles never cut off; the Play cue shows */
html.m-app .deck-stage:has(> .games-grid) { position: relative; }
html.m-app .deck-stage:has(> .games-grid) > .deck-head { padding-right: 12.5rem; }
html.m-app .games-lb { position: absolute; top: 0.375rem; right: var(--m-pad); margin: 0; width: max-content; }
html.m-app .games-lb-link { min-height: 2rem; padding: 0 0.625rem; font-size: 0.6875rem; }
html.m-app .game-name { white-space: normal; overflow: visible; text-overflow: clip; font-size: clamp(0.95rem, 4.2vw, 1.15rem); line-height: 1.05; }
html.m-app .game-bar { min-height: 0; padding: 0.4375rem 0.5rem 0.5rem 0.625rem; gap: 0.25rem; }
html.m-app .game-play { display: inline-flex; font-size: 0.625rem; letter-spacing: .08em; }

/* Fan Shop: the products are the show. The featured panel (the same product is the first card in the list) is left out of the
   phone layout, and the product cards get more width so the photography is larger. */
@media (max-aspect-ratio: 4/3) { html.m-app .shop-layout > .feature-panel { display: none; } }
html.m-app .shop-card { width: clamp(9rem, 40vw, 12rem); }
html.m-app .market-rail-wrap { min-height: 15rem; }
html.m-app .shop-detail, html.m-app .market .item-meta { gap: 0.5rem 0.875rem; }

/* Fan Shop on a phone held upright: lighter type at a smaller size, and the products as a grid three across that fills the screen
   (scrolls inside its own box), so many more items are in view at once. The filters, sort and selected-item bar stay as they are, only smaller. */
@media (max-aspect-ratio: 4/3) {
  html.m-app .shop-stage { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 0.5rem; }
  html.m-app .shop-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  html.m-app .market { flex: 1 1 auto; min-height: 0; padding: 0.625rem 0.625rem 0.5rem; gap: 0.5rem; }
  html.m-app .market-bar { gap: 0.4375rem; }
  html.m-app .market-bar .shop-filter { padding: 0.4375rem 0.75rem; font-weight: 500; font-size: 0.625rem; letter-spacing: .1em; }
  html.m-app .market-bar .shop-sort-label { font-size: 0.5625rem; letter-spacing: .14em; }
  html.m-app .market-bar .shop-sort-field select { padding: 0.25rem 1.875rem 0.25rem 0.625rem; font-weight: 400; letter-spacing: .03em; }   /* stays 16px: smaller makes iOS zoom in */
  html.m-app .market-rail-wrap { flex: 1 1 auto; min-height: 0; }
  html.m-app .market-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 0.375rem;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 0.125rem; scroll-padding: 0; scroll-snap-type: none; }
  html.m-app .market-rail-wrap .rail-arrow { display: none; }
  html.m-app .market-rail .shop-card { width: auto; min-width: 0; padding: 0 0 0.4375rem; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.5rem), calc(100% - 0.5rem) 100%, 0 100%); }
  html.m-app .market-rail .shop-card-art { flex: none; aspect-ratio: 1; padding: 10%; }
  html.m-app .market-rail .shop-card-art img { filter: drop-shadow(0 0.375rem 0.625rem rgba(0,0,0,.45)); }
  html.m-app .market-rail .shop-card-name { padding: 0 0.4375rem; font-weight: 500; font-size: 0.5625rem; letter-spacing: .05em; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.m-app .market-rail .shop-card-price { padding: 0.25rem 0.4375rem 0; font-size: 0.95rem; }
  html.m-app .market .item-bar { gap: 0.5rem; padding: 0.5rem 0.625rem; }
  html.m-app .market .item-name { margin-bottom: 0.3125rem; font-size: 1.05rem; }
  html.m-app .market .item-field { gap: 0.125rem; }
  html.m-app .market .item-field b { font-size: 0.5rem; letter-spacing: .14em; }
  html.m-app .market .item-field span { font-size: 0.85rem; }
  html.m-app .market .item-actions :is(.buy-btn, .details-btn) { min-height: 2.375rem; padding: 0.4375rem 0.75rem; font-weight: 500; font-size: 0.625rem; letter-spacing: .12em; }
}

/* Product details: photo first and large, then price and the buy button straight after; facts in a compact grid */
html.m-app #item-title { font-size: clamp(1.05rem, 5vw, 1.4rem); line-height: 1.05; }
html.m-app .pd { gap: 0.625rem; padding-top: 0.375rem; }
html.m-app .pd-stage { height: clamp(14rem, 42dvh, 24rem); }
html.m-app .pd-thumbs { gap: 0.375rem; }
html.m-app .pd-thumbs button { width: 3rem; height: 3rem; padding: 0.25rem; }
html.m-app .pd-info { gap: 0.625rem; padding: 0.75rem; }
html.m-app .pd-info .pd-price { padding: 0.375rem 0.875rem 0.5rem 0.75rem; }
html.m-app .pd-info .pd-price .product-price { font-size: 2rem; }
html.m-app .pd-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.375rem; }
html.m-app .pd-fact { padding: 0.4375rem 0.5rem; }
html.m-app .pd-fact dd { font-size: 1rem; }

/* Villa Videos: the two boxes fill the screen and stay put (no dragging), on their plain claret colour; the reel plays over it */
html.m-app .cl-choices { gap: 0.625rem; padding: 0.5rem var(--m-pad) 0.75rem; overflow: hidden; overscroll-behavior: none; touch-action: manipulation;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); align-content: stretch; }
html.m-app .cl-card { min-height: 0 !important; height: 100%; aspect-ratio: auto; background: var(--claret-grad); }
html.m-app .cl-card:is(:hover, :focus-visible) { background: var(--claret-grad); }
@media (min-aspect-ratio: 4/3) { html.m-app .cl-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); } }

/* Villa Vault cards on phones: the scale follows the finger with no easing lag, and the artwork keeps one fixed shadow
   (re-filtering every card on every frame is what made swiping stutter); further cards fade a little instead of darkening. */
html.m-app .deck .card { transition: translate .35s cubic-bezier(.2,.65,.3,1); }
html.m-app .deck .card img { filter: drop-shadow(0 0.75rem 1.25rem rgba(0,0,0,.55)); opacity: calc(1 - .3 * var(--dist, 0)); transition: none; }
html.m-app .deck .card.selected img { filter: drop-shadow(0 0 1.5px rgba(196,222,246,.95)) drop-shadow(0 0 0.75rem rgba(148,190,229,.45)); opacity: 1; }

/* Comp Creator: compact steps and one-line match rows, so many more matches fit before the next step */
html.m-app .cb-step { padding: 0.5rem 0.625rem 0.625rem; }
html.m-app .cb-title { font-size: 1rem; }
html.m-app .cb-matches { grid-template-columns: minmax(0, 1fr); gap: 0.3125rem; }
html.m-app .cb-match { padding: 0.3125rem 0.5rem; min-height: 0; }
html.m-app .cb-match-meta { font-size: 0.5625rem; margin-bottom: 0.125rem; }
html.m-app .cb-match-teams { gap: 0.375rem; }
html.m-app .cb-badge { width: 1.25rem; height: 1.25rem; }
html.m-app .cb-team-name { font-size: 0.75rem; }
html.m-app .cb-score { font-size: 0.95rem; }
html.m-app .cb-players { gap: 0.3125rem; }
html.m-app .cb-mode { gap: 0.625rem; flex-wrap: nowrap; padding: 0.25rem var(--m-pad) 0.5rem; }
html.m-app .cb-mode > .cb-tool { flex: 1 1 auto; min-width: 0; justify-content: center; text-align: center; padding-left: 0.5rem; padding-right: 0.5rem; letter-spacing: .05em; gap: 0.375rem; }
html.m-app .cb-stage .deck-head-actions { gap: 0.625rem; }

/* match and player steps close like a drop-down once something is picked (js/clip-builder.js) */
.cb-picked { display: none; }
html.m-app .cb-step.has-pick .cb-title { cursor: pointer; flex-wrap: wrap; row-gap: 0.125rem; }
html.m-app .cb-step.has-pick .cb-title::after { content: ""; margin-left: auto; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(45deg); transition: transform .2s ease; }
html.m-app .cb-step.has-pick.is-collapsed .cb-title::after { transform: rotate(-45deg); }
html.m-app .cb-step.has-pick .cb-picked { display: block; order: 3; flex: 1 0 100%; font: 500 0.8125rem/1.25 var(--ff-ui), sans-serif; letter-spacing: .02em; text-transform: none; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.m-app .cb-step.is-collapsed .cb-title { margin-bottom: 0; }
html.m-app .cb-step.is-collapsed .cb-body { display: none; }

/* News: shorter Top News cards, so more stories fit */
html.m-app .tn-lead { min-height: 0; }
html.m-app .tn-lead-slot { height: 20dvh; max-height: 20dvh; }
html.m-app .nt-body:has(> .tn-lead-slot) { grid-template-rows: auto minmax(0, 1fr); }   /* the list takes all the room the smaller headline leaves */
html.m-app .tn-lead-body { padding: 0.375rem 0.625rem 0.4375rem; }
html.m-app .tn-lead-headline { font-size: clamp(0.95rem, 4.2vw, 1.1rem); line-height: 1.08; }
html.m-app .tn-item { padding: 0.375rem 0.625rem; }
html.m-app .tn-item-headline { font-size: 0.8125rem; line-height: 1.2; }

/* Match Centre: compact cards (the page count follows the phone card height, js/match-centre.js) and the filters on one row */
html.m-app .mc-card { padding: 0.4375rem 0.625rem; gap: 0.25rem; }
html.m-app .mc-card-head { font-size: 0.5625rem; }
html.m-app .mc-card-foot { display: none; }
html.m-app .mc-card-score { font-size: 1.35rem; }
html.m-app .mc-card-team img { width: 1.5rem; height: 1.5rem; }
html.m-app .mc-filters { gap: 0.375rem; }
html.m-app .pg-scroll { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
html.m-app .pg-scroll > .pg-grid { height: auto; min-height: 100%; }

/* ---------- Villa Games in play (phones) ----------
   "In play" = the panel holds an answer area (.pyr-answer). The board/artwork gets all the height the panel does not need,
   and the panel is sized to its own (compact) content, so there is no box to scroll inside while playing.
   The title row is one line (title left, How to play / Villa Games right), which gives the board more room. */
html.m-app .pyr-head.deck-head--row { flex-wrap: nowrap; justify-content: space-between; gap: 0.5rem; padding-bottom: 0.125rem; }
html.m-app .pyr-head.deck-head--row > :first-child { flex: 1 1 auto; min-width: 0; }
html.m-app .pyr-head .deck-title { font-size: clamp(1.05rem, 5vw, 1.35rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m-app .pyr-head .deck-actions { flex: none; width: auto; display: flex; flex-wrap: nowrap; gap: 0.3125rem; margin: 0; }
html.m-app .pyr-head :is(.help-btn, .back-btn) { min-height: 1.875rem; padding: 0.25rem 0.5rem; font-size: 0.5625rem; letter-spacing: .1em; gap: 0.3125rem; }

html.m-app .pyr-layout:has(#pyr-form) #pyr-qbox { display: none; }   /* Pyramid: the question is shown once, in the panel */
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) { grid-template-rows: minmax(0, 1fr) auto; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) > .pyr-panel { max-height: calc(var(--app-h, 100dvh) * .55); overflow-y: auto; overscroll-behavior: contain; padding: 0.4375rem 0.5625rem 0.5rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-panel-head { margin-bottom: 0.3125rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-panel-title { font-size: 0.95rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-panel-body { flex: none; overflow: visible; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-panel-body > * { flex: 1 1 100%; margin: 0; min-width: 0; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-panel-body > .g-btn-row { flex: 1 1 0; display: flex; gap: 0.375rem; }   /* Give up / Restart share a row with Back to modes */
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-panel-body > .g-btn-row > .g-btn { flex: 1 1 0; min-height: 2.125rem; padding: 0.25rem 0.5rem; font-size: 0.625rem; letter-spacing: .1em; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-panel-body > .pyr-link { flex: 0 0 auto; padding: 0 0.125rem; font-size: 0.5625rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-block { padding: 0.4375rem 0.625rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-block > * { margin-top: 0; margin-bottom: 0.25rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-block > :last-child { margin-bottom: 0; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-block :is(.pyr-kicker, .pyr-cat-line) { font-size: 0.5625rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-block :is(.pyr-preview, .obs-question) { font-size: 1rem; line-height: 1.15; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-facts { display: flex; flex-wrap: wrap; gap: 0.125rem 1.125rem; margin-top: 0.125rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-facts dt { font-size: 0.5rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-facts dd { font-size: 1rem; line-height: 1.1; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-progress { height: 0.3125rem; }
html.m-app .pyr-layout:is(:has(.pyr-answer), :has(.bingo-player)) .pyr-hint { font-size: 0.625rem; line-height: 1.25; }
html.m-app .pyr-answer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3125rem 0.375rem; align-items: stretch; padding: 0.4375rem 0.625rem; }
html.m-app .pyr-answer > :not(.psearch, .pyr-input, .pyr-submit, .bingo-picked) { grid-column: 1 / -1; margin: 0; }
html.m-app .pyr-answer > :is(.psearch, .pyr-input, .bingo-picked) { grid-column: 1; min-width: 0; margin: 0; }
html.m-app .pyr-answer > .pyr-submit { grid-column: 2; width: auto; margin: 0; padding: 0 0.875rem; white-space: nowrap; min-height: 2.5rem; }
html.m-app .pyr-answer > .pyr-feedback:empty { display: none; }
html.m-app .pyr-answer .pyr-answer-label { font-size: 0.5625rem; }
html.m-app .pyr-answer > .bingo-picked { align-self: center; font-size: 0.8125rem; }
/* Villa Bingo: the current player on one compact line; the result and Next player straight under it */
html.m-app .bingo-player { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.25rem; text-align: left; }
html.m-app .bingo-player > * { margin: 0; }
html.m-app .bingo-player-name { font-size: 1.15rem; line-height: 1.1; }
html.m-app .pyr-panel-body > .pyr-wide { min-height: 2.5rem; }
/* each board is centred in its own area, at the size the area allows (never cropped, never stretched) */
html.m-app .pyr-layout > :first-child { justify-items: center; align-content: center; }

/* ---------- keyboard up (phones) ----------
   The visible area is roughly half the screen. The board/artwork keeps the left column at full height; the question
   (kept above the answer box) and the answer box are on the right. The title row, bottom bar, extra buttons and secondary
   text are left out until the keyboard closes. Villa Reveal's wide table keeps the full width and is stacked instead. */
html.m-app.m-kb .pyr-head { display: none; }
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0.5rem;
  padding-top: 0.375rem; padding-bottom: 0.375rem;
}
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) > :first-child { grid-column: 1; grid-row: 1; }
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) > .pyr-panel { grid-column: 2; grid-row: 1; align-self: start; max-height: 100%; overflow: visible; clip-path: none; position: relative; z-index: 5; }
html.m-app.m-kb .pyr-layout:has(.pyr-answer input) :is(.pyr-panel-head, .pyr-panel-body > .g-btn-row, .pyr-panel-body > .pyr-link, .pyr-kicker, .pyr-cat-line, .pyr-hint, .pyr-progress, .pyr-answer-label, .mx-sub, .mxi-random) { display: none; }
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) .pyr-block { padding: 0.375rem 0.5rem; }
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) .pyr-block :is(.pyr-preview, .obs-question) { font-size: 0.875rem; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) .pyr-facts dd { font-size: 0.875rem; }
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) .pyr-answer { grid-template-columns: minmax(0, 1fr); padding: 0.375rem 0.5rem; }
html.m-app.m-kb .pyr-layout:not(.wd-layout):has(.pyr-answer input) .pyr-answer > .pyr-submit { grid-column: 1; }
/* the player suggestions open below the answer box, as wide as the screen allows (over the board, never off screen) */
html.m-app.m-kb .pyr-layout .pyr-answer .psearch { position: relative; }
html.m-app.m-kb .pyr-layout:has(.pyr-answer input) :is(.pyr-panel, .pyr-answer, .pyr-block) { clip-path: none !important; }   /* the cut corner would clip the suggestions */
html.m-app.m-kb .pyr-layout:not(.wd-layout) .pyr-answer .psearch-list { top: calc(100% + 0.25rem); bottom: auto; left: auto; right: 0; width: min(20rem, calc(100vw - 1rem)); max-height: calc(var(--app-h, 100dvh) * .5); z-index: 30; }
/* Villa Reveal: the table stays on top at full width; only the question and the answer box stay below it */
html.m-app.m-kb .wd-layout:has(.pyr-answer) { padding-top: 0.25rem; padding-bottom: 0.25rem; }
html.m-app.m-kb .wd-layout:has(.pyr-answer) > .pyr-panel { padding-top: 0.375rem; padding-bottom: 0.375rem; }

/* ---------- Villa Games hub: six rectangular tiles that fill the screen ---------- */
html.m-app .deck-stage:has(> .games-grid) { container-type: normal; }
html.m-app .games-lb { margin: 0.375rem var(--m-pad) 0; }
html.m-app .games-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto;
  gap: 0.375rem; padding: 0.375rem var(--m-pad) 0.5rem; overflow: hidden; justify-content: stretch; align-content: stretch; --bar: 2.75rem;
}
html.m-app .game-tile { height: auto; min-height: 0; clip-path: none; animation: none; }
html.m-app .game-art { flex: 1 1 0; height: auto; min-height: 0; }
html.m-app .game-art img { object-fit: cover; }
html.m-app .game-bar { min-height: var(--bar); padding: 0.375rem 0.625rem; }
html.m-app .game-name { font-size: clamp(1rem, 4.6vw, 1.3rem); }
html.m-app .game-desc, html.m-app .game-play { display: none; }
@media (max-height: 500px) { html.m-app .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); } }

/* ============================================================
   Site-wide tidy (2026-11-25)
   - VILLAVERSE in plain white
   - no title underline (the sky/claret lead and the long hairline)
   - a two-line profile box top right (full name over @username); the page menu drops onto its own row beneath it
   - the right-hand header buttons (back, help, section switches) are as tall as the page title
   ============================================================ */
.brand span, .m-brand span, .brand span b, .m-brand b { color: #fff; }
.head-rule { display: none !important; }

html:not(.m-app) .account-box { width: 15rem; height: 2.75rem; }   /* the menu row's height */
.ab-who { gap: 0.625rem !important; padding-left: 0.625rem !important; }
.ab-avatar { width: 1.75rem; height: 1.75rem; font-size: 0.9375rem; }
.ab-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; text-align: left; }
.ab-names .ab-name { font: 600 0.8125rem var(--ff-ui), sans-serif; letter-spacing: .06em; text-transform: none; overflow: hidden; text-overflow: ellipsis; }
.ab-user { font: 500 0.6875rem var(--ff-ui), sans-serif; letter-spacing: .04em; text-transform: none; color: var(--sky); overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 761px) {
  html:not(.m-app) .top-bar { flex-wrap: wrap; padding-right: 3vw; row-gap: 0.25rem; min-height: 3.625rem; }
  html:not(.m-app) .top-bar .brand { margin-right: auto; min-height: 3.625rem; }
  html:not(.m-app) .top-bar::after { content: ""; order: 2; flex-basis: 100%; height: 0; }   /* line break: the menu sits on its own row, right-aligned */
  html:not(.m-app) .top-bar .tabs--top { order: 3; flex: 0 1 auto; width: auto; margin: 0 0 0 auto; }
  html:not(.m-app) .top-bar .tabs--top .tab { flex: 0 1 auto; }
}

/* right-hand header buttons (How to play, back, Vault views, Comp Creator links): the standard button height.
   They used to match the page title beside them; the title now sits on the menu row, so they follow the buttons instead. */
html:not(.m-app) { --title-h: 2.75rem; }
html:not(.m-app) .deck-head--row { align-items: center; }
html:not(.m-app) .deck-head--row > .back-btn,
html:not(.m-app) .deck-head-actions > *,
html:not(.m-app) .deck-actions > *,
html:not(.m-app) .vault-views > *,
html:not(.m-app) .vv-sections > * {
  box-sizing: border-box; min-height: var(--title-h); padding-left: 1.625rem; padding-right: 1.625rem;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.8125rem;
}
html:not(.m-app) .vault-views, html:not(.m-app) .vv-sections { margin-top: 0; align-self: center; }
.deck-head-actions { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; justify-content: flex-end; }

/* Comp Creator: the match / player / action panel spans 75% of the screen on desktop */
@media (min-width: 901px) { html:not(.m-app) .cb-flow { width: 75vw; max-width: none; padding-left: 0; padding-right: 0; } }
@media (min-width: 901px) { html:not(.m-app) .cb-mode { margin-left: 12.5vw; margin-right: 12.5vw; } }

/* Squad info bar: a "Compilations" button (that player's uploaded compilations) beside Watch Clips */
.watch-btn--ghost { color: #fff; background: linear-gradient(180deg, rgba(158,28,88,.95), rgba(103,14,54,.92)); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); padding-left: 1.5rem; padding-right: 1.5rem; }
.watch-btn--ghost + .watch-btn { margin-left: 0.625rem; }
@media (max-width: 860px) { .watch-btn--ghost { margin-left: auto; } .watch-btn--ghost + .watch-btn { margin-left: 0.5rem; } }

/* Player profiles: first name above the surname, the same on every player */
.pc-first { display: block; font-size: .5em; letter-spacing: .08em; line-height: 1; margin-bottom: .1em; }
.pc-last { display: block; }

/* Villa Videos hub: two 16:9 boxes, each with a silent looping showreel behind the title */
.cl-choices { max-width: min(93.75rem, 100%); }
.cl-card { aspect-ratio: 16 / 9; min-height: 0 !important; height: auto; }
.cl-reel { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.cl-reel.is-on { opacity: 1; }                          /* the player(s) on show; js/clips-hub.js swaps a pair */
.cl-reel.no-fade { transition: none; }
@media (prefers-reduced-motion: reduce) { .cl-reel { transition: none; } }
.cl-card::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(12,3,8,0) 40%, rgba(12,3,8,.55) 72%, rgba(12,3,8,.9) 100%); }
.cl-card::after { z-index: 1; }
.cl-card h2, .cl-go { z-index: 2; text-shadow: 0 2px 0.875rem rgba(0,0,0,.75); }
.cl-card:hover .cl-reel { filter: brightness(1.08); }
@media (min-width: 761px) { .cl-choices { align-content: center; } }

/* Watermark over videos (js/watermark.js): the VillaVerse logo, centred near the bottom, clear of the player controls */
.vv-watermark { position: absolute; z-index: 5; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(var(--wm-h, 1.875rem) * 1.3); box-sizing: border-box; }
.vv-watermark[hidden] { display: none; }
.vv-wm-logo { display: inline-flex; align-items: center; height: var(--wm-h, 1.875rem); opacity: .7; filter: drop-shadow(0 1px 0.25rem rgba(0,0,0,.6)); }
.vv-wm-logo img { height: 100%; width: auto; }
.cl-card .vv-watermark { z-index: 1; padding-bottom: 0; align-items: flex-start; justify-content: flex-end; padding: 0.875rem 1.125rem 0 0; }   /* hub previews: logo top right, clear of the title */
@media (max-width: 760px) {
  .info-bar:has(.watch-btn--ghost) { flex-wrap: wrap; row-gap: 0.5rem; }
  .info-bar:has(.watch-btn--ghost) .info-ident { flex: 1 1 100%; }
  .info-bar .watch-btn--ghost, .info-bar .watch-btn--ghost + .watch-btn { flex: 1 1 0; justify-content: center; margin-left: 0; }
  .info-bar .watch-btn--ghost + .watch-btn { margin-left: 0.5rem; }
}

/* Player clips: the video always fits its box (it used to keep its own height on short screens and run over the buttons) */
.pc-videobox { position: relative; }
.pc-videobox video { position: absolute; inset: 0; }

/* Page title on the menu row (js/title-row.js): left of the menu, level with it */
@media (min-width: 761px) {
  html:not(.m-app) .top-bar .deck-title--bar { order: 3; margin: 0 auto 0 0; flex: 0 1 auto; min-width: 0; align-self: center; }
  html:not(.m-app) .top-bar .deck-title--bar + .tabs--top { margin-left: 0; align-self: flex-end; }
  html:not(.m-app) .deck-head--titled-above { padding-top: 1.2vh; }
  /* a heading with nothing else in it takes no space */
  html:not(.m-app) .deck-head--titled-above:not(.deck-head--row):not(:has(:not(.head-rule))) { display: none; }
  html:not(.m-app) .deck-head--row.deck-head--titled-above > div:first-child:not(:has(:not(.head-rule))) { flex: 0 0 0; }
  html:not(.m-app) .deck-head--row.deck-head--titled-above > :last-child { margin-left: auto; }
}

/* Fan Shop: the featured item shows just its name and price (condition/size are on the item's own page) */
#feat-tag { display: none !important; }
/* a long page title (e.g. a product name) wraps on the left; the menu always stays on the right of the same row */
@media (min-width: 761px) {
  html:not(.m-app) .top-bar .deck-title--bar { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  html:not(.m-app) .top-bar .deck-title--bar + .tabs--top { flex: 0 0 auto; margin-left: 2vw; }
  html:not(.m-app) .top-bar .deck-title--bar.is-long { font-size: clamp(1.6rem, 2.6vw, 2.6rem); }
}

/* Boxes no longer lift on hover: inside scrolling panels the lift cut off their top edge. The border/background highlight stays. */
html body :is(a.mc-card, .mcc, a.tn-lead, .vid-box, .panel, .game-tile, .news-hero, .news-card, .pyr-mode, .cl-card, .cb-match, .cb-player, .vg-card, .fx-card):is(:hover, :focus-visible) { transform: none; }

/* News: Latest News takes the column's height, the Match Centre box sits just under it at the size of its content, with larger text */
@media (min-width: 901px) {
  html:not(.m-app) .news-col { grid-template-rows: minmax(0, 1fr) auto; gap: 0.5rem; }
  html:not(.m-app) .mcc { gap: 0.5rem; padding: 0.875rem 1rem 0.75rem; }
  html:not(.m-app) .mcc-line { font-size: 0.9375rem; gap: 0.25rem 0.75rem; padding-top: 0.5rem; }
  html:not(.m-app) .mcc-label { font-size: 0.6562rem; }
  html:not(.m-app) .mcc-go { font-size: 0.75rem; }
}

/* Villa Games: no small blue labels above the mode / difficulty names */
.pyr-mode-tag { display: none !important; }

/* "How to play": the ? sits centred in its square */
html body .help-btn span { width: 1.125rem; height: 1.125rem; font: 600 0.6875rem/1 var(--ff-ui), sans-serif; letter-spacing: 0; padding: 0; box-sizing: border-box; }
html body .help-btn { gap: 0.625rem; }

/* Shooting stars (js/shooting-stars.js): a thin streak with a bright head, in the backdrop under the page */
.vv-sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.vv-star {
  position: absolute; left: 0; top: 0; height: 2px; border-radius: 2px; opacity: 0;
  transform-origin: 100% 50%; margin-top: -1px;
  background: linear-gradient(90deg, transparent, rgba(148,190,229,.35) 60%, #fff);
  filter: drop-shadow(0 0 0.375rem rgba(200,225,255,.85));
}
.vv-star::after { content: ""; position: absolute; right: -2px; top: 50%; width: 0.25rem; height: 0.25rem; margin-top: -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0.625rem 0.1875rem rgba(220,235,255,.9); }

/* ============================================================
   Polish pass (design-polish branch): accessibility and touch refinements only. No layout, colour or wording changes.
   ============================================================ */
/* Keyboard focus: one clear sky ring on every control, shown only for keyboard users (mouse clicks never show it).
   The top menu keeps its own inset ring, which suits its sliding highlight. */
html body :is(a[href], button, input, select, textarea, summary, [role="button"], [tabindex]:not([tabindex="-1"])):not(.tab):focus-visible {
  outline: 2px solid var(--sky); outline-offset: 2px;
}
html body :is(input, select, textarea):focus-visible { outline-offset: 1px; }

/* Phones and tablets: small text links and arrows get a larger invisible tap area (at least ~2.5rem) without moving anything. */
html.m-app :is(.games-lb-link, .pyr-link, .m-brand) { position: relative; }
html.m-app :is(.games-lb-link, .pyr-link, .m-brand)::after { content: ""; position: absolute; inset: -0.5625rem -0.375rem; }
html.m-app .rail-arrow { width: 2.5rem; }
html.m-app .pc-chip { min-height: 2.25rem; }

/* Player clips on phones: everything inside the screen width, the controls in one row under the video,
   and each clip in the list one box (thumbnail and its text together), three across and evenly sized */
.pc-glyph { display: inline; }
html.m-app .pc-glyph { display: none; }
html.m-app .pc-library { grid-template-columns: minmax(0, 1fr); padding-left: var(--m-pad); padding-right: var(--m-pad); }
html.m-app .pc-library > * { min-width: 0; }
html.m-app .pc-now { position: relative; display: block; }
html.m-app .pc-now-text { padding-right: 3.5rem; }
html.m-app .pc-pos { position: absolute; top: 0.125rem; right: 0; font-size: 0.6875rem; letter-spacing: .12em; color: var(--blue); }
html.m-app .pc-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.375rem; margin-top: 0.375rem; }
html.m-app .pc-btns > :is(.pc-btn, .pc-auto) { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 2.5rem; margin: 0; padding: 0.25rem 0.25rem; font-size: 0.6875rem; letter-spacing: .08em; line-height: 1.1; text-align: center; white-space: normal; align-self: stretch; }
html.m-app .pc-side { overflow: hidden; }
html.m-app .pc-rail { height: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4375rem; }
html.m-app .pc-item { flex-direction: column; align-items: stretch; gap: 0; padding: 0.25rem 0.25rem 0; overflow: hidden; min-width: 0;
  background: var(--claret-grad); border: 1px solid var(--line, rgba(255,255,255,.12)); }
html.m-app .pc-item .pc-thumb { width: 100%; height: auto; max-height: none; aspect-ratio: 16 / 9; }
html.m-app .pc-item-text { padding: 0.3125rem 0.4375rem 0.375rem; gap: 0.0625rem; }
html.m-app .pc-item-text b { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m-app .pc-pager { padding-top: 0.125rem; }
html.m-app .pc-library { grid-template-rows: auto minmax(0, 1fr); }
html.m-app .pc-videobox { flex: none; aspect-ratio: 16 / 9; }          /* the video fills its box: no black band above it */
html.m-app .pc-rail { flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
html.m-app .pc-item .pc-thumb { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }

/* Respect the system "reduce motion" setting everywhere: movement becomes instant; nothing is hidden or removed. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* Smoother text on the dark claret surfaces (macOS/Safari), and stable images while they load. */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.game-art img, .panel-img { background-color: rgba(20,4,12,.6); }

/* js/player-clips.js: the previous clip's last frame, held over the player while the next one loads */
.pc-hold { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
.pc-hold[hidden] { display: none; }
/* Match Centre on phones: hold the filter bar's height (the When tabs + three dropdowns) until js/match-centre.js fills it,
   so the fixture list does not jump down when the filters arrive */
html.m-app .mc-bar:has(> #mc-filters:empty) { min-height: 11rem; }
