/*
 * com_sparkle - public styles.
 * Everything is scoped under .xh so it sits happily inside any Joomla template.
 * Colours and shapes follow the original standalone competition site: deep green, gold, berry red,
 * a string of fairy lights, falling snow and a candy-cane footer.
 * No inline styles are used anywhere (friendly to strict Content-Security-Policy settings).
 */
.xh {
  --xh-dark: #0b2a1c;
  --xh-mid: #12402b;
  --xh-bright: #1d6b45;
  --xh-paper: #f6f0e4;
  --xh-link: #8c0f23;
  --xh-bg: var(--xh-dark);
  --xh-bg2: var(--xh-mid);
  --xh-card: #fff;
  --xh-ink: #1b1b1b;
  --xh-accent: #c8102e;
  --xh-gold: #e8b923;
  --xh-green: #2b6a4a;
  --xh-muted: #666;
  position: relative;
  isolation: isolate;
  margin: 0 0 1.5rem;
  border-radius: 14px;
  overflow: hidden;
  overflow: clip;
  color: var(--xh-ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--xh-paper) radial-gradient(circle at 20% 0, #fff 0, transparent 40%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.xh *, .xh *::before, .xh *::after { box-sizing: border-box; }
.xh a { color: var(--xh-link); }
.xh .xh-form .xh-picker select#xh-addr { min-height: 0 !important; height: auto !important; padding: .3rem !important; }
.xh [hidden] { display: none !important; }
.xh .xh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Colour schemes (chosen in the component Options; green is the original) ---- */
.xh.xh-scheme-red   { --xh-dark: #3d0b16; --xh-mid: #5e1424; --xh-bright: #9b1c35; --xh-paper: #fbf1ec; --xh-link: #8c0f23; --xh-accent: #1f6b45; --xh-green: #8a2a3d; }
.xh.xh-scheme-blue  { --xh-dark: #0a1f3d; --xh-mid: #123a6b; --xh-bright: #1f64b0; --xh-paper: #eef3fa; --xh-link: #14508f; --xh-accent: #c8102e; --xh-green: #2b5f8a; }
.xh.xh-scheme-plum  { --xh-dark: #2a0f3d; --xh-mid: #43195f; --xh-bright: #7a2fa8; --xh-paper: #f6effa; --xh-link: #6b2290; --xh-accent: #c8102e; --xh-green: #6b3a8f; }
.xh.xh-scheme-snow  { --xh-dark: #1f4d3a; --xh-mid: #2a6048; --xh-bright: #3f8a66; --xh-paper: #ffffff; --xh-link: #8c0f23; }
.xh.xh-nosnow .xh-snow { display: none; }
.xh.xh-nolights .xh-lights { display: none; }

/* ---- Header, lights, hero ---- */
.xh-header { background: linear-gradient(var(--xh-dark), var(--xh-mid)); border-bottom: 3px solid var(--xh-gold); color: #fff; padding: .6rem 1rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.xh .xh-brand { color: var(--xh-gold); font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; text-decoration: none; }
.xh .xh-nav a { color: #fff; margin-left: .6rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid rgba(232, 185, 35, .5); font-size: .9rem; text-decoration: none; display: inline-block; }
.xh .xh-nav a:hover, .xh .xh-nav a:focus-visible, .xh .xh-nav a[aria-current] { background: var(--xh-gold); color: var(--xh-dark); }

.xh-lights { height: 26px; background: var(--xh-dark); position: relative; overflow: hidden; }
.xh-lights::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 2px; background: #222; }
.xh-lights::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 22px;
  background:
    radial-gradient(circle 6px at 20px 14px, #ff3b3b 0 5px, transparent 6px),
    radial-gradient(circle 6px at 60px 14px, #ffd23f 0 5px, transparent 6px),
    radial-gradient(circle 6px at 100px 14px, #3bd16f 0 5px, transparent 6px),
    radial-gradient(circle 6px at 140px 14px, #4aa8ff 0 5px, transparent 6px);
  background-size: 160px 22px; background-repeat: repeat-x;
  animation: xh-twinkle 2.4s ease-in-out infinite alternate; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .6)); }
@keyframes xh-twinkle { from { opacity: 1; } to { opacity: .45; } }

.xh-hero { position: relative; overflow: hidden; text-align: center; color: #fff; padding: 2.2rem 1rem 2.6rem;
  background: radial-gradient(ellipse at 50% 0, var(--xh-bright) 0, var(--xh-dark) 70%); border-bottom: 6px double var(--xh-gold); }
.xh-hero-in { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.xh-hero-star { font-size: 2.2rem; filter: drop-shadow(0 0 10px #ffd23f); animation: xh-glow 2.5s ease-in-out infinite alternate; }
@keyframes xh-glow { from { transform: scale(1); } to { transform: scale(1.15); } }
.xh .xh-hero-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 7vw, 2.8rem); line-height: 1.15; margin: .3rem 0 .6rem; color: var(--xh-gold); text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.xh-hero-sub { margin: 0; font-size: 1.05rem; color: #f3ead2; }
.xh-snow { position: absolute; inset: 0; pointer-events: none; }
.xh-snow i { position: absolute; top: -20px; color: #fff; opacity: .55; font-style: normal; animation: xh-fall linear infinite; }
@keyframes xh-fall { to { transform: translateY(340px) rotate(360deg); } }
.xh-snow i:nth-child(1){left:0%;animation-duration:7s;animation-delay:-0s;font-size:10px}
.xh-snow i:nth-child(2){left:37%;animation-duration:12s;animation-delay:-3s;font-size:17px}
.xh-snow i:nth-child(3){left:74%;animation-duration:9s;animation-delay:-6s;font-size:10px}
.xh-snow i:nth-child(4){left:11%;animation-duration:14s;animation-delay:-9s;font-size:17px}
.xh-snow i:nth-child(5){left:48%;animation-duration:11s;animation-delay:-1s;font-size:10px}
.xh-snow i:nth-child(6){left:85%;animation-duration:8s;animation-delay:-4s;font-size:17px}
.xh-snow i:nth-child(7){left:22%;animation-duration:13s;animation-delay:-7s;font-size:10px}
.xh-snow i:nth-child(8){left:59%;animation-duration:10s;animation-delay:-10s;font-size:17px}
.xh-snow i:nth-child(9){left:96%;animation-duration:7s;animation-delay:-2s;font-size:10px}
.xh-snow i:nth-child(10){left:33%;animation-duration:12s;animation-delay:-5s;font-size:17px}
.xh-snow i:nth-child(11){left:70%;animation-duration:9s;animation-delay:-8s;font-size:10px}
.xh-snow i:nth-child(12){left:7%;animation-duration:14s;animation-delay:-0s;font-size:17px}
.xh-snow i:nth-child(13){left:44%;animation-duration:11s;animation-delay:-3s;font-size:10px}
.xh-snow i:nth-child(14){left:81%;animation-duration:8s;animation-delay:-6s;font-size:17px}
.xh-snow i:nth-child(15){left:18%;animation-duration:13s;animation-delay:-9s;font-size:10px}
.xh-snow i:nth-child(16){left:55%;animation-duration:10s;animation-delay:-1s;font-size:17px}
.xh-snow i:nth-child(17){left:92%;animation-duration:7s;animation-delay:-4s;font-size:10px}
.xh-snow i:nth-child(18){left:29%;animation-duration:12s;animation-delay:-7s;font-size:17px}
.xh-snow i:nth-child(19){left:66%;animation-duration:9s;animation-delay:-10s;font-size:10px}
.xh-snow i:nth-child(20){left:3%;animation-duration:14s;animation-delay:-2s;font-size:17px}
.xh-snow i:nth-child(21){left:40%;animation-duration:11s;animation-delay:-5s;font-size:10px}
.xh-snow i:nth-child(22){left:77%;animation-duration:8s;animation-delay:-8s;font-size:17px}

/* ---- Content ---- */
.xh-main { max-width: 720px; margin: 0 auto; padding: 1rem; }
.xh .xh-h1 { font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; margin: .5rem 0 1rem; color: var(--xh-dark); }
.xh .xh-sect { font-family: Georgia, serif; font-size: 1.5rem; color: var(--xh-link); margin: .2rem 0 0; text-align: center; }
.xh .xh-sect::before, .xh .xh-sect::after { content: " ❄ "; color: var(--xh-green); font-size: 1rem; }
.xh .xh-sect-sub { text-align: center; margin: .1rem 0 1rem; color: var(--xh-green); font-size: 1.05rem; }
.xh .xh-center { text-align: center; }
.xh .xh-muted { color: var(--xh-muted); font-size: .9rem; }

.xh .xh-notice { padding: .8rem 1rem; border-radius: 8px; margin: 1rem 0; background: #fff9e3; border: 2px dashed var(--xh-gold); color: var(--xh-ink); }
.xh .xh-notice.xh-error { background: #fde2e2; border-color: var(--xh-accent); border-style: solid; }
.xh .xh-notice.xh-ok { background: #dff3e6; border-color: var(--xh-green); border-style: solid; }

.xh .xh-btn { background: var(--xh-accent); color: #fff; border: 0; border-radius: 8px; padding: .7rem 1.1rem; font: inherit; font-size: 1rem; text-decoration: none; display: inline-block; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); line-height: 1.3; }
.xh .xh-btn:hover, .xh .xh-btn:focus-visible { filter: brightness(1.1); color: #fff; }
.xh .xh-btn.xh-alt { background: var(--xh-green); }
.xh .xh-btn.xh-small { padding: .4rem .7rem; font-size: .9rem; }
.xh .xh-btn:disabled { opacity: .5; cursor: default; }
.xh :focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }

/* ---- Crest link, category filter, badges ---- */
.xh .xh-crest { display: inline-flex; flex-direction: column; align-items: center; gap: .5rem; text-decoration: none; color: var(--xh-dark); }
.xh .xh-crest-ring { position: relative; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, var(--xh-bright), var(--xh-dark) 75%); border: 5px double var(--xh-gold);
  box-shadow: 0 0 0 4px var(--xh-dark), 0 4px 14px rgba(0, 0, 0, .35); transition: transform .2s; }
.xh .xh-crest:hover .xh-crest-ring, .xh .xh-crest:focus-visible .xh-crest-ring { transform: scale(1.06); }
.xh .xh-crest-tree { font-size: 3rem; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.xh .xh-crest-star { position: absolute; top: -12px; right: -6px; font-size: 1.6rem; filter: drop-shadow(0 0 6px #ffd23f); animation: xh-glow 2.5s ease-in-out infinite alternate; }
.xh .xh-crest-text { background: var(--xh-accent); color: #fff; padding: .55rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: 1.05rem; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.xh .xh-cats { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin: 0 0 .8rem; }
.xh .xh-chip-btn { background: #fff; color: var(--xh-dark); border: 2px solid var(--xh-gold); border-radius: 999px; padding: .35rem .9rem; font: inherit; font-size: .95rem; cursor: pointer; }
.xh .xh-chip-btn.xh-on { background: var(--xh-gold); font-weight: 700; }
.xh .xh-cat { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--xh-green); font-weight: 700; }
.xh .xh-award { margin: 0 0 .4rem; padding: .3rem .6rem; border-radius: 8px; font-weight: 700; background: #fff3c4; border: 1px solid var(--xh-gold); display: inline-block; }
.xh .xh-award-runnerup { background: #eef0f3; border-color: #9aa3ad; }
.xh .xh-terms a { font-weight: 600; }
.xh .xh-form fieldset.radio, .xh .xh-form .form-check { margin: .1rem 0; }
.xh .xh-form .form-check { display: flex; gap: .5rem; align-items: center; }
.xh .xh-form .form-check label { font-weight: 400; margin: 0; }
.xh .xh-form .form-check input { width: 1.2rem; height: 1.2rem; }

/* ---- Cards ---- */
.xh .xh-search { display: block; width: 100%; padding: .65rem 1rem; font: inherit; font-size: 1rem; border: 2px solid var(--xh-gold); border-radius: 999px; background: #fff; color: var(--xh-ink); margin: 0 0 1rem; }
.xh .xh-card { background: var(--xh-card); border: 2px solid #e6dcc3; border-radius: 12px; overflow: hidden; margin-bottom: .9rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.xh .xh-card > img, .xh .xh-imgwrap { grid-column: 1; min-width: 0; }
.xh .xh-card > img, .xh .xh-imgwrap img { width: 100%; height: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; max-height: 240px; }
.xh .xh-minimap { grid-column: 2; min-height: 170px; height: 100%; position: relative; z-index: 0; isolation: isolate; background: #e8efe9; }
.xh .xh-card-body { grid-column: 1 / -1; }
/* A card with only a photo, or only a map, uses the full width but stays short */
.xh .xh-card.xh-has-img:not(.xh-has-map) > img, .xh .xh-card.xh-has-img:not(.xh-has-map) > .xh-imgwrap { grid-column: 1 / -1; }
.xh .xh-card.xh-has-img:not(.xh-has-map) > img, .xh .xh-card.xh-has-img:not(.xh-has-map) .xh-imgwrap img { max-height: 200px; }
.xh .xh-card.xh-has-map:not(.xh-has-img) > .xh-minimap { grid-column: 1 / -1; min-height: 160px; }
@media (max-width: 600px) {
  .xh .xh-card { grid-template-columns: minmax(0, 1fr); }
  .xh .xh-card > img, .xh .xh-imgwrap, .xh .xh-minimap { grid-column: 1; }
  .xh .xh-minimap { min-height: 180px; height: 180px; }
}
.xh .xh-card-body { padding: .8rem 1rem 1rem; }
.xh .xh-card-title { margin: 0 0 .25rem; font-family: Georgia, serif; font-size: 1.1rem; color: var(--xh-ink); }
.xh .xh-card p { margin: .25rem 0 .75rem; color: #333; }
.xh .xh-num { background: var(--xh-accent); color: #fff; border-radius: 50%; display: inline-block; min-width: 1.8rem; height: 1.8rem; line-height: 1.8rem; text-align: center; font-size: .9rem; margin-right: .4rem; font-family: system-ui, sans-serif; }
.xh .xh-num.xh-wd { background: #999; }
.xh .xh-card.xh-flash { outline: 3px solid var(--xh-gold); }

.xh .xh-ranks { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
.xh .xh-rk { background: #fff; color: var(--xh-ink); border: 2px solid #bbb; padding: .5rem .8rem; border-radius: 8px; font: inherit; font-size: .95rem; cursor: pointer; }
.xh .xh-rk.xh-on { background: var(--xh-gold); border-color: #b88f00; font-weight: 700; }

/* Withdrawn houses: stay listed, greyed out, with a banner across the photo */
.xh .xh-imgwrap { position: relative; overflow: hidden; }
.xh .xh-imgwrap .xh-noimg { aspect-ratio: 4 / 3; background: #d9d9d9; }
.xh .xh-wd-banner { position: absolute; left: -10%; right: -10%; top: 50%; transform: translateY(-50%) rotate(-8deg); text-align: center;
  background: rgba(200, 16, 46, .93); color: #fff; font-weight: 800; letter-spacing: .25em; font-size: 1.3rem; padding: .55rem 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.xh .xh-withdrawn img { filter: grayscale(1) brightness(.85); }
.xh .xh-withdrawn .xh-card-title, .xh .xh-withdrawn p { color: #777; }
.xh .xh-wd-note { color: #777; font-style: italic; margin: .6rem 0 0; }

/* ---- Map ---- */
.xh .xh-map { height: 260px; border-radius: 12px; margin: 0 0 1rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); position: relative; z-index: 0; isolation: isolate; }
.xh .xh-pin { background: var(--xh-accent); color: #fff; border: 2px solid #fff; border-radius: 50%; width: 28px; height: 28px; line-height: 24px; text-align: center; font-weight: 700; font-size: .8rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }

/* ---- Vote bar and dialog ---- */
.xh .xh-chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh .xh-modal { border: 0; border-radius: 14px; padding: 1.2rem 1.3rem; max-width: 420px; width: calc(100% - 2rem); box-shadow: 0 8px 30px rgba(0, 0, 0, .4); background: #fff; color: #1b1b1b; }
.xh .xh-modal::backdrop { background: rgba(0, 0, 0, .55); }
.xh .xh-modal h2 { margin: .2rem 0 .6rem; font-size: 1.3rem; color: var(--xh-dark); }
.xh .xh-modal p { white-space: pre-line; margin: .2rem 0 1rem; }
.xh .xh-modal-btns { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* ---- Forms ---- */
.xh .xh-form .control-group { margin: .9rem 0; }
.xh .xh-form label { display: block; font-weight: 600; margin: 0 0 .25rem; }
.xh .xh-form .form-control, .xh .xh-form input[type=text], .xh .xh-form input[type=email], .xh .xh-form input[type=file], .xh .xh-form textarea, .xh .xh-form select, .xh .xh-rank select {
  width: 100%; padding: .65rem; font: inherit; font-size: 1rem; border: 1px solid #bbb; border-radius: 8px; background: #fff; color: var(--xh-ink); }
.xh .xh-form input.xh-postcode, .xh .xh-form .xh-postcode input { text-transform: uppercase; }
.xh .xh-form .invalid { border-color: var(--xh-accent); }
.xh .xh-form .star { color: var(--xh-accent); }
.xh .xh-form .control-group:has(input[type=checkbox]) { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: flex-start; gap: .6rem; }
.xh .xh-form .control-group:has(input[type=checkbox]) label { font-weight: 400; margin: 0; }
.xh .xh-form input[type=checkbox] { width: 1.3rem; height: 1.3rem; margin-top: .15rem; }
.xh .xh-form .form-text, .xh .xh-form [id$="-desc"] { font-size: .85rem; color: var(--xh-muted); }
.xh .xh-pcmsg { margin: .3rem 0 0; min-height: 1.4em; }
.xh .xh-rank { background: #fff; border-radius: 10px; padding: .5rem 1rem 1rem; margin: .8rem 0; border-left: 6px solid var(--xh-gold); }
.xh .xh-hp { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }

/* ---- Footer (also holds the vote controls on the house list) ---- */
.xh-footer { background: var(--xh-dark); color: #d9cfae; text-align: center; font-size: .85rem; margin-top: 1.5rem; padding: 0 1rem 1.2rem; }
.xh-footer p { margin: 0; }
/* Voting bar: a floating strip in the middle of the screen so corner widgets (accessibility, language chooser) stay clear. */
.xh-votebar { display: none; position: fixed; left: 50%; bottom: .8rem; transform: translateX(-50%); z-index: 1030; width: min(640px, calc(100vw - 10rem)); box-sizing: border-box; background: var(--xh-dark); color: #fff; border: 2px solid var(--xh-gold); border-radius: 14px; padding: .55rem .9rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .4); align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.xh-votebar.xh-picking { display: flex; }
.xh-votebar .xh-vpicks { display: flex; flex-direction: column; gap: .1rem; min-width: 0; font-size: .85rem; color: #fff; text-align: left; }
.xh-votebar .xh-vbtns { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
.xh:has(.xh-votebar.xh-picking) .xh-footer { margin-bottom: 6rem; }
.xh .xh-chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .xh-votebar { width: calc(100vw - 1.5rem); bottom: 4.6rem; justify-content: center; }
  .xh-votebar .xh-vpicks { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: .1rem .9rem; font-size: .78rem; }
  .xh-votebar .xh-vbtns { margin-left: 0; }
}
.xh-candy { height: 10px; margin: 0 -1rem 1rem; background: repeating-linear-gradient(135deg, #c8102e 0 12px, #fff 12px 24px); }

/* ---- Full width (Options: use the whole page width) ---- */
.xh.xh-fullwidth { border-radius: 0; box-shadow: none; margin: 0; }
.xh.xh-fullwidth .xh-main { max-width: 960px; }
.xh.xh-fullwidth .xh-header { padding-left: max(1rem, 3vw); padding-right: max(1rem, 3vw); }

@media (prefers-reduced-motion: reduce) {
  .xh-snow i, .xh-lights::after, .xh-hero-star { animation: none; }
}
@media (max-width: 480px) {
  .xh .xh-nav a { margin-left: 0; margin-right: .4rem; }
}

/* "Already entered" popup (centre of the screen) */
.xh-dialog { border: 3px solid var(--xh-gold, #e8b923); border-radius: 16px; padding: 1.4rem 1.6rem 1.2rem; max-width: min(30rem, calc(100vw - 2rem)); background: #fffdf6; color: #1b1b1b; text-align: center; box-shadow: 0 18px 60px rgba(0, 0, 0, .55); margin: auto; font-size: 1.05rem; line-height: 1.5; }
.xh-dialog::backdrop { background: rgba(6, 28, 18, .72); }
.xh-dialog .xh-dialog-icon { font-size: 2.6rem; line-height: 1; }
.xh-dialog .xh-dialog-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; margin: .3rem 0 .6rem; color: var(--xh-link, #8c0f23); }
.xh-dialog p { margin: 0 0 .8rem; }
.xh-dialog .xh-dialog-actions { margin: 1rem 0 0; }

/* Fieldset per category on the plain ballot form */
.xh .xh-ballot-cat { border: 2px solid var(--xh-gold); border-radius: 10px; padding: .6rem 1rem 1rem; margin: 0 0 1.2rem; }
.xh .xh-ballot-cat legend { float: none; width: auto; padding: 0 .5rem; font-family: Georgia, serif; font-size: 1.2rem; color: var(--xh-link); }

/* Rules page */
.xh .xh-rules { max-width: 46rem; margin: 0 auto; font-size: 1.1rem; line-height: 1.6; text-align: left; }
.xh .xh-rules h2 { font-size: 1.35rem; margin: 1.8rem 0 .4rem; padding-bottom: .2rem; border-bottom: 2px solid var(--xh-gold, #e8b923); }
.xh .xh-rules p, .xh .xh-rules li { margin: .5rem 0; }
.xh .xh-rules ul, .xh .xh-rules ol { padding-left: 1.4rem; }
.xh .xh-rules .short { background: #e7f3ec; color: #12301f; border-left: 6px solid #2b6a4a; padding: .8rem 1rem; border-radius: 6px; }
.xh .xh-rules .fill { background: #fff3a8; color: #1b1b1b; padding: 0 .25rem; border-radius: 3px; font-weight: 600; }
.xh .xh-rules .small { font-size: .9rem; opacity: .8; }

/* Address list */
.xh .xh-addrbox { margin: .4rem 0 1rem; }
.xh .xh-addrbox label { display: block; margin-bottom: .35rem; font-weight: 600; }
.xh .xh-picker select#xh-addr { width: 100%; font-size: 1rem; text-align: left; border: 2px solid var(--xh-gold, #e8b923); border-radius: 10px; padding: .3rem; background: #fff; }
.xh .xh-picker select#xh-addr option { padding: .55rem .6rem; white-space: normal; border-radius: 6px; }
.xh .xh-picker select#xh-addr option:first-child { font-weight: 700; color: var(--xh-link, #8c0f23); border-bottom: 1px solid #e6dcc0; }
.xh .xh-dialog .xh-dialog-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.xh [hidden] { display: none !important; }
/* Some templates (e.g. Helix) fix every select to a short height (calc(2.25rem + 2px)), which clips the text.
   Make our selects tall enough whatever the template says. */
.xh .xh-form select, .xh .xh-rank select { height: auto !important; min-height: calc(2.25rem + 14px) !important; padding-top: .55rem !important; padding-bottom: .55rem !important; line-height: 1.5 !important; }
.xh .xh-addrbox .form-text { margin-top: .5rem; }

/* ---- Stanwick Sparkle 1.0.0 additions ---- */
.xh .xh-skip { position: absolute; left: -9999px; top: 0; background: #fff; color: var(--xh-dark); padding: .5rem 1rem; z-index: 50; border-radius: 0 0 8px 0; }
.xh .xh-skip:focus { left: 0; }
.xh .xh-countdown { text-align: center; font-weight: 700; color: var(--xh-dark); background: #fff3c4; border: 2px solid var(--xh-gold); border-radius: 999px; padding: .45rem 1rem; margin: .8rem auto; max-width: 36rem; }
.xh .xh-tools { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; margin: 0 0 .8rem; }
.xh .xh-viewtoggle { display: inline-flex; gap: .4rem; }
.xh .xh-chip-btn:focus-visible, .xh .xh-zoom:focus-visible, .xh .xh-btn:focus-visible { outline: 3px solid var(--xh-dark); outline-offset: 2px; }
.xh .xh-card > .xh-zoom { grid-column: 1; min-width: 0; padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.xh .xh-zoom img { width: 100%; height: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; max-height: 240px; }
.xh .xh-card.xh-has-img:not(.xh-has-map) > .xh-zoom { grid-column: 1 / -1; }
.xh .xh-card.xh-has-img:not(.xh-has-map) > .xh-zoom img { max-height: 200px; }
@media (max-width: 640px) { .xh .xh-card > .xh-zoom { grid-column: 1; } }
.xh .xh-card-title a.xh-card-link { color: inherit; text-decoration: none; }
.xh .xh-card-title a.xh-card-link:hover, .xh .xh-card-title a.xh-card-link:focus-visible { text-decoration: underline; }

/* Gallery view: photo-first grid. Voting buttons stay. */
.xh .xh-list.xh-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; align-items: start; }
.xh .xh-list.xh-gallery .xh-card { grid-template-columns: minmax(0, 1fr); margin-bottom: 0; }
.xh .xh-list.xh-gallery .xh-card > .xh-zoom, .xh .xh-list.xh-gallery .xh-card > .xh-imgwrap { grid-column: 1; }
.xh .xh-list.xh-gallery .xh-minimap, .xh .xh-list.xh-gallery .xh-card-body > p:not(.xh-cat):not(.xh-award), .xh .xh-list.xh-gallery .xh-card-body > a.xh-btn { display: none; }
.xh .xh-list.xh-gallery .xh-card[hidden] { display: none; }
.xh .xh-list.xh-gallery .xh-ranks { display: flex; flex-wrap: wrap; gap: .3rem; }

/* Enlarged photo */
.xh .xh-lightbox { max-width: min(96vw, 1100px); width: 96vw; padding: .8rem; border: 3px solid var(--xh-gold); border-radius: 12px; text-align: center; }
.xh .xh-lightbox img { max-width: 100%; max-height: 78vh; height: auto; border-radius: 8px; }
.xh .xh-lb-title { font-family: Georgia, serif; font-size: 1.1rem; margin: 0 0 .5rem; color: var(--xh-dark); }
.xh dialog::backdrop, dialog.xh-lightbox::backdrop { background: rgba(0, 0, 0, .65); }

/* Walking trail */
.xh .xh-trail { background: #fff; border: 2px solid var(--xh-gold); border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1rem; }
.xh .xh-trail-title { font-family: Georgia, serif; font-size: 1.2rem; margin: 0 0 .3rem; color: var(--xh-dark); }
.xh .xh-trail-sum { font-weight: 700; color: var(--xh-dark); }
.xh .xh-trail-list { padding-left: 1.6rem; margin: .5rem 0; max-height: 18rem; overflow: auto; }
.xh .xh-trail-list li { margin: .2rem 0; }
.xh .xh-trail-leg { color: #555; font-size: .9rem; }

/* Single-home, winners, manage pages */
.xh .xh-card.xh-solo { grid-template-columns: minmax(0, 1fr); }
.xh .xh-card.xh-solo > img { max-height: 520px; width: 100%; height: auto; aspect-ratio: auto; }
.xh .xh-minimap-big { min-height: 280px; margin: .5rem 0; border-radius: 8px; grid-column: 1; }
.xh .xh-crumbs { margin: 0 0 .8rem; }
.xh .xh-manage-addr { font-size: 1.2rem; margin: 0 0 .2rem; }
.xh .xh-help { font-size: .9rem; color: #555; margin: .2rem 0 0; }
.xh .xh-winnerspage .xh-card { margin-top: .6rem; }

/* Leaflet's own credit line: darker text so it passes contrast checks */
.xh .leaflet-container .leaflet-control-attribution, .xh .leaflet-container .leaflet-control-attribution a { color: #0a3d78; }
.xh .leaflet-container .leaflet-control-attribution { background: rgba(255, 255, 255, .9); }

/* ---- 1.1.0: vote-now pop-up, verification box ---- */
.xh .xh-nav a.xh-nav-vote { background: var(--xh-gold); color: var(--xh-dark); font-weight: 700; }
.xh .xh-nav a.xh-nav-vote:hover, .xh .xh-nav a.xh-nav-vote:focus-visible { background: #fff; }
.xh .xh-rk[hidden] { display: none; }
.xh .xh-rk .xh-rk-on { display: none; }
.xh .xh-rk.xh-on .xh-rk-on { display: inline; }
.xh .xh-rk.xh-on .xh-rk-off { display: none; }
.xh .xh-howto { max-width: 34rem; }
.xh .xh-howto-steps { padding-left: 1.3rem; margin: .5rem 0; }
.xh .xh-howto-steps li { margin: .35rem 0; }
.xh .xh-howto-points { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-weight: 700; margin: .6rem 0; }
.xh .xh-howto-note { font-size: .95rem; }
.xh .xh-howto-state { background: #fff7d6; border-radius: 8px; padding: .5rem .7rem; }
.xh .xh-verify-box { background: #eef6ee; border: 2px solid #0b6b3a; border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0; }
.xh .xh-btn-big { font-size: 1.15rem; padding: .8rem 1.6rem; }
.xh .xh-terms input[type=checkbox] { flex: none; width: 1.3rem; height: 1.3rem; margin-top: .15rem; }
.xh .xh-social { border: 0; padding: 0; margin: 1rem 0; }
.xh .xh-social-q { font-size: 1rem; font-weight: 600; float: none; width: auto; margin-bottom: .4rem; }
.xh .xh-social-opt { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.6rem; font-size: 1.05rem; }
.xh .xh-social-opt input[type=radio] { width: 1.3rem; height: 1.3rem; }
.xh input.xh-locked, .xh input.xh-locked:focus, .xh .xh-form input[type=text].xh-locked, .xh .xh-form input[type=text].xh-locked:focus { background: #e9e9e9; color: #555; cursor: not-allowed; border-style: dashed; }
.xh .xh-social label.xh-social-opt { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.6rem; }

/* "How to enter" / "How to vote" hook buttons (classes hte / htv). */
.xh .xh-howto-btn { margin: .4rem 0 1rem; }

/* ---- Message pop-up (media/js/messages.js) ---- */
.xh-msgbox .xh-msgbox-body { text-align: center; }
.xh-msgbox .xh-msgbox-body p { margin: 0 0 .6rem; }

/* ---- Category chooser: three big coloured buttons with an icon (replaces the small radio dots) ---- */
.xh fieldset#jform_category { border: 0; padding: 0; margin: 0; }
.xh fieldset#jform_category > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.xh fieldset#jform_category .form-check { position: relative; padding: 0; margin: 0; min-height: 0; display: block; min-width: 0; }
.xh fieldset#jform_category .form-check-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; float: none; opacity: 0; cursor: pointer; z-index: 2; }
.xh fieldset#jform_category .form-check-label { --c: #c8102e; display: flex; width: 100%; box-sizing: border-box; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 6.2rem; padding: .8rem .4rem; border: 3px solid var(--c); border-radius: 16px; background: #fff; color: var(--c); font-weight: 700; font-size: 1.05rem; line-height: 1.2; text-align: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); transition: background .12s, color .12s, transform .12s; position: relative; margin: 0; }
.xh fieldset#jform_category .form-check-label::before { font-size: 2.3rem; line-height: 1; }
.xh fieldset#jform_category input[value=house] + .form-check-label { --c: #c8102e; }
.xh fieldset#jform_category input[value=door] + .form-check-label { --c: #14532d; }
.xh fieldset#jform_category input[value=window] + .form-check-label { --c: #1e4fa8; }
.xh fieldset#jform_category input[value=house] + .form-check-label::before { content: "🏠"; }
.xh fieldset#jform_category input[value=door] + .form-check-label::before { content: "🚪"; }
.xh fieldset#jform_category input[value=window] + .form-check-label::before { content: "🪟"; }
.xh fieldset#jform_category .form-check:hover .form-check-label { transform: translateY(-2px); }
.xh fieldset#jform_category .form-check-input:checked + .form-check-label { background: var(--c); color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--c); }
.xh fieldset#jform_category .form-check-input:checked + .form-check-label::after { content: "✓"; position: absolute; top: .3rem; right: .5rem; font-size: 1.2rem; font-weight: 800; }
.xh fieldset#jform_category .form-check-input:focus-visible + .form-check-label { outline: 3px solid #e8b923; outline-offset: 3px; }
@media (max-width: 480px) { .xh fieldset#jform_category .form-check-label { font-size: .92rem; min-height: 5.6rem; } .xh fieldset#jform_category .form-check-label::before { font-size: 2rem; } }
