@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@400;500;600;700&display=swap');

/* Brand palette and type shared with www.urbansphinx.com (website/css/style.css). */
:root {
  color-scheme: light;
  --onyx: #0B0B0A;
  --onyx-soft: #151412;
  --gold-brand: #C9A227;
  --gold-bright: #E4C158;
  --parchment: #F1ECE0;
  --parchment-dim: #E7E0CF;
  --charcoal: #2A2723;
  --muted-gold: #8A7648;
  --line-on-dark: rgba(201, 162, 39, 0.35);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ink: #2A2723;
  --muted: #7d7360;
  --gold: #C9A227;
  --gold-light: #f2e3b3;
  --paper: #F1ECE0;
  --panel: #F8F4EA;
  --line: #d9d1bf;
  --green: #477754;
  --red: #a43931;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: #795a18; }
.hidden { display: none !important; }
.site-header { height: 76px; padding: 0 max(24px, calc((100% - 1180px) / 2)); display: flex; justify-content: space-between; align-items: center; background: #141310; color: white; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: white; text-decoration: none; }
.brand img { display: block; }
.brand strong, .brand small { display: block; letter-spacing: .13em; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: var(--gold); font-size: 9px; }
.connection-status { color: #dcc782; font-size: 12px; }
main { max-width: 1180px; min-height: calc(100vh - 142px); padding: 46px 24px 64px; margin: 0 auto; }
.auth-shell { min-height: 610px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 70px; }
.auth-copy { max-width: 580px; padding: 32px 0; }
.eyebrow { margin: 0 0 10px; color: #98701d; font-weight: 800; font-size: 11px; letter-spacing: .17em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-family: var(--serif); font-size: clamp(40px, 6vw, 64px); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 20px; }
.auth-copy h1 em { color: #ae8127; font-weight: 400; }
.auth-copy > p:not(.eyebrow) { max-width: 470px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.feature-note { margin-top: 45px; color: #5d584c; font-size: 14px; }
.gold-dot { display: inline-block; width: 9px; height: 9px; margin-right: 9px; border-radius: 50%; background: var(--gold); }
.panel { padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 35px #48370d0a; }
.auth-form h2 { margin-bottom: 8px; font-family: var(--serif); font-size: 28px; }
.muted { color: var(--muted); }
.auth-form .muted { font-size: 14px; margin-bottom: 26px; }
label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; padding: 12px 13px; border: 1px solid #d9d3c6; border-radius: 7px; background: white; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #d5a94522; }
textarea { resize: vertical; }
.phone-entry { display: flex; align-items: center; margin-bottom: 16px; overflow: hidden; border: 1px solid #d9d3c6; border-radius: 7px; background: white; }
.phone-entry span { padding: 0 13px; color: #615a4b; border-right: 1px solid #eee9df; }
.phone-entry input { border: 0; box-shadow: none; }
.consent-copy { margin: 14px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; color: #5f5b53; font-size: 12px; font-weight: 500; line-height: 1.5; }
.checkbox-row input { width: 16px; height: 16px; margin: 0; accent-color: #ab7a18; }
.button { display: inline-flex; min-height: 42px; padding: 10px 16px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 750; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: #191815; color: white; }
.button-primary:hover { background: #38352e; }
.button-quiet { background: #f3efe5; border-color: #e7e0d1; color: #38342c; }
.full-width { width: 100%; margin-top: 10px; }
.form-message { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
.form-message.success { color: var(--green); }
.dev-code { margin-top: 8px; padding: 9px; border-radius: 6px; background: #f6efdb; color: #675019; font-size: 12px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: #795a18; font-size: 12px; font-weight: 700; text-decoration: underline; }
#otpFields { margin-top: 14px; }
#otpInput { letter-spacing: .3em; }
.app-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.app-heading h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); }
.account-tools { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; margin-bottom: 24px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { padding: 13px 17px; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.tab.active { border-bottom-color: var(--gold); color: var(--ink); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 34px 0 18px; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: 31px; }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.create-hunt-card {
  display: flex;
  min-height: 245px;
  padding: 25px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 1px dashed #b49b66;
  border-radius: 12px;
  background: linear-gradient(145deg, #fffdf7, #f5f0e3);
  color: #59471e;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.create-hunt-card:hover { transform: translateY(-3px); border-color: #987324; box-shadow: 0 14px 28px #49391114; }
.create-hunt-plus { display: grid; width: 64px; height: 64px; place-items: center; border: 1px solid #d7c69d; border-radius: 50%; background: #fff; color: #9c7627; font-size: 42px; font-weight: 300; line-height: 1; }
.create-hunt-title { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.event-card { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; color: var(--ink); }
.event-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.event-image { height: 155px; display: grid; place-items: center; background: linear-gradient(135deg, #25231e, #4c412a); color: #d9b65d; font-family: var(--serif); font-size: 24px; }
.event-image img { width: 100%; height: 100%; object-fit: cover; }
.event-card-body { padding: 17px; }
.event-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; }
.event-card p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.empty-message, .empty-state { color: var(--muted); }
.empty-message { padding: 22px 0; }
.event-detail { margin-top: 24px; }
.event-detail h2 { margin: 16px 0 7px; font-family: var(--serif); font-size: 30px; }
.event-detail p { color: #5f5b53; line-height: 1.65; }
.join-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; margin: 25px 0 9px; padding-top: 20px; border-top: 1px solid var(--line); }
.small { font-size: 12px; }
.token-pill { padding: 8px 13px; border: 1px solid #e4d199; border-radius: 30px; background: var(--gold-light); color: #5c4514; font-size: 13px; font-weight: 800; }
.hunt-card { max-width: 780px; }
.hunt-card .trial-counter { color: #96701f; font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.hunt-card h3 { margin: 14px 0; font-family: var(--serif); font-size: 27px; }
.hunt-card .challenge { margin-bottom: 22px; white-space: pre-wrap; line-height: 1.7; }
.challenge-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.challenge-audio { display: block; width: min(100%, 520px); margin: 0 0 18px; }
.hunt-answer { display: flex; gap: 10px; }
.hunt-answer input { flex: 1; }
.hint-box { margin: 15px 0; padding: 13px; border-left: 3px solid var(--gold); background: #faf5e7; line-height: 1.5; }
.winner-banner { padding: 17px; margin-bottom: 15px; background: var(--gold-light); border-radius: 8px; font-family: var(--serif); font-size: 19px; }
.team-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.team-header h3 { font-family: var(--serif); font-size: 26px; }
.team-code { padding: 10px 14px; border-radius: 7px; background: #f5efdE; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; letter-spacing: .15em; }
.member-list { padding-left: 18px; line-height: 1.9; }
.organizer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-stack h3, .form-stack h4 { margin: 0; font-family: var(--serif); }
.form-stack h3 { font-size: 22px; }
.form-stack h4 { margin-top: 7px; font-size: 18px; }
.form-stack label { margin: 0; }
.form-stack label input, .form-stack label textarea, .form-stack label select { display: block; margin-top: 6px; }
.form-stack .checkbox-row { display: flex; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
fieldset legend { padding: 0 5px; color: var(--muted); font-size: 12px; }
fieldset .checkbox-row { margin: 0; }
.divider { height: 1px; margin: 5px 0; background: var(--line); }
.issued-code { padding: 15px; border-radius: 8px; background: #f5efde; color: #554112; font-family: ui-monospace, monospace; font-size: 21px; font-weight: 800; letter-spacing: .2em; }
.issued-code small { display: block; margin-top: 7px; font: 12px/1.4 system-ui; letter-spacing: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-live { margin-top: 18px; overflow-x: auto; }
.broadcast-form { display: flex; gap: 14px; align-items: end; margin-top: 16px; }
.broadcast-form label { flex: 1; }
.broadcast-form textarea { display: block; margin-top: 6px; }
.planned-trials-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbf8f0; color: #65532d; font-size: 13px; }
.planned-trials-control strong { color: var(--ink); font-size: 17px; }
.planned-trials-dialog { width: min(440px, calc(100% - 28px)); padding: 26px; border: 1px solid #d8ceb6; border-radius: 13px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px #18160e44; }
.planned-trials-dialog::backdrop { background: #17161299; backdrop-filter: blur(2px); }
.planned-trials-dialog h3 { font-family: var(--serif); font-size: 24px; }
.planned-trials-dialog .muted { font-size: 13px; line-height: 1.55; }
.team-management { margin-top: 20px; }
.team-management-tools { display: grid; grid-template-columns: minmax(240px, .7fr) 1fr; gap: 20px; align-items: end; }
.team-management .table-scroll { overflow-x: auto; }
.team-management .data-table { min-width: 620px; }
#createTrialForm { padding-top: 6px; }
#trialEditorEmpty { padding: 12px 0; font-size: 13px; }
.form-stack > .muted { margin: 0; font-size: 13px; line-height: 1.5; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: #716b5d; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.data-table .own-row { background: #faf4e3; }
.status-good { color: var(--green); font-weight: 700; }
.status-bad { color: var(--red); font-weight: 700; }
.global-message { padding: 12px 15px; margin-bottom: 16px; border: 1px solid #d9c785; border-radius: 7px; background: #fbf3d9; color: #554112; font-size: 13px; }
.global-message.error { border-color: #e2bcb9; background: #fff1ef; color: var(--red); }
.reconnecting { color: var(--red); }
footer { min-height: 66px; display: flex; justify-content: space-between; align-items: center; padding: 0 max(24px, calc((100% - 1180px) / 2)); background: #141310; color: #9c988d; font-size: 11px; }
footer span:first-child { color: #dcc782; font-weight: 800; letter-spacing: .12em; }

@media (max-width: 800px) {
  main { padding-top: 28px; }
  .auth-shell { grid-template-columns: 1fr; gap: 6px; }
  .auth-copy { padding: 10px 0; }
  .auth-copy h1 { font-size: 48px; }
  .feature-note { margin-top: 20px; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .organizer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { height: 64px; padding: 0 16px; }
  .site-header .brand img { width: 36px; height: 36px; }
  main { padding: 22px 16px 42px; }
  .auth-copy h1 { font-size: 42px; }
  .auth-copy > p:not(.eyebrow) { font-size: 15px; }
  .panel { padding: 20px; }
  .app-heading { align-items: flex-start; flex-direction: column; }
  .account-tools { width: 100%; flex-wrap: wrap; }
  .event-grid { grid-template-columns: 1fr; }
  .event-image { height: 145px; }
  .join-form { grid-template-columns: 1fr; }
  .team-header { flex-direction: column; }
  .hunt-answer { flex-direction: column; }
  .broadcast-form { flex-direction: column; align-items: stretch; }
  .two-fields { grid-template-columns: 1fr; }
  footer { padding: 15px 16px; gap: 8px; flex-direction: column; align-items: flex-start; }
}

/* Editorial field-guide theme */
:root {
  --ink: #201d18;
  --muted: #777166;
  --gold: #e3b84f;
  --gold-light: #f6e8c3;
  --paper: #f2efe7;
  --panel: #fffdf7;
  --line: #e5dece;
  --green: #3b7757;
  --red: #a43931;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 88% 8%, #e6d8b638, transparent 33rem),
    radial-gradient(ellipse at 4% 42%, #d5c7a526, transparent 30rem),
    var(--paper);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(#70644812 .7px, transparent .7px);
  background-size: 6px 6px;
  content: "";
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 2;
  height: 72px;
  background: linear-gradient(110deg, #151511, #242118 72%, #30291a);
  box-shadow: 0 5px 24px #100e0a26;
}

.site-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d5a945, #f3dc99, #d5a945, transparent);
  content: "";
}

.brand { gap: 13px; }
.brand img { filter: drop-shadow(0 0 9px #ddb74d2b); }
.brand strong { letter-spacing: .18em; }
.connection-status {
  padding: 7px 11px;
  border: 1px solid #d5a94536;
  border-radius: 99px;
  background: #ffffff08;
  color: #ead59b;
  font-size: 11px;
  letter-spacing: .06em;
}

main { max-width: 1280px; }
.auth-shell { gap: clamp(40px, 8vw, 112px); }
.auth-copy { position: relative; }
.auth-copy::before {
  display: block;
  width: 70px;
  height: 3px;
  margin-bottom: 22px;
  background: linear-gradient(90deg, #9e741f, #e8c260);
  content: "";
}
.auth-copy .eyebrow { color: #87641b; }
.auth-copy h1 { font-size: clamp(48px, 6.3vw, 76px); }
.auth-copy h1 em { color: #a47821; }
.auth-copy > p:not(.eyebrow) { max-width: 430px; }
.feature-note {
  display: inline-flex;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #d8cba8;
  border-radius: 7px;
  background: #fffaf0a8;
  box-shadow: 0 6px 20px #76612c0b;
  font-size: 12px;
}
.gold-dot { box-shadow: 0 0 0 4px #d5a94526; }
.auth-form {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid #ded5c0;
  border-radius: 15px;
  background: linear-gradient(145deg, #fffefa, #fffdf6);
  box-shadow: 0 24px 70px #49391117, 0 3px 10px #49391108;
}
.auth-form::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #9b6d15, #e6c66d, #9b6d15);
  content: "";
}
.auth-form .eyebrow { margin-top: 4px; }
.auth-form h2 { font-size: 30px; }
.button-google {
  gap: 11px;
  border-color: #d9d4c9;
  background: #fff;
  color: #302e29;
  box-shadow: 0 3px 10px #241e0e0c;
}
.button-google:hover { background: #fbfaf7; }
.button-google span { color: #4285f4; font-size: 17px; font-weight: 850; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 15px; color: #898171; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
#localLoginFields > .muted { margin: 0 0 18px; font-size: 12px; }
input, textarea, select {
  border-color: #dcd5c7;
  border-radius: 8px;
  background-color: #fffefa;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover, textarea:hover, select:hover { border-color: #c9b77f; }
input:focus, textarea:focus, select:focus { border-color: #ba8b27; box-shadow: 0 0 0 4px #d5a94524; }
.button { min-height: 44px; border-radius: 8px; }
.button-primary {
  border-color: #1c1a15;
  background: linear-gradient(135deg, #29271f, #151410);
  box-shadow: 0 5px 12px #1d1a1122;
}
.button-primary:hover { background: linear-gradient(135deg, #47402e, #29251b); }
.button:disabled { cursor: wait; opacity: .72; transform: none; }

.dashboard-banner {
  position: relative;
  min-height: 216px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 32px clamp(25px, 5vw, 58px);
  margin: 0 0 31px;
  border: 1px solid #5d4b25;
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 78% 28%, #b3934633, transparent 34%),
    linear-gradient(112deg, #1a1915, #242117 63%, #342b1b);
  box-shadow: 0 16px 42px #382b101f;
  color: #fffdf7;
}
.dashboard-banner::before, .dashboard-banner::after {
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid #d1aa5140;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.dashboard-banner::before { top: -155px; right: 130px; }
.dashboard-banner::after { top: -128px; right: 157px; width: 226px; height: 226px; border-color: #d1aa512e; }
.dashboard-banner > div:first-child { position: relative; z-index: 1; }
.dashboard-banner .eyebrow { color: #e3c46f; }
.dashboard-banner h2 { margin: 0 0 11px; font-family: var(--serif); font-size: clamp(27px, 4vw, 40px); line-height: 1.12; letter-spacing: -.02em; }
.dashboard-banner h2 em { color: #e5bf5d; font-weight: 400; }
.dashboard-banner p:last-child { max-width: 470px; margin: 0; color: #d0cabb; font-size: 13px; line-height: 1.6; }
.banner-seal {
  position: absolute;
  top: 50%;
  right: 15%;
  width: 105px;
  height: 105px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid #e3bc5b8a;
  border-radius: 50%;
  color: #e7c567;
  transform: translateY(-50%) rotate(-9deg);
  box-shadow: 0 0 0 7px #d7b24a0b, inset 0 0 0 4px #d7b24a12;
}
.banner-seal span { font-family: var(--serif); font-size: 32px; line-height: 1; }
.banner-seal small { margin-top: 5px; font-size: 7px; letter-spacing: .18em; text-align: center; }
.banner-coordinates { position: absolute; right: 26px; bottom: 18px; color: #c8b985; font: 9px/1.6 ui-monospace, monospace; letter-spacing: .1em; text-align: right; }
.app-heading { margin: 0 0 20px; align-items: end; }
.app-heading h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 43px); }
.app-heading .eyebrow { margin-bottom: 7px; }
.account-tools { padding: 8px 11px; border: 1px solid #dfd8c9; border-radius: 9px; background: #fffdf8c9; }
.account-tools #userLabel { color: #49453c; font-weight: 650; }
.tabs {
  gap: 5px;
  padding: 5px;
  margin-bottom: 22px;
  border: 1px solid #e3dccd;
  border-radius: 10px;
  background: #eae6dc;
}
.tab { padding: 10px 16px; border: 0; border-radius: 7px; font-size: 12px; transition: background .15s, color .15s, box-shadow .15s; }
.tab:hover { background: #ffffff80; color: var(--ink); }
.tab.active { background: #fffdf8; color: #5e4613; box-shadow: 0 2px 7px #352c1916; }
.section-heading { margin: 28px 0 16px; }
.section-heading h2 { font-size: 33px; }
.panel {
  border-color: #e1daca;
  border-radius: 13px;
  background: linear-gradient(145deg, #fffefa, #fffdf7);
  box-shadow: 0 10px 30px #3f32120b, 0 2px 5px #3f321208;
}
.event-card {
  border-color: #e1daca;
  border-radius: 13px;
  box-shadow: 0 6px 18px #382d130b;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.event-card:hover { border-color: #c9a448; box-shadow: 0 14px 28px #382d1318; }
.event-image { position: relative; background: radial-gradient(circle at 70% 25%, #bd985447, transparent 34%), linear-gradient(140deg, #24231e, #413820 75%, #725d2d); }
.event-image::after {
  position: absolute;
  inset: 12px;
  border: 1px solid #e4c46842;
  border-radius: 4px;
  content: "";
}
.event-card-body { padding: 18px; }
.event-card h3 { font-size: 22px; }
.event-card p { font-size: 13px; }
.form-stack { gap: 14px; }
.form-stack h3 { font-size: 24px; }
.form-stack h4 { margin-top: 8px; color: #755819; font-size: 17px; }
.form-stack label { color: #514b3f; font-size: 12px; }
.form-stack input, .form-stack textarea, .form-stack select { font-size: 13px; font-weight: 450; }
.organizer-grid { gap: 20px; }
.organizer-grid > .panel { position: relative; overflow: hidden; }
.organizer-grid > .panel::before {
  position: absolute;
  top: 0;
  left: 28px;
  width: 42px;
  height: 3px;
  background: #c59a39;
  content: "";
}
.admin-live h3 { font-family: var(--serif); }
.data-table th { padding-top: 12px; padding-bottom: 12px; }
.data-table tbody tr:hover { background: #fbf7ed; }
.global-message { position: sticky; top: 10px; z-index: 3; box-shadow: 0 6px 18px #33270c14; }
footer { min-height: 72px; border-top: 2px solid #a07a2d; background: #171612; }

@media (max-width: 800px) {
  .auth-copy h1 { font-size: 58px; }
  .dashboard-banner { min-height: 195px; }
  .banner-seal { right: 7%; width: 85px; height: 85px; }
  .team-management-tools { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { height: 64px; }
  .connection-status { padding: 6px 8px; font-size: 10px; }
  .auth-copy h1 { font-size: 46px; }
  .auth-form { padding: 26px 22px; }
  .dashboard-banner { min-height: 184px; padding: 25px 21px; margin-bottom: 22px; }
  .dashboard-banner h2 { max-width: 280px; font-size: 29px; }
  .dashboard-banner p:last-child { max-width: 250px; font-size: 11px; }
  .banner-seal { top: 22px; right: 18px; width: 53px; height: 53px; transform: rotate(-9deg); }
  .banner-seal span { font-size: 20px; }
  .banner-seal small, .banner-coordinates { display: none; }
  .app-heading { gap: 13px; }
  .app-heading h1 { font-size: 32px; }
  .account-tools { gap: 9px; }
  .tabs { margin-right: -3px; margin-left: -3px; }
  .tab { padding: 10px 12px; }
  .section-heading h2 { font-size: 29px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.empty-event-card {
  grid-column: 1 / -1;
  padding: 38px;
  border: 1px dashed #cfc4a9;
  border-radius: 13px;
  background: #fffdf7b8;
  text-align: center;
}
.empty-seal { color: #b28b35; font-size: 29px; }
.empty-event-card h3 { margin: 12px 0 7px; font-family: var(--serif); font-size: 24px; }
.empty-event-card p { margin: 0; color: var(--muted); font-size: 13px; }
.event-card-body { position: relative; }
.event-state { display: inline-block; margin-bottom: 11px; color: #987426; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.event-state-live { color: #32734d; }
.event-card-cta { display: flex; justify-content: space-between; align-items: center; padding-top: 13px; margin-top: 14px; border-top: 1px solid var(--line); color: #69501a; font-size: 12px; font-weight: 750; }
.event-card-cta span { font-size: 17px; }
.event-workspace { padding-top: 8px; scroll-margin-top: 24px; }
.back-link { margin-bottom: 14px; text-decoration: none; }
.event-overview {
  display: block;
}
.event-detail {
  display: grid;
  grid-template-columns: 1fr minmax(220px, .36fr);
  gap: 25px;
  align-items: stretch;
  overflow: hidden;
  padding: clamp(23px, 4vw, 40px);
  border: 1px solid #55451f;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 80% 0%, #d4ad4e20, transparent 32%),
    linear-gradient(120deg, #201f19, #30291d);
  color: #fffdf6;
  box-shadow: 0 15px 36px #342a151b;
  margin: 0;
}
.event-detail-copy { align-self: center; }
.event-detail-copy .eyebrow { color: #dfbd61; }
.event-detail h2 { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
.event-detail-copy > p:not(.eyebrow) { max-width: 640px; margin-bottom: 20px; color: #d5d0c4; font-size: 14px; line-height: 1.65; }
.event-facts { display: flex; flex-wrap: wrap; gap: 22px; }
.event-facts span { min-width: 110px; display: grid; gap: 4px; }
.event-facts small { color: #c9ae68; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.event-facts strong { color: #f4f0e5; font-size: 12px; font-weight: 650; }
.event-countdown {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 21px;
  border: 1px solid #e2c36b59;
  border-radius: 10px;
  background: #fffdf70a;
  text-align: center;
}
.countdown-kicker { color: #e3c779; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.event-countdown > strong { margin: 12px 0; color: #fff3cb; font: 700 clamp(24px, 3vw, 34px)/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.06em; }
.countdown-footnote { color: #d5d0c2; font-size: 11px; line-height: 1.5; }
.event-countdown-live > strong { color: #b7e0bd; font: 800 22px/1 system-ui, sans-serif; letter-spacing: .12em; }
.live-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 12px; }
.live-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid #ffffff2b; border-radius: 999px; background: #ffffff0c; color: #f7f1e3; font-size: 11px; font-weight: 750; letter-spacing: .04em; cursor: pointer; }
.live-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.toggle-switch { position: relative; width: 34px; height: 19px; flex: 0 0 34px; border-radius: 999px; background: #615d53; transition: background .18s; }
.toggle-switch::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; content: ""; transition: transform .18s; }
.live-toggle input:checked + .toggle-switch { background: #5b9b66; }
.live-toggle input:checked + .toggle-switch::after { transform: translateX(15px); }
.live-toggle input:focus-visible + .toggle-switch { outline: 3px solid #dfbd61; outline-offset: 3px; }
.live-toggle:has(input:disabled) { cursor: not-allowed; opacity: .65; }
.kickstart-control { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 15px; color: #fff3cb; font-size: 12px; font-weight: 750; cursor: pointer; }
.kickstart-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.kickstart-switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #797364; transition: background .15s; }
.kickstart-switch::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fffdf6; content: ""; transition: transform .15s; }
.kickstart-control input:checked + .kickstart-switch { background: #4f9a68; }
.kickstart-control input:checked + .kickstart-switch::after { transform: translateX(16px); }
.kickstart-control input:focus-visible + .kickstart-switch { outline: 3px solid #e3c779; outline-offset: 3px; }
.kickstart-control input:disabled + .kickstart-switch { opacity: .75; }
.team-progress-banner { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(180px, 1fr) auto; gap: 18px; align-items: center; padding: 14px 18px; margin: 15px 0 3px; border: 1px solid #dfd0a3; border-radius: 10px; background: linear-gradient(100deg, #fffaf0, #fffdf7); box-shadow: 0 5px 15px #382d130b; }
.team-progress-copy { display: grid; gap: 4px; }
.team-progress-copy .eyebrow { margin: 0; color: #8b6a1c; }
.team-progress-copy strong { font-family: var(--serif); font-size: 18px; }
.team-progress-count { color: #736b5c; font-size: 11px; font-weight: 700; text-align: right; }
.team-progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #eae4d4; }
.team-progress-track > span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, #a77b20, #d3aa4f); transition: width .35s ease; }
.leaderboard-list { display: grid; gap: 11px; }
.leaderboard-team { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; }
.leaderboard-team.own-team { border-color: #d3b45e; background: #fffaf0; }
.leaderboard-team-heading { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; margin-bottom: 10px; }
.leaderboard-team-heading > strong { overflow-wrap: anywhere; font-size: 13px; }
.leaderboard-team-heading > span:last-child { color: #725820; font-size: 11px; font-weight: 750; text-align: right; }
.leaderboard-rank { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #eee8d8; color: #5e4a1e; font-size: 11px; font-weight: 800; }
.leaderboard-team-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: #787163; font-size: 10px; }
.join-prompt {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) 1.25fr;
  gap: 25px;
  align-items: center;
  padding: 20px 23px;
  margin: 16px 0;
  border: 1px solid #e3d7b7;
  border-radius: 12px;
  background: linear-gradient(110deg, #fffaf0, #fffdf7);
}
.join-prompt h3 { margin: 0 0 5px; font-family: var(--serif); font-size: 20px; }
.join-prompt p { margin: 0; }
.join-form { grid-template-columns: 1fr 1fr auto; gap: 11px; margin: 0; padding: 0; border: 0; }
.join-form label { margin: 0; font-size: 11px; }
.join-form input { margin-top: 5px; }
.event-tabs { margin: 18px 0 4px; }
.main-tabs { width: fit-content; min-width: 100px; margin: 0 0 21px; }
.main-tabs .tab { min-width: 88px; }
.event-panel > .section-heading { margin-top: 22px; }
.not-started-message { padding: 8px 0; color: #795c21; font-family: var(--serif); font-size: 22px; }
.create-event-dialog { max-height: min(90vh, 900px); overflow-y: auto; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.dialog-heading h3 { margin: 0; font-family: var(--serif); font-size: 26px; }
.dialog-close { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 23px; line-height: 1; }
.admin-live h3 { margin-bottom: 13px; }

@media (max-width: 800px) {
  .event-detail { grid-template-columns: 1fr; }
  .event-countdown { min-height: 130px; }
  .join-prompt { grid-template-columns: 1fr; }
  .join-form { grid-template-columns: 1fr 1fr; }
  .join-form button { grid-column: 1 / -1; }
  .team-progress-banner { grid-template-columns: 1fr auto; gap: 10px 14px; }
  .team-progress-track { grid-column: 1 / -1; grid-row: 2; }
  .team-progress-count { grid-column: 2; grid-row: 1; }
}
@media (max-width: 560px) {
  .event-detail { gap: 20px; padding: 23px 20px; }
  .event-facts { gap: 13px 19px; }
  .event-facts span { min-width: 100px; }
  .event-countdown { min-height: 106px; padding: 15px; }
  .event-countdown > strong { margin: 9px 0; }
  .join-prompt { padding: 18px; }
  .join-form { grid-template-columns: 1fr; }
  .join-form button { grid-column: auto; }
  .leaderboard-team-heading { grid-template-columns: 27px minmax(0, 1fr); }
  .leaderboard-team-heading > span:last-child { grid-column: 2; text-align: left; }
  .leaderboard-team-foot { flex-direction: column; gap: 3px; }
  .empty-event-card { padding: 30px 20px; }
}

/* ---------- Events, registration and organiser management (Oct 2026) ---------- */
.header-right { display: flex; align-items: center; gap: 16px; }
.header-account:empty { display: none; }
.button-header { min-height: 36px; padding: 7px 15px; border: 1px solid #e3b84f88; background: transparent; color: #f4e2ae; }
.button-header:hover { background: #ffffff12; }
.button-small { min-height: 30px; padding: 5px 11px; font-size: 12px; }
.button-large { min-height: 50px; padding: 13px 26px; font-size: 15px; }
.button[disabled] { cursor: not-allowed; opacity: .55; transform: none; }
.button-accept { background: #2f6b4b; color: #fff; }
.button-reject { background: #fff; border-color: #e2bcb9; color: var(--red); }
.text-button.danger { color: var(--red); }
.field-note { color: var(--muted); font-size: 11px; font-weight: 500; }

/* Status chips: green = live / open, red = not live / not open. The word always accompanies the colour. */
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }
.status-chip.is-good { background: #e3f1e7; color: #276343; }
.status-chip.is-bad { background: #f8e4e1; color: #9b3229; }
.event-facts .status-chip { margin-top: 2px; }

/* Event tiles */
.event-card { display: flex; flex-direction: column; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.event-card:hover { box-shadow: 0 14px 30px #4939111a; }
.event-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.event-card-body { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.tile-category { color: #8f6a1d; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.tile-flag { align-self: flex-start; margin-top: 4px; padding: 2px 7px; border-radius: 5px; background: #eee9dd; color: #625b4c; font-size: 10px; font-weight: 700; }
.event-card .tile-summary { color: #4f4a40; font-size: 13px; line-height: 1.5; }
.event-card .tile-date { margin-top: auto; padding-top: 6px; }
.tile-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.event-image-placeholder { display: grid; place-content: center; gap: 6px; text-align: center; }
.event-image-placeholder span { color: #b4994f; font: 800 10px/1 system-ui, sans-serif; letter-spacing: .3em; }

/* Event pop-up */
.event-dialog { width: min(760px, calc(100% - 28px)); max-height: min(92vh, 1000px); padding: 0; overflow-y: auto; border: 1px solid #d8ceb6; border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 90px #120f0866; }
.event-dialog::backdrop { background: #16140f8c; backdrop-filter: blur(6px) brightness(.85); -webkit-backdrop-filter: blur(6px) brightness(.85); }
.event-dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.event-dialog-close { position: sticky; top: 14px; z-index: 2; float: right; margin: 14px 14px -50px 0; box-shadow: 0 4px 14px #0000001f; }
.event-dialog-image { display: block; width: 100%; height: 240px; object-fit: cover; background: linear-gradient(135deg, #25231e, #4c412a); color: #d9b65d; font-family: var(--serif); font-size: 26px; }
.event-dialog-image.event-image-placeholder { display: grid; }
.event-dialog-content { padding: 26px 30px 30px; }
.event-dialog-content h2 { margin: 0 0 8px; font-family: var(--serif); font-size: clamp(26px, 4vw, 34px); line-height: 1.15; }
.event-dialog-lede { margin: 0 0 4px; color: #4f4a40; font-size: 16px; line-height: 1.55; }
.event-facts-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin: 22px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.event-facts-list div { min-width: 0; }
.event-facts-list dt { margin-bottom: 4px; color: #8f6a1d; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.event-facts-list dd { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.event-facts-list dd a { font-size: 12px; font-weight: 700; white-space: nowrap; }
.event-facts-list .price { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.event-dialog-description { margin-bottom: 24px; color: #4f4a40; line-height: 1.7; white-space: pre-wrap; }
.event-dialog-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.event-dialog-actions .button-large { width: 100%; }
.registration-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 13px 15px; border: 1px solid #d9c785; border-radius: 9px; background: #fbf3d9; color: #554112; font-size: 14px; line-height: 1.5; }
.registration-note.is-bad { border-color: #e2bcb9; background: #fff1ef; color: var(--red); }
.join-with-code { margin: 14px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.registration-form { margin-top: 18px; }
.access-reminder { padding: 12px 14px; border-left: 3px solid var(--gold); background: #faf5e7; font-size: 14px; line-height: 1.5; }
.payment-section { display: grid; gap: 12px; padding: 16px; }
.payment-section p { margin: 0; font-size: 14px; }
.upi-qr { display: block; width: min(240px, 100%); height: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.registration-done { padding: 54px 30px; text-align: center; }
.registration-done p { max-width: 460px; margin: 0 auto 22px; color: #4f4a40; line-height: 1.6; }

/* Organiser */
.no-access { max-width: 640px; margin: 40px auto; }
.no-access h2 { font-family: var(--serif); font-size: 28px; }
.organiser-mode .main-tabs { display: none; }
.event-form .event-form-fields { display: flex; flex-direction: column; gap: 12px; }
.schedule-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
.schedule-fields label { margin: 0; }
.upi-preview { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.upi-preview img { width: 90px; height: 90px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.challenge-formats { display: grid; gap: 10px; padding: 14px; }
.challenge-formats label { margin: 0; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.count-pill { padding: 4px 10px; border-radius: 999px; background: var(--gold-light); color: #5c4514; font-size: 12px; font-weight: 800; }
.team-status { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.team-status.is-pending { background: #fbf0d0; color: #7a5a12; }
.team-status.is-good { background: #e3f1e7; color: #276343; }
.team-status.is-bad { background: #f8e4e1; color: #9b3229; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.compact-toggle { padding: 4px 9px 4px 4px; border-color: var(--line); background: #f6f2e8; color: var(--ink); }
.compact-toggle .toggle-switch { background: #b9b2a3; }
.team-management .data-table, .leaderboard-management .data-table { min-width: 760px; }
.leaderboard-management { margin-top: 20px; }
.leaderboard-management .table-scroll { overflow-x: auto; }
.lb-input { width: 88px; padding: 8px 9px; }
.leaderboard-table tr[data-dirty] { background: #fbf3d9; }
.add-team { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbf8f0; }
.add-team summary { cursor: pointer; font-weight: 750; }
.add-team form { margin-top: 14px; }
.team-tools { align-items: center; justify-content: space-between; }
.team-tools .checkbox-row { margin: 0; }
.admin-live h4 { margin: 18px 0 8px; font-family: var(--serif); font-size: 18px; }
.table-scroll { overflow-x: auto; }

@media (max-width: 560px) {
  .header-right { gap: 10px; }
  .connection-status { display: none; }
  .event-dialog { width: 100%; max-width: 100%; max-height: 100%; height: 100%; margin: 0; border-radius: 0; }
  .event-dialog-content { padding: 22px 18px 28px; }
  .event-dialog-image { height: 190px; }
  .event-facts-list { grid-template-columns: 1fr; }
  .schedule-fields { grid-template-columns: 1fr; }
}
.event-facts .status-chip { display: inline-flex; min-width: 0; gap: 6px; }
.event-facts .status-dot { display: block; min-width: 0; }
#eventsView.event-detail-open > .section-heading { display: none; }
.create-event-dialog { width: min(640px, calc(100% - 28px)); }
.schedule-fields { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schedule-fields input, .two-fields input, .two-fields select { min-width: 0; }
@media (max-width: 560px) { .schedule-fields { grid-template-columns: 1fr; } }
.event-form-message:empty { display: none; }
.event-form-message { padding: 11px 13px; border: 1px solid #e2bcb9; border-radius: 8px; background: #fff1ef; font-weight: 600; }
.schedule-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- Oct 6: cover images, updates, team page, comms ---------- */
/* The cover sits only in the top band of the tile, like the placeholder. */
.event-card .event-image { position: relative; flex: 0 0 155px; height: 155px; overflow: hidden; }
.event-card .event-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.event-card .event-image:has(img)::after { display: none; }
@media (max-width: 560px) { .event-card .event-image { flex-basis: 145px; height: 145px; } }

.cover-preview { display: grid; gap: 10px; margin-top: 10px; }
.cover-frames { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.cover-frames figure { margin: 0; }
.cover-frames figcaption { margin-bottom: 6px; color: #8f6a1d; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cover-frame { position: relative; overflow: hidden; border-radius: 8px; background: #2a261e; cursor: grab; touch-action: none; user-select: none; box-shadow: inset 0 0 0 1px #00000014; }
.cover-frame:active { cursor: grabbing; }
.cover-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cover-frame-tile { aspect-ratio: 360 / 155; border-radius: 7px; }
.cover-frame-banner { aspect-ratio: 760 / 240; }

.updates-list { display: grid; gap: 14px; }
.update-card { padding: 18px 20px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; background: var(--panel); }
.update-card h3 { margin: 6px 0 6px; font-family: var(--serif); font-size: 20px; }
.update-body { color: #4f4a40; line-height: 1.65; white-space: pre-wrap; }
.update-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.update-kind { color: #8f6a1d; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.update-rules { border-left-color: #a43931; }
.update-rules .update-kind { color: #9b3229; }
.update-instructions { border-left-color: #3b7757; }
.update-instructions .update-kind { color: #276343; }
.update-news { border-left-color: #4b6aa8; }
.update-news .update-kind { color: #3a5590; }

.team-name { margin: 0 0 14px; font-family: var(--serif); font-size: 28px; }
.player-list { display: grid; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.player-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf7; }
.player-name { font-weight: 650; }
.captain-badge { padding: 3px 9px; border-radius: 999px; background: var(--gold-light); color: #5c4514; font-size: 11px; font-weight: 800; white-space: nowrap; }
.team-rank { padding-top: 16px; border-top: 1px solid var(--line); }
.team-rank p { margin: 4px 0 0; font-size: 15px; }
.team-rank strong { font-family: var(--serif); font-size: 24px; }

.hunt-progress { margin-bottom: 22px; }
.hunt-progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: #5f5b53; font-size: 13px; font-weight: 700; }
.hunt-progress .team-progress-track { height: 10px; }

.team-comms { margin-top: 20px; }
.comms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.comms-grid textarea { font-family: inherit; line-height: 1.5; }
.comms-grid code { padding: 1px 4px; border-radius: 4px; background: #f3efe5; font-size: 11px; }
.updates-admin-list { display: grid; gap: 10px; margin-top: 6px; }
.updates-admin-list .update-card { padding: 12px 14px; }
.updates-admin-list .update-card h3 { font-size: 17px; }
.lb-input:disabled { background: #f3efe5; color: var(--muted); }
@media (max-width: 800px) { .comms-grid { grid-template-columns: 1fr; } .cover-frames { grid-template-columns: 1fr; } }

/* Oct 6: organiser sections stacked and collapsible */
.organizer-stack { display: grid; gap: 20px; }
.collapsible { position: relative; overflow: hidden; }
.collapsible::before { position: absolute; top: 0; left: 28px; width: 42px; height: 3px; background: #c59a39; content: ""; }
.collapsible > summary, .sub-collapsible > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; list-style: none; user-select: none;
}
.collapsible > summary::-webkit-details-marker, .sub-collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::after, .sub-collapsible > summary::after {
  flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid #8a6a22; border-bottom: 2px solid #8a6a22;
  transform: rotate(45deg); transition: transform .15s ease; content: "";
}
.collapsible:not([open]) > summary::after, .sub-collapsible:not([open]) > summary::after { transform: rotate(-45deg); }
.collapsible > summary h3 { margin: 0; font-size: 24px; }
.collapsible > summary:focus-visible, .sub-collapsible > summary:focus-visible { outline: 2px solid #c59a39; outline-offset: 4px; border-radius: 4px; }
.collapsible[open] > summary { margin-bottom: 16px; }
.collapsible > .form-stack { gap: 14px; }
.comms-stack { display: grid; gap: 14px; }
.comms-stack textarea { font-family: inherit; line-height: 1.5; }
.comms-stack code { padding: 1px 4px; border-radius: 4px; background: #f3efe5; font-size: 11px; }
.sub-collapsible { padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fbf8f0; }
.sub-collapsible > summary h4 { margin: 0; color: #755819; font-size: 17px; }
.sub-collapsible[open] > summary { margin-bottom: 12px; }

/* Oct 6 (b): tile image sits inside a bezel instead of bleeding to the edges */
.event-card .event-image { margin: 10px 10px 0; border-radius: 7px; }

/* Collapsible panels whose summary holds a panel heading */
.collapsible > summary > .panel-heading { flex: 1; min-width: 0; }
.collapsible > summary .panel-heading h3 { margin: 0; }
.collapsible > .form-stack { display: grid; }
.admin-live-panel .admin-live { margin-top: 0; }

/* Organiser read-only Live view */
#organiserTabs { margin-top: 18px; }
.live-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.live-stats span { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbf8f0; }
.live-stats small { color: #8a7a55; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.live-stats strong { font-family: var(--serif); font-size: 22px; }
#liveBoardContent .leaderboard-list { display: grid; gap: 10px; }
#liveBoardContent .leaderboard-team-foot { font-size: 11px; }
#liveBoardContent h4 { margin: 20px 0 8px; font-family: var(--serif); font-size: 18px; }
.live-feed { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.live-feed li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.live-feed li span { color: var(--muted); font-size: 11px; min-width: 110px; }
@media (max-width: 560px) { .live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Oct 6 (c): player tabs without repeated headings; My Team as three tiles */
.team-tiles { display: grid; gap: 14px; }
.team-tile { padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 6px 18px #33270c0d; }
.team-tile-name { text-align: center; }
.team-tile-name .team-name { margin: 0; }
.team-tile .player-list { margin: 0; }
.team-tile-rank { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.team-tile-label { display: block; color: #8a6a22; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.team-tile-rank p { margin: 4px 0 0; }
.rank-badge { flex: none; min-width: 74px; padding: 12px 16px; border: 1px solid #e3cf9a; border-radius: 10px; background: #f6ecd2; color: #3a2d0f; font-family: var(--serif); font-size: 26px; font-weight: 700; text-align: center; }
.hunt-topline { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.hunt-topline:has(> .hidden) { display: none; }
.event-detail:has(.event-countdown.hidden) { grid-template-columns: 1fr; }
.event-countdown.countdown-done .countdown-kicker, .event-countdown.countdown-done #eventCountdown { display: none; }

/* Oct 6 (d): Event details / Event scheduler tiles, scheduler switches, lifecycle */
.form-tile { display: grid; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fbf8f0; }
.form-tile + .form-tile { margin-top: 16px; }
.form-tile > h4 { margin: 0; color: #755819; font-family: var(--serif); font-size: 18px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf7; cursor: pointer; }
.switch-row > span:first-child { display: grid; gap: 3px; }
.switch-row strong { color: var(--ink); font-size: 14px; }
.switch-row small { color: var(--muted); font-size: 12px; font-weight: 450; }
.switch-row input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); }
.switch-row .toggle-switch { background: #b9b2a3; }
.switch-row input:checked + .toggle-switch { background: #5b9b66; }
.switch-row input:checked + .toggle-switch::after { transform: translateX(15px); }
.switch-row input:focus-visible + .toggle-switch { outline: 3px solid #dfbd61; outline-offset: 3px; }
.switch-row:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.scheduler-auto { border-color: #e3cf9a; background: #f6ecd2; }
.scheduler-controls { display: grid; gap: 10px; }
.token-rules { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fbf8f0; }
.token-rules .button { justify-self: start; }
.lifecycle-tile { display: grid; gap: 12px; border-color: #e2c3b8; }
.lifecycle-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.lifecycle-row p { margin: 0; max-width: 60ch; }
.button-danger { border: 1px solid #a8452f; background: #a8452f; color: #fff; }
.button-danger:hover:not(:disabled) { background: #8f3824; }
.button-danger:disabled { opacity: .45; cursor: not-allowed; }
.confirm-dialog { max-width: 440px; }
.confirm-dialog #confirmWord { text-transform: lowercase; }

/* Oct 6 (e): lifecycle sections and controls */
.organiser-sections { display: grid; gap: 30px; }
.event-section { display: grid; gap: 8px; }
.event-section > p { margin: 0 0 6px; }
.event-section-heading { display: flex; align-items: center; gap: 10px; }
.event-section-heading h3 { margin: 0; font-family: var(--serif); font-size: 22px; }
.event-card.is-archived { filter: grayscale(.9); opacity: .72; }
.event-card.is-archived:hover { opacity: .9; }
.deleted-section { padding-top: 18px; border-top: 1px dashed var(--line); }
.deleted-row { padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fbf8f0; }
.deleted-row summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; cursor: pointer; }
.deleted-body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.deleted-body p { flex: 1 1 220px; margin: 0; }
.lifecycle-actions { display: grid; gap: 10px; }
.lifecycle-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf7; }
.lifecycle-action > div { display: grid; gap: 3px; flex: 1 1 260px; }
.lifecycle-action strong { font-size: 14px; }
.lifecycle-action small { color: var(--muted); font-size: 12px; }
#organizerView.read-only .collapsible:not(.lifecycle-tile) { opacity: .85; }
#infoBody p { margin: 0 0 8px; }

/* Oct 6 (f): organiser home: hero, welcome bar, Crafter Control Panel */
.crafter-hero { position: relative; display: flex; align-items: center; gap: clamp(18px, 4vw, 36px); overflow: hidden; margin-bottom: 14px; padding: clamp(22px, 4vw, 36px) clamp(20px, 5vw, 44px); border: 1px solid #55451f; border-radius: 14px; background: radial-gradient(circle at 85% 20%, #bd985433, transparent 40%), linear-gradient(140deg, #171612, #2b261a 70%, #3d3320); color: #f7f1e3; }
.crafter-hero img { flex: none; width: clamp(84px, 13vw, 132px); height: auto; filter: drop-shadow(0 8px 22px #00000066); }
.crafter-hero h1 { margin: 0 0 10px; color: #e5bf5d; font-family: var(--serif); font-size: clamp(30px, 5.5vw, 54px); letter-spacing: .14em; line-height: 1.05; }
.crafter-hero p { max-width: 640px; margin: 0; color: #d9d2c1; font-size: clamp(14px, 1.6vw, 16px); line-height: 1.6; }
.crafter-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 18px; padding: 10px 12px 10px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.crafter-welcome > p { margin: 0; font-size: 15px; }
.crafter-welcome strong { font-family: var(--serif); font-size: 18px; }
.crafter-welcome .account-tools { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.control-panel { display: grid; gap: 14px; padding: clamp(16px, 3vw, 26px); border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 10px 28px #33270c0f; }
.control-panel-title { margin: 0 0 4px; font-family: var(--serif); font-size: clamp(24px, 3.4vw, 32px); }
.panel-section { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbf8f0; }
.panel-section > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.panel-section > summary::-webkit-details-marker { display: none; }
.panel-section > summary::after { width: 9px; height: 9px; margin-left: auto; border-right: 2px solid #8a6a22; border-bottom: 2px solid #8a6a22; transform: rotate(45deg); transition: transform .15s; content: ""; }
.panel-section:not([open]) > summary::after { transform: rotate(-45deg); }
.panel-section-title { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.panel-section > p { margin: 8px 0 12px; }
.panel-section .event-grid { margin-top: 4px; }
.panel-empty { margin: 0; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.panel-section .deleted-row + .deleted-row { margin-top: 8px; }
.panel-section.deleted-section { padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .crafter-hero { flex-direction: column; text-align: center; } .crafter-hero p { margin: 0 auto; } }

/* ================================================================
   Brand layer (Oct 6): match www.urbansphinx.com: Cormorant Garamond
   headings, Inter body, onyx / gold / parchment, near-square corners.
   ================================================================ */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; color: var(--charcoal); }
h1 { font-weight: 500; }
.eyebrow { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.1rem; letter-spacing: 0; color: var(--muted-gold); text-transform: lowercase; }
.eyebrow::first-letter { text-transform: uppercase; }
a { color: var(--muted-gold); }

/* Buttons: the website's flat gold and outline buttons */
.button { border-radius: 2px; font-family: var(--sans); font-weight: 500; letter-spacing: .01em; }
.button-primary { background: var(--gold-brand); border-color: var(--gold-brand); color: var(--onyx); box-shadow: none; }
.button-primary:hover:not(:disabled) { background: var(--gold-bright); border-color: var(--gold-bright); }
.button-quiet { background: transparent; border: 1px solid var(--charcoal); color: var(--charcoal); }
.button-quiet:hover:not(:disabled) { background: rgba(42, 39, 35, .06); }

/* Corners: every tile rounded (12px), form fields 8px */
.panel, .event-card, .create-hunt-card, .collapsible, .sub-collapsible, .form-tile, .switch-row, .lifecycle-action,
.token-rules, .team-tile, .rank-badge, .update-card, .leaderboard-team, .event-detail, .event-countdown, .crafter-hero,
.crafter-welcome, .control-panel, .panel-section, .deleted-row, .live-stats span, .join-hero, .player-list li, .tabs,
.tab, .cover-frame, .panel-empty, .registration-note, .winner-banner, dialog, .qv-tile, .quickview, .section-banner, .category-tile, .craft-home, .alert-board, .stop-tile, .network-strip, .integrity-box, .chip-box { border-radius: 12px !important; }
input, textarea, select, .phone-entry { border-radius: 8px !important; }
.event-card .event-image, .event-card .event-image img { border-radius: 8px; }

/* ---------- Header: the website's sticky ribbon ---------- */
.site-header { display: block; position: sticky; top: 0; z-index: 50; height: auto; padding: 0; background: rgba(11, 11, 10, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid var(--line-on-dark); }
.header-wrap { display: flex; align-items: center; gap: 28px; width: 100%; max-width: 1180px; height: 76px; margin: 0 auto; padding: 0 24px; }
.site-header .brand { gap: 12px; margin-right: auto; color: var(--parchment); }
.site-header .brand img { width: 46px; height: 46px; border-radius: 50%; }
.brand-name { font-family: var(--serif); font-size: 1.3rem; letter-spacing: .03em; color: var(--parchment); }
.brand-tag { margin-left: 4px; padding: 2px 8px; border: 1px solid var(--line-on-dark); color: var(--gold-bright); font-size: 11px; letter-spacing: .08em; }
.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav a { position: relative; padding: 4px 0; color: var(--parchment); font-size: .95rem; text-decoration: none; }
.main-nav a:hover, .main-nav a.active { color: var(--gold-bright); }
.main-nav a.active::after { position: absolute; right: 0; bottom: -4px; left: 0; height: 1px; background: var(--gold-brand); content: ""; }
.header-right { gap: 14px; }
.connection-status { display: none; font-size: 12px; }
.connection-status.reconnecting { display: block; color: #f0a39a; }
.button-header { min-height: 34px; padding: 6px 16px; border: 1px solid var(--gold-brand); border-radius: 2px; background: transparent; color: var(--parchment); font-size: .9rem; }
.button-header:hover { background: rgba(201, 162, 39, .12); }
.nav-toggle { display: none; padding: 0 4px; border: 0; background: none; color: var(--parchment); font-size: 1.6rem; }
@media (max-width: 820px) {
  .header-wrap { gap: 14px; }
  .main-nav { position: fixed; top: 76px; right: 0; left: 0; flex-direction: column; align-items: stretch; gap: 0; max-height: 0; overflow: hidden; background: var(--onyx); border-bottom: 1px solid var(--line-on-dark); transition: max-height .3s ease; }
  .main-nav.open { max-height: 340px; }
  .main-nav a { padding: 16px 28px; border-bottom: 1px solid var(--line-on-dark); }
  .main-nav a.active::after { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 420px) { .brand-name { font-size: 1.1rem; } .header-wrap { padding: 0 16px; } }

/* ---------- Player events page ---------- */
.join-hero { margin-bottom: 14px; padding: clamp(34px, 6vw, 60px) 24px; border: 1px solid var(--line-on-dark); background: var(--onyx); text-align: center; }
.join-hero h1 { margin: 0; color: var(--parchment); font-size: clamp(2.3rem, 5.5vw, 3.8rem); font-weight: 500; line-height: 1.1; }
#appPanel:has(#eventsView.event-detail-open) .join-hero { display: none; }
.player-account-bar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.player-account-bar:has(> .hidden) { display: none; }

/* ---------- Dark tiles use the website's onyx and gold ---------- */
.event-detail, .crafter-hero { background: var(--onyx); border-color: var(--line-on-dark); }
.crafter-hero h1 { color: var(--gold-bright); font-weight: 600; }
.event-detail h2 { color: var(--parchment); }
.event-image { background: linear-gradient(140deg, var(--onyx), #241f14 75%, #3b3220); }

/* Event tiles: parchment plaques with a gold hover, like the website's tiles */
.event-card { background: var(--parchment); border: 1px solid var(--line); box-shadow: none; }
.event-card:hover { border-color: var(--gold-brand); }
.event-card h3 { color: var(--charcoal); font-weight: 600; }
.tile-category { color: var(--muted-gold); }
.panel { box-shadow: none; }
.control-panel, .panel-section, .form-tile, .token-rules { background: var(--panel); }
.panel-section-title, .control-panel-title { font-weight: 600; }
.count-pill { border-radius: 2px; }

/* Locked "Join with your team code": visible, with a hover note until registration opens */
.text-button.is-locked { color: var(--muted); cursor: not-allowed; text-decoration-style: dotted; }
.has-tooltip { position: relative; }
@media (hover: hover) {
.has-tooltip[data-tip]:hover::after, .has-tooltip[data-tip]:focus-visible::after {
  position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 5; width: max-content; max-width: 260px;
  padding: 8px 11px; border-radius: 3px; background: var(--onyx); color: var(--parchment);
  font-family: var(--sans); font-size: 12px; font-weight: 500; line-height: 1.45; text-align: center; text-decoration: none;
  white-space: normal; transform: translateX(-50%); box-shadow: 0 6px 18px #00000040; content: attr(data-tip);
}
}
.locked-code-note { margin: 6px auto 0; color: var(--muted); font-size: 13px; text-align: center; }
@media (hover: hover) { .locked-code-note { display: none; } }

/* 7 Oct: organiser tabs, paths, event lock, integrity and the Alert Board */
.organiser-tabs { flex-wrap: wrap; }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; }
.quick-view { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.qv-item { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.qv-item small { color: var(--muted-gold); font-size: 10px; letter-spacing: .14em; font-weight: 700; }
.qv-item strong { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.qv-item > span { color: var(--muted); font-size: 12px; }
.qv-alert { color: var(--red); }
@media (max-width: 700px) { .quick-view { grid-template-columns: 1fr; } }
.lock-banner { margin-bottom: 14px; padding: 11px 14px; border: 1px solid #d9c48a; border-radius: 9px; background: #f6ecd2; color: #5e4613; font-size: 13px; }
#organizerView.is-event-locked .lockable { opacity: .55; filter: grayscale(.4); cursor: not-allowed; }
.event-lock-tile { border-color: #d9c48a; }
.bulb { display: inline-block; width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%; box-shadow: inset 0 -2px 3px #0003; }
.bulb-grey { background: #a9a396; }
.bulb-red { background: #c2392f; box-shadow: 0 0 8px #c2392f99, inset 0 -2px 3px #0003; }
.bulb-orange { background: #df8a1f; box-shadow: 0 0 8px #df8a1f99, inset 0 -2px 3px #0003; }
.bulb-green { background: #3d9a57; box-shadow: 0 0 8px #3d9a5799, inset 0 -2px 3px #0003; }
.paths-tile .switch-row { margin: 0; }
.paths-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .paths-switches { grid-template-columns: 1fr; } }
.template-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .template-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.template-option { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf7; cursor: pointer; }
.template-option input { position: absolute; opacity: 0; pointer-events: none; }
.template-option.is-selected { border-color: var(--gold); background: #f6ecd2; box-shadow: inset 0 0 0 1px var(--gold); }
.template-option:has(input:disabled) { cursor: not-allowed; }
.template-option:has(input:disabled):not(.is-selected) { opacity: .5; }
.template-option:has(input:focus-visible) { outline: 3px solid #dfbd61; outline-offset: 2px; }
.template-label { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); }
.template-meta { color: var(--muted); font-size: 12px; }
.path-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.path-counts:empty { display: none; }
.path-count { display: grid; padding: 8px 12px; border-radius: 8px; background: #efe6cf; font-size: 12px; }
.path-count strong { font-size: 13px; }
.path-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #efe6cf; color: #5e4613; font-weight: 700; font-size: 12px; }
.registration-status-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.registration-status-row > label { flex: 0 1 240px; }
.pause-field { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.is-dulled { opacity: .55; cursor: not-allowed; }
button.is-dulled { pointer-events: auto; }
.add-team.is-dulled summary { cursor: not-allowed; }
.alert-controls { display: grid; gap: 14px; margin-bottom: 16px; }
.integrity-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.integrity-row .bulb { width: 20px; height: 20px; }
.auto-live-row { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; align-items: end; }
@media (max-width: 700px) { .auto-live-row { grid-template-columns: 1fr; } }
.alert-board { border-radius: 10px; background: #0b0b0a; color: #ddd6c4; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; }
.alert-board-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #ffffff1a; color: var(--gold-bright); letter-spacing: .12em; font-size: 11px; }
.alert-legend { color: #a59e8c; letter-spacing: 0; }
.alert-legend i { display: inline-block; width: 8px; height: 8px; margin: 0 4px 0 10px; border-radius: 50%; }
.lg-new { background: #ef5a4f; } .lg-ack { background: #f0a43a; } .lg-fixed { background: #5bc27a; }
.alert-log { max-height: 340px; overflow-y: auto; padding: 6px 0; }
.alert-line { display: grid; grid-template-columns: 74px 66px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 4px 12px; }
.alert-line + .alert-line { border-top: 1px solid #ffffff0d; }
.alert-time { color: #8d8676; }
.alert-level { font-weight: 700; }
.state-new { color: #ef5a4f; }
.state-ack { color: #f0a43a; }
.state-fixed { color: #5bc27a; }
.alert-ack { padding: 1px 8px; border: 1px solid currentColor; border-radius: 5px; background: transparent; color: inherit; font: inherit; font-size: 11px; }
.alert-state { color: #8d8676; font-size: 11px; }
.alert-empty { margin: 0; padding: 10px 12px; color: #8d8676; }
@media (max-width: 560px) { .alert-line { grid-template-columns: 60px 1fr; } .alert-msg, .alert-ack, .alert-state { grid-column: 1 / -1; } }
.tile-alerts { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; font-size: 12px; font-weight: 600; }
.tile-alerts .is-error { color: var(--red); }
.tile-alerts .is-warning { color: #b46b12; }
.tile-alerts.is-clear { color: var(--green); }
.live-control { display: grid; gap: 12px; }
.hunt-answer.is-dulled { opacity: .5; }
.access-paused-note { margin: 6px 0 0; color: var(--red); font-size: 13px; }
@media (hover: hover) { .hunt-answer.is-dulled + .access-paused-note { display: none; } }
.challenge-video { position: relative; margin-top: 14px; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; }
.challenge-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trial-image-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.trial-image-preview img { max-width: 180px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.update-hint { border-left-color: #8a5bb0; }
.update-hint .update-kind { color: #6c3f92; }

/* 7 Oct: players per entry and offer price */
.team-size-field { border: 0; padding: 0; margin: 0; }
.team-size-field legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.team-size-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .team-size-options { grid-template-columns: 1fr; } }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: end; }
.price-row .offer-field { grid-column: 1 / 2; }
@media (max-width: 560px) { .price-row { grid-template-columns: 1fr; } }
.price-was { color: var(--muted); font-weight: 500; }
.price-offer { color: var(--red); }
.event-image, .event-image-placeholder { position: relative; }
.offer-ribbon { position: absolute; top: 12px; left: 0; z-index: 2; display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 0 4px 4px 0; background: var(--red); color: #fff; font: 600 13px/1.2 var(--sans); box-shadow: 0 3px 10px #0004; letter-spacing: 0; text-transform: none; }
.offer-ribbon .offer-label { font-size: 10px; letter-spacing: .14em; color: #ffe2c2; }
.offer-ribbon s { opacity: .75; font-weight: 500; }
.offer-ribbon strong { font-size: 15px; }

/* 7 Oct (late): Craft Board header, home tiles, welcome pop-up, event tiles */
body.organiser-mode .header-wrap { position: relative; max-width: 1280px; }
body.organiser-mode .site-header .brand { margin-right: 0; }
body.organiser-mode .brand-name { letter-spacing: .12em; font-weight: 600; }
.header-title { position: absolute; left: 50%; transform: translateX(-50%); color: var(--gold-bright); font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: .22em; white-space: nowrap; pointer-events: none; }
body.organiser-mode .header-right { margin-left: auto; }
body.organiser-mode #accountTools { flex-direction: column; align-items: flex-end; gap: 4px; padding: 0; border: 0; background: none; box-shadow: none; }
body.organiser-mode #accountTools #userLabel { color: var(--parchment); font-weight: 500; font-size: 12px; }
body.organiser-mode #accountTools .button { min-height: 26px; padding: 3px 12px; border: 1px solid var(--gold-brand); background: transparent; color: var(--parchment); font-size: 12px; }
body.organiser-mode #accountTools .button:hover { background: rgba(201, 162, 39, .12); }
@media (max-width: 700px) {
  .header-title { font-size: 1rem; letter-spacing: .14em; }
  body.organiser-mode .brand-name { display: none; }
  body.organiser-mode #accountTools #userLabel { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.category-tile { position: relative; display: grid; align-content: start; gap: 8px; min-height: 170px; padding: 22px 20px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--ink); text-align: left; box-shadow: 0 8px 22px #33270c0d; transition: transform .15s, box-shadow .15s, border-color .15s; }
.category-tile:hover, .category-tile:focus-visible { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 12px 26px #33270c1f; }
.category-title { padding-right: 44px; font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.15; }
.category-note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.category-badge { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 9px; border-radius: 16px; background: var(--onyx); color: var(--gold-bright); font-weight: 700; font-size: 14px; }
.category-deleted { background: #f3eee3; }
.category-tile .tile-alerts { margin-top: 4px; }
.craft-section { display: grid; gap: 12px; }
.craft-section .section-heading h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--serif); }
.tile-alerts .is-pending, .tile-alerts.is-pending { color: var(--muted-gold); }
.tile-alerts .is-clear { color: var(--green); }
.welcome-dialog { width: min(440px, calc(100% - 32px)); padding: 44px 28px 40px; border: 1px solid var(--line-on-dark); background: var(--onyx); color: var(--parchment); text-align: center; }
.welcome-dialog::backdrop { background: rgba(11, 11, 10, .7); backdrop-filter: blur(2px); }
.welcome-dialog img { display: block; margin: 0 auto 18px; border-radius: 50%; }
.welcome-dialog h2 { margin: 0; color: var(--gold-bright); font-family: var(--serif); font-size: clamp(26px, 5vw, 34px); font-weight: 600; letter-spacing: .04em; }
.welcome-dialog .dialog-close { position: absolute; top: 10px; right: 10px; color: var(--parchment); background: transparent; border-color: var(--line-on-dark); }
.event-card h3, .event-card .tile-summary { text-align: center; }
.tile-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: auto; padding-top: 8px; color: var(--muted); font-size: 13px; }
.tile-venue { display: inline-flex; align-items: flex-start; gap: 5px; min-width: 0; text-align: left; }
.tile-venue .pin-icon { flex: none; margin-top: 2px; color: var(--muted-gold); }
.tile-when { flex: none; text-align: right; white-space: nowrap; }
.event-number { margin-left: 10px; padding: 3px 9px; border: 1px solid var(--line-on-dark); border-radius: 3px; color: var(--gold-bright); font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .1em; vertical-align: middle; }
.craft-section > .back-link { justify-self: start; }

/* 7 Oct (night): Craft Board polish */
.welcome-dialog { border: 2px solid var(--gold-brand); box-shadow: 0 0 0 1px #00000080, 0 18px 50px #00000080; }
body.organiser-mode #accountTools { align-items: center; }
.craft-home { padding: clamp(18px, 3vw, 28px); border: 2px solid var(--gold-brand); border-radius: 3px; background: var(--onyx); box-shadow: 0 12px 30px #0000002e; }
.craft-home-title { margin: 0 0 18px; color: var(--gold-bright); font-family: var(--serif); font-size: clamp(24px, 3.2vw, 32px); font-weight: 600; letter-spacing: .08em; }
.craft-home .category-tile { box-shadow: none; }
.category-tile { place-content: center; justify-items: center; text-align: center; min-height: 150px; }
.category-title { padding: 0 34px; text-align: center; }
.category-note { position: absolute; inset: auto 12px 12px; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none; font-size: 12px; text-align: center; }
@media (hover: hover) { .category-tile:hover .category-note, .category-tile:focus-visible .category-note { opacity: 1; transform: none; } .category-tile:hover .category-title, .category-tile:focus-visible .category-title { transform: translateY(-18px); } }
@media (hover: none) { .category-note { display: none; } }
.category-title { transition: transform .15s; }
.section-banner { display: grid; justify-items: center; gap: 6px; padding: 16px 20px; border: 1px solid var(--gold-brand); border-radius: 3px; background: var(--onyx); color: var(--parchment); text-align: center; }
.section-banner h2 { margin: 0; color: var(--gold-bright); font-family: var(--serif); font-size: clamp(20px, 2.6vw, 26px); font-weight: 600; letter-spacing: .14em; }
.section-banner p { margin: 0; max-width: 60ch; color: #d9d2c1; font-size: 13px; }
.section-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 8px 0 0; }
.section-counts div { display: flex; align-items: baseline; gap: 6px; }
.section-counts dt { color: #bdb49f; font-size: 12px; }
.section-counts dt::after { content: ":"; }
.section-counts dd { margin: 0; color: var(--gold-bright); font-weight: 700; font-size: 15px; }
.tile-alerts.is-passed { color: var(--green); }
.tile-alerts.is-failed { color: var(--red); }
@media (pointer: coarse) { .category-note { display: none; } .category-tile:hover .category-title { transform: none; } }

/* 8 Oct: event tile refresh and category banner */
body.organiser-mode main { padding-top: 16px; }
.section-banner { position: relative; }
.section-banner > .back-link { position: absolute; top: 50%; left: 20px; margin: 0; transform: translateY(-50%); color: var(--gold-bright); }
.section-banner > .back-link:hover { color: var(--parchment); }
@media (max-width: 700px) {
  .section-banner > .back-link { position: static; justify-self: start; transform: none; }
}
.craft-section .event-card { border: 1.5px solid var(--onyx); border-radius: 12px; overflow: hidden; }
.craft-section .event-card .event-image, .craft-section .event-card .event-image img { border-radius: 8px; }
.event-card h3 { margin-bottom: 0; }
.event-card .tile-summary { margin: 0; }
.tile-meta { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 4px; }
.tile-when { display: inline-flex; align-items: flex-start; gap: 5px; text-align: left; white-space: normal; }
.tile-when .pin-icon { flex: none; margin-top: 2px; color: var(--muted-gold); }
.tile-chips { justify-content: space-between; gap: 8px; }
.chip-box { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf7; }
.integrity-box { display: block; margin-top: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf7; font-size: 12px; }
.integrity-box.is-pending { border-color: #e2cf9f; }
.integrity-box.is-passed { border-color: #b9d8c2; }
.integrity-box.is-failed { border-color: #e6b8b2; }

/* 8 Oct: Event Network Check */
.tab-count { background: var(--onyx); color: #fff; }
.tab.active .tab-count { background: var(--onyx); color: #fff; }
.network-tile { display: grid; gap: 14px; }
.network-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf7; }
.network-strip .bulb { width: 20px; height: 20px; }
.check-run + .check-run { border-top: 1px solid #ffffff26; margin-top: 4px; padding-top: 4px; }
.check-run-head { padding: 6px 12px 4px; color: var(--gold-bright); font-size: 11px; letter-spacing: .06em; }
.check-run:not(:first-child) { opacity: .7; }
.alert-line { grid-template-columns: 112px 66px minmax(0, 1fr) auto; }
.alert-line.level-error { color: #ef5a4f; }
.alert-line.level-warning { color: #f0a43a; }
.lg-new { background: #ef5a4f; } .lg-ack { background: #f0a43a; }
@media (max-width: 560px) { .alert-line { grid-template-columns: 1fr auto; } .alert-time { grid-column: 1 / -1; } }
.refusal-dialog { position: fixed; padding: 28px 26px 24px; border: 2px solid var(--red); }
.refusal-dialog::backdrop { background: rgba(11, 11, 10, .55); }
.refusal-dialog h3 { margin: 0 34px 10px 0; color: var(--red); font-family: var(--serif); font-size: 22px; }
.refusal-dialog p { margin: 0; line-height: 1.55; }
.refusal-dialog .dialog-close { position: absolute; top: 10px; right: 10px; }
.live-control .auto-live-row { margin-top: 2px; }
.alert-line { grid-template-columns: 112px 66px minmax(0, 1fr); }
@media (max-width: 560px) { .alert-line { grid-template-columns: 66px 1fr; } }

/* 8 Oct (midday): Quickview, four-colour status, live controls, winner */
.status-chip.is-warn { background: #fbecd6; color: #94570e; }
.status-chip.is-idle { background: #ebe8e1; color: #5f5a50; }
.quickview { display: grid; gap: 12px; }
.qv-tile { padding: 14px clamp(14px, 2.4vw, 22px); border: 2px solid var(--gold-brand); border-radius: 3px; background: var(--onyx); color: var(--parchment); }
.qv-tile h4 { margin: 0 0 6px; color: var(--gold-bright); font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.qv-row { display: grid; grid-template-columns: 18px 190px minmax(0, 1fr) 190px; align-items: center; gap: 10px; min-height: 38px; padding: 7px 0; border-top: 1px solid #ffffff17; font-size: 14px; }
.qv-tile h4 + .qv-row { border-top: 0; }
.qv-key { color: #a59e8c; font-size: 13px; }
.qv-val { color: var(--parchment); }
.qv-meter { display: grid; grid-template-columns: 1fr 42px; align-items: center; gap: 8px; }
.qv-bar { height: 6px; border-radius: 3px; background: #ffffff1f; overflow: hidden; }
.qv-bar span { display: block; height: 100%; background: var(--gold-brand); }
.qv-percent { color: var(--gold-bright); font-weight: 700; font-size: 13px; text-align: right; }
.qv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.qv-steps { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; flex: 1 1 420px; }
.qv-step { display: flex; align-items: center; gap: 7px; color: #a59e8c; font-size: 13px; white-space: nowrap; }
.qv-step.is-current { color: var(--parchment); font-weight: 700; }
.qv-step.is-current .bulb { width: 16px; height: 16px; }
.qv-step-line { flex: 1 1 24px; min-width: 14px; height: 1px; margin: 0 10px; background: var(--line-on-dark); }
.qv-states { display: flex; gap: 22px; }
.qv-state { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; }
.qv-state small { display: block; color: #a59e8c; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.qv-top .qv-state .bulb { width: 16px; height: 16px; }
.quickview .bulb { width: 12px; height: 12px; }
@media (max-width: 700px) {
  .qv-row { grid-template-columns: 18px minmax(0, 1fr); gap: 2px 10px; }
  .qv-key { grid-column: 2; }
  .qv-val { grid-column: 2; }
  .qv-side { grid-column: 2; }
  .qv-side:empty { display: none; }
  .qv-step span { font-size: 12px; }
  .qv-step-line { margin: 0 5px; }
}
.stop-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .stop-controls { grid-template-columns: 1fr; } }
.stop-tile { padding: 14px; }
.end-tile { border-color: #e2c3b8; }
.reset-action { margin-top: 4px; border-color: #e2c3b8; }
.winner-badge { color: #8a6a1d; font-weight: 700; white-space: nowrap; }
.goodie-field.is-dulled input { cursor: not-allowed; }
.goodie-note { display: block; margin-top: 4px; font-size: 11px; font-weight: 450; }
.qv-row > * { min-width: 0; }
.qv-val { overflow-wrap: anywhere; }
.qv-tile { min-width: 0; overflow: hidden; }
@media (max-width: 700px) { .qv-steps { flex-basis: 100%; } .qv-states { flex-wrap: wrap; } }
@media (max-width: 700px) {
  .qv-step { flex-direction: column; gap: 4px; }
  .qv-step span { font-size: 11px; }
  .qv-step-line { min-width: 6px; margin: 0 2px 16px; }
}

/* 8 Oct (evening): event banner redesign */
.banner-v2 .event-detail-copy { display: grid; align-content: center; gap: 8px; }
.banner-v2 .event-detail-copy h2 { margin: 0; }
.banner-v2 .banner-summary { margin: 0 !important; color: #d5d0c4; font-size: 15px; }
.banner-v2 .banner-fact { display: flex; align-items: center; gap: 8px; margin: 0; color: #f4f0e5; font-size: 14px; font-weight: 600; }
.banner-v2 .banner-fact .pin-icon { flex: none; width: 16px; height: 16px; margin: 0; color: var(--gold-bright); }
.banner-v2 .event-countdown { display: grid; justify-items: center; align-content: center; gap: 12px; text-align: center; }
.banner-registration .status-chip { font-size: 12px; padding: 5px 11px; }
.banner-v2 .event-countdown > strong#eventCountdown { margin: 0; }
.banner-live { display: inline-flex; align-items: center; gap: 12px; color: #fff3cb; font: 700 clamp(24px, 3vw, 34px)/1 var(--sans); letter-spacing: .02em; }
.banner-live .bulb { width: clamp(18px, 2.2vw, 24px); height: clamp(18px, 2.2vw, 24px); }
.event-detail.banner-v2:has(.event-countdown.hidden) { grid-template-columns: inherit; }
@media (max-width: 700px) { .banner-v2 .event-countdown { width: 100%; } }
.banner-v2 .event-detail-copy > p { margin: 0 !important; }
.event-number { white-space: nowrap; }
.event-countdown > .banner-live { margin: 0; font: 700 clamp(24px, 3vw, 34px)/1 var(--sans); letter-spacing: .02em; color: #fff3cb; }

/* 8 Oct (evening): player ribbon menu, banner, event tiles */
body:not(.organiser-mode) .player-account-bar { display: none !important; }
body:not(.organiser-mode) main { padding-top: 16px; }
.join-hero { padding: clamp(18px, 3vw, 28px) 24px; }
.join-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: .1em; }
.join-hero p { max-width: 640px; margin: 10px auto 0; color: #d5d0c4; font-size: clamp(13px, 1.5vw, 15px); line-height: 1.6; }
.player-menu { position: relative; }
.person-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--gold-brand); border-radius: 50%; background: transparent; color: var(--parchment); }
.person-button:hover, .person-button[aria-expanded="true"] { background: rgba(201, 162, 39, .14); color: var(--gold-bright); }
.player-menu-list { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; display: grid; min-width: 220px; padding: 8px; border: 1px solid var(--line-on-dark); border-radius: 12px; background: var(--onyx); box-shadow: 0 12px 30px #0006; }
.menu-identity { margin: 4px 8px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-on-dark); color: #cfc7b3; font-size: 12px; overflow-wrap: anywhere; }
.menu-item { padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--parchment); text-align: left; font-size: 14px; }
.menu-item:hover { background: #ffffff14; }
.menu-item.danger { color: #f0a39a; }
.event-card { border: 3px solid var(--onyx) !important; border-radius: 14px !important; overflow: hidden; }
.craft-section .event-card { border-width: 3px; }
.status-strip { justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: var(--onyx); }
.integrity-box { border: 1px solid var(--onyx) !important; background: var(--onyx) !important; }
.integrity-box.is-pending { color: #c9c2b0; }
.integrity-box.is-passed { color: #7fd398; }
.integrity-box.is-failed { color: #f08a80; }

/* 8 Oct (night): player tabs inside large black tiles */
.dark-tile { padding: clamp(16px, 3vw, 26px); border: 3px solid var(--onyx); border-radius: 14px !important; background: var(--onyx); color: #f4f0e5; }
.dark-tile.empty-state, .dark-tile .empty-state, .dark-tile > p, .dark-tile .muted { color: #cfc7b3; }
.dark-tile .not-started-message { color: var(--gold-bright); }
.dark-tile-title { margin: 0 0 16px; color: #fff3cb; font-family: var(--serif); font-size: clamp(26px, 3vw, 32px); text-align: center; }
.nested-tile { min-width: 0; padding: 16px 18px; border-radius: 12px !important; background: #fff; color: var(--ink); }
.nested-tile .muted { color: var(--muted); }

/* Event Updates: white update cards inside the black tile */
.dark-tile .updates-list .update-card { border: 0; border-left: 4px solid var(--gold); background: #fff; color: var(--ink); }
.dark-tile .updates-list.empty-state, .dark-tile .updates-list > p { margin: 0; color: #cfc7b3; }

/* My Team: name + position on top, teammates below */
.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
.team-mates-tile { grid-column: 1 / -1; }
.team-grid .team-tile-label { margin-bottom: 6px; }
.team-name-tile { display: grid; align-content: center; }
.team-name-tile .team-name { margin: 0; overflow-wrap: anywhere; font-size: clamp(24px, 4vw, 30px); line-height: 1.15; }
.team-position-tile { display: grid; align-content: center; justify-items: center; min-width: 120px; text-align: center; }
.position-figure { display: flex; align-items: baseline; font-family: var(--serif); font-weight: 700; color: var(--onyx); }
.position-rank { font-size: clamp(42px, 7vw, 56px); line-height: 1; }
.position-total { margin-left: 2px; color: var(--muted); font-size: clamp(18px, 3vw, 22px); }
.teammate-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: mate; }
.teammate-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf7; counter-increment: mate; }
.teammate-list .player-name { min-width: 0; overflow-wrap: anywhere; }
.teammate-list .player-name::before { content: counter(mate) ". "; color: var(--muted-gold); font-weight: 800; }
@media (max-width: 520px) { .team-position-tile { min-width: 96px; padding: 14px 12px; } }

/* Hunt: small status tile, then the challenge tile */
.hunt-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: var(--onyx); color: #f4f0e5; }
.hunt-status.hidden { display: none; }
.hunt-status-label { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.hunt-status-label small { display: block; color: #a9a396; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hunt-status .token-pill { border-color: var(--gold-brand); background: transparent; color: var(--gold-bright); }
.hunt-tile .hunt-card { max-width: none; }
.hunt-tile .hunt-progress-label { color: #d5d0c4; }
.hunt-tile .team-progress-track { background: #ffffff26; }
.hunt-tile .hunt-card .trial-counter { color: var(--gold-bright); }
.hunt-tile .hunt-card .trial-counter span { color: #a9a396; }
.hunt-tile .hunt-card h3 { color: #fff3cb; }
.hunt-tile .hunt-card .challenge { color: #fff; }
.hunt-tile .hunt-answer input { border-color: #fff; background: #fff; color: var(--ink); }
.hunt-tile .hunt-answer .button-primary { border-color: #fff; background: #fff; color: var(--onyx); }
.hunt-tile .hunt-answer .button-primary:hover { background: var(--parchment); }
.hunt-tile .hunt-answer.is-dulled { cursor: not-allowed; }
.hunt-tile .hunt-answer.is-dulled > * { pointer-events: none; }
.hunt-tile .has-tooltip[data-tip]:hover::after { background: var(--parchment); color: var(--onyx); }
.hunt-tile .locked-code-note { margin: 8px 0 0; color: #f0a39a; text-align: left; }
.hunt-tile .hint-box { border-left-color: var(--gold-bright); border-radius: 8px; background: #ffffff14; color: #f4f0e5; }
.hunt-tile .button-quiet { border-color: #ffffff59; background: transparent; color: #f4f0e5; }
.hunt-tile .form-message { color: #f0a39a; }
.hunt-tile .form-message.success { color: #7fd398; }
.hunt-tile .winner-banner { color: var(--onyx); }

/* Leaderboard: centred heading and white rows inside the black tile */
.leaderboard-tile .leaderboard-list { padding: 0; border: 0; background: none; }
.leaderboard-tile .leaderboard-team { border: 0; background: #fff; }
.leaderboard-tile .leaderboard-team.own-team { box-shadow: inset 0 0 0 2px var(--gold); background: #fffaf0; }
.leaderboard-tile .leaderboard-list > p { margin: 0; text-align: center; }
.leaderboard-tile .not-started-message { padding: 0 0 4px; }
.leaderboard-tile .leaderboard-team { color: var(--ink); }
.hunt-tile .hunt-answer input, .hunt-tile .hunt-answer .button, .hunt-tile .button-quiet { border-radius: 8px; }
.hunt-tile .hunt-answer.is-dulled { opacity: 1; }
.hunt-tile .hunt-answer.is-dulled > * { opacity: .5; }
.hunt-tile #buyHint { margin-top: 12px; }

/* Hunt top row: status tile (with its note) and a narrow tokens tile */
.hunt-top { display: flex; align-items: stretch; gap: 12px; margin-bottom: 12px; }
.hunt-top:not(:has(> :not(.hidden))) { display: none; }
.hunt-top .hunt-status { flex: 1; min-width: 0; margin: 0; justify-content: flex-start; gap: 14px 18px; flex-wrap: wrap; }
.hunt-status-label { flex: none; }
.hunt-status-note { flex: 1 1 260px; min-width: 0; margin: 0; color: #c9c2b0; font-size: 13px; line-height: 1.45; }
.hunt-tokens { display: grid; flex: none; place-content: center; justify-items: center; min-width: 84px; padding: 8px 14px; border-radius: 12px; background: var(--onyx); text-align: center; }
.hunt-tokens.hidden { display: none; }
.hunt-tokens small { color: #a9a396; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hunt-tokens strong { color: var(--gold-bright); font-size: 22px; line-height: 1.1; }
.hunt-tile.hidden { display: none; }
@media (max-width: 520px) { .hunt-status-note { flex-basis: 100%; } .hunt-tokens { min-width: 72px; padding: 8px 10px; } }
.hunt-tile #buyHint:disabled { opacity: .45; cursor: not-allowed; }

/* Team changes: player actions in My Team, organiser lock and players dialog */
.teammate-list li { flex-wrap: wrap; }
.teammate-side { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 12px; }
.teammate-side .text-button { font-size: 12px; font-weight: 700; }
.teammate-side .locked-code-note { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; text-align: right; }
.team-lock-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.lb-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.team-lock-row { max-width: 460px; margin: 0; }
.team-players-dialog { width: min(520px, calc(100vw - 32px)); }
.team-players-list { display: grid; gap: 8px; margin: 12px 0 16px; padding: 0; list-style: none; }
.team-players-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; }
.team-players-list .row-actions { display: inline-flex; gap: 12px; }

/* ⓘ menu on teammate rows */
.mate-menu { position: relative; display: inline-flex; }
.mate-info { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1.5px solid var(--muted-gold); border-radius: 50%; background: #fff; color: var(--muted-gold); font: italic 700 12px/1 Georgia, serif; cursor: pointer; }
.mate-info:hover, .mate-info[aria-expanded="true"] { border-color: var(--onyx); background: var(--onyx); color: var(--gold-bright); }
.mate-list { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; display: grid; min-width: 200px; padding: 6px; border-radius: 10px; background: var(--onyx); box-shadow: 0 10px 26px #0005; }
.mate-list.hidden { display: none; }
.mate-item { padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--parchment); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.mate-item:hover:not(:disabled) { background: #ffffff17; }
.mate-item.danger { color: #f0a39a; }
.mate-item:disabled { opacity: .45; cursor: not-allowed; }
.mate-note { margin: 2px 10px 6px; color: #c9c2b0; font-size: 12px; line-height: 1.4; }
.teammate-list li { flex-wrap: nowrap; }
.team-mates-tile { overflow: visible; }

/* Craft Board: sphinx emblem menu, Settings box, reject pop-up, Registration Management */
#accountTools.organiser-hidden { display: none !important; }
.emblem-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.emblem-button img { width: 40px; height: 40px; border-radius: 50%; transition: box-shadow .15s ease; }
.emblem-button:hover img, .emblem-button[aria-expanded="true"] img { box-shadow: 0 0 0 2px #ffffffb3; }
.settings-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 26px 28px; overflow: auto; }
.settings-dialog h2 { margin: 0 0 18px; font-family: var(--serif); }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; }
.settings-tabs { display: grid; align-content: start; gap: 6px; }
.settings-tab { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; color: var(--ink); font-weight: 700; text-align: left; cursor: pointer; }
.settings-tab.active { border-color: var(--onyx); background: var(--onyx); color: var(--gold-bright); }
.settings-pane h3 { margin: 0 0 12px; font-family: var(--serif); }
.settings-pane h4 { margin: 14px 0 0; }
.settings-pane .checkbox-row span { display: grid; gap: 2px; }
@media (max-width: 700px) { .settings-layout { grid-template-columns: 1fr; } .settings-tabs { grid-auto-flow: column; overflow-x: auto; } }
.reject-dialog { width: min(460px, calc(100vw - 32px)); }
.registration-controls { display: grid; gap: 14px; }
.auto-email-row span { display: grid; gap: 2px; }
#registrationView.is-event-locked .lockable { opacity: .55; }
/* Eight organiser tabs on one line: share the width evenly; scroll sideways on small screens */
#organiserTabs { flex-wrap: nowrap; }
#organiserTabs .tab { flex: 1 1 auto; padding: 10px 8px; font-size: 12px; text-align: center; }

/* Two-level organiser tabs: 4 main tabs; the active one flows down into its black sub-tab band */
.org-tabs { margin: 18px 0 14px; }
.org-tabs.hidden { display: none; }
.org-main { display: grid; grid-template-columns: repeat(var(--tab-count, 4), 1fr); gap: 4px; padding: 4px; border: 1px solid #e3dccd; border-radius: 12px; background: #eae6dc; }
.org-tab { position: relative; padding: 7px 10px; border: 0; border-radius: 9px !important; background: transparent; color: #6f6656; font-size: 12.5px; font-weight: 800; text-align: center; cursor: pointer; }
.org-tab:hover { color: var(--ink); }
.org-tab.active { background: var(--onyx); color: var(--gold-bright); }
.org-tabs.has-subs .org-tab.active { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.org-tabs.has-subs .org-tab.active::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 13px; background: var(--onyx); }
.org-tabs.has-subs .org-tab.active::before { content: ""; position: absolute; z-index: 1; top: calc(100% + 3px); left: -10px; right: -10px; height: 10px;
  background: radial-gradient(circle at 0 0, transparent 9.5px, var(--onyx) 10px) left / 10px 10px no-repeat,
              radial-gradient(circle at 100% 0, transparent 9.5px, var(--onyx) 10px) right / 10px 10px no-repeat; }
.org-tab .tab-count, .org-sub .tab-count { margin-left: 6px; }
.org-subs { min-height: 38px; margin-top: 8px; }
.org-sub-row { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--onyx); transform-origin: top center; }
.org-sub-row.hidden { display: none; }
.org-sub-row.dropping { animation: org-drop .26s ease-out; }
@keyframes org-drop { from { clip-path: inset(0 0 100% 0 round 12px); opacity: .4; } to { clip-path: inset(0 0 0 0 round 12px); opacity: 1; } }
.org-sub { padding: 6px 8px; border: 0; border-radius: 8px !important; background: transparent; color: #d8d1c0; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.org-sub:hover { color: #fff; }
.org-sub.active { color: var(--gold-bright); }
.panel-title { margin: 0 0 16px; font-family: var(--serif); font-size: 24px; }
#trialConfigView.is-event-locked .lockable, #registrationView.is-event-locked .lockable { opacity: .55; filter: grayscale(.4); cursor: not-allowed; }
@media (max-width: 700px) {
  .org-main { grid-template-columns: repeat(2, 1fr); }
  .org-sub-row { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .org-sub { white-space: normal; }
  .org-tabs.has-subs .org-tab.active::before, .org-tabs.has-subs .org-tab.active::after { display: none; }
  .org-tabs.has-subs .org-tab.active { border-radius: 9px !important; }
}

/* "Updated 7:14 PM ↻" on organiser pages that don't refresh by themselves */
.updated-stamp { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.updated-stamp.hidden { display: none; }
.updated-stamp.in-gap { min-height: 38px; margin: 0; }
.refresh-now { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 50% !important; background: #fffdf7; color: var(--ink); font-size: 14px; line-height: 1; cursor: pointer; }
.refresh-now:hover { border-color: var(--onyx); background: var(--onyx); color: var(--gold-bright); }

/* Event configuration: one black tile with white sub-tiles */
.config-panel { padding: 18px !important; border: 0 !important; background: var(--onyx) !important; }
#createEventForm .config-grid, #editEventForm .config-grid { padding: 0; }
#createEventForm { background: var(--onyx); padding: 16px; border-radius: 14px; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cfg-tile { min-width: 0; padding: 14px 16px; border-radius: 12px !important; background: #fff; color: var(--ink); }
.cfg-full { grid-column: 1 / -1; }
.cfg-tile h4 { margin: 0 0 10px; color: #6b5418; font-family: var(--serif); font-size: 16px; }
.cfg-tile h4 .field-note { font-family: var(--sans); font-weight: 500; }
.cfg-tile > input, .cfg-tile > select, .cfg-tile > textarea { width: 100%; }
.cfg-tile .two-fields { margin-top: 8px; }
.venue-row { display: grid; grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1.5fr); gap: 12px; align-items: center; }
.venue-row .checkbox-row { margin: 0; white-space: nowrap; }
.is-dull { opacity: .45; }
.access-input.is-dull, .offer-field.is-dull input { cursor: not-allowed; }
.size-radios { display: grid; gap: 8px; }
.size-radio { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.size-radio:has(input:checked) { border-color: var(--gold); background: #fbf3dc; }
.size-radio:has(input:disabled) { cursor: not-allowed; opacity: .7; }
.size-radio span { display: grid; gap: 1px; }
.size-radio small { color: var(--muted); font-size: 11px; }
.size-radio.hidden { display: none; }
.price-tile { display: grid; align-content: start; gap: 10px; }
.price-tile label { margin: 0; }
.offer-check { margin: 0; }
.upi-field.is-dull { opacity: .45; }
.upi-field .upi-preview { margin-top: 10px; }
.upi-field .upi-preview img { width: 150px; height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; }
.uploads-tile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.uploads-tile > p { grid-column: 1 / -1; margin: 0; }
.uploads-tile .cover-frame { margin-top: 8px; }
.cover-frame.is-fallback { cursor: default; opacity: .7; }
.banner-fallback { margin: 6px 0 0; }
.config-panel .event-form-message { color: #f0a39a; }
@media (max-width: 700px) {
  .config-grid, .uploads-tile { grid-template-columns: 1fr; }
  .venue-row { grid-template-columns: 1fr; }
}
.size-radio { justify-content: flex-start !important; text-align: left; }
.size-radio input { flex: none; width: auto !important; margin: 0; }
.cfg-tile .checkbox-row input { width: auto; }
#createEventForm > .eyebrow, #createEventForm h2, #createEventForm > p { color: #f4f0e5; }
#createEventForm > .eyebrow { color: var(--gold-bright); }
#createEventForm .dialog-heading h3 { color: #f4f0e5; }
#createEventForm .dialog-heading .eyebrow { color: var(--gold-bright); }
#createEventForm .event-form-message { color: #f0a39a; }

/* Network check: one black tile — Lock event on top, online (left) and offline (right) below */
.network-panel { display: grid; gap: 14px; }
.network-panel .cfg-tile { padding: 6px; }
.network-panel .cfg-tile .switch-row { border: 0; background: transparent; }
.net-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.net-online, .net-offline { display: grid; gap: 14px; min-width: 0; }
.network-panel .alert-board { border: 1px solid #ffffff2e; }
.net-run { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 4px; }
.net-run .bulb { width: 22px; height: 22px; }
.net-run-text { margin: 0; padding: 0 12px 10px; color: #a59e8c; font-size: 11px; }
.net-checklist { padding: 14px 16px !important; }
.net-checklist h4 { margin-bottom: 8px; }
.checklist { display: grid; gap: 4px; max-height: 360px; overflow-y: auto; }
.checklist .checkbox-row { margin: 0; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.checklist .checkbox-row:last-child { border-bottom: 0; }
.checklist .checkbox-row input { width: auto; }
.checklist .checkbox-row.is-dull { opacity: .6; cursor: not-allowed; }
.org-sub .tab-dot { width: 9px; height: 9px; margin-left: 7px; vertical-align: middle; box-shadow: none; }
@media (max-width: 760px) { .net-grid { grid-template-columns: 1fr; } }

/* Network check v2: two equal columns, each one tile with a fixed-height scrolling area and its toggle at the bottom */
.net-grid { align-items: stretch; }
.net-col { display: flex; flex-direction: column; min-width: 0; }
.net-scroll { height: 360px; max-height: none; overflow-y: scroll; flex: none; }
.network-panel .net-checklist { padding: 14px 16px !important; }
.net-checklist .checklist { padding-right: 6px; }
.net-foot { margin-top: auto; border: 0 !important; border-top: 1px solid var(--line) !important; border-radius: 0 !important; background: transparent !important; padding: 12px 2px 4px !important; }
.net-foot-dark { border-top-color: #ffffff1f !important; padding: 12px 12px !important; }
.net-foot-dark strong { color: #f4f0e5 !important; }
.net-foot-dark small { color: #a59e8c !important; }
.alert-log.net-scroll { padding: 6px 0; }
.net-col { height: 560px; }
.net-scroll { height: auto; flex: 1 1 0; min-height: 0; }
.net-foot-dark, .net-foot-dark * { font-family: var(--sans); }
.net-foot-dark strong { font-size: 14px; }
.net-foot-dark small { font-size: 12px; }
.net-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .net-grid { grid-template-columns: 1fr; } }

/* Header title: larger CRAFT BOARD */
.header-title { font-size: 1.8rem; }
@media (max-width: 700px) { .header-title { font-size: 1.25rem; } }

/* Tab lights (Pre-event: network checks; Live: event status) */
.org-tab .tab-dot { width: 9px; height: 9px; margin-left: 8px; vertical-align: middle; box-shadow: none; }

/* ⓘ explanation buttons, top right of a tile */
.info-tip { position: absolute; top: 10px; right: 10px; z-index: 5; }
.info-btn { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid #c9bfa6; border-radius: 50% !important; background: #fff; color: #6b5418; font: italic 700 12px/1 Georgia, serif; cursor: pointer; }
.dark-tile > .info-tip .info-btn { border-color: #ffffff40; background: transparent; color: var(--gold-bright); }
.info-pop { display: none; position: absolute; top: 26px; right: 0; width: min(280px, 70vw); padding: 10px 12px; border-radius: 9px; background: #1d1b17; color: #eee7d5; font-size: 12px; font-weight: 450; line-height: 1.45; text-align: left; box-shadow: 0 10px 28px #0006; }
.info-tip.open .info-pop { display: block; }

/* Live event – Manage: black tiles with white sub-tiles */
.dark-tile { position: relative; display: grid; gap: 14px; padding: 18px !important; border: 0 !important; background: var(--onyx) !important; color: #f4f0e5; }
.dark-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; color: var(--gold-bright); font-family: var(--serif); font-size: 20px; letter-spacing: .14em; text-align: center; }
.dark-title .bulb { width: 16px; height: 16px; }
.dark-tile.collapsible > summary { justify-content: center; position: relative; }
.dark-tile.collapsible > summary::after { position: absolute; right: 40px; border-color: var(--gold-bright); }
.dark-tile.collapsible[open] > summary { margin-bottom: 0; }
.dark-tile.collapsible::before { display: none; }
.dark-tile .cfg-tile { position: relative; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 168px; gap: 14px; }
/* Game timer: a square tile on the right of Start the hunt (14 Oct 2026). */
.game-clock { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; }
.game-clock h4 { margin: 0 0 4px; }
.game-clock-time { margin: 0; font: 600 34px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; font-variant-numeric: tabular-nums; color: var(--ink, #1d1a14); }
.game-clock-of { margin: 0; font-size: 14px; color: var(--muted, #7a7262); font-variant-numeric: tabular-nums; }
.game-clock-note { margin: 6px 0 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #7a7262); }
.game-clock.is-running .game-clock-note { color: #2f7d4f; }
.game-clock.is-over .game-clock-time, .game-clock.is-over .game-clock-note { color: #c0392b; }
.start-sub { display: grid; align-content: start; gap: 12px; padding: 16px !important; text-align: center; }
.start-sub h4 { margin: 0; color: #6b5418; font-family: var(--serif); font-size: 18px; }
.auto-live-line { display: flex; align-items: center; justify-content: center; gap: 14px; }
.auto-live-line input[type="datetime-local"] { width: auto; flex: 0 1 240px; min-width: 0; }
.manual-live-line { display: flex; justify-content: center; align-items: center; min-height: 44px; }
.bare-switch { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.bare-switch input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); }
.bare-switch input:disabled + .toggle-switch { opacity: .5; cursor: not-allowed; }
.slim-sub { padding: 2px 40px 2px 4px !important; }
.slim-sub .team-lock-row { max-width: none; border: 0; background: transparent; }
.slim-sub .info-tip { top: 50%; transform: translateY(-50%); }
.dark-tile .update-form { margin: 0; }
.stop-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stop-tile { position: relative; padding: 14px 40px 14px 14px !important; }
.stop-tile .switch-row { border: 0; background: transparent; padding: 6px 4px; }
.reset-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; padding: 0 4px; }
.reset-row strong { color: var(--ink); font-size: 14px; }
.reset-row .button { padding: 8px 14px; }
@media (max-width: 700px) {
  .start-grid, .stop-controls { grid-template-columns: 1fr; }
  .game-clock { aspect-ratio: auto; padding: 18px !important; }
  .auto-live-line { flex-wrap: wrap; }
}
.bare-switch .toggle-switch { width: 40px; height: 22px; flex-basis: 40px; background: #b9b2a3; }
.bare-switch .toggle-switch::after { width: 16px; height: 16px; }
.bare-switch input:checked + .toggle-switch { background: #5b9b66; }
.bare-switch input:checked + .toggle-switch::after { transform: translateX(18px); }
.bare-switch input:focus-visible + .toggle-switch { outline: 3px solid #dfbd61; outline-offset: 3px; }
.leaderboard-management.dark-tile { margin-top: 0; }
details.dark-tile { display: block; }
details.dark-tile > .cfg-tile { margin-top: 14px; }
.dark-tile > .info-tip { top: 22px; right: 14px; }
@media (max-width: 700px) {
  .dark-title { font-size: 16px; letter-spacing: .1em; padding: 0 34px; }
  .dark-tile.collapsible > summary::after { right: 30px; }
}

/* Lifecycle tiles: count on the top left, ⓘ on the top right */
.category-tile { cursor: pointer; }
.category-tile .category-badge { left: 14px; right: auto; }
.category-tile > .info-tip { top: 14px; right: 14px; }
.category-tile .info-pop { text-align: left; }

/* Settings: one fixed large window; only the right side scrolls */
.settings-dialog { width: min(1100px, calc(100vw - 32px)); height: min(85vh, 780px); max-height: none; overflow: hidden; }
.settings-dialog[open] { display: flex; flex-direction: column; }
.settings-dialog .settings-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
.settings-dialog .settings-tabs { align-self: start; }
.settings-dialog .settings-pane { min-height: 0; overflow-y: auto; padding-right: 6px; }
.settings-dialog::backdrop, .create-event-dialog::backdrop { background: #16140f8c; backdrop-filter: blur(6px) brightness(.85); -webkit-backdrop-filter: blur(6px) brightness(.85); }
@media (max-width: 700px) {
  .settings-dialog { width: 100vw; height: 100dvh; max-width: none; margin: 0; border-radius: 0 !important; }
}

/* Create an event: as wide as the Event configuration tile */
.create-event-dialog { width: min(1232px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); }
.category-tile .info-pop { width: min(220px, 60vw); right: -4px; }

/* Template choice: plain radio buttons */
.template-picker { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.template-option { display: inline-flex; align-items: center; gap: 8px; padding: 6px 2px; border: 0; background: transparent; box-shadow: none !important; }
.template-option.is-selected { background: transparent; border: 0; }
.template-option input { position: static; opacity: 1; pointer-events: auto; width: auto; margin: 0; accent-color: #8a6a22; }
.template-option .template-label { font-weight: 700; }
.template-option .template-meta { color: var(--muted); font-size: 12px; }
.mapped-status { margin: 8px 0 0; }

/* Registration: state chip, Pause and Resume now */
.reg-state { display: flex; align-items: center; gap: 10px; align-self: center; }
.reg-state-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.registration-status-row { align-items: center; }

/* Map teams with Trials: bottom of Team Management */
.map-strip { display: grid; gap: 10px; margin-top: 6px; }

/* Add a team by hand / Add spot team pop-ups */
.team-form-dialog { width: min(620px, calc(100vw - 28px)); padding: 26px 28px; border: 1px solid #d8ceb6; border-radius: 13px; background: var(--panel); color: var(--ink); }
.team-form-dialog::backdrop { background: #16140f8c; backdrop-filter: blur(6px) brightness(.85); -webkit-backdrop-filter: blur(6px) brightness(.85); }
.team-form-dialog h2 { margin: 0 0 6px; font-family: var(--serif); }
.team-form-dialog .dialog-close { float: right; }
.spot-warning { margin: 4px 0 10px; padding: 8px 12px; border-radius: 8px; background: #fdf0d5; color: #7a4d06; font-size: 13px; }
.spot-summary { margin: 4px 0 12px; font-weight: 700; }
.spot-code-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.spot-code { padding: 10px 18px; border: 2px dashed var(--gold); border-radius: 10px; font: 700 26px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; user-select: all; }
.lb-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
details.dark-tile > .lb-actions + .cfg-tile { margin-top: 10px; }
.dialog-error { margin: 6px 0 10px; padding: 8px 12px; border-radius: 8px; background: #fbe4e1; color: #8c2a20; font-size: 13px; }
.template-option .template-label { font-family: var(--sans); font-size: 15px; }

/* Registrations Management: black tile with white sub-tiles */
.registrations-panel { display: grid; gap: 14px; }
.reg-top-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.registrations-panel .cfg-tile { position: relative; }
.registrations-panel .cfg-tile > .info-tip { top: 12px; right: 12px; }
.reg-tile h4, .teams-head h4 { margin: 0 0 10px; color: #6b5418; font-family: var(--serif); font-size: 16px; }
.reg-tile .registration-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.reg-tile .pause-field { display: flex; align-items: center; gap: 8px; }
.reg-tile .pause-field select { width: auto; min-width: 96px; padding: 6px 28px 6px 10px; }
.reg-tile .auto-email-row { margin: 0; }
.teams-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 30px; }
.teams-head h4 { display: flex; align-items: center; gap: 10px; margin: 0; }
.teams-head .count-pill { font-family: var(--sans); }
.teams-tile .table-scroll { margin-top: 10px; }
.teams-table th { white-space: nowrap; }
.teams-table td { vertical-align: top; }
.teams-table .nowrap, .teams-table .email-cell { white-space: nowrap; }
.teams-table .email-cell .team-status { margin-right: 6px; }
.source-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #efe7d2; color: #6b5418; font-size: 10.5px; font-weight: 700; text-transform: lowercase; vertical-align: 1px; }
.warn-text { color: #a0521b; }
.teams-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.teams-empty { margin: 10px 0 0; }
.registrations-panel .map-strip { padding: 4px 40px 4px 6px !important; }
.registrations-panel .map-strip .switch-row { border: 0; background: transparent; gap: 16px; }
.path-counts-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; margin-right: 6px; }
.path-count-chip { padding: 3px 9px; border-radius: 999px; background: #f3ecdb; color: var(--ink); font-size: 12px; }
.registrations-panel .map-strip > .info-tip { top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) {
  .reg-top-grid { grid-template-columns: 1fr; }
  .teams-head { flex-wrap: wrap; }
}
.teams-head .add-team { margin: 0; padding: 0; border: 0; background: transparent; }

/* Info buttons inside table cells sit inline */
.cell-with-info { display: inline-flex; align-items: center; gap: 6px; }
.cell-with-info .info-tip { position: relative; top: auto; right: auto; display: inline-block; }
.cell-with-info .info-btn { width: 17px; height: 17px; font-size: 10.5px; }
.cell-with-info .info-pop { width: max-content; max-width: 260px; }
.plus-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--gold); border-radius: 50% !important; background: #fff; color: #6b5418; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.plus-button:hover { background: #fbf3dc; }
.teams-table td { vertical-align: middle; }

/* Organiser leaderboards: 10 rows tall, sticky header */
.leaderboard-management .table-scroll thead th { position: sticky; top: 0; z-index: 1; background: #fff; }
#liveBoardContent .leaderboard-list { overflow-y: auto; padding-right: 4px; }

/* Player leaderboard: own team shown as 10th row when outside the top 10 */
.leaderboard-team.detached-row { margin-top: 14px; position: relative; }
.leaderboard-team.detached-row::before { content: "⋯"; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); color: var(--muted); letter-spacing: .3em; }

/* Teams table v3: code and transaction columns, email marks, row menu */
.team-code-cell { font: 700 13px/1 ui-monospace, Menlo, monospace; letter-spacing: .08em; user-select: all; }
.missing-text { color: #b23a2c; font-size: 12px; font-weight: 700; }
.mail-ok { color: #2f8a4d; font-size: 17px; font-weight: 800; }
.mail-bad { margin-right: 8px; color: #c0392b; font-size: 16px; font-weight: 800; }
.menu-cell { width: 36px; text-align: right; }
.row-menu { position: relative; display: inline-block; }
.row-menu-btn { width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 8px !important; background: transparent; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.row-menu-btn:hover, .row-menu.open .row-menu-btn { border-color: var(--line); background: #f6f1e4; }
.row-menu-list { display: none; position: fixed; z-index: 30; min-width: 120px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 10px 26px #0002; }
.row-menu.open .row-menu-list { display: grid; }
.row-menu-item { padding: 8px 12px; border: 0; border-radius: 6px !important; background: transparent; color: var(--ink); font-size: 13px; text-align: left; cursor: pointer; }
.row-menu-item:hover { background: #f6f1e4; }
.row-menu-item.danger { color: #b23a2c; font-weight: 700; }
.teams-table .col-na { background: #f4f1ea; color: #c2b9a5; }
.teams-table th.col-na { color: #c2b9a5; }

/* ---------- Craft Board type scale (one size per role) ----------
   Page title: 20px serif, spaced capitals (gold on black tiles, dark gold on white panels)
   Tile title: 17px serif, dark gold
   Label:      11px sans, spaced capitals (Quickview labels, table headers)
   Body:       14px sans · Small: 12px sans */
body.organiser-mode {
  --type-page: 20px;
  --type-tile: 17px;
  --type-body: 14px;
  --type-small: 12px;
}
body.organiser-mode .event-panel .panel-title,
body.organiser-mode .event-panel .panel-heading h3,
body.organiser-mode .event-panel .collapsible:not(.dark-tile) > summary h3 {
  margin: 0 0 16px; color: #6b5418; font-family: var(--serif); font-size: var(--type-page); font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
body.organiser-mode .event-panel .panel-heading h3 { margin: 0; }
body.organiser-mode .event-panel .dark-title { font-size: var(--type-page); }
body.organiser-mode .event-panel .cfg-tile h4,
body.organiser-mode .event-panel .start-sub h4,
body.organiser-mode .event-panel .reg-tile h4,
body.organiser-mode .event-panel .teams-head h4,
body.organiser-mode .event-panel .form-tile > h4,
body.organiser-mode .event-panel .form-stack h4,
body.organiser-mode .event-panel .admin-live h4,
body.organiser-mode #liveBoardContent h4,
body.organiser-mode .event-panel .sub-collapsible > summary h4,
body.organiser-mode .updates-admin-list .update-card h3 {
  color: #6b5418; font-family: var(--serif); font-size: var(--type-tile); font-weight: 600; letter-spacing: 0; text-transform: none;
}
body.organiser-mode .event-panel .switch-row strong,
body.organiser-mode .event-panel .lifecycle-action strong,
body.organiser-mode .event-panel .reset-row strong { font-size: var(--type-body); }
body.organiser-mode .event-panel .switch-row small,
body.organiser-mode .event-panel .lifecycle-action small,
body.organiser-mode .event-panel .muted.small,
body.organiser-mode .event-panel .field-note { font-size: var(--type-small); }
body.organiser-mode .event-panel .data-table th { font-size: 11px; letter-spacing: .12em; }
body.organiser-mode .event-panel .data-table td { font-size: 13.5px; }
body.organiser-mode .event-panel label { font-size: 13px; }
body.organiser-mode .leaderboard-table .lb-name { color: var(--ink); font-size: var(--type-body); }

/* ---------- Craft Board spacing (one rhythm everywhere) ----------
   Between tiles: 14px · Panel padding: 18px · Sub-tile padding: 14px 16px · Inside a tile: 12px */
body.organiser-mode { --space-tile: 14px; --space-panel: 18px; --space-inner: 12px; }
body.organiser-mode .event-panel .organizer-stack,
body.organiser-mode .event-panel .quickview,
body.organiser-mode .event-panel .lifecycle-actions,
body.organiser-mode .event-panel .config-grid,
body.organiser-mode .event-panel .reg-top-grid,
body.organiser-mode .event-panel .net-grid,
body.organiser-mode .event-panel .start-grid,
body.organiser-mode .event-panel .stop-controls,
body.organiser-mode .event-panel .registrations-panel,
body.organiser-mode .event-panel .network-panel,
body.organiser-mode .event-panel .dark-tile { gap: var(--space-tile); }
body.organiser-mode .event-panel > .panel,
body.organiser-mode .event-panel .organizer-stack > .panel { padding: var(--space-panel) !important; }
body.organiser-mode .event-panel .cfg-tile:not(.slim-sub):not(.map-strip):not(.net-lock) { padding: 14px 16px; }
body.organiser-mode .event-panel .form-stack { gap: var(--space-inner); }
body.organiser-mode .event-panel .lifecycle-action { padding: 12px 16px; }
body.organiser-mode .event-panel .panel-heading { margin-bottom: var(--space-inner); }
body.organiser-mode .event-panel .stop-controls { margin-top: 0; }
body.organiser-mode #updatedStamp { margin-top: var(--space-tile); }

/* Idea 3: remaining pages in the black tile with white sub-tiles */
.trial-panel .trial-stack { gap: var(--space-tile, 14px); }
.trial-panel .cfg-tile.paths-tile { border: 0; }
.trial-panel .planned-trials-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; border: 0; background: #fff; }
.trial-panel .challenge-tile { display: grid; gap: 12px; }
.trial-panel .challenge-tile h4 { margin: 0; }
.updates-panel .update-form { margin: 0; }
.updates-panel .cfg-tile h4 { margin: 0 0 10px; }
.lifecycle-tile .dark-title .count-pill { font-family: var(--sans); font-size: 11px; letter-spacing: .06em; }
.lifecycle-tile .lifecycle-action.cfg-tile { border: 0; background: #fff; }
.trial-panel .lock-banner { margin: 0; }
.dark-tile .cfg-tile, .dark-tile .lifecycle-action { color: var(--ink); }
.dark-tile .cfg-tile .muted, .dark-tile .cfg-tile .muted.small, .dark-tile .lifecycle-action small { color: var(--muted); opacity: 1; }

/* ---------- Craft Board buttons: three styles, one shape ----------
   Primary: gold fill · Secondary: dark outline · Danger: red outline (fills red on hover)
   Accept = primary, Reject/Delete = danger. Height 36px (small 30px), radius 8px. */
body.organiser-mode .button { min-height: 36px; padding: 7px 16px; border-radius: 8px !important; font-size: 13px; font-weight: 600; letter-spacing: .01em; box-shadow: none; transform: none; transition: background .15s, border-color .15s, color .15s; }
body.organiser-mode .button:hover { transform: none; }
body.organiser-mode .button-small { min-height: 30px; padding: 4px 12px; font-size: 12px; }
body.organiser-mode .button-primary,
body.organiser-mode .button-accept { border: 1px solid var(--gold-brand); background: var(--gold-brand); color: var(--onyx); }
body.organiser-mode .button-primary:hover:not(:disabled):not([aria-disabled="true"]),
body.organiser-mode .button-accept:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--gold-bright); background: var(--gold-bright); }
body.organiser-mode .button-quiet { border: 1px solid #2a2723; background: #fff; color: #2a2723; }
body.organiser-mode .button-quiet:hover:not(:disabled):not([aria-disabled="true"]) { background: #f6f1e4; }
body.organiser-mode .button-danger,
body.organiser-mode .button-reject { border: 1px solid #b23a2c; background: #fff; color: #b23a2c; }
body.organiser-mode .button-danger:hover:not(:disabled):not([aria-disabled="true"]),
body.organiser-mode .button-reject:hover:not(:disabled):not([aria-disabled="true"]) { background: #b23a2c; color: #fff; }
body.organiser-mode .button:disabled,
body.organiser-mode .button[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
body.organiser-mode .dark-tile > .button-primary, body.organiser-mode .lb-actions .button-primary { box-shadow: none; }

/* ---------- Numbers that line up (tabular figures) ---------- */
body.organiser-mode .data-table td, body.organiser-mode .data-table input,
body.organiser-mode input[type="number"], body.organiser-mode .count-pill,
body.organiser-mode .path-count-chip, body.organiser-mode .qv-row, body.organiser-mode .qv-percent,
body.organiser-mode .planned-trials-control, body.organiser-mode .live-stats strong,
body.organiser-mode .leaderboard-rank, body.organiser-mode .countdown, body.organiser-mode #updatedStamp,
.leaderboard-rank, .token-pill, .countdown, .rank-number { font-variant-numeric: tabular-nums lining-nums; }
body.organiser-mode .data-table td.nowrap { letter-spacing: .02em; }
body.organiser-mode .leaderboard-table input[type="number"] { text-align: center; }

/* ---------- Empty states: faint sphinx emblem + one line ---------- */
.empty-sphinx { display: grid; justify-items: center; gap: 8px; padding: 26px 16px; text-align: center; }
.empty-sphinx img { width: 44px; height: 44px; filter: brightness(0); opacity: .16; }
.empty-sphinx p { max-width: 360px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dark-tile > .empty-sphinx img, .craft-home .empty-sphinx img { filter: none; opacity: .35; }
.dark-tile > .empty-sphinx p, .craft-home .empty-sphinx p { color: #cfc6b0; }
.empty-sphinx img { width: 52px; height: 52px; filter: grayscale(1); opacity: .22; }
.dark-tile > .empty-sphinx img, .craft-home .empty-sphinx img { filter: none; opacity: .45; }

/* ---------- Skeleton loading ---------- */
@keyframes sk-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton { display: grid; gap: 12px; padding: 14px 4px; }
.skeleton span, .skeleton-tile span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #ece6d8 0, #f7f3ea 40%, #ece6d8 80%); background-size: 800px 100%; animation: sk-shimmer 1.3s linear infinite; }
.dark-tile .skeleton span, .skeleton-tiles .skeleton-tile span { background: linear-gradient(90deg, #26231e 0, #34302a 40%, #26231e 80%); background-size: 800px 100%; }
.skeleton-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.skeleton-tile { display: grid; align-content: end; gap: 10px; min-height: 170px; padding: 18px; border-radius: 12px; background: #151411; }
.skeleton-tile span:first-child { width: 70%; height: 16px; }
.skeleton-tile span:nth-child(2) { width: 90%; }
.skeleton-tile span:nth-child(3) { width: 45%; }
.quickview .skeleton-tiles { grid-template-columns: 1fr; }
.quickview .skeleton-tile { min-height: 110px; }
@media (prefers-reduced-motion: reduce) { .skeleton span, .skeleton-tile span { animation: none; } }

/* ---------- Gentle motion (150–200 ms, no bounce) ---------- */
@keyframes us-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes us-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes us-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.event-panel:not(.hidden) { animation: us-fade-up .18s ease-out; }
.org-sub-row:not(.hidden) { animation: us-fade .16s ease-out; }
dialog[open] { animation: us-pop .18s ease-out; }
dialog[open]::backdrop { animation: us-fade .18s ease-out; }
.info-tip.open .info-pop, .row-menu.open .row-menu-list { animation: us-fade .12s ease-out; }
.player-view:not(.hidden), .tab-panel:not(.hidden) { animation: us-fade-up .18s ease-out; }
.category-tile, .event-card, .cfg-tile.reg-tile, .button, .row-menu-btn, .info-btn, .plus-button { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.event-card:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .event-panel, .org-sub-row, dialog[open], dialog[open]::backdrop, .info-pop, .row-menu-list, .player-view, .tab-panel { animation: none !important; }
  .event-card:hover, .category-tile:hover { transform: none; }
}

/* ---------- Hunt: the challenge as a sealed card ---------- */
.hunt-tile .challenge-card {
  position: relative; margin-top: 46px; padding: 46px 24px 24px; border: 1px solid #c9a227aa; border-radius: 14px !important;
  background:
    radial-gradient(120% 80% at 50% 0%, #2a2318 0%, #17140f 55%, #0f0d0a 100%),
    repeating-linear-gradient(45deg, #ffffff05 0 2px, transparent 2px 6px);
  background-blend-mode: normal;
  box-shadow: 0 18px 40px #0007, inset 0 0 0 6px #0f0d0a, inset 0 0 0 7px #c9a22740;
}
.hunt-tile .challenge-card .trial-seal {
  position: absolute; top: -36px; left: 50%; display: grid; place-content: center; width: 72px; height: 72px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f3d27a, #c9a227 55%, #8a6a17); color: #1a160e; text-align: center;
  box-shadow: 0 6px 16px #0008, inset 0 0 0 3px #ffffff30, inset 0 0 0 5px #8a6a1766;
}
.hunt-tile .challenge-card .trial-seal small { font-size: 9px; font-weight: 800; letter-spacing: .18em; line-height: 1; }
.hunt-tile .challenge-card .trial-seal strong { font-family: var(--serif); font-size: 28px; line-height: 1; }
.hunt-tile .challenge-card .seal-sub { margin: 0 0 6px; color: #a9a396; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-align: center; text-transform: uppercase; }
.hunt-tile .challenge-card h3 { margin: 4px 0 6px; color: var(--gold-bright); font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: .28em; text-align: center; text-transform: uppercase; }
.hunt-tile .challenge-card .card-ornament { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 18px; color: #c9a227; font-size: 12px; }
.hunt-tile .challenge-card .card-ornament span { width: 54px; height: 1px; background: linear-gradient(90deg, transparent, #c9a227aa); }
.hunt-tile .challenge-card .card-ornament span:last-child { background: linear-gradient(90deg, #c9a227aa, transparent); }
.hunt-tile .challenge-card .challenge { margin-bottom: 22px; color: #f6efdc; font-family: var(--serif); font-size: 19px; line-height: 1.6; text-align: center; }
.hunt-tile .challenge-card .hunt-answer .button-primary { border-color: var(--gold-brand); background: var(--gold-brand); color: var(--onyx); }
.hunt-tile .challenge-card .hunt-answer .button-primary:hover { background: var(--gold-bright); }
.hunt-tile .challenge-card #buyHint { display: block; margin: 14px auto 0; border-color: #c9a22766; color: #e8d9ad; background: transparent; }
.hunt-tile .challenge-card .hint-box { text-align: left; }

.hunt-tile .challenge-card #answerFeedback:empty { display: none; }

/* ---------- Hunt: the moment of success ---------- */
.hunt-tile .challenge-card { overflow: visible; }
.hunt-tile .challenge-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 30%, #f3d27a55 45%, #fff3c888 50%, #f3d27a55 55%, transparent 70%) no-repeat;
  background-size: 250% 100%; background-position: 150% 0;
}
.hunt-tile .challenge-card.cleared::after { animation: us-shimmer 1.1s ease-out forwards; }
.hunt-tile .challenge-card.cleared { animation: us-glow 1.4s ease-out; }
.hunt-tile .challenge-card.cleared .trial-seal { animation: us-seal 0.9s cubic-bezier(.3,1.6,.5,1); }
.hunt-tile .challenge-card #answerFeedback.success { color: var(--gold-bright); font-family: var(--serif); font-size: 16px; letter-spacing: .2em; text-align: center; text-transform: uppercase; animation: us-pop .4s ease-out; }
#huntTokens strong { display: inline-block; font-variant-numeric: tabular-nums; transition: color .3s, transform .3s; }
#huntTokens strong.ticking { color: var(--gold-bright); transform: scale(1.18); }
@keyframes us-shimmer { 0% { opacity: 1; background-position: 150% 0; } 100% { opacity: 1; background-position: -60% 0; } }
@keyframes us-glow { 0% { box-shadow: 0 18px 40px #0007, inset 0 0 0 6px #0f0d0a, inset 0 0 0 7px #c9a22740; } 35% { box-shadow: 0 0 46px #c9a22788, inset 0 0 0 6px #0f0d0a, inset 0 0 0 7px #f3d27a; } 100% { box-shadow: 0 18px 40px #0007, inset 0 0 0 6px #0f0d0a, inset 0 0 0 7px #c9a22740; } }
@keyframes us-seal { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.22) rotate(-8deg); box-shadow: 0 0 30px #f3d27a; } 100% { transform: translateX(-50%) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .hunt-tile .challenge-card.cleared, .hunt-tile .challenge-card.cleared::after, .hunt-tile .challenge-card.cleared .trial-seal, #huntTokens strong { animation: none; transition: none; }
}

/* ---------- Player leaderboard: leader spotlight and own-team glow ---------- */
#leaderboardContent .leader-spotlight { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 34px 0 8px; padding: 42px 20px 18px; border: 1px solid #c9a227; border-radius: 12px; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, #2a2318 0%, #17140f 60%, #0f0d0a 100%); box-shadow: inset 0 0 0 5px #0f0d0a, inset 0 0 0 6px #c9a22740; animation: us-fade-up .5s ease-out both; }
#leaderboardContent .leader-seal { position: absolute; top: -28px; left: 50%; display: grid; place-items: center; width: 56px; height: 56px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f8e19a, #c9a227 55%, #8a6a17); color: #1a160e; font-family: var(--serif); font-size: 26px; font-weight: 700; box-shadow: 0 6px 16px #0006, 0 0 0 4px #0f0d0a, 0 0 0 5px #c9a22788; }
#leaderboardContent .leader-caption { color: #c9b27a; font-size: 10px; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; }
#leaderboardContent .leader-name { max-width: 100%; overflow-wrap: anywhere; color: var(--gold-bright); font-family: var(--serif); font-size: 22px; }
#leaderboardContent .leader-trial { color: #e8d9ad; font-size: 11px; font-weight: 750; }
#leaderboardContent .leader-spotlight .team-progress-track { width: 100%; margin-top: 10px; }
#leaderboardContent .podium-you { padding: 2px 8px; border-radius: 999px; background: var(--gold-brand); color: var(--onyx); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
#leaderboardContent .leader-spotlight.own-team { box-shadow: inset 0 0 0 5px #0f0d0a, inset 0 0 0 6px var(--gold-bright), 0 0 24px #f3d27a77; }
#leaderboardContent .leaderboard-team.own-team { border-color: var(--gold-brand); box-shadow: 0 0 0 1px var(--gold-brand), 0 0 18px #c9a22766; animation: us-own-glow 2.4s ease-in-out 2; }
@keyframes us-own-glow { 50% { box-shadow: 0 0 0 1px var(--gold-bright), 0 0 26px #f3d27aaa; } }
@media (prefers-reduced-motion: reduce) { #leaderboardContent .leader-spotlight, #leaderboardContent .leaderboard-team.own-team { animation: none; } }

/* ---------- Event pop-up: slow zoom on the banner ---------- */
.event-dialog-frame { position: relative; overflow: hidden; }
.event-dialog-frame::after { content: ""; position: absolute; inset: auto 0 0; height: 70px; background: linear-gradient(180deg, transparent, #0b0b0a33); pointer-events: none; }
dialog[open] .event-dialog-frame img.event-dialog-image { animation: us-kenburns 16s cubic-bezier(.25,.1,.25,1) forwards; will-change: transform; }
@keyframes us-kenburns { from { transform: scale(1); } to { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { dialog[open] .event-dialog-frame img.event-dialog-image { animation: none; } }

/* ---------- Event banner: split-flap countdown ---------- */
/* Tiles size themselves to the countdown box: 30px wide at most, smaller when the box is narrow. */
.event-countdown { container-type: inline-size; }
#eventCountdown.flip-countdown { --fd: min(30px, calc(100cqi / 11.4)); display: flex; align-items: flex-start; justify-content: center; gap: calc(var(--fd) * .2); max-width: 100%; margin: 0; font: inherit; letter-spacing: 0; }
.flip-countdown .fc-group { display: grid; justify-items: center; gap: calc(var(--fd) * .2); }
.flip-countdown .fc-group small { color: #c9b27a; font-size: clamp(7px, calc(var(--fd) * .3), 9px); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.flip-countdown .fc-digits { display: flex; gap: calc(var(--fd) * .1); }
.flip-countdown .fc-sep { width: calc(var(--fd) * .4); padding-top: calc(var(--fd) * .27); color: #c9a227; font: 700 calc(var(--fd) * .72)/1 var(--sans); text-align: center; }
.flip-countdown .fd { position: relative; width: var(--fd); height: calc(var(--fd) * 1.47); border-radius: calc(var(--fd) * .2); perspective: calc(var(--fd) * 5.3); box-shadow: 0 4px 10px #0007; font: 700 calc(var(--fd) * .93)/calc(var(--fd) * 1.47) var(--sans); font-variant-numeric: tabular-nums; color: #fff3cb; }
.flip-countdown .fd > span { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; backface-visibility: hidden; }
.flip-countdown .fd b { display: block; height: calc(var(--fd) * 1.47); text-align: center; font-weight: 700; }
.flip-countdown .fd-upper, .flip-countdown .fd-flap-top { top: 0; border-radius: calc(var(--fd) * .2) calc(var(--fd) * .2) 0 0; background: linear-gradient(180deg, #2c261b, #1f1a12); border-bottom: 1px solid #0008; }
.flip-countdown .fd-lower, .flip-countdown .fd-flap-bottom { bottom: 0; border-radius: 0 0 calc(var(--fd) * .2) calc(var(--fd) * .2); background: linear-gradient(180deg, #19150f, #110f0b); }
.flip-countdown .fd-lower b, .flip-countdown .fd-flap-bottom b { margin-top: calc(var(--fd) * -.735); }
.flip-countdown .fd-flap-top { transform-origin: 50% 100%; z-index: 2; visibility: hidden; }
.flip-countdown .fd-flap-bottom { transform-origin: 50% 0; z-index: 2; visibility: hidden; transform: rotateX(90deg); }
.flip-countdown .fd.flipping .fd-flap-top { visibility: visible; animation: us-flap-top .3s ease-in forwards; }
.flip-countdown .fd.flipping .fd-flap-bottom { visibility: visible; animation: us-flap-bottom .3s ease-out .3s forwards; }
.flip-countdown .fd::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000a; z-index: 3; }
@keyframes us-flap-top { from { transform: rotateX(0); } to { transform: rotateX(-90deg); } }
@keyframes us-flap-bottom { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .flip-countdown .fd.flipping .fd-flap-top, .flip-countdown .fd.flipping .fd-flap-bottom { animation: none; visibility: hidden; }
}

/* ---------- Brand icon set ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.us-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.14em; flex: none; }
.info-btn, .dialog-close, .row-menu-btn { font-size: 0 !important; }
.info-btn::before, .dialog-close::before, .row-menu-btn::before { content: ""; display: block; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.info-btn { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12.2' cy='6.4' r='1.75'/%3E%3Cpath d='M9.6 10.2h3.9v7.4h1.6v1.6H9.4v-1.6h1.8v-5.8H9.6z'/%3E%3C/svg%3E"); color: #6b5418; }
.info-btn::before { width: 15px; height: 15px; }
.cell-with-info .info-btn::before { width: 13px; height: 13px; }
.dark-tile > .info-tip .info-btn { color: var(--gold-bright); }
.dialog-close { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E"); color: var(--ink); }
.dialog-close::before { width: 18px; height: 18px; }
.welcome-dialog .dialog-close { color: var(--parchment); }
.row-menu-btn { display: inline-grid; place-items: center; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5.5' r='1.9'/%3E%3Ccircle cx='12' cy='12' r='1.9'/%3E%3Ccircle cx='12' cy='18.5' r='1.9'/%3E%3C/svg%3E"); }
.row-menu-btn::before { width: 18px; height: 18px; }
.mail-ok, .mail-bad { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 13px; vertical-align: middle; }
.mail-ok { background: #2f8a4d; color: #fff; }
.mail-bad { border: 1.5px solid #c0392b; color: #c0392b; font-size: 12px; }
.team-status .us-icon { margin-right: 4px; font-size: 12px; }

/* ---------- Loading mark: boot splash and busy buttons ---------- */
.boot-splash { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(80% 60% at 50% 40%, #1d1912, var(--onyx)); transition: opacity .45s ease, visibility .45s; }
.boot-splash.done { opacity: 0; visibility: hidden; }
.us-loader { position: relative; display: grid; place-items: center; width: 108px; height: 108px; }
.us-loader img { width: 64px; height: 64px; animation: us-breathe 2.4s ease-in-out infinite; }
.us-loader svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: us-spin 1.6s linear infinite; }
.us-loader circle { fill: none; stroke-width: 2.5; }
.us-loader .track { stroke: #c9a22726; }
.us-loader .arc { stroke: var(--gold-bright); stroke-linecap: round; stroke-dasharray: 72 217; filter: drop-shadow(0 0 4px #f3d27a99); }
.boot-word { margin: 0; color: #c9b27a; font-family: var(--serif); font-size: 13px; letter-spacing: .42em; padding-left: .42em; }
button[aria-busy="true"] { cursor: progress; opacity: .85; }
button[aria-busy="true"]::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .5em; vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: us-spin .8s linear infinite; }
@keyframes us-spin { to { transform: rotate(360deg); } }
@keyframes us-breathe { 50% { transform: scale(1.05); opacity: .85; } }
@media (prefers-reduced-motion: reduce) {
  .us-loader img, .us-loader svg { animation: none; }
  button[aria-busy="true"]::before { animation-duration: 2.4s; }
}

/* ---------- Gold focus rings (keyboard only) ---------- */
:root { --focus-ring: #a87d12; }
.site-header, .dark-tile, .event-detail, .challenge-card, .boot-splash, .leader-spotlight, .welcome-dialog, .org-sub-row, footer { --focus-ring: #f3d27a; }
:where(a, button, summary, select, [tabindex]:not([tabindex="-1"]), input[type="checkbox"], input[type="radio"], input[type="file"]):focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--focus-ring) 22%, transparent);
}
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
:where(a, button, summary, select, input, textarea, [tabindex]):focus:not(:focus-visible) { outline: none; }
.info-btn:focus-visible, .dialog-close:focus-visible, .row-menu-btn:focus-visible, .plus-button:focus-visible { border-radius: 50%; }
.row-menu-btn:focus-visible { border-radius: 8px !important; }

/* ---------- Consistent hover states (mouse and trackpad only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]),
  body.organiser-mode .button:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]) { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
  .button:hover:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]),
  body.organiser-mode .button:hover:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]) { transform: translateY(-1px); box-shadow: 0 6px 14px #1a140626; }
  .button:active:not(:disabled), body.organiser-mode .button:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
  .data-table tbody tr, .leaderboard-team, .update-card, .menu-item, .row-menu-item { transition: background-color .15s ease, box-shadow .15s ease; }
  .data-table tbody tr:hover { background: #fbf5e4; }
  .dark-tile .data-table tbody tr:hover { background: #fbf5e4; }
  .leaderboard-team:not(.own-team):hover, .update-card:hover { box-shadow: inset 3px 0 0 var(--gold-brand), 0 4px 12px #1a14060f; }
  a:not(.button):not(.brand):not(.event-card):not(.category-tile), .text-button { text-underline-offset: 3px; transition: text-decoration-color .15s ease, color .15s ease; }
  a:not(.button):not(.brand):not(.event-card):not(.category-tile):not(.main-nav a):hover, .text-button:hover:not(:disabled) { text-decoration-line: underline; text-decoration-color: var(--gold-brand); text-decoration-thickness: 2px; }
  .info-btn:hover { border-color: var(--gold-brand); background: #fbf3dc; }
  .dark-tile > .info-tip .info-btn:hover { background: #ffffff14; }
  .dialog-close:hover { border-color: var(--gold-brand); background: #fbf3dc; }
  .welcome-dialog .dialog-close:hover { background: #ffffff14; }
  .toggle-switch, .tab, .org-tab, .org-sub, .info-btn, .row-menu-btn, .dialog-close, .plus-button { cursor: pointer; }
}

/* ---------- Corner radius: three sizes only ---------- */
:root { --r-sm: 8px; --r-md: 12px; --r-lg: 16px; }
:root:root :is(.button, .button-header, input:not([type="checkbox"]):not([type="radio"]), textarea, select, .phone-entry, .tab, .org-sub, .settings-tab,
  .menu-item, .mate-item, .row-menu-item, .row-menu-btn, .global-message, .lock-banner, .event-form-message, .dev-code, .team-code, .issued-code, .panel-empty,
  .template-option, .size-radio, .path-count, .challenge-image, .cover-frame, .cover-frame-tile, .event-image, .event-image img, .hint-box, .integrity-box, .chip-box,
  .info-pop, .dialog-error, .winner-banner, .registration-note, .upi-qr, .upi-preview img, .trial-image-preview img, .event-number, .tile-flag, .team-status,
  .path-badge, .alert-ack, .has-tooltip::after) { border-radius: var(--r-sm) !important; }
:root:root :is(.cfg-tile, .nested-tile, .leaderboard-team, .update-card, .team-tile, .rank-badge, .form-tile, .switch-row, .token-rules, .deleted-row,
  .lifecycle-action, .panel-section, .qv-item, .qv-tile, .live-stats span, .add-team, .sub-collapsible, .player-list li, .teammate-list li, .team-players-list li,
  .network-strip, .alert-board, .stop-tile, .challenge-video, .hunt-status, .hunt-tokens, .status-strip, .org-main, .account-tools, .tabs,
  .planned-trials-control, .event-countdown, .team-progress-banner, .player-menu-list, .mate-list, .row-menu-list, .section-banner, .category-tile, fieldset,
  .leader-spotlight) { border-radius: var(--r-md) !important; }
:root:root :is(.panel, .dark-tile, .control-panel, .event-card, .event-detail, .challenge-card, dialog, .event-dialog, .planned-trials-dialog, .crafter-hero,
  .craft-home, .quickview, #createEventForm) { border-radius: var(--r-lg) !important; }
@media (max-width: 560px) { :root:root .event-dialog { border-radius: 0 !important; } }

/* ---------- Scroll bars: thin, gold handle ---------- */
:root { --scroll-thumb: #c9a22799; --scroll-thumb-hover: #c9a227; --scroll-track: #efe8d6; }
.dark-tile, .alert-board, .welcome-dialog, .event-detail, .player-menu-list, .mate-list { --scroll-thumb: #c9a227aa; --scroll-thumb-hover: #f3d27a; --scroll-track: #ffffff14; }
.dark-tile .cfg-tile, .dark-tile .nested-tile { --scroll-thumb: #c9a22799; --scroll-thumb-hover: #c9a227; --scroll-track: #efe8d6; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { border-radius: 8px; background: var(--scroll-track); }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: var(--scroll-thumb) padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover) padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
html { scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
html::-webkit-scrollbar { width: 10px; }

/* ---------- Event banner: the countdown / status box keeps one size ---------- */
.event-detail.banner-v2 { grid-template-columns: minmax(0, 1fr) 300px; }
.banner-v2 .event-countdown { box-sizing: border-box; width: 300px; height: 180px; min-height: 180px; padding: 14px 16px; align-self: center; justify-self: end; overflow: hidden; }
.banner-v2 .event-countdown > .banner-live { font-size: 30px; }
.banner-v2 .event-countdown > .banner-live .bulb { width: 22px; height: 22px; }
@media (max-width: 800px) {
  .event-detail.banner-v2 { grid-template-columns: minmax(0, 1fr); }
  .banner-v2 .event-countdown { width: 100%; justify-self: stretch; }
}

/* ---------- Trial configuration v2: setup tile and challenge tabs ---------- */
.trial-panel .trial-setup-tile { display: grid; gap: 12px; }
.trial-setup-grid { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 12px; }
.ct-box { position: relative; display: grid; align-content: start; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); background: #fbf8f0; }
.ct-box > h5 { margin: 0; padding-right: 26px; color: #6b5418; font-family: var(--serif); font-size: 15px; font-weight: 600; }
.ct-box > .info-tip { top: 9px; right: 9px; }
.ct-box textarea, .ct-box input:not([type="checkbox"]):not([type="radio"]) { margin: 0; }
.total-box input { max-width: 120px; font-size: 18px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.template-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.template-row .template-picker { gap: 6px 20px; }
.template-lock { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.template-lock input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); }
.template-lock input:checked + .toggle-switch { background: #5b9b66; }
.template-lock input:checked + .toggle-switch::after { transform: translateX(15px); }
.template-lock input:disabled + .toggle-switch { opacity: .5; }
.template-lock input:focus-visible + .toggle-switch { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.trial-setup-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.trial-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.trial-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-sm, 8px); background: #fffdf7; color: var(--ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.trial-tab.active { border-color: var(--onyx); background: var(--onyx); color: var(--gold-bright); }
.trial-tab .status-light { width: 8px; height: 8px; border-radius: 50%; background: #b9b2a2; }
.trial-tab .status-light.is-on { background: #3f9a57; box-shadow: 0 0 6px #3f9a5799; }
.trial-form { display: grid; gap: 12px; }
.ct-row { display: grid; gap: 12px; }
.ct-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ct-answers { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.ct-hint { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); }
.media-preview img { display: block; width: 100%; max-height: 170px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--r-sm, 8px); background: #2a261e; }
.video-preview img { aspect-ratio: 16 / 9; height: auto; max-height: 170px; }
.trial-image-preview { display: grid; gap: 8px; }
.trial-image-preview img { max-width: none; max-height: 170px; object-fit: contain; }
.method-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ct-box .checkbox-row { margin: 0; }
.ct-box.is-dulled { opacity: .55; }
.ct-box.goodie-field.is-dulled { opacity: .55; }
.info-pop .goodie-note:empty { display: none; }
@media (max-width: 900px) {
  .ct-hint { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-answers > .ct-box:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .trial-setup-grid, .ct-two { grid-template-columns: minmax(0, 1fr); }
}

.template-row { flex-wrap: nowrap; }
.template-row .template-picker { flex: 1 1 auto; min-width: 0; }
@media (max-width: 1100px) { .template-row { flex-wrap: wrap; } }
.media-preview { position: relative; display: grid; place-items: center; height: 150px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm, 8px); background: #1d1912; }
.media-preview img { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; object-fit: cover; }
.trial-image-preview img { object-fit: contain; background: #1d1912; }
.media-preview.is-empty { border-style: dashed; background: #f4efe2; }
.media-preview.is-empty img, .media-preview img.is-broken { display: none; }
.media-preview.is-empty::before { content: attr(data-empty); color: #9a9078; font-size: 13px; }
.media-preview .play-mark { position: absolute; width: 46px; height: 46px; border-radius: 50%; background: #0b0b0acc; box-shadow: 0 0 0 2px #f3d27a; }
.media-preview .play-mark::after { content: ""; position: absolute; left: 18px; top: 14px; border-left: 15px solid #f3d27a; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.media-preview.is-empty .play-mark { display: none; }
.trial-image-field:has(.trial-image-preview.is-empty) .image-remove { display: none; }
.template-row .template-picker { gap: 6px 14px; }
.template-row .template-option { padding: 4px 0; }
@media (max-width: 640px) { .ct-hint > .ct-box:first-child { grid-column: 1 / -1; } }

/* ---------- Trial configuration v2.1: tab joined to its sheet; grouped sub-tiles ---------- */
.trial-panel .challenge-tile { --sheet: #f6ecd2; --sheet-edge: #c9a227; }
.trial-tabs { position: relative; z-index: 1; flex-wrap: nowrap; align-items: flex-end; gap: 4px; margin-bottom: -13px; padding: 0 0 0 2px; border-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.trial-tabs::-webkit-scrollbar { display: none; }
.trial-tabs-caption { align-self: center; margin-right: 6px; color: #8a7a52; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
:root:root .trial-tab { flex: none; min-height: 36px; padding: 7px 14px 9px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0 !important; background: #fbf8f0; color: #5f5747; }
:root:root .trial-tab.active { min-height: 44px; padding-bottom: 14px; border-color: var(--sheet-edge); background: var(--sheet); color: var(--onyx); box-shadow: none; }
.trial-tab.active .status-light:not(.is-on) { background: #a39a85; }
:root:root .trial-sheet { position: relative; gap: 14px; padding: 16px; border: 1.5px solid var(--sheet-edge); border-radius: 12px !important; background: var(--sheet); }
.trial-sheet .ct-box { border-color: #e6dcc2; background: #fff; }
.ct-field { position: relative; display: grid; align-content: start; gap: 8px; min-width: 0; }
.ct-field > h5 { margin: 0; padding-right: 26px; color: #6b5418; font-family: var(--serif); font-size: 15px; font-weight: 600; }
.ct-field > .info-tip { top: -2px; right: 0; }
.ct-field.is-dulled { opacity: .55; }
.ct-pair { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.ct-group { gap: 14px 16px; padding: 14px 16px; }
.ct-group > .info-tip { display: none; }
.ct-answers-group { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.ct-stack { display: grid; align-content: start; gap: 14px; }
.ct-method-group { grid-template-columns: minmax(0, 1fr); }
.ct-box.ct-hint { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); }
.ct-hint > .hint-switch { grid-column: 1 / -1; margin: 0; }
.ct-hint.hint-off > .ct-field { display: none; }
.ct-group .ct-field + .ct-field, .ct-group .ct-stack { position: relative; }
.ct-answers-group > .ct-stack, .ct-hint > .ct-field + .ct-field { padding-left: 16px; border-left: 1px solid #efe6cf; }
.ct-method-group > .ct-field + .ct-field { padding-top: 14px; border-top: 1px solid #efe6cf; }
.ct-method-group > .ct-field + .ct-field > .info-tip { top: 12px; }
@media (max-width: 900px) {
  .ct-pair { grid-template-columns: minmax(0, 1fr); }
  .ct-box.ct-hint { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-hint > .ct-field:nth-child(2) { grid-column: 1 / -1; }
  .ct-hint > .ct-field + .ct-field { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .ct-answers-group { grid-template-columns: minmax(0, 1fr); }
  .ct-answers-group > .ct-stack { padding-left: 0; border-left: 0; padding-top: 14px; border-top: 1px solid #efe6cf; }
  .trial-sheet { padding: 12px; }
}
:root:root .trial-tab:not(.active) { margin-bottom: 2px; }

/* ---------- Trial configuration v2.2: centred headings and actions; tabs fill the width ---------- */
.trial-setup-tile .ct-box > h5, .trial-panel .challenge-tile > h4 { padding: 0 26px; text-align: center; }
.trial-setup-tile .total-box { justify-items: center; }
.trial-setup-tile .template-box { justify-items: center; }
.template-row, .template-row { flex-direction: column; flex-wrap: nowrap; justify-content: center; gap: 12px; }
.template-row .template-picker { justify-content: center; }
.trial-setup-actions { justify-content: center; }
.trial-sheet > .admin-actions { justify-content: center; }
:root:root .trial-tab { flex: 1 1 0; justify-content: center; min-width: 64px; }

/* ---------- Path templates drawn as linked stages ---------- */
.template-diagram { display: block; overflow: visible; }
.template-diagram line { stroke: #c9a227; stroke-width: 2; stroke-linecap: round; }
.template-diagram circle { fill: #0b0b0a; stroke: #c9a227; stroke-width: 1.6; transition: fill .15s ease, stroke .15s ease; }
.template-diagram text { fill: #f3d27a; font: 700 12px/1 var(--sans); text-anchor: middle; dominant-baseline: middle; font-variant-numeric: tabular-nums; transition: fill .15s ease; }
.template-option.is-selected .template-diagram circle { fill: #e3bd4a; stroke: #8a6a17; }
.template-option.is-selected .template-diagram text { fill: #0b0b0a; }
.template-option.is-selected .template-diagram line { stroke: #8a6a17; stroke-width: 2.4; }
.template-option:has(input:disabled):not(.is-selected) .template-diagram { opacity: .45; }
.template-row .template-picker { gap: 10px 26px; }
.template-row .template-option { gap: 8px; }

/* ---------- Satchel items: Craft Board ---------- */
.trial-panel .items-tile { position: relative; display: grid; gap: 12px; }
.trial-panel .items-tile > h4 { margin: 0; padding: 0 26px; text-align: center; }
.items-head { display: flex; align-items: center; justify-content: space-between; }
.items-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.items-list > .empty-sphinx { grid-column: 1 / -1; }
.item-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid #e6dcc2; border-radius: var(--r-md, 12px); background: #fbf8f0; }
.item-card-picture { display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--r-sm, 8px); background: #0b0b0a; color: var(--gold-bright); overflow: hidden; }
.item-card-picture img { width: 100%; height: 100%; object-fit: cover; }
.item-glyph { width: 44px; height: 44px; }
.item-card-body { display: grid; gap: 4px; min-width: 0; }
.item-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.item-card-title strong { font-family: var(--serif); font-size: 16px; }
.item-action { padding: 2px 8px; border-radius: 999px !important; background: #0b0b0a; color: var(--gold-bright); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.item-card-facts, .item-card-held, .item-card-place { margin: 0; color: var(--muted); font-size: 12px; }
.item-card-held { display: flex; align-items: center; gap: 6px; }
.item-card-held .info-tip { position: relative; top: auto; right: auto; }
.item-card-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.item-dialog { width: min(620px, calc(100% - 28px)); }
.item-form-top { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.item-picture { display: grid; justify-items: center; gap: 8px; }
.item-picture-preview { display: grid; place-items: center; width: 120px; height: 120px; border-radius: var(--r-md, 12px); background: #0b0b0a; color: var(--gold-bright); overflow: hidden; }
.item-picture-preview img { width: 100%; height: 100%; object-fit: cover; }
.item-picture-preview .item-glyph { width: 64px; height: 64px; }
.item-picture-button { cursor: pointer; }
.item-form-fields { display: grid; gap: 12px; }
@media (max-width: 560px) { .item-form-top { grid-template-columns: minmax(0, 1fr); justify-items: center; } .item-form-fields { width: 100%; } }

/* ---------- Satchel: player Hunt tab ---------- */
.satchel-tile { display: grid; gap: 12px; margin-top: 14px; }
.satchel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.satchel-head h3 { margin: 0; color: var(--gold-bright); font-family: var(--serif); font-size: 17px; letter-spacing: .24em; text-transform: uppercase; }
.satchel-head span { color: #a9a396; font-size: 12px; }
.satchel-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.satchel-slot { display: grid; justify-items: center; gap: 6px; padding: 10px 6px 8px; border: 1px solid #c9a22755; border-radius: var(--r-md, 12px); background: #17140f; color: #f1e8d2; font: 600 12px/1.2 var(--sans); cursor: pointer; }
.satchel-picture { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2a2318, #0b0b0a); color: var(--gold-bright); overflow: hidden; box-shadow: inset 0 0 0 1px #c9a22766; }
.satchel-picture img { width: 100%; height: 100%; object-fit: cover; }
.satchel-picture .item-glyph { width: 34px; height: 34px; }
.satchel-name { text-align: center; overflow-wrap: anywhere; }
.satchel-empty { grid-column: 1 / -1; margin: 0; padding: 12px; border: 1px dashed #c9a22755; border-radius: var(--r-md, 12px); color: #a9a396; text-align: center; }
.satchel-slot.arrive { animation: us-arrive 1s ease-out; }
@keyframes us-arrive { 0% { transform: scale(.4) translateY(-30px); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; box-shadow: 0 0 26px #f3d27a; } 100% { transform: none; } }
@media (hover: hover) and (pointer: fine) { .satchel-slot:hover { border-color: var(--gold-bright); background: #211b12; } }
.inspect-dialog { width: min(420px, calc(100% - 28px)); padding: 28px 22px 24px; border: 1px solid #c9a227aa; background: radial-gradient(120% 80% at 50% 0%, #2a2318, #17140f 60%); color: #f1e8d2; text-align: center; }
.inspect-dialog .dialog-close { position: absolute; top: 10px; right: 10px; background: transparent; border-color: #ffffff30; color: #f1e8d2; }
.inspect-picture { display: grid; place-items: center; width: 120px; height: 120px; margin: 0 auto 12px; border-radius: 50%; background: #0b0b0a; color: var(--gold-bright); overflow: hidden; box-shadow: 0 0 0 2px #c9a227, 0 0 30px #c9a22744; }
.inspect-picture img { width: 100%; height: 100%; object-fit: cover; }
.inspect-picture .item-glyph { width: 70px; height: 70px; }
.inspect-dialog h2 { margin: 0 0 8px; color: var(--gold-bright); font-family: var(--serif); font-size: 22px; letter-spacing: .04em; }
.inspect-text { margin: 0 0 10px; color: #e8dfc8; line-height: 1.6; }
.inspect-engraving { margin: 0; padding: 10px 12px; border: 1px dashed #c9a22788; border-radius: var(--r-sm, 8px); color: var(--gold-bright); font-family: var(--serif); font-style: italic; }
@media (prefers-reduced-motion: reduce) { .satchel-slot.arrive { animation: none; } }
.item-picture-button input[type="file"] { display: none !important; }

/* ---------- Gameplay configuration ---------- */
.gameplay-panel .energy-config { position: relative; display: grid; gap: 12px; }
.gameplay-panel .cfg-tile > h4 { margin: 0; padding: 0 26px; text-align: center; }
.gameplay-panel .ct-box > h5 { padding: 0 26px; text-align: center; }
.energy-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; padding: 0 26px; }
.energy-head h4 { margin: 0; }
.energy-body { display: grid; gap: 12px; }
.gameplay-switch { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.gameplay-switch input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); }
.gameplay-switch input:checked + .toggle-switch { background: #5b9b66; }
.gameplay-switch input:checked + .toggle-switch::after { transform: translateX(15px); }
.gameplay-switch input:focus-visible + .toggle-switch { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.energy-config.is-off .energy-body { opacity: .45; pointer-events: none; }
.unit-input { display: flex; align-items: center; justify-content: center; gap: 8px; }
.unit-input input { max-width: 110px; font-size: 18px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.unit-input span { color: var(--muted, #6f685c); font-weight: 700; }
#energyRate { margin: 0; text-align: center; }
.energy-preview-box { background: #fff; }
.energy-preview-box #energyPreview { padding: 12px 14px; border-radius: var(--r-md, 12px); background: var(--onyx); }

/* ---------- Energy bar (player Hunt and preview) ---------- */
.hunt-energy { margin-bottom: 12px; padding: 12px 16px; }
.hunt-energy.hidden { display: none; }
.energy-meter { display: grid; gap: 7px; }
.energy-meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.energy-meter-head small { color: #a9a396; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.energy-meter-head strong { color: var(--gold-bright); font-size: 18px; font-variant-numeric: tabular-nums; }
.energy-track { position: relative; height: 12px; overflow: hidden; border: 1px solid #c9a22755; border-radius: 999px; background: #1d1b17; }
.energy-fill { position: absolute; inset: 0 auto 0 0; width: var(--level, 100%); border-radius: inherit; background: linear-gradient(90deg, #a07d17, var(--gold-bright)); box-shadow: 0 0 10px #e4c15855; transition: width 1s linear, background .4s; }
.energy-meter.is-low .energy-fill { background: linear-gradient(90deg, #a8571b, #e39a3a); box-shadow: 0 0 10px #e39a3a55; }
.energy-meter.is-low strong { color: #e9a24a; }
.energy-meter.is-critical .energy-fill { background: linear-gradient(90deg, #8f2a22, #d9503f); box-shadow: 0 0 10px #d9503f66; }
.energy-meter.is-critical strong { color: #e0614f; }
.energy-meter.is-paused .energy-meter-head small::after { content: " · paused"; color: #8c867a; letter-spacing: .08em; }
.energy-vignette { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: var(--vignette, 0); background: radial-gradient(ellipse at center, transparent 55%, #000000d9 100%); transition: opacity 2s ease; }
.energy-empty { display: grid; justify-items: center; gap: 10px; padding: 26px 12px; text-align: center; }
.energy-empty-mark { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid #c9a22755; border-radius: 50%; color: #8c7a4a; }
.energy-empty-mark svg { width: 30px; height: 30px; }
.energy-empty p { max-width: 34ch; margin: 0; color: #e8dfc8; font-size: 16px; line-height: 1.55; }
.satchel-tile.is-dulled { opacity: .45; pointer-events: none; filter: grayscale(.6); }
@media (prefers-reduced-motion: reduce) { .energy-fill, .energy-vignette { transition: none; } }

/* Live event - Manage: energy column */
.lb-energy { white-space: nowrap; }
/* Desk boost sits under the bar (14 Oct 2026). */
.lb-energy-line { display: flex; align-items: center; }
.lb-energy .lb-boost { display: block; margin-top: 5px; padding: 3px 10px; font-size: 12px; }
.lb-winner { white-space: nowrap; text-align: right; }
.challenge-prize-count { margin: 8px 0; color: var(--gold, #d7b46a); font-weight: 600; }
.lb-energy-bar { display: inline-block; width: 56px; height: 8px; margin-right: 6px; overflow: hidden; border-radius: 999px; background: #e8e1cf; vertical-align: middle; }
.lb-energy-bar i { display: block; height: 100%; background: #c9a227; }
.lb-energy-bar.is-low i { background: #e39a3a; }
.lb-energy-bar.is-critical i { background: #d9503f; }
.lb-energy-value { display: inline-block; min-width: 36px; font-variant-numeric: tabular-nums; }
.energy-give { position: relative; display: inline-block; margin-left: 4px; }
.energy-give > summary { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: #fffdf7; font-weight: 800; cursor: pointer; list-style: none; }
.energy-give > summary::-webkit-details-marker { display: none; }
.energy-give[open] > summary { border-color: var(--onyx); background: var(--onyx); color: var(--gold-bright); }
.energy-give-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 5; display: flex; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm, 8px); background: #fff; box-shadow: 0 6px 18px #0002; }

/* ---------- Special powers ---------- */
.item-action.is-attack { background: #5c1d17; color: #ffd9cf; }
.item-action.is-defence { background: #1f3d2a; color: #d4f0dc; }
.power-type-row { display: flex; gap: 18px; }
#powerForm fieldset { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm, 8px); }
#powerForm fieldset.hidden, #powerForm label.hidden { display: none; }
#powerForm legend { padding: 0 6px; font-weight: 700; }
.power-effect-note { margin: 6px 0 0; }
.inspect-power { margin: 0 0 10px; color: var(--gold-bright); font-weight: 700; }
.inspect-actions { display: flex; justify-content: center; margin-top: 14px; }
.target-list { display: grid; gap: 8px; margin-top: 12px; }
.target-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 14px; border: 1px solid #c9a22766; border-radius: var(--r-sm, 8px); background: #1d1b17; color: #f4ecd8; font-size: 15px; font-weight: 700; text-align: left; cursor: pointer; }
.target-row:hover:not(:disabled) { border-color: var(--gold-bright); background: #2a261e; }
.target-row:disabled { opacity: .45; cursor: not-allowed; }
.target-row small { color: #a9a396; font-size: 12px; font-weight: 600; }
.stun-card { display: grid; justify-items: center; gap: 8px; padding: 24px 12px; text-align: center; }
.stun-card .item-glyph { width: 64px; height: 64px; color: #e4c158; animation: stun-spin 6s linear infinite; }
.stun-title { margin: 0; color: #f4ecd8; font-family: var(--serif); font-size: 20px; }
.stun-clock { margin: 0; color: var(--gold-bright); font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
@keyframes stun-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .stun-card .item-glyph { animation: none; } }
.hunt-shields { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.hunt-shields.hidden { display: none; }
.shield-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border: 1px solid #5b9b66; border-radius: 999px; background: #10251a; color: #d4f0dc; font-size: 13px; font-variant-numeric: tabular-nums; }
.shield-chip .item-glyph { width: 20px; height: 20px; color: #8fd19e; }
.target-list { max-height: min(60vh, 520px); overflow-y: auto; padding-right: 2px; }

/* ---------- Picture library (Settings) and picker ---------- */
.library-pane { display: grid; align-content: start; gap: 12px; min-height: 0; }
.library-head h3 { margin: 0 0 4px; }
.library-head p { margin: 0; }
.library-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; min-height: 0; }
.library-folders { display: grid; align-content: start; gap: 4px; }
.library-folder { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 6px 10px; border: 1px solid transparent; border-radius: var(--r-sm, 8px); background: transparent; color: var(--ink); font-weight: 700; text-align: left; cursor: pointer; }
.library-folder small { color: #8a8170; font-weight: 600; }
.library-folder:hover { background: #f6f0df; }
.library-folder.active { border-color: var(--onyx); background: var(--onyx); color: var(--gold-bright); }
.library-folder.active small { color: #c9c2b0; }
.new-folder { display: flex; gap: 6px; margin-top: 8px; }
.new-folder input { min-width: 0; flex: 1; margin: 0; padding: 6px 10px; }
.library-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.library-toolbar strong { font-family: var(--serif); font-size: 18px; }
.library-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.library-actions label.button { cursor: pointer; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.library-tile { display: grid; justify-items: center; gap: 5px; padding: 8px; border: 1px solid #e6dcc2; border-radius: var(--r-md, 12px); background: #fbf8f0; color: var(--ink); cursor: pointer; }
.library-tile:hover { border-color: var(--gold); box-shadow: 0 4px 14px #0001; }
.library-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm, 8px); background: #0b0b0a; }
.library-thumb img { width: 100%; height: 100%; object-fit: contain; }
.library-name { max-width: 100%; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.library-tile small { color: #8a8170; font-size: 11px; }
.library-edit-picture { display: grid; place-items: center; width: 160px; height: 160px; margin: 0 auto; overflow: hidden; border-radius: var(--r-md, 12px); background: #0b0b0a; }
.library-edit-picture img { width: 100%; height: 100%; object-fit: contain; }
.library-edit-actions { flex-wrap: wrap; }
.library-edit-actions label.button { cursor: pointer; }
.library-picker { width: min(720px, calc(100vw - 32px)); }
.picker-folders { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.picker-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fffdf7; font-weight: 700; cursor: pointer; }
.picker-chip.active { border-color: var(--onyx); background: var(--onyx); color: var(--gold-bright); }
.picker-grid { max-height: 60vh; overflow-y: auto; }
.picture-buttons { display: flex; justify-content: center; gap: 6px; }
.picture-buttons .button { padding-inline: 12px; }
.item-card-picture img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) { .library-layout { grid-template-columns: 1fr; } .library-folders { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; } }

/* ---------- Power ranges, presets, matching defences ---------- */
.power-range-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e6dcc2; }
.power-range-row small { display: block; color: #8a8170; font-size: 11px; font-weight: 500; }
.blocks-grid { display: grid; grid-template-columns: 70px 80px 80px; align-items: center; justify-items: center; gap: 8px 6px; }
.blocks-grid strong:nth-child(3n+1) { justify-self: start; }
.blocks-grid input { width: 18px; height: 18px; margin: 0; accent-color: #7a5c12; }
.powers-actions { display: inline-flex; align-items: center; gap: 10px; }
.target-row em { color: var(--gold-bright); font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.power-preset.hidden { display: none; }
.picture-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 120px; }
.picture-buttons .button { min-height: 30px; padding: 4px 6px; font-size: 12px; }
.picture-buttons .button { min-width: 0; width: 100%; }

/* ---------- Story tab ---------- */
.story-tile { display: grid; gap: 4px; padding: 22px 20px; }
.story-waiting { margin: 0; color: #c9c2b0; text-align: center; font-family: var(--serif); font-size: 18px; }
.story-chapter { display: grid; gap: 12px; }
.story-chapter-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; color: var(--gold-bright); font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.story-new { padding: 2px 8px; border-radius: 999px; background: var(--gold-bright); color: #0b0b0a; font-family: system-ui, sans-serif; font-size: 10px; letter-spacing: .1em; }
.story-image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #c9a22755; border-radius: var(--r-md, 12px); }
.story-text { color: #efe6cf; font-family: var(--serif); font-size: 17px; line-height: 1.7; white-space: pre-wrap; }
.story-chapter.is-new .story-text { color: #fff8e2; }
.story-divider { margin: 18px 0; }
.story-field-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.story-image-box { display: grid; gap: 6px; align-content: start; }
.story-image-preview img { max-height: 140px; object-fit: cover; }
.story-bookends { position: relative; display: grid; gap: 12px; }
.story-bookends > h4 { margin: 0; padding: 0 26px; text-align: center; }
.story-bookends .ct-box > h5 { text-align: center; }
.story-image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 700px) { .story-field-grid { grid-template-columns: minmax(0, 1fr); } }
.item-preset.hidden { display: none; }
.satchel-slot { position: relative; }
.satchel-badge { position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 999px; background: var(--gold-bright); color: #0b0b0a; font-size: 10px; font-weight: 800; letter-spacing: .04em; animation: badge-pulse 1.6s ease-in-out infinite; }
@keyframes badge-pulse { 50% { box-shadow: 0 0 0 4px #e4c15844; } }
@media (prefers-reduced-motion: reduce) { .satchel-badge { animation: none; } }

/* ---------- Focus mode: slim strip and bottom bar once the hunt has started ---------- */
.live-strip { display: none; }
.more-tab, .more-menu { display: none; }
body.focus-mode .live-strip, body.pre-hunt .live-strip { position: sticky; top: var(--header-h, 0px); z-index: 20; display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 10px; padding: 6px 12px; border: 1px solid #c9a22755; border-radius: 12px; background: #0b0b0a; color: #f4ecd8; cursor: pointer; }
body.focus-mode #backToEvents, body.pre-hunt #backToEvents { display: none; }
body.focus-mode:not(.show-banner) #eventDetailContent, body.pre-hunt:not(.show-banner) #eventDetailContent { display: none; }
body.pre-hunt .hunt-top { display: none; }
.strip-back { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #1d1b17; color: var(--gold-bright); font-size: 16px; cursor: pointer; }
.strip-name { flex: 1; min-width: 0; overflow: hidden; font-family: var(--serif); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.strip-status { display: inline-flex; flex: none; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.strip-tokens { display: inline-grid; flex: none; justify-items: center; padding-left: 10px; border-left: 1px solid #c9a22744; color: var(--gold-bright); font-weight: 800; line-height: 1; }
.strip-tokens small { color: #a9a396; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.strip-chevron { flex: none; color: #a9a396; font-size: 12px; }
body.focus-mode .hunt-top { display: none; }
body.focus-mode > footer, body.focus-mode footer { display: none; }
body.focus-mode #eventTabs { position: fixed; right: 0; bottom: 0; left: 0; z-index: 45; display: flex; gap: 0; margin: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); overflow: visible; border: 0; border-top: 1px solid #c9a22755; border-radius: 16px 16px 0 0; background: #0b0b0a; box-shadow: 0 -6px 24px #0004; }
body.focus-mode #eventTabs > .tab { flex: 1 1 0; justify-content: center; min-height: 48px; margin: 0; border: 0; border-radius: 12px; background: transparent; color: #c9c2b0; font-size: 13px; font-weight: 700; }
body.focus-mode #eventTabs > .tab.active { background: #1d1b17; color: var(--gold-bright); }
body.focus-mode #eventTabs > [data-event-view="teamView"], body.focus-mode #eventTabs > [data-event-view="updatesView"] { display: none; }
body.focus-mode #eventTabs > #storyTab { order: 1; }
body.focus-mode #eventTabs > [data-event-view="huntView"] { order: 2; flex-grow: 1.4; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
body.focus-mode #eventTabs > [data-event-view="leaderboardView"] { order: 3; }
body.focus-mode #eventTabs > .more-tab { position: relative; display: inline-flex; order: 4; }
body.focus-mode #eventTabs > #storyTab.hidden { display: none; }
.more-dot { position: absolute; top: 8px; right: 18%; width: 8px; height: 8px; border-radius: 50%; background: #e0614f; }
.more-dot.hidden { display: none; }
body.focus-mode .more-menu { position: absolute; right: 10px; bottom: calc(100% + 8px); display: grid; gap: 4px; min-width: 190px; padding: 6px; border: 1px solid #c9a22755; border-radius: 12px; background: #141310; box-shadow: 0 10px 30px #0006; }
body.focus-mode .more-menu.hidden { display: none; }
.more-item { position: relative; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 8px; background: transparent; color: #f4ecd8; font-weight: 700; text-align: left; cursor: pointer; }
.more-item:hover, .more-item.active { background: #1d1b17; color: var(--gold-bright); }
.more-item .more-dot { top: 50%; right: 12px; transform: translateY(-50%); }
body.focus-mode #eventDetail { padding-bottom: 150px; }

/* ---------- Pockets: Backpack, Abilities, Supplies ---------- */
.hunt-pockets { display: grid; grid-template-columns: repeat(var(--pockets, 3), minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.hunt-pockets.hidden { display: none; }
body.focus-mode .hunt-pockets { position: fixed; right: 8px; bottom: calc(68px + env(safe-area-inset-bottom)); left: 8px; z-index: 44; margin: 0; }
.hunt-pockets.is-dulled { opacity: .5; filter: grayscale(.6); }
.pocket-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 6px 8px; border: 1px solid #c9a22766; border-radius: 12px; background: #141310ee; color: #f4ecd8; font-size: 13px; font-weight: 700; cursor: pointer; backdrop-filter: blur(6px); }
.pocket-button.is-empty { color: #8c867a; }
.pocket-icon { display: grid; width: 20px; height: 20px; color: var(--gold-bright); }
.pocket-icon svg { width: 100%; height: 100%; }
.pocket-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #2a261e; color: var(--gold-bright); font-size: 12px; font-variant-numeric: tabular-nums; }
.pocket-dot { position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 3px #e4c15844; }
.pocket-button.arrive { animation: badge-pulse 1.2s ease-in-out 3; }
.pocket-dialog { width: min(560px, calc(100vw - 24px)); }
.pocket-dialog h2 { margin: 0 0 4px; color: var(--gold-bright); font-family: var(--serif); letter-spacing: .12em; text-transform: uppercase; }
.pocket-dialog .satchel-slots { margin-top: 12px; }
.supply-badge { top: auto; bottom: 6px; animation: none; }
.item-action.is-supply { background: #3a2c10; color: #f6dfa0; }
.supply-only.hidden, .item-only-field.hidden { display: none; }
@media (max-width: 380px) { .pocket-name { display: none; } }
body.focus-mode .site-header { position: relative; }
body.focus-mode .live-strip, body.pre-hunt .live-strip { top: 6px; }
.supply-badge { top: 6px; bottom: auto; }
.pocket-icon svg { display: block; width: 20px; height: 20px; }
body.focus-mode #eventTabs > .tab { display: inline-flex; align-items: center; }
body.focus-mode #eventTabs > .tab.hidden { display: none; }
body.focus-mode #eventTabs > .tab[data-event-view="teamView"], body.focus-mode #eventTabs > .tab[data-event-view="updatesView"], body.focus-mode #eventTabs > .tab.hidden { display: none; }

/* ---------- Live event - Manage: slim leaderboard + team dialog ---------- */
.slim-board td { vertical-align: middle; }
.slim-board .lb-rank { width: 32px; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.lb-name-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lb-name-button:hover .lb-name { text-decoration: underline; text-underline-offset: 3px; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.lb-chips:empty { display: none; }
.lb-chip { padding: 1px 8px; border-radius: 999px; background: #eee8da; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.lb-chip.is-bad { background: #f6dcd8; color: var(--red); }
.lb-chip.is-warn { background: #fbe7c8; color: #8a5a12; }
.lb-chip.is-good { background: #dcebdf; color: var(--green); }
.lb-chip.is-gold { background: var(--gold-light); color: #5c4514; }
.slim-board .lb-progress { min-width: 140px; }
.slim-board .lb-progress .team-progress-track { display: block; height: 8px; }
.slim-board .lb-progress small { color: var(--muted); }
.slim-board .button.is-dulled { opacity: .55; }
.slim-board .menu-cell { width: 40px; text-align: right; }

.team-sheet h4 { margin: 18px 0 8px; font-family: var(--serif); font-size: 17px; }
.team-sheet .team-pane > h4:first-child { margin-top: 0; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sheet-card { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; }
.sheet-card > small { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sheet-energy { width: 100%; margin: 2px 0 0; }
.sheet-switch, .sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; margin-bottom: 10px; }
.sheet-switch small { display: block; color: var(--muted); }
.sheet-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sheet-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; }
.sheet-list li > span:first-child { flex: 1 1 auto; min-width: 0; }
.sheet-list li:has(.sheet-thumb) { justify-content: flex-start; }
.sheet-thumb { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 8px; background: var(--onyx); color: var(--gold-bright); }
.sheet-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sheet-thumb .item-glyph { width: 26px; height: 26px; }
.sheet-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.sheet-edit label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.sheet-edit small { flex-basis: 100%; }
.sheet-table tr.is-current td { background: #fbf3d9; }
@media (max-width: 700px) {
  .settings-dialog .settings-layout { grid-template-rows: auto minmax(0, 1fr); align-content: start; }
  /* The slim leaderboard as cards: name and ⋮, then progress, then energy and the desk boost. */
  .slim-board thead { display: none; }
  .leaderboard-management .data-table.slim-board { min-width: 0; }
  .slim-board, .slim-board tbody { display: block; width: 100%; }
  .slim-board tr { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px 8px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
  .slim-board td { display: block; padding: 0; border: 0; }
  .slim-board .lb-rank { grid-row: 1; grid-column: 1; }
  .slim-board td:nth-child(2) { grid-row: 1; grid-column: 2; }
  .slim-board .menu-cell { grid-row: 1; grid-column: 3; }
  .slim-board .lb-progress { grid-row: 2; grid-column: 2 / 4; min-width: 0; }
  .slim-board .lb-energy { grid-row: 3; grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; }
  .slim-board .lb-energy .lb-boost { margin-top: 0; }
  .slim-board .lb-winner { grid-row: 4; grid-column: 2 / 4; text-align: left; }
  .slim-board .lb-winner:empty { display: none; }
}

/* Event configuration: category, tile description and duration share one row */
.cfg-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.duration-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.duration-fields .unit-input { display: flex; align-items: center; gap: 6px; }
.duration-fields input { width: 100%; min-width: 0; }
@media (max-width: 700px) { .cfg-row3 { grid-template-columns: 1fr; } }

/* ---------- Gameplay configuration (redesign) ---------- */
.energy-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.energy-field { display: grid; gap: 6px; margin: 0; font-size: 13px; font-weight: 700; }
.energy-field > span:first-child { color: #6b5418; }
.energy-field .unit-input { display: flex; align-items: center; gap: 6px; }
.energy-field .unit-input input { width: 100%; min-width: 0; }
.energy-field input[readonly] { background: #f3efe5; color: var(--muted); }
.energy-empty input { width: 100%; }
.energy-rate { margin: -4px 0 0; }
.follow-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.follow-switch input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); }
.follow-switch input:checked + .toggle-switch { background: #5b9b66; }
.follow-switch input:checked + .toggle-switch::after { transform: translateX(15px); }
.energy-preview-wide { padding: 12px 14px; border-radius: 12px; background: var(--onyx); }
.energy-preview-wide .energy-fill { transition: width .6s ease, background .4s; }

.gp-pockets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.gp-pocket { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 420px; background: #fff; }
.gp-pocket-head { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding-right: 26px; }
.gp-pocket-head h4 { margin: 0; text-align: center; }
.gp-pocket > .info-tip { position: absolute; top: 14px; right: 10px; }
.gp-pocket-icon { display: grid; place-items: center; width: 28px; height: 28px; color: #6b5418; }
.gp-pocket-icon svg { width: 24px; height: 24px; }
.gp-pocket .items-list { grid-template-columns: 1fr; }
.gp-pocket.is-pocket-off .items-list, .gp-pocket.is-pocket-off .items-head { opacity: .45; }
.item-card.is-off { opacity: .55; }
.item-card-actions .item-switch { margin-left: auto; }
/* Locked event: editing is frozen, but switches, tag links and messages still work. */
#gameplayView.is-event-locked .gp-edit { display: none !important; }
@media (max-width: 900px) {
  .energy-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gp-pockets { grid-template-columns: 1fr; }
  .gp-pocket { min-height: 0; }
}
.energy-fields .unit-input { justify-content: flex-start; }
.energy-fields input { box-sizing: border-box; height: 44px; padding: 8px 12px; font-size: 15px; font-weight: 600; text-align: left; }
.energy-fields .unit-input > span { color: var(--muted); font-weight: 700; }
.energy-field.energy-empty > span, .energy-fields .energy-field > span:first-child { text-align: left; }

/* Hunt: energy bar (80%) with the tokens tile beside it (20%) */
.hunt-energy-row { display: grid; grid-template-columns: 4fr 1fr; gap: 10px; margin-bottom: 12px; }
.hunt-energy-row.hidden { display: none; }
.hunt-energy-row .hunt-energy { margin: 0; }
.energy-tokens { display: grid; place-content: center; justify-items: center; padding: 8px 6px; text-align: center; }
.energy-tokens strong { color: var(--gold-bright); font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.energy-tokens small { color: #a9a396; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.energy-tokens.hidden { display: none; }

/* Trials can be configured only once the template is locked */
.trial-lock-note { display: none; margin: 8px 0; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; background: #fbf8f0; color: var(--muted); text-align: center; }
.challenge-tile.needs-template-lock .trial-lock-note { display: block; }
.challenge-tile.needs-template-lock #trialTabs, .challenge-tile.needs-template-lock #trialEditorEmpty, .challenge-tile.needs-template-lock #createTrialForm { display: none !important; }

/* Live event - Manage: desk boost tools under the leaderboard */
.desk-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.desk-tools.hidden { display: none; }
.desk-tool { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 40px 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; }
.desk-tool > .info-tip { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); }
.desk-tool .team-lock-row { flex: 1; max-width: none; margin: 0; padding: 0; border: 0; background: transparent; }
.boost-all strong { margin-right: auto; }
.boost-all .unit-input input { width: 64px; height: 36px; font-size: 15px; }
@media (max-width: 700px) { .desk-tools { grid-template-columns: 1fr; } }

/* Abilities: shields & immunities, steal pick, spy snapshot, ability values */
.hunt-shields { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.shields-title { flex-basis: 100%; color: #a9a396; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.shield-chip.is-immune { border-color: #7fbf8e66; }
.shield-chip.is-finished { border-color: var(--gold-bright); }
.steal-dialog { max-width: min(420px, calc(100vw - 24px)); }
.steal-clock-wrap { display: flex; justify-content: center; margin: 6px 0 12px; }
.steal-clock { --left: 100%; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: conic-gradient(var(--gold-bright) var(--left), #ffffff22 0); color: var(--gold-bright); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; position: relative; }
.steal-clock::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #15130f; }
.steal-clock { isolation: isolate; }
.steal-clock::before { z-index: -1; }
.steal-list { display: grid; gap: 8px; }
.steal-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 1px solid #c9a22755; border-radius: 12px; background: #1f1c17; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.steal-option.is-taken { border-color: var(--gold-bright); }
.steal-option small, .snapshot-list small { display: block; color: #a9a396; }
.steal-option .satchel-picture, .snapshot-list .satchel-picture { width: 44px; height: 44px; flex: 0 0 44px; }
.snapshot-list { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.snapshot-list li { display: flex; align-items: center; gap: 10px; }
.ability-values-dialog { width: min(640px, calc(100vw - 24px)); }
.ability-values-table td { vertical-align: middle; }
.ability-values-table .unit-input { justify-content: flex-start; }
.ability-values-table input { width: 70px; height: 34px; font-size: 14px; }
.ability-values-table tr.simple-row td { background: #faf6ec; }
.ability-values-table input:disabled { background: #f3efe5; color: var(--muted); border-color: transparent; }
.shields-title { color: var(--muted); }

/* Super abilities and airdrops */
.update-airdrop .update-kind { color: #b0571a; }
.item-action.is-super { background: linear-gradient(90deg, #6b3a08, #8a5a12); color: #ffe9b8; }
.power-airdrop { display: grid; gap: 12px; padding: 12px 14px; border: 1px dashed var(--gold); border-radius: 10px; }
.power-airdrop > .field-note { margin: 0; }
.airdrops-list { display: grid; gap: 8px; }
.airdrop-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.airdrop-row .satchel-picture { width: 44px; height: 44px; }
.airdrop-text { display: grid; gap: 2px; min-width: 0; }
.airdrop-text small { color: var(--muted); }
.airdrop-text .item-action { justify-self: start; }
.airdrop-status { font-size: 13px; color: var(--muted); }
.airdrop-row.is-open .airdrop-status { color: #b0571a; font-weight: 700; }
.airdrop-row.is-used { opacity: .65; }
.hunt-airdrops { display: grid; gap: 10px; margin-bottom: 12px; }
.airdrop-card { border: 1px solid var(--gold-bright); box-shadow: 0 0 0 1px #e4c15833, 0 8px 24px #c9a22722; animation: airdrop-in .5s ease-out; }
.airdrop-head { display: flex; gap: 12px; align-items: center; }
.airdrop-head .satchel-picture { width: 52px; height: 52px; }
.airdrop-head strong { display: block; font-family: var(--serif); font-size: 20px; color: var(--gold-bright); }
.airdrop-kicker { color: #f0a35a; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.airdrop-challenge { margin: 12px 0 6px; font-size: 16px; white-space: pre-line; }
.airdrop-power, .airdrop-tag { margin: 0 0 10px; font-size: 13px; opacity: .8; }
.airdrop-claim { display: flex; gap: 8px; }
.airdrop-claim input { flex: 1; min-width: 0; }
.ability-values-table .super-row td { border-top: 1px dashed var(--line); }
@keyframes airdrop-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .airdrop-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .airdrop-status { grid-column: 2 / -1; grid-row: 2; }
  .airdrop-action { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) { .airdrop-card { animation: none; } }
.invisible { visibility: hidden; }

/* Trial rewards and the game balance check */
.rewards-strip { margin-top: 16px; }
.rewards-strip h4 { margin: 0 0 10px; }
.rewards-list { display: grid; gap: 8px; }
.reward-row { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px; align-items: center; }
.reward-trial { font-weight: 800; font-size: 13px; color: var(--muted-gold); }
.reward-items { display: flex; flex-wrap: wrap; gap: 6px; }
.reward-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.reward-chip img, .reward-chip .item-glyph { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: #0b0b0b; color: var(--gold-bright); padding: 2px; }
.reward-chip.is-off { opacity: .5; text-decoration: line-through; }
.trial-rewards-line { margin: 4px 0 0; font-size: 13px; color: var(--muted-gold); }
.balance-panel .balance-board { padding: 0; }
.balance-run { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.balance-minutes { display: inline-flex; align-items: center; gap: 8px; color: #f2e3b3; font-size: 13px; font-weight: 700; }
.balance-minutes .unit-input input { width: 72px; }
.alert-line.level-note { color: #b9c2cc; }
.alert-line.level-ok { color: #7fcf8e; }
.reward-note-list { margin: 8px 0 0; padding-left: 18px; }

/* Mid-event challenges (12 Oct 2026) */
.challenge-name-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.challenge-name-row label { display: grid; gap: 4px; flex: 1 1 220px; font-size: 13px; }
.prize-fieldset { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; }
.prize-fieldset legend { padding: 0 6px; font-weight: 600; }
.prize-picker { display: grid; gap: 10px; max-height: 260px; overflow-y: auto; }
.prize-group { display: grid; gap: 4px; }
.prize-group > small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.danger-text { color: #b3261e; font-weight: 600; }
.challenge-prizes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.challenge-prizes li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; }
.challenge-prizes .satchel-picture { width: 36px; height: 36px; }
.challenge-prizes small { display: block; opacity: .8; font-size: 12px; }
.update-challenge .update-kind { color: #b0571a; }

/* Storyboard tile (12 Oct 2026) */
.board-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.board-grid .board-box:not(.board-ending) { grid-column: 1 / -1; }
#trialConfigView.is-event-locked .board-chapters [data-board-edit] { display: none; }
.board-box input, .board-box textarea { width: 100%; }
.board-chapter { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.board-chapter > .text-button, .board-chapter > p { grid-column: 1 / -1; justify-self: start; }
.board-page { display: grid; gap: 6px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.board-page h6 { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.board-page img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; }
.board-page p { margin: 0; white-space: pre-wrap; font-size: 14px; }
@media (max-width: 720px) { .board-grid, .board-chapter { grid-template-columns: minmax(0, 1fr); } }

/* Story pages in the Hunt tab */
.story-page { display: grid; gap: 14px; }
.story-page-kicker { margin: 0; color: var(--gold, #c9a227); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.story-page-image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.story-page-text { white-space: pre-wrap; font-family: var(--serif); font-size: 18px; line-height: 1.55; }
.story-page-actions { display: flex; justify-content: space-between; gap: 10px; }
.story-page-actions [data-page="next"]:only-child { margin-left: auto; }
.story-back { margin-top: 10px; }

/* Mid-event challenge countdown */
.countdown-dialog { border: 1px solid var(--gold-bright, #e4c158); border-radius: 18px; background: #0d0c0a; color: #f3ead6; padding: 28px 32px; text-align: center; width: min(360px, calc(100vw - 32px)); }
.countdown-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.countdown-text { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #f0a35a; }
.countdown-number { margin: 0; font-family: var(--serif); font-size: 72px; line-height: 1; color: var(--gold-bright, #e4c158); font-variant-numeric: tabular-nums; }

/* Winner messages */
.ending-text { white-space: pre-wrap; }
.countdown-after { margin: 10px 0 0; }
.countdown-after:empty { display: none; }

/* Test copies (12 Oct 2026) */
.test-banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 12px; padding: 10px 14px; border: 2px dashed #d9761e; border-radius: 12px; background: #fff3e6; color: #6b3608; }
.test-banner.hidden { display: none; }
.test-banner strong { letter-spacing: .08em; }
.test-banner-text { font-size: 14px; }
.test-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.test-banner .button { border-color: #d9761e; background: #fff; color: #6b3608; }
.test-banner .test-purge { background: #8e2b12; border-color: #8e2b12; color: #fff; }
.test-chip { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px; background: #d9761e; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.test-copy-tile .test-copy-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.test-copy-tile .test-copy-row > span:first-child { display: grid; gap: 2px; }
.test-copy-tile small { color: var(--muted); }
.test-copy-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.category-test { border-style: dashed; }
.test-banner select { width: auto; min-width: 110px; padding-block: 6px; }
.craft-home-stack { display: grid; gap: 18px; }
.category-tile.is-soon { cursor: default; opacity: .55; border-style: dashed; }
.category-tile.is-soon:hover { transform: none; border-color: var(--line); box-shadow: none; }
.category-soon { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.qv-test-line { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qv-test-line .test-chip { margin: 0; }
.answer-lock { margin: 6px 0 0; color: #b0571a; font-weight: 600; font-size: 14px; }
.answer-lock:empty { display: none; }
.hunt-answer.is-waiting { opacity: .55; }
.wrong-message-label { margin-top: 10px; }
.board-wrong input { width: 100%; }

/* ---------- Item, booster and ability dialogs (13 Oct 2026) ---------- */
.item-dialog { width: min(680px, calc(100% - 28px)); }
.item-dialog .dialog-caps-title { margin-right: 36px; margin-left: 36px; text-align: center; text-transform: uppercase; letter-spacing: .12em; }
.item-dialog .item-form-top { grid-template-columns: 168px minmax(0, 1fr); gap: 18px; }
.item-dialog .item-picture-preview { width: 168px; height: 168px; }
.item-dialog .item-picture-preview .item-glyph { width: 80px; height: 80px; }
.field { display: grid; min-width: 0; }
.field-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.field-head label { margin: 0; }
.field-info, .power-effect-line .info-tip { position: relative; top: auto; right: auto; display: inline-block; z-index: 6; }
.field-info .info-btn, .power-effect-line .info-btn { width: 17px; height: 17px; }
.field-info .info-btn::before, .power-effect-line .info-btn::before { width: 13px; height: 13px; }
.field-head .info-pop, .power-effect-line .info-pop { width: min(300px, 80vw); }
.power-effect-line { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.power-effect-line:empty, .power-effect-line > span:empty:only-child { display: none; }
.limit-row { display: flex; gap: 8px; }
.limit-row select { flex: 1 1 auto; min-width: 0; }
.limit-row input { flex: 0 0 84px; width: 84px; }
.item-dialog .form-stack .checkbox-row { margin: 0; }
@media (max-width: 560px) { .item-dialog .item-form-top { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Save / error pop-up (Craft Board, 13 Oct 2026) ---------- */
.message-pop { width: min(380px, calc(100% - 32px)); padding: 26px 24px 18px; border: 1px solid #d9c785; border-radius: 16px; background: #fffdf6; color: #3b3220; text-align: center; box-shadow: 0 24px 60px #0007; cursor: pointer; }
.message-pop::backdrop { background: #16140f8c; backdrop-filter: blur(6px) brightness(.85); -webkit-backdrop-filter: blur(6px) brightness(.85); }
.message-pop p { margin: 10px 0 12px; font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.message-pop small { color: var(--muted); font-size: 11px; }
.message-pop-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #f6ecc9; color: #8a6a12; }
.message-pop-icon::before { content: "✓"; font-size: 22px; font-weight: 800; }
.message-pop.error { border-color: #e2bcb9; }
.message-pop.error .message-pop-icon { background: #fde4e1; color: var(--red); }
.message-pop.error .message-pop-icon::before { content: "!"; }
.message-pop.error p { color: var(--red); }

/* ---------- Needs item, tag challenges (13 Oct 2026) ---------- */
.needs-item-note { margin: 10px 0 0; padding: 8px 12px; border: 1px dashed #c9a22799; border-radius: 9px; background: #c9a2270f; color: inherit; font-size: 13px; font-weight: 600; }
.needs-items { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.needs-label { margin-top: 12px; }
.needs-note { margin-top: 8px; }
.tag-for-chips { display: grid; gap: 6px; }
.tag-for-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tag-for-row > span { min-width: 52px; }
.tag-chip { display: inline-flex; margin: 0; cursor: pointer; }
.tag-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tag-chip span { padding: 4px 10px; border: 1px solid #d9cfb4; border-radius: 999px; background: #fff; color: #514b3f; font-weight: 700; font-size: 12px; }
.tag-chip input:checked + span { border-color: var(--gold-brand, #c9a227); background: #f6ecc9; color: #6b5418; }
.tag-chip input:focus-visible + span { outline: 2px solid var(--gold-brand, #c9a227); outline-offset: 2px; }
.tag-for-summary { margin: 4px 0 0; }
.item-card-note { margin: 0; color: var(--red); font-size: 12px; }
.field-head .field-label { color: #514b3f; font-size: 12px; font-weight: 700; }

/* ---------- Mid-event challenge prizes (13 Oct 2026) ---------- */
.prize-list { display: grid; gap: 10px; }
.prize-row { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) 28px; gap: 12px; align-items: start; padding: 10px; border: 1px solid #e3d9bf; border-radius: 12px; background: #fff; }
.prize-pic { display: grid; justify-items: center; gap: 4px; }
.prize-pic .item-picture-preview { width: 64px; height: 64px; }
.prize-pic .item-glyph { width: 34px; height: 34px; }
.prize-fields { display: grid; gap: 6px; }
.prize-crux { color: var(--muted); font-size: 12px; }
.prize-restores { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; }
.prize-restores input { width: 80px; margin: 0 !important; }
.prize-remove { width: 26px; height: 26px; border: 1px solid #d9cfb4; border-radius: 50%; background: #fff; color: #6b5418; cursor: pointer; }
.prize-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.challenge-window.is-dulled { opacity: .5; }
.item-card-from { color: var(--muted); font-size: 12px; }

/* ---------- Game Tree (13 Oct 2026) ---------- */
.game-tree-tile { position: relative; display: grid; gap: 10px; }
.game-tree-scroll { overflow-x: auto; padding-bottom: 6px; }
.tree-canvas { position: relative; margin: 0 auto; }
.tree-cols { position: absolute; top: 0; left: 0; right: 0; height: 20px; }
.tree-col { position: absolute; transform: translateX(-50%); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tree-lines { position: absolute; top: 0; left: 0; overflow: visible; }
.tree-lines path { fill: none; stroke: #c9b98d; stroke-width: 2; }
.tree-lines path.tree-hop { stroke: #8a6a12; stroke-dasharray: 5 4; stroke-width: 1.6; }
.tree-nodes { position: absolute; left: 0; right: 0; bottom: 0; }
.tree-node { position: absolute; display: grid; justify-items: center; gap: 3px; padding: 0; border: 0; background: none; transform: translate(-50%, -17px); cursor: pointer; font: inherit; }
.tree-dot { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #c9a227; border-radius: 50%; background: #fffdf6; color: #3b3220; font-size: 12px; font-weight: 800; }
.tree-node.is-empty .tree-dot { border-style: dashed; border-color: #b9ae92; color: #9a917d; background: transparent; }
.tree-node.is-warning .tree-dot { border-color: #e08a1e; box-shadow: 0 0 0 3px #e08a1e33; }
.tree-node.is-error .tree-dot { border-color: var(--red); box-shadow: 0 0 0 3px #c0392b33; }
.tree-node.is-open .tree-dot { background: #f6ecc9; }
.tree-lock { position: absolute; top: -9px; right: -11px; font-size: 12px; font-style: normal; }
.tree-badges { display: flex; gap: 4px; padding: 1px 6px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px #e3d9bf; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.game-tree-detail { padding: 12px 14px; border: 1px solid #e3d9bf; border-radius: 12px; background: #fff; display: grid; gap: 8px; }
.tree-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tree-detail-head small { color: var(--muted); }
.tree-detail-head .text-button { margin-left: auto; }
.tree-detail-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.tree-detail-row strong { color: #514b3f; font-size: 12px; }
.tree-detail-row small { color: var(--muted); }
.tree-detail-row .level-error { color: var(--red); }
.tree-detail-row .level-warning { color: #b8650f; }
.game-tree-challenges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.tree-strip-label { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tree-chip { padding: 3px 9px; border: 1px solid #e3d9bf; border-radius: 999px; background: #fff; }
.tree-checked { flex-basis: 100%; color: var(--muted); font-size: 11px; }
@media (max-width: 560px) { .tree-detail-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* 4:3 pictures (13 Oct 2026): story and challenge pictures fill a 4:3 frame;
   a tap on the challenge picture shows it whole, full screen. */
.challenge-frame { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; margin: 0 0 18px; padding: 0; border: 1px solid #c9a22755; border-radius: 8px; overflow: hidden; background: #0b0b0d; cursor: zoom-in; }
.zoom-hint { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #000a; color: #f3e7c4; font-size: 16px; line-height: 1; }
.image-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; }
.image-viewer::backdrop { background: #000; }
.image-viewer-scroll { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; touch-action: pinch-zoom pan-x pan-y; }
.image-viewer-scroll img { max-width: 100%; max-height: 100dvh; object-fit: contain; }
.image-viewer-close { position: fixed; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #c9a22788; background: #000c; color: #f3e7c4; font-size: 18px; }
.image-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted, #8a8170); }
.story-image-preview img { aspect-ratio: 4 / 3; }

/* Magnifier scene (13 Oct 2026): a lens over the challenge picture shows the hidden picture, enlarged. */
.challenge-scene { position: relative; }
.challenge-scene .challenge-frame { margin-bottom: 8px; }
.challenge-scene.is-lens .challenge-frame { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.challenge-scene .challenge-image { -webkit-user-drag: none; user-select: none; }
.challenge-scene.is-lens .zoom-hint { display: none; }
.lens-wrap { position: absolute; width: 0; height: 0; display: none; pointer-events: none; z-index: 2; }
.challenge-scene.is-lens .lens-wrap { display: block; }
.lens { position: absolute; left: -66px; top: -66px; width: 132px; height: 132px; border-radius: 50%; overflow: hidden; border: 5px solid #c9a227; background: #e9dcc0; box-shadow: 0 0 0 2px #6b5112, 0 10px 24px #000b, inset 0 0 18px #0006; }
.lens::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #ffffff50, transparent 42%); }
.lens-view { position: absolute; background-size: cover; background-position: center; background-repeat: no-repeat; }
.lens-handle { position: absolute; left: 44px; top: 44px; width: 14px; height: 56px; border-radius: 7px; background: linear-gradient(90deg, #5a3a1c, #8a5a2c); transform: rotate(-45deg); transform-origin: top center; box-shadow: 0 4px 10px #0008; }
.lens-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.lens-tip { font-size: 13px; color: #c9a227; }
.reveal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.reveal-item { display: grid; gap: 6px; font-size: 13px; }
@media (max-width: 640px) { .reveal-grid { grid-template-columns: 1fr; } }

/* Unlock scene (13 Oct 2026). Drawn looks animate in 2.4 s: the tool comes in
   (0-0.8 s), the lock gives (0.8-1.4 s), then it opens (1.3-2.3 s). */
.unlock-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; margin: 0 0 10px; border: 1px solid #c9a22755; border-radius: 8px; overflow: hidden; background: #0b0b0d; }
.unlock-frame .unlock-art, .unlock-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.unlock-frame img.unlock-open { position: absolute; inset: 0; animation: ul-fade .9s ease-out both; }
.unlock-art g { transform-box: fill-box; }
.ul-tool, .ul-glow, .ul-cracks { opacity: 0; }
.ul-cutter .ul-jaw-a, .ul-cutter .ul-jaw-b { stroke: #8a8270; stroke-width: 5; stroke-linecap: round; transform-origin: 0 0; }
.ul-lid { transform-origin: 0% 100%; }
.ul-arm-left { transform-origin: 0% 100%; } .ul-arm-right { transform-origin: 100% 100%; }

/* Key: slides in, turns; the shackle lifts and the lock drops. */
.is-opening-opens .ul-tool-key { opacity: 1; }
.is-opening-opens .ul-key { animation: ul-key-in .55s ease-out both, ul-key-turn .3s .6s ease-in-out both, ul-fade-out .3s 1.3s both; transform-origin: center; }
.is-opening-opens .ul-shackle, .is-opening-breaks .ul-shackle { animation: ul-shackle .25s .85s ease-out both; }
.is-opening-opens .ul-lock { animation: ul-drop .55s 1.05s ease-in both; transform-origin: center; }
/* Cutter or crowbar: bites, the frame shakes, the lock flies off, cracks show. */
.is-opening-breaks .ul-tool-cutter { opacity: 1; }
.is-opening-breaks .ul-cutter { animation: ul-cutter-in .45s ease-out both, ul-fade-out .3s 1.3s both; }
.is-opening-breaks .ul-jaw-a { animation: ul-jaw-a .2s .5s ease-in both; } .is-opening-breaks .ul-jaw-b { animation: ul-jaw-b .2s .5s ease-in both; }
.is-opening-breaks .unlock-art { animation: ul-shake .45s .65s ease-in-out both; }
.is-opening-breaks .ul-lock { animation: ul-fly .6s .75s ease-out both; transform-origin: center; }
.is-opening-breaks .ul-cracks { animation: ul-fade .3s .7s both; }
/* Crate: the lid lifts and the glow rises. */
.look-crate.is-opening-opens .ul-lid { animation: ul-lid .9s 1.35s cubic-bezier(.3,1.4,.5,1) both; }
.look-crate.is-opening-breaks .ul-lid { animation: ul-lid-pop .8s 1.05s cubic-bezier(.3,1.6,.5,1) both; }
.look-crate[class*="is-opening"] .ul-glow { animation: ul-fade .9s 1.6s both; }
.look-crate.is-open .ul-lid { transform: translateY(-18px) rotate(-24deg); }
.look-crate.is-open .ul-glow { opacity: 1; }
/* Padlocked hands: the chain falls, the cuffs slip off, the hands part. */
.look-hands[class*="is-opening"] .ul-chain { animation: ul-drop .6s 1.2s ease-in both; }
.look-hands.is-opening-breaks .ul-link-m { animation: ul-snap .3s .7s ease-out both; }
.look-hands[class*="is-opening"] .ul-cuff { animation: ul-cuff .6s 1.5s ease-in both; }
.look-hands[class*="is-opening"] .ul-arm-left { animation: ul-arm-left .8s 1.5s cubic-bezier(.3,1.3,.5,1) both; }
.look-hands[class*="is-opening"] .ul-arm-right { animation: ul-arm-right .8s 1.5s cubic-bezier(.3,1.3,.5,1) both; }
.look-hands.is-open .ul-chain, .look-hands.is-open .ul-cuff { opacity: 0; }
.look-hands.is-open .ul-arm-left { transform: translate(-46px, 12px) rotate(-8deg); }
.look-hands.is-open .ul-arm-right { transform: translate(46px, 12px) rotate(8deg); }
.unlock-frame.is-open .ul-lock { opacity: 0; }
/* Own pictures: a shake, then the open picture fades in. */
.look-own[class*="is-opening"] img { animation: ul-shake .5s ease-in-out both; }
/* A wrong item: a short shake. */
.unlock-frame.is-refused .unlock-art, .unlock-frame.is-refused img { animation: ul-shake .4s ease-in-out; }

@keyframes ul-key-in { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ul-key-turn { to { transform: scaleY(.25); } }
@keyframes ul-cutter-in { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ul-jaw-a { to { transform: rotate(16deg); } } @keyframes ul-jaw-b { to { transform: rotate(-16deg); } }
@keyframes ul-shackle { to { transform: translateY(-9px); } }
@keyframes ul-drop { to { transform: translateY(120px) rotate(28deg); opacity: 0; } }
@keyframes ul-fly { to { transform: translate(90px, -70px) rotate(80deg); opacity: 0; } }
@keyframes ul-snap { to { transform: translateY(40px) rotate(70deg); opacity: 0; } }
@keyframes ul-lid { to { transform: translateY(-18px) rotate(-24deg); } }
@keyframes ul-lid-pop { 0% { transform: none; } 60% { transform: translateY(-34px) rotate(-30deg); } 100% { transform: translateY(-18px) rotate(-24deg); } }
@keyframes ul-cuff { to { transform: translateY(70px); opacity: 0; } }
@keyframes ul-arm-left { to { transform: translate(-46px, 12px) rotate(-8deg); } }
@keyframes ul-arm-right { to { transform: translate(46px, 12px) rotate(8deg); } }
@keyframes ul-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-1deg); } 40% { transform: translateX(6px) rotate(1deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes ul-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ul-fade-out { to { opacity: 0; } }

.unlock-use { margin: 0 0 14px; }
.unlock-ask { margin: 0 0 8px; font-size: 14px; color: #c9a227; }
.unlock-items { display: flex; flex-wrap: wrap; gap: 8px; }
.unlock-item { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 6px; border: 1px solid #c9a22766; border-radius: 10px; background: #17130d; color: #f1e8d2; font: inherit; font-size: 14px; cursor: pointer; }
.unlock-item:hover:not(:disabled) { border-color: #f3d27a; }
.unlock-item:disabled { opacity: .5; }
.unlock-item .satchel-picture { width: 32px; height: 32px; }
.unlock-reply { min-height: 20px; margin: 8px 0 0; font-size: 14px; color: #e07a5f; }
.unlock-inside { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #c9a22755; border-radius: 8px; background: #c9a2270f; color: #f1e8d2; white-space: pre-wrap; }
.unlock-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.unlock-grid textarea, .unlock-grid input:not([type="checkbox"]):not([type="file"]) { width: 100%; }
@media (max-width: 640px) { .unlock-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .unlock-frame * { animation-duration: .01ms !important; animation-delay: 0s !important; } }

/* An empty table keeps its column names, with one quiet row (14 Oct 2026). */
.data-table tr.empty-row td { padding: 18px 12px; text-align: center; color: var(--muted, #7a7262); font-style: italic; }

/* Desk boost line under the player's HP bar (14 Oct 2026). */
.desk-line { margin: 6px 0 0; font-size: 12px; line-height: 1.35; color: #b9b2a2; }
.desk-line.is-open { color: #e9c97c; font-weight: 600; }
.desk-line.is-closed { color: #d9503f; }

/* ---------- Rulebook (14 Oct 2026) ---------- */
.rulebook-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.rulebook-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #efe6cf; }
.rulebook-steps li:first-child { border-top: 0; }
.rb-step { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #1d1a14; color: #e8c766; font-weight: 700; font-size: 13px; }
.rb-text { display: grid; gap: 2px; min-width: 0; }
.rb-text small { color: var(--muted, #7a7262); font-size: 12.5px; line-height: 1.4; }
.rb-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rb-email { margin-top: 4px; font-size: 13px; }
@media (max-width: 640px) { .rulebook-steps li { grid-template-columns: 28px minmax(0, 1fr); } .rulebook-steps li > :last-child { grid-column: 2; justify-self: start; } }
.rb-template-note { margin: 10px 0; }
.rb-markers h4 { margin: 18px 0 4px; }
.rb-marker-table td { padding: 5px 8px; vertical-align: top; font-size: 13px; }
.rb-marker-table td:first-child { white-space: nowrap; }
.update-card.is-pinned { border: 1px solid #c9a227; box-shadow: 0 0 0 1px #c9a22733 inset; }
.update-card [data-open-rulebook] { margin-top: 10px; }

/* ---------- Before the hunt and the player guide (14 Oct 2026) ---------- */
.guide { display: grid; gap: 12px; }
.guide.is-pc { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.guide-demo { min-width: 0; }
.demo-label { margin: 0 0 6px; color: #e8c766; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
/* The demo: the Hunt screen at real size (390x780 or 1280x760), scaled to fit. */
.demo-frame { position: relative; width: 100%; overflow: hidden; border-radius: 14px; box-shadow: 0 0 0 1px #3a352a; }
.demo-screen { position: absolute; top: 0; left: 0; overflow: hidden; transform-origin: top left; background: #0b0b0a; color: #f4ecd8; text-align: left; --inv: 1; }
.demo-main { padding: 16px 16px 0; }
.demo-screen.is-pc .demo-main { max-width: 1180px; margin: 0 auto; padding: 16px 24px 0; }
.demo-screen .live-strip { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 10px; padding: 6px 12px; border: 1px solid #c9a22755; border-radius: 12px; background: #0b0b0a; color: #f4ecd8; }
.demo-screen .strip-back { display: grid; place-items: center; }
.demo-screen .hunt-tile { margin: 0; }
.demo-answer { display: flex; gap: 8px; margin-top: 14px; }
.demo-answer span { flex: 1; padding: 12px 14px; border-radius: 10px; background: #fffaf0; color: #9a9078; font-size: 15px; }
.demo-answer b { padding: 12px 20px; border-radius: 10px; background: #c9a227; color: #1d1a14; }
.demo-hint { display: inline-block; margin-top: 10px; color: #c9c2b0; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
/* Pockets and tabs sit where they sit in play: pinned to the bottom. */
.demo-screen .demo-pockets { position: absolute; right: 8px; bottom: 68px; left: 8px; z-index: 8; margin: 0; }
.demo-tabs { position: absolute; right: 0; bottom: 0; left: 0; z-index: 9; display: flex; padding: 6px 8px; border-top: 1px solid #c9a22755; border-radius: 16px 16px 0 0; background: #0b0b0a; box-shadow: 0 -6px 24px #0004; }
.demo-tabs .tab { position: relative; display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; color: #c9c2b0; font-size: 13px; font-weight: 700; }
.demo-tabs .tab.active { background: #1d1b17; color: var(--gold-bright); }
.demo-tabs .tab.is-hunt { flex-grow: 1.4; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
/* Steps: the numbered parts; the one being explained glows and grows a little. */
.demo-screen [data-g] { position: relative; cursor: pointer; transition: opacity .2s, filter .2s, box-shadow .2s, transform .2s; }
.demo-screen.has-focus [data-g]:not(.is-focus) { opacity: .3; filter: saturate(.4); }
.demo-screen.has-focus .hunt-energy:not(.is-focus), .demo-screen.has-focus .demo-tabs:not(.is-focus) { opacity: 1; filter: none; }
.demo-screen.has-focus .hunt-energy:not(.is-focus) > :not(.is-focus), .demo-screen.has-focus .demo-tabs:not(.is-focus) > :not(.is-focus) { opacity: .3; filter: saturate(.4); }
.demo-screen [data-g].is-focus { z-index: 6; opacity: 1; filter: none; box-shadow: 0 0 0 3px #e8c766, 0 0 26px #e8c766aa; transform: scale(1.04); }
.demo-screen .demo-tabs.is-focus, .demo-screen .demo-pockets .is-focus { transform: scale(1.02); }
.demo-screen .desk-line.is-focus { border-radius: 8px; }
/* The numbers stay full size whatever the scale. */
.guide-num { position: absolute; top: -7px; left: -7px; z-index: 7; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #e8c766; color: #1d1a14; font: 700 11px/1 system-ui, sans-serif; box-shadow: 0 1px 4px #0008; transform: scale(var(--inv, 1)); transform-origin: center; }
.demo-tabs > .guide-num { top: -10px; right: 14px; left: auto; }
.demo-tabs .tab > .guide-num { top: 4px; left: 8px; }
.demo-screen .desk-line > .guide-num { top: -2px; left: -22px; }
.demo-hint { display: block; text-align: center; }
.demo-screen .live-strip > .guide-num { top: -10px; }
.guide-card { padding: 14px 16px; border-radius: 14px; background: #fffaf0; color: #1d1a14; }
.guide-card h4 { margin: 2px 0 6px; font-family: var(--serif, Georgia, serif); font-size: 18px; }
.guide-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.guide-count { color: #9a7425; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.guide-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guide-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.guide-dots i { width: 6px; height: 6px; border-radius: 50%; background: #d9cfb4; }
.guide-dots i.is-on { background: #c9a227; }
.hunt-energy-row { position: relative; }
.guide-help { position: absolute; top: -8px; right: -6px; z-index: 3; width: 24px; height: 24px; border-radius: 50%; border: 1px solid #c9a227; background: #15140f; color: #e8c766; font: 700 13px/1 system-ui, sans-serif; cursor: pointer; }
.guide-dialog { width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 18px 14px; border: 0; border-radius: 18px; background: #0b0b0a; color: #ece6d6; }
.guide-dialog::backdrop { background: #000a; }
.guide-dialog h2 { margin: 0 0 12px; font-family: var(--serif, Georgia, serif); color: #e8c766; font-size: 20px; }
.guide-dialog .dialog-close { color: #ece6d6; }
/* In the dialog (phone) the explanation stays in view while the demo scrolls. */
.guide-dialog { overflow-y: auto; }
.guide-dialog .guide.is-phone .guide-card { position: sticky; bottom: -18px; z-index: 5; box-shadow: 0 -8px 24px #000c; }
.guide.is-pc .guide-card { position: sticky; top: 0; }
.guide-nav .button { white-space: nowrap; }
/* Before the start (15 Oct 2026): "Event starts in" and the Demo. */
.before-clock { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; color: #ece6d6; font-size: 15px; }
.before-clock-label { color: #c9c2b0; font-weight: 700; }
.before-clock strong { color: var(--gold-bright); font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.before-clock.is-soon .bulb { animation: soon-pulse 1.2s ease-in-out infinite; }
@keyframes soon-pulse { 50% { box-shadow: 0 0 0 6px #4caf5044; } }
@media (prefers-reduced-motion: reduce) { .before-clock.is-soon * { animation: none; } }
.demo-screen .demo-tabs, .demo-screen .demo-tabs[data-g] { position: absolute; z-index: 9; }
/* Offline network check: Props and Tags checklists (16 Oct 2026). */
.checklist .checklist-head { margin: 10px 0 4px; font-size: 13px; letter-spacing: .02em; }
.checklist .checklist-head:first-child { margin-top: 0; }
.checklist .check-props { display: block; margin-top: 2px; color: var(--muted, #6f6a5e); font-size: 12px; line-height: 1.4; white-space: pre-line; }

/* SANCTUM (16 Oct 2026): the module ribbon, module tiles and phase placeholders. */
.sanctum-ribbon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; margin-bottom: 18px; padding: 10px 16px 10px 20px; border: 1px solid var(--gold-brand); border-radius: 12px; background: var(--onyx); color: var(--parchment); }
.sanctum-ribbon.hidden { display: none; }
.sanctum-ribbon > p { margin: 0; font-size: 15px; }
.sanctum-ribbon strong { color: var(--gold-bright); font-family: var(--serif); font-size: 18px; font-weight: 600; }
.ribbon-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #8f8778; font-size: 12.5px; }
.ribbon-crumb { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 0; background: none; color: #d9d2c1; font: inherit; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
.ribbon-crumb:hover { color: var(--gold-bright); }
.module-number { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold-brand); color: var(--onyx); font-size: 12px; font-weight: 800; letter-spacing: 0; }
.module-tile .module-number { position: absolute; top: 14px; left: 14px; }
.module-grid .category-title { padding-right: 0; font-size: 22px; }
.soon-panel h3 { margin: 0 0 6px; color: var(--gold-bright); font-family: var(--serif); }
.soon-panel p { margin: 0; color: #d9d2c1; }
.org-tabs.no-subs .org-subs { min-height: 0; margin-top: 0; }

/* Team site phase 2: view-only areas of a module. */
[data-ro="1"] :is(input, select, textarea, .toggle-switch, button:not(.info-btn), .cover-frame) { opacity: .55; cursor: not-allowed; }
[data-ro="1"] [data-ro-allow="1"] :is(input, select, textarea, .toggle-switch, button, .cover-frame),
[data-ro="1"][data-ro-allow="1"] :is(input, select, textarea, .toggle-switch, button, .cover-frame) { opacity: 1; cursor: auto; }
[data-ro="1"] [data-ro-allow="1"] { outline: 2px solid var(--gold-brand); outline-offset: 2px; border-radius: 12px; }
.sphinx-locked[data-ro="1"] { position: relative; }
section.sphinx-locked[data-ro="1"]::after { content: "Sphinx only"; position: absolute; top: 10px; right: 12px; padding: 2px 8px; border-radius: 10px; background: var(--onyx); color: var(--gold-bright); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.ro-note { margin: 0 0 12px; padding: 8px 14px; border: 1px dashed var(--gold-brand); border-radius: 10px; background: #fffaf0; color: #6b5a2b; font-size: 13px; font-weight: 600; }
.module-hidden { display: none !important; }
.complete-tile { margin-top: 16px; }

/* Team site phase 3: event forms. */
.form-card { display: grid; align-content: start; gap: 6px; min-height: 200px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 8px 22px #33270c0d; transition: transform .15s, border-color .15s; }
.form-card:hover, .form-card:focus-visible { transform: translateY(-2px); border-color: var(--gold); }
.form-card h3 { margin: 0; font-family: var(--serif); font-size: 21px; }
.form-card p { display: flex; gap: 6px; align-items: center; margin: 0; font-size: 13px; }
.form-number { justify-self: start; padding: 2px 8px; border-radius: 10px; background: var(--onyx); color: var(--gold-bright); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.form-backnote { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid #b5483a; background: #fbefec; color: #7a2d22; font-size: 13px; }
.panel-menu-link { margin-top: 14px; color: var(--gold-bright); font-size: 13px; }
.form-dialog { width: min(860px, calc(100vw - 32px)); }
.form-section { display: block; min-width: 0; margin: 0 0 14px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 12px; }
.form-section legend { padding: 0 6px; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.form-section legend small { margin-left: 6px; color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 14px; }
.form-grid label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.form-grid .checkbox-row { display: flex; align-items: center; align-self: end; }
.form-wide { grid-column: 1 / -1; }
.form-radio { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.form-radio .checkbox-row { font-weight: 500; }
.form-grid .duration-fields { display: flex; gap: 8px; }
.is-dull { opacity: .5; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.form-actions [data-act="delete"] { margin-right: auto; order: -1; }
.form-event-line { margin: 0 0 12px; font-size: 14px; }
.form-qr { display: block; max-width: 180px; margin-top: 10px; border-radius: 8px; }
.form-note { display: grid; gap: 4px; margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--gold-brand); border-radius: 12px; background: #fffaf0; font-size: 14px; }
.form-note.hidden { display: none; }
.form-note-todo { color: #8a3b10; font-weight: 700; }
.form-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 0; }
.form-facts div { padding: 10px 12px; border: 1px solid var(--line-on-dark, #3a352b); border-radius: 10px; }
.form-facts dt { color: #a99f8a; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.form-facts dd { margin: 4px 0 0; color: var(--parchment); font-size: 15px; }
.form-facts a { color: var(--gold-bright); }
.money-form .form-section { background: var(--panel); }
.money-form > .button { margin-top: 4px; }
.money-form .form-section { color: var(--ink); }
.money-form .form-section legend { display: none; }
.money-form .form-grid label { color: #514b3f; }

/* Team site phase 4: Pre Event Activity checklists. */
.warden-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.warden-head p { margin: 4px 0 0; color: #bdb4a2; }
.warden-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.warden-stale { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: #5a2a14; color: #ffd9b8; font-weight: 700; font-size: 13px; }
.warden-count { margin: 12px 0 8px; color: var(--gold-bright); font-weight: 700; font-size: 13px; }
.warden-list { display: grid; gap: 8px; }
.warden-list.is-dull { opacity: .55; }
.warden-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid #3a352b; border-radius: 10px; background: #15140f; color: var(--parchment); cursor: pointer; }
.warden-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--gold-brand); }
.warden-row span { display: grid; gap: 2px; }
.warden-row small { color: #bdb4a2; white-space: pre-line; }
.offline-source { margin: -4px 0 8px; }

/* Team site phase 5: Sphinx controls and Site Architecture. */
.spot-switch-tile { position: relative; }
.spot-switch-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.spot-switch-row .checkbox-row { margin: 0; }
.spot-switch-tile p { margin: 8px 0 0; }
#openSpotTeam.is-off { opacity: .5; }
.sphinx-only { display: none !important; }
body[data-module="sphinx"] .sphinx-only { display: flex !important; }
.metric-intro { margin: -8px 0 16px; color: #d9d2c1; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.metric-tile { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--panel); color: var(--ink); }
.metric-tile strong { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.metric-tile small { color: var(--muted); font-size: 12px; }
.metric-label { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.metric-chart { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--panel); }
.metric-bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin-top: 10px; }
.metric-bar { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--gold-brand); }
.metric-refresh { margin-top: 14px; }
